stilt.Project.check#

Project.check()[source]#

Return what would stop the project’s simulations, found before any run.

Looks only at the inputs, and runs and downloads nothing. For each variant it checks that:

  • the met’s directory exists and holds an ARL file (met_directory);

  • every met file each receptor’s run needs is there, naming the hours (met_files);

  • the first met file they need holds at least two time periods, which HYSPLIT needs (met_periods);

  • each receptor is inside the met’s crop box, subgrid_bounds, when the crop is on (met_crop);

  • each receptor is inside the footprint grid (grid);

  • each averaging_kernel table exists (kernel_table), has a kernel for every receptor (kernel_missing), and holds none for a receptor the project lacks (kernel_unused);

  • varsiwant holds zsfc when a receptor is above sea level (altitude_ref="msl") and a run reads it: the near-field correction, the release heights of a multipoint receptor whose points are less than 1 km apart and at different altitudes, or the pressure_weighting transform (zsfc).

A met with download has no files to look for: they are fetched when a run needs them, so only its crop is checked.

Returns:

One row for each thing found, with check (the name in parentheses above), variant (the variants it is found for, separated by commas, when they share a met, a run length, a grid, or a table), receptor (NA when it is not about one receptor), and message columns. Empty when nothing is found. stilt check prints it.

Return type:

DataFrame

Raises:

ValueError – If config.yaml or receptors.csv is invalid.

Notes

The check looks for files, not inside them (except to count the time periods of the first file a run needs, and to read the spacing of the met steps from the file of a run’s end), and the crop box is the only domain it knows. A run that passes it can still fail as MET_COVERAGE: a met file that is damaged or cut short is found when the run opens it, and a receptor outside the domain of the files (an uncropped met), when HYSPLIT starts it.

Examples

>>> problems = project.check()
>>> problems.empty  # True when nothing would stop a run
>>> problems[problems.check == "met_files"][
...     ["receptor", "message"]
... ]