stilt#
PYSTILT
A python implementation of the STILT model.
- class stilt.ModelConfig(**data)[source]#
-
- build_simulation_configs()[source]#
Build a list of SimulationConfig objects, one for each receptor.
- 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.Meteorology(path, format, tres)[source]#
Meteorological data files for STILT simulations.
- class stilt.Model(project, **kwargs)[source]#
-
- property simulations: SimulationCollection | None#
Load all simulations from the output working directory.
- stilt.stilt_init(project, branch=None, repo=None)[source]#
Initialize STILT project
Python implementation of Rscript -e “uataq::stilt_init(‘project’)”
- class stilt.Receptor(time, location)[source]#
- __init__(time, location)[source]#
A receptor that wraps a geometric object (Point, MultiPoint, etc.) and associates it with a timestamp.
- Parameters:
time (datetime) – The timestamp associated with the receptor.
location (Location) – A location object representing the receptor’s spatial position.
- property geometry: Geometry#
Receptor geometry.
- property timestr: str#
Get the time as an ISO formatted string.
- Returns:
Time in ‘YYYYMMDDHHMM’ format.
- Return type:
- class stilt.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:
- class stilt.Trajectory(simulation_id, receptor, data, n_hours, met_files, params)[source]#
STILT trajectory.
- class stilt.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
Modules
Stochastic Time-Inverted Lagrangian Transport (STILT) Model. |
|