nsrdb.preprocessing.nasa_data_model.NasaDataModel

class NasaDataModel(input_file, output_pattern)[source]

Bases: object

Class to handle conversion of nasa data to standard uwisc style format for NSRDB pipeline

Parameters:
  • input_file (str) – e.g. “./2017/01/01/nacomposite_2017.001.0000.nc”

  • output_pattern (str) – Needs to include year, doy, and timestamp format keys. e.g. “./{year}/{doy}/nacomposite_{timestamp}.nc”

Methods

derive_stdevs(ds)

Derive standard deviations of some variables, which are used as training features.

drop_vars(ds)

Drop list of variables

remap_cloud_phase(ds)

Map nasa cloud phase flags to uwisc values.

remap_dims(ds)

Rename dims and coords to standards.

rename_vars(ds)

Rename variables to uwisc conventions

run(input_file, output_pattern)

Run conversion routine and write converted dataset.

write_output(ds, output_file)

Write converted dataset to output_file.

Attributes

ds

Get xarray dataset for raw input file

output_file

Get output file name for given output pattern.

timestamp

Get year, doy, hour from input file name.

property timestamp

Get year, doy, hour from input file name.

TODO: Should get this from relative_time variables to be more precise

property output_file

Get output file name for given output pattern.

property ds

Get xarray dataset for raw input file

classmethod rename_vars(ds)[source]

Rename variables to uwisc conventions

classmethod drop_vars(ds)[source]

Drop list of variables

classmethod remap_dims(ds)[source]

Rename dims and coords to standards. Make lat / lon into 2d arrays, as expected by cloud regridding routine.

classmethod remap_cloud_phase(ds)[source]

Map nasa cloud phase flags to uwisc values.

classmethod derive_stdevs(ds)[source]

Derive standard deviations of some variables, which are used as training features.

classmethod write_output(ds, output_file)[source]

Write converted dataset to output_file.

classmethod run(input_file, output_pattern)[source]

Run conversion routine and write converted dataset.