Weather tools

cycles.weather

download_forcing(data_path, forcing, date_start, date_end)

Download forcing netCDF files for a date range.

Parameters:
  • data_path (Path | str) –

    Directory where forcing files are stored.

  • forcing (str) –

    Name of reanalysis product.

  • date_start (datetime | int) –

    Start datetime or start year.

  • date_end (datetime | int) –

    End datetime or end year.

find_grids(forcing, *, locations=None, screen_output=True, remove_duplicates=True)

Find nearest valid weather grids for provided locations.

Parameters:
  • forcing (str) –

    Name of reanalysis product.

  • locations (LocationInput, default: None ) –

    Optional coordinates or named coordinates.

  • screen_output (bool, default: True ) –

    If True, print selected grid summary.

  • remove_duplicates (bool, default: True ) –

    If True, collapse duplicate grid selections.

Returns:
  • str | list[str]

    Weather filename for one location or list of filenames.

generate_weather_files(data_path, weather_path, forcing, date_start, date_end, *, hourly=False, locations=None, header=True)

Generate Cycles weather files for selected locations and dates.

Parameters:
  • data_path (Path | str) –

    Directory containing downloaded forcing files.

  • weather_path (Path | str) –

    Output directory for generated weather files.

  • forcing (str) –

    Name of reanalysis product.

  • date_start (datetime) –

    Start date of generated records.

  • date_end (datetime) –

    End date of generated records.

  • hourly (bool, default: False ) –

    If True, write hourly weather files.

  • locations (LocationInput, default: None ) –

    Optional coordinates or named coordinates.

  • header (bool, default: True ) –

    If True, write weather file headers.