Xarray_dataset ( xarray.Dataset) – The XArray Dataset object that you’d like to convert into a CDF fileįile_name ( str) – The path to the place the newly created CDF file This function converts XArray Dataset objects into CDF files. xarray_to_cdf ( xarray_dataset, file_name, from_unixtime = False, from_datetime = False, istp = True, record_dimensions =, compression = 0 ) ¶ Gather all global scope attributes in the CDF fileĬreate an XArray Dataset objects with the data variables, coordinate variables, and global attributes.Ĭdflib. Gather all the Variable objects created in the first step, and separate them into data variables or coordinate variables Optionally, convert CDF_EPOCH/EPOCH16/TT2000 variables to unixtime or datetimeĬreate an XArray Variable object using the dimensions determined in steps 1 and 2, the attributes from steps 3 and 4, and then the variable data Optionally, convert FILLVALs to NaNs in the data Gather all attributes that belong to the variableĪdd a few attributes that enable better plotting with built-in xarray functions (name, units, etc) If no dimensions are found through the above checks, create a dumension named “dimX” If either of the above are time varying, the code appends “_dim” to the end of the name The DEPEND_X probably points to the appropriate dimensions for that variable, so we check those Determine the name of the other dimensions of the variable, if they existĬheck if the variable name itself might be a dimension.If neither of the above, we create a new dimensions named “recordX” The DEPEND_0 likely points to the approrpiate dimensions Determine the name of the dimension that spans the data “records”Ĭheck if the variable itself might be a dimension.cdf_to_xarray ( fname, to_unixtime = True, fillval_to_nan = True ) > print ( thg_data ) Processing Steps: #Load in and display the CDF file > thg_data = cdflib.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |