2.1. HWP_tools module

This file provides Hourly Wildfire Potential (HWP) tools.

HWP_tools.check_restart_files(hourly_hwpdir, fcst_dates)[source]

Check the restart files.

Parameters
  • hourly_hwpdir – the directory where the RESTART data is copied (nwges/HOURLY_HWP)

  • fcst_dates – Forecast dates

Returns

lists of hours with and without available RESTART files

HWP_tools.copy_missing_restart(nwges_dir, hwp_non_avail_hours, hourly_hwpdir)[source]

Check the restart files.

The script loops through hwp_non_avail_hours (missing files in nwges/HOURLY_HWP) and determines if an alternative RESTART file in nwges/fcst_fv3lam/RESTART is available instead. If so, it is appended to restart_avail_hours.

Parameters
  • nwges_dir – holds the boundary, INPUT, and RESTART files (e.g,

  • here (described) –

  • [ufs-community/ufs-srweather-app#654](https – //github.com/ufs-community/ufs-srweather-app/issues/654))

  • in (The use of NWGES is a bit of a legacy variable name) –

  • holding (production. It is often used to define a directory) –

  • files (DA-relevant) –

  • directory. (outside of the main COM output) –

  • hwp_non_avail_hours – a list of hours without available RESTART files

  • hourly_hwpdir – the directory where the RESTART data is copied (nwges/HOURLY_HWP)

Returns

list of::
  • restart_avail_hours

  • restart_nonavail_hours_test which is a subset of hwp_non_avail_hours.

HWP_tools.process_hwp(fcst_dates, hourly_hwpdir, cols, rows, intp_dir, rave_to_intp)[source]

Check the restart files.

Parameters
  • fcst_dates – a list of forecasts (for production/ops/ebb=2, it is {current_day - 25 hours: current_day-1hours}, for ebb=1, it is current_day:current_day+24 hours)

  • hourly_hwpdir – the directory where the RESTART data is copied (nwges/HOURLY_HWP)

  • cols – hard coded dimension for the RRFS_NA_3km and RRFS_CONUS_3km domains:: cols = 2700 if predef_grid == ‘RRFS_NA_3km’ else 1092

  • rows – hard coded dimension for the RRFS_NA_3km and RRFS_CONUS_3km domains:: rows = 3950 if predef_grid == ‘RRFS_NA_3km’ else 1820

  • intp_dir – the working directory for smoke processing (${CYCLE_DIR}/process_smoke)

  • rave_to_intp – a string based on the grid name:: rave_to_intp = predef_grid+”intp”

Returns

list of::
  • average (through time) of HWP_AVE in the available RESTART files

  • hwp_ave_arr converted to an xarray DataArray

  • the total precipitation vector (totprcp) reshaped to the 2D grid

  • totprcp_ave_arr converted to an xarray DataArray