input_preparation
¶
Functions:
-
download_and_process–Download and process the weather data one or more RESKit workflows need.
download_and_process
¶
download_and_process(
workflows,
start_date,
end_date,
boundary_box,
output_dir,
tiling=False,
zoom_level=4,
tile_output_dir=None,
)
Download and process the weather data one or more RESKit workflows need.
A workflow may depend on several weather sources (see depends_on); each is prepared
by its own registered preparer (see _SOURCE_PREPARERS) and contributes its outputs to
the returned dict (e.g. the ERA5 preparer adds "era5_path"). Sources whose automated
download is not implemented yet (e.g. GWA4) do not fail the call — they just print a
notice that the data must be downloaded manually.
Parameters:
-
(workflows¶str or list of str) –Name of a registered RESKit workflow (a key of
depends_on), or a list of such names. When a list is given, the union of their variable requirements is prepared in a single call. -
(start_date¶str) –Inclusive date range to download (
"YYYY-MM-DD"). -
(end_date¶str) –Inclusive date range to download (
"YYYY-MM-DD"). -
(boundary_box¶dict) –Bounding box
{"north", "south", "west", "east"}in degrees. -
(output_dir¶str) –Directory to download/process into.
-
(tiling¶bool, default:False) –If True, tile the processed data into the
<zoom>/<x>/<y>/<year>/structure. -
(zoom_level¶int, default:4) –Web-Mercator tiling zoom level, by default 4.
-
(tile_output_dir¶str, default:None) –Override for the tile output directory (defaults to
<output_dir>/tiles).
Returns:
-
dict–Merged outputs of the workflows' sources' preparers.
Raises:
-
ValueError–If any given workflow name is unknown.