nsrdb.data_model.gfs.GfsFiles

class GfsFiles(source_dir, time_index)[source]

Bases: object

Class to handle Gfs file selection

Parameters:
  • source_dir (str) – Directory containing GFS files

  • time_index (pandas.DatetimeIndex) – DatetimeIndex for day of interest

Methods

get(source_dir, time_index)

Get GFS files from source_dir that match the desired time_index

Attributes

date_stamp

Date to get GFS files for

files

GFS files that match time_index

time_index

Time index for the date of interest that files are needed for

property time_index

Time index for the date of interest that files are needed for

Returns:

pandas.DatetimeIndex

property date_stamp

Date to get GFS files for

Returns:

str – Date in GFS file format of YYYY_MMDD

property files

GFS files that match time_index

Returns:

list

classmethod get(source_dir, time_index)[source]

Get GFS files from source_dir that match the desired time_index

Parameters:
  • source_dir (str) – Directory containing GFS files

  • time_index (pandas.DatetimeIndex) – DatetimeIndex for day of interest

Returns:

list – List of file paths for each timestep in time_index. Files with the shortest forecast time (‘offset’) are chosen for each timestep