stilt.simulation#
Classes
|
HYSPLIT control parameters. |
|
STILT footprint. |
|
|
|
Abstract base class for STILT model outputs. |
|
|
|
STILT trajectory. |
- class stilt.simulation.Control(**data)[source]#
HYSPLIT control parameters.
- classmethod from_path(path)[source]#
Build Control object from HYSPLIT control file.
- Returns:
Control object with parsed parameters.
- Return type:
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class stilt.simulation.Output(simulation_id, receptor, data)[source]#
Abstract base class for STILT model outputs.
- class stilt.simulation.Trajectory(simulation_id, receptor, data, n_hours, met_files, params)[source]#
STILT trajectory.
- class stilt.simulation.Footprint(simulation_id, receptor, data, xmin, xmax, ymin, ymax, xres, yres, projection='+proj=longlat', smooth_factor=1.0, time_integrate=False)[source]#
STILT footprint.
- __init__(simulation_id, receptor, data, xmin, xmax, ymin, ymax, xres, yres, projection='+proj=longlat', smooth_factor=1.0, time_integrate=False)[source]#
- property time_range: tuple[datetime, datetime]#
Get time range of footprint data.
- Returns:
Time range of footprint data.
- Return type:
tuple[pd.Timestamp, pd.Timestamp]
- classmethod calculate(particles, xmin, xmax, ymin, ymax, xres, yres, projection='+proj=longlat', smooth_factor=1.0, time_integrate=False, file=None)[source]#
- Return type:
Self
- static read_netcdf(file, parse_receptor=True, **kwargs)[source]#
Read netCDF file and return xarray Dataset.
- integrate_over_time(start=None, end=None)[source]#
Integrate footprint over time.
- Parameters:
start (datetime, optional) – Start time of integration. The default is None.
end (datetime, optional) – End time of integration. The default is None.
- Returns:
Time-integrated footprint
- Return type:
xr.DataArray
- class stilt.simulation.Simulation(config)[source]#
- PATHS = {'config': 'config.yaml', 'control': 'CONTROL', 'error': 'error.parquet', 'footprints': '*_foot.nc', 'log': 'stilt.log', 'params': 'CONC.CFG', 'receptors': 'receptors.csv', 'setup': 'SETUP.CFG', 'trajectory': 'trajec.parquet', 'winderr': 'WINDERR', 'zicontrol': 'ZICONTROL', 'zierr': 'ZIERR'}#
- FAILURE_PHRASES = {'Fortran runtime error': 'FORTRAN_RUNTIME_ERROR', 'Insufficient number of meteorological files found': 'MISSING_MET_FILES', 'PARTICLE_STILT.DAT does not contain any trajectory data': 'NO_TRAJECTORY_DATA', 'meteorological data time interval varies': 'VARYING_MET_INTERVAL'}#
- classmethod from_path(path)[source]#
Load simulation from a directory containing config.yaml.
- Parameters:
path (str | Path) – Path to the simulation directory.
- Returns:
Instance of the simulation.
- Return type:
Self
- property time_range: tuple[datetime, datetime]#
Get time range of simulation.
- Returns:
Time range of simulation.
- Return type:
TimeRange
- property status: str | None#
Get the status of the simulation.
- Returns:
Status of the simulation.
- Return type:
- property meteorology: Meteorology#
- property setup: Namelist#
Setup namelist.
- property trajectory: Trajectory | None#
STILT particle trajectories.
- property error: Trajectory | None#
STILT particle error trajectories.
- property footprints: FootprintCollection#
Dictionary of STILT footprints.
- Returns:
Collection of Footprint objects.
- Return type:
- property footprint: Footprint | None#
Load the default footprint from the simulation directory.
The default footprint is the one with the highest resolution if multiple footprints exist, otherwise it is the only footprint.
- Returns:
Footprint object.
- Return type: