easy_vic_build.tools.nc_func.create_nc

Utilities for creating NetCDF files and copying NetCDF attributes.

Functions

copy_garrtibutefunc(src_dataset, dst_dataset)

Copy global attributes from one NetCDF dataset to another.

copy_vattributefunc(src_var, dst_var)

Copy attributes from one NetCDF variable to another.

demo_combineGlobalSnow_SWE_add_time_dim()

Legacy example: combine GlobalSnow SWE files into one NetCDF dataset.

demo_combineTRMM_P_add_time_dim()

Legacy example: combine daily TRMM files into one time-stacked dataset.

demos1()

Legacy example: convert GLDAS percentile data array into NetCDF.

Classes

create_nc()

Helper for creating NetCDF files and copying metadata.

class easy_vic_build.tools.nc_func.create_nc.create_nc[source]

Bases: object

Helper for creating NetCDF files and copying metadata.

Initialize a create_nc helper instance.

__init__()[source]

Initialize a create_nc helper instance.

copy_garrtibutefunc(dst_dataset_path, src_dataset_path)[source]

Copy global attributes from one NetCDF file to another.

Parameters:
  • dst_dataset_path (str) – Destination NetCDF path.

  • src_dataset_path (str) – Source NetCDF path.

Return type:

None

copy_vattributefunc(dst_dataset_path, src_dataset_path)[source]

Copy variable attributes from one NetCDF file to another.

Parameters:
  • dst_dataset_path (str) – Destination NetCDF path.

  • src_dataset_path (str) – Source NetCDF path.

Return type:

None

easy_vic_build.tools.nc_func.create_nc.copy_vattributefunc(src_var, dst_var)[source]

Copy attributes from one NetCDF variable to another.

Parameters:
  • src_var (netCDF4.Variable) – Source variable.

  • dst_var (netCDF4.Variable) – Destination variable.

Return type:

None

easy_vic_build.tools.nc_func.create_nc.copy_garrtibutefunc(src_dataset, dst_dataset)[source]

Copy global attributes from one NetCDF dataset to another.

Parameters:
  • src_dataset (netCDF4.Dataset) – Source dataset.

  • dst_dataset (netCDF4.Dataset) – Destination dataset.

Return type:

None

easy_vic_build.tools.nc_func.create_nc.demos1()[source]

Legacy example: convert GLDAS percentile data array into NetCDF.

Notes

This function is kept as an ad-hoc workflow example and relies on local hard-coded paths.

easy_vic_build.tools.nc_func.create_nc.demo_combineTRMM_P_add_time_dim()[source]

Legacy example: combine daily TRMM files into one time-stacked dataset.

Notes

This function is kept for reproducibility of historical preprocessing and uses hard-coded local paths.

easy_vic_build.tools.nc_func.create_nc.demo_combineGlobalSnow_SWE_add_time_dim()[source]

Legacy example: combine GlobalSnow SWE files into one NetCDF dataset.

Notes

This function is kept for reproducibility of historical preprocessing and uses hard-coded local paths.