-
Notifications
You must be signed in to change notification settings - Fork 51
Gage Data RFC
For V3 processing in troute, RFC gage data are ingested in nwm_network_preprocess
.
rfc_params
: checking whether RFC-type reservoirs are specified by examining the rfc key within waterbody_parameters. If RFC is enabled, the following parameters are read:
-
rfc_forecast
: Determines whether RFC reservoir forecasts are enabled. -
param_file
: Points to the reservoir parameter file containing data necessary for RFC, USGS, and USACE observations. No further processing for RFC is conducted, ifrfc_forecast
is False.
If the param_file
is available and either reservoir_da (data assimilation) or rfc_forecast is enabled, nhd_io.read_reservoir_parameter_file extracts the waterbody type dataframe waterbody_types_df from the reservoir parameter file that encodes waterbody types including RFC gages:
- Type 1: Level pool
- Type 2: USGS Hybrid Persistence
- Type 3: USACE Hybrid Persistence
- Type 4: RFC
In addition, usgs- and usace lake gage crosswalks are created.
The RFCDA class
, a child class of AbstractDA
, is responsible for ingesting and processing RFC related data for reservoir data assimilation. Depending on the setting of the from_files parameter, the data are either imported as BMI arrays, or read from RFC gage files.
The constructor checks if RFC reservoir DA is enabled through the reservoir_rfc_da parameter inside the reservoir_da configuration. The main RFC dataframes are initialized:
- _
reservoir_rfc_df
: stores RFC time series data. - _
reservoir_rfc_param_df
: stores the corresponding RFC parameters for data assimilation.
If RFC is enabled and legacy data isn't used, the RFC data components, encoded as ndarrays, are retrieved from shared memory space (value_dict):
rfc_da_timestep
rfc_totalCounts
rfc_synthetic_values
rfc_discharges
-
rfc_timeseries_idx
-rfc_use_rfc
rfc_Datetime
rfc_timeSteps
rfc_StationId_stringLengths
rfc_List_array
rfc_List_stringLengths
The main RFC dataframe rfc_df
is assembled using the routine _bmi_reassemble_rfc_timeseries
, which is part of the bmi_array2df
(a2df) library for the conversion of ndarrays to 2D dataframes with non-numeric entries and indexes. After dataframe assembly, the method assemble_rfc_dataframes
creates the final RFC dataframes (_reservoir_rfc_df
and _reservoir_rfc_param_df
) by linking the decoded data with network crosswalks, initial time (t0), and RFC parameters.
The RFC time series data is read from specified file paths, using rfc_parameters
like lookback hours and offset hours to define the time range of interest. The method _read_timeseries_files
reads the time series data for the selected time window. The assemble_rfc_dataframes method is again used to organize the RFC data into the _reservoir_rfc_df
and _reservoir_rfc_param_df dataframes
.
The assemble_rfc_dataframes
function processes RFC timeseries data by pivoting it into a format where rows represent locations (station IDs) and columns represent dates, replacing gage IDs with lake IDs using a crosswalk. It also constructs a parameter dataframe with metadata like total counts, timeseries indices, and other relevant fields, adjusting for the model's start time (t0). The function ensures that missing values are handled and columns are properly typed before returning both the observations and parameter dataframes for further use in data assimilation.
The update_after_compute
method updates the data assimilation parameters after a simulation run. It uses the results from the run (run_results) to modify the _reservoir_rfc_param_df for the next iteration of the model's loop.
- Overview
- Hydrofabric Integration
- Input Forcing
- Domain Data
- Data Formats
- CLI
- BMI Tutorial
- Lower Colorado, TX example
- Larger Domains (e.g. CONUS)