Survey

Inheritance diagram of gspy.src.classes.survey.Survey
class gspy.src.classes.survey.Survey.Survey(metadata=None)

Class defining a survey or dataset

The Survey group contains general metadata about the survey or data colleciton as a whole. Information about where the data was collected, acquisition start and end dates, who collected the data, any clients or contractors involved, system specifications, equipment details, and so on are documented within the Survey as data variables and attributes.

Users are allowed to add as much or little information to data variables as they choose. However, following the CF convention, a set of global dataset attributes are required: * title * institution * source * history * references

A “spatial_ref” variable is also required within Survey and should contain all relevant information about the coordinate reference system.

Once instantiated, tabular and raster classes can be added to the survey. Each tabular or raster dataset is a separate xarray.Dataset.

Survey(metadata)

Parameters:

metadata (str or dict) –

  • If str, a metadata file

  • If dict, dictionary of survey metadata.

Return type:

gspy.Survey

See also

Spatial_ref

For information on creating a spatial ref

add_raster(*args, **kwargs)

Add Raster data to the survey.

See also

gspy.Raster

For instantiation/reading requirements

add_tabular(type, data_filename, metadata_file=None, **kwargs)

Add Tabular data to the survey

Parameters:
  • data_filename (str) – File to read data from

  • metadata_file (str, optional) – Metadata file for the tabular data

See also

gspy.Tabular

For instantiation/reading requirements

property contents

print out the contents of the survey

classmethod open_netcdf(filename, **kwargs)

Read a survey from a netcdf file with lazy loading

Parameters:

filename (str) – Netcdf file name

Returns:

out

Return type:

gspy.Survey

property raster
read_metadata(filename=None)

Read metadata for the survey

Parameters:

filename (str) – Metadata file.

Return type:

dict

See also

Survey.write_metadata_template

For more metadata data information

reproject()

Reprojects Survey

The Survey and all dependent datasets are reprojected into a new CRS

Raises:

NotImplementedError – Function planned but not currently implemented

property spatial_ref
property tabular
static write_metadata_template(filename='survey_md.yml')

Creates a metadata template for a Survey

If a Survey metadata file is not found or passed, an empty template file is generated and an Exception is raised.

Raises:

Exception – “Please re-run and specify metadata when instantiating Survey()”

write_ncml(filename)

Write an NcML (NetCDF XML) metadata file

TODO: Re-write this.

Parameters:

filename (str) – Name of the NetCDF file to generate NcML for

write_netcdf(filename)

Write a survey to a netcdf file as well as any attached datasets.

Parameters:

filename (str) – Netcdf file name

write_zarr(filename)

Write a survey to a netcdf file as well as any attached datasets.

Parameters:

filename (str) – Netcdf file name

property xarray