:mod:`cerbere` was designed to easy data management tasks. It can be used to
easily convert data files from one format to another, or to reformat data to
another formatting convention matching a specific project requirements. For some
examples of such operation, refer also to :ref:`format_profile`.
:mod:`cerbere` was designed to ease data management tasks. It can be used to
convert data files from one format to another, or to reformat data to
another formatting convention matching a specific project requirements, with
minimum code effort. For some examples of such operation, refer also to
:ref:`format_profile`.
When saving the content of a :mod:`~cerbere.dataset` class object, the output
file is formatted following the default settings and conventions implemented in
...
...
@@ -25,6 +26,257 @@ particular, it can define:
Let's format for instance data to GHRSST format (as defined in GDS 2.1
document). We define these requirements in a profile file as follow:
.. code-block:: yaml
---
# Defines the list and default values of the global attributes of a Cerbere new feature
attributes:
# Description
id:
naming_authority: org.ghrsst
title:
summary:
cdm_data_type:
keywords: Oceans > Ocean Temperature > Sea Surface Temperature
acknowledgement: "Please acknowledge the use of these data with the following statement: these data were produced by the Centre de Recherche et d'Exploitation Satellitaire (CERSAT), at IFREMER, Plouzane (France)"
processing_level:
metadata_link:
comment:
file_quality_level:
# Observation
platform:
platform_type:
instrument:
instrument_type:
band:
# Conventions
Conventions: CF 1.7, ACDD 1.3, ISO 8601
Metadata_Conventions: Climate and Forecast (CF) 1.7, Attribute Convention for Data Discovery (ACDD) 1.3
standard_name_vocabulary: NetCDF Climate and Forecast (CF) Metadata Convention
keywords_vocabulary: NASA Global Change Master Directory (GCMD) Science Keywords
format_version: GDSv1.2
gds_version_id:
platform_vocabulary: CEOS mission table
instrument_vocabulary: CEOS instrument table
# Authorship
institution: Institut Francais de Recherche et d'Exploitation de la Mer (Ifremer) Centre de Recherche et d'Exploitation satellitaire (CERSAT)
institution_abbreviation: Ifremer/CERSAT
project: Group for High Resolution Sea Surface Temperature (GHRSST)
program: CMEMS
license: GHRSST protocol describes data use as free and open.
Get the dimensions (like in netCDF) of a file (Note that the geolocation dimension
names returned are standardized):
.. code-block:: python
f.dims
Get the dimensions (like in netCDF) of a particular field:
.. code-block:: python
f.get_field_dims('sea_surface_temperature')
Get the size of a dimension (standard names can be used for geolocation
dimensions):
.. code-block:: python
f.get_dimsize('row') # standard dimension name for Swath feature
Get a field and print it:
.. code-block:: python
field = f.get_field('sea_surface_temperature')
print(field)
.. note::
|Field| are similar to variables in netcdf or `DataArray` in xarray_. A field consists of :
* an attached *variable* describing the geophysical quantity provided by the field (together with a few descriptive attributes such standard name, etc...)
* *attributes* further documenting the provided observation values (units,...) similar to the variable attributes in netCDF
* an *array of values* (observations)
* an optional array of *quality flags* (one for each observation value)
* an optional array of *quality history* (one for each observation value) documenting the reason why a value was flagged
Get the dimensions (like in netCDF) of a file (Note that the geolocation dimension
names returned are standardized):
.. code-block:: python
f.dims
Get the dimensions (like in netCDF) of a particular field:
.. code-block:: python
f.get_field_dims('sea_surface_temperature')
Get the size of a dimension (standard names can be used for geolocation
dimensions):
.. code-block:: python
f.get_dimsize('row') # standard dimension name for Swath feature
Get a field and print it:
.. code-block:: python
field = f.get_field('sea_surface_temperature')
print(field)
.. note::
|Field| are similar to variables in netcdf or `DataArray` in xarray_. A field consists of :
* an attached *variable* describing the geophysical quantity provided by the field (together with a few descriptive attributes such standard name, etc...)
* *attributes* further documenting the provided observation values (units,...) similar to the variable attributes in netCDF
* an *array of values* (observations)
* an optional array of *quality flags* (one for each observation value)
* an optional array of *quality history* (one for each observation value) documenting the reason why a value was flagged