Tabular

Inheritance diagram of gspy.src.classes.data.Tabular
class gspy.src.classes.data.Tabular.Tabular(xarray_obj)

Accessor to xarray.Dataset that handles Tabular data

See also

gspy.Spatial_ref

For Spatial reference instantiation.

static count_column_headers(columns)

Takes the header of a csv and counts repeated entries

A header “depth[0], depth[1], depth[2] will create an entry {‘depth’:3}

Parameters:

columns (list of str) – list of column names

Returns:

Dictionary with each unique column name and its count

Return type:

dict

get_fortran_format(key, default_f32='f10.3', default_f64='g16.6')
property is_netcdf
classmethod open_netcdf(filename, group='tabular', **kwargs)

Lazy loads a netCDF file but enforces CF convention when opening

Parameters:
  • filename (str) – NetCDF file

  • group (str, optional) – The NetCDF group containing Tabular data, by default ‘tabular’

Return type:

xarray.Dataset

classmethod read(filename, metadata_file=None, spatial_ref=None, **kwargs)

Instantiate a Tabular class from tabular data

When reading the metadata and data file, the following are established in order * User defined dimensions * User defined coordinates * Columns are read in and/or combined and added to the Dataset as variables

Parameters:
  • filename (str) – Filename to read from.

  • metadata_file (str, optional) – Json file name, by default None

  • spatial_ref (dict, gspy.Spatial_ref, or xarray.DataArray, optional) – Spatial ref object, by default None

Returns:

Dataset with all data read in.

Return type:

xarray.Dataset

See also

survey.Spatial_ref

For information on creating a spatial ref

property type

File type of the Tabular class

Returns:

File type

Return type:

str

write_netcdf(filename, group='tabular')

Write to netcdf file

Parameters:
  • filename (str) – Path to the file

  • group (str, optional) – Netcdf group name to use inside netcdf file. Default is ‘tabular’

write_zarr(filename, group='tabular')

Write to netcdf file

Parameters:
  • filename (str) – Path to the file

  • group (str, optional) – Netcdf group name to use inside netcdf file. Default is ‘tabular’