nwm_eval.fetch_data.extract_flow_for_gages#

nwm_eval.fetch_data.extract_flow_for_gages(nc_file, locations, start_time=None, end_time=None, flow_var='flow', feature_id_var='feature_id', time_var='time')[source]#

Extract time and flow for specific gages from a NetCDF file.

Return type:

DataFrame

Parameters:
  • nc_file (Path) – Path to NetCDF file.

  • locations (dict) – Dictionary containing secondary ID (NWM link IDs) and primary ID (USGS gage IDs).

  • start_time (pd.Timestamp, optional) – Start time for filtering.

  • end_time (pd.Timestamp, optional) – End time for filtering.

  • flow_var (str) – Name of flow variable in NetCDF.

  • feature_id_var (str) – Name of feature_id variable in NetCDF.

  • time_var (str) – Name of time variable in NetCDF.

Returns:

pd.DataFrame with columns [‘time’, ‘location_id’, ‘value’].