GeoEco.DataProducts.CMEMS.CMEMSARCOArray
- class GeoEco.DataProducts.CMEMS.CMEMSARCOArray(username, password, datasetID, variableShortName, log10Transform=False, xCoordType='center', yCoordType='center', zCoordType='center', tCoordType='min', lazyPropertyValues=None)
Bases:
GridA
Gridfor accessing 2D, 3D, and 4D gridded datasets published by Copernicus Marine Service.Copernicus Marine Service is also known as Copernicus Marine Environmental Monitoring Service (CMEMS). This example shows how to use this class to create time series of chlorophyll concentration rasters from Copernicus GlobColour and ocean temperature rasters from the Global Ocean Physics Reanalysis. There is another example showing how to do this in ArcGIS with the Create Rasters for CMEMS Dataset geoprocessing tool.
Requires: Python numpy module, Python copernicusmarine module.
- Parameters:
username (
str) – Copernicus Marine Service user name. Minimum length꞉ 1.password (
str) – Copernicus Marine Service password. Minimum length꞉ 1.datasetID (
str) – Dataset ID to access. You can find the Dataset ID by going to the Copernicus Marine Data Store, viewing your product of interest, clicking on Data Access, and scrolling to the Dataset ID table. The dataset must have 2, 3, or 4 dimensions. Two of the dimensions must be longitude and latitude. The third and fourth dimension can be depth or time. Minimum length꞉ 1.variableShortName (
str) –”Short name” of the variable to access. You can find the variable’s short name by going to to the Copernicus Marine Data Store, viewing your product of interest, clicking on Data Access, scrolling to the Dataset ID table, and clicking on Form under the Subset column. When the form appears, look under the Variables heading. Each variable has a long description in black font, followed by the variable short name and units (in brackets) in a lighter color. Do not include the units as part of the short name. Minimum length꞉ 1.
log10Transform (
bool, optional) –“If True, a
log10(base 10 logarithm) function will be applied to the data after it is downloaded before further processing. This transformation may be useful when working with data that are always positive but heavily skewed, such as chlorophyll concentration or other biological oceanographic data. For example, it is a common practice tolog10transform chlorophyll data before detecting chlorophyll fronts or utilizing chlorophyll in a species distribution model.Note that it is only possible to take the logarithm of a positive number. If the data contain values less than or equal to zero, a warning will be issued and they will be treated as missing values.
xCoordType (
str, optional) – Specifies whether the latitude coordinates used by Copernicus for this dataset are the left edges ('min'), the centers ('center'), or the right edges ('max') of the cells. This cannot be determined automatically but for most Copernicus datasets the longitude coordinates are the centers of the cells. To determine the appropriate value for your dataset of interest, consult the dataset’s documentation or contact Copernicus for help. Alternatively, download the dataset to a raster using'center', load it into a GIS, and overlay a high resolution shoreline. Examine the overlap to determine whether'min'or'max'would provide a better match up between the raster and the shoreline. Allowed values꞉'min','center','max'.yCoordType (
str, optional) – Specifies whether the latitude coordinates used by Copernicus for this dataset are the bottom edges ('min'), the centers ('center'), or the top edges ('max') of the cells. This cannot be determined automatically but for most Copernicus datasets the latitude coordinates are the centers of the cells. To determine the appropriate value for your dataset of interest, consult the dataset’s documentation or contact Copernicus for help. Alternatively, download the dataset to a raster using'center', load it into a GIS, and overlay a high resolution shoreline. Examine the overlap to determine whether'min'or'max'would provide a better match up between the raster and the shoreline. Allowed values꞉'min','center','max'.zCoordType (
str, optional) – Specifies whether the depth coordinates used by Copernicus for this dataset are the shallow edges ('min'), the centers ('center'), or the deep edges ('max') of the cells. This cannot be determined automatically but for most Copernicus datasets the depth coordinates are the centers of the cells. To determine the appropriate value for your dataset of interest, consult the dataset’s documentation or contact Copernicus for help. Allowed values꞉'min','center','max'.tCoordType (
str, optional) – Specifies whether the time coordinates used by Copernicus for this dataset are the starting times ('min'), the center times ('center'), or the ending times ('max') of the time slices. This cannot be determined automatically but most Copernicus datasets that are “instantaneous” use center times, while most datasets that represent mean values (e.g. daily or monthly means) use starting times. To determine the appropriate value for your dataset of interest, consult the dataset’s documentation or contact Copernicus for help. Allowed values꞉'min','center','max'.lazyPropertyValues (
dictmappingstrtoobject, optional) – Lazy properties to set when this object is constructed, expressed as a dictionary mapping the names of lazy properties to their values.
- Returns:
CMEMSARCOArrayinstance.- Return type:
Properties
- property CenterCoords
(
object) Coordinates of the grid cell centers, indexed using the 1-character dimension of interest and optionally arangeto retrieve anumpy.ndarrayof coordinates (e.g.CenterCoords['x', 0:4]) or an integer to retrieve afloatfor a single coordinate (e.g.CenterCoords['x', 10]). Coordinates for thetdimension are returned asdatetimeinstances. Read only.
- property CoordDependencies
(
tupleofstr) Same length asDimensions. Dimensions that each dimension depends on for determining its coordinates.Nonefor dimensions that have a constant coordinate increment. Read only.
- property CoordIncrements
(
tupleoffloat) Same length asDimensions. Coordinate increment for each dimension.Nonefor dimensions that do not have a constant coordinate increment. Read only.
- property Data
(
object) This grid’s data, indexable using slices (e.g.grid.Data[:, 5:10, -10:]) or integers (e.g.grid.Data[0,1,-2]) or both in combination. Strides and negative indexes are supported in the traditional manner. If the grid is writable,Datacan be assigned to write values to the grid, e.g.grid.Data[0,1] = 5orgrid.Data[:,:] = numpy.zeros(grid.Shape). Returns and acceptsnumpy.ndarray,float, andint. Read only.
- property DataIsScaled
(
bool) If True, the underlying raw data are stored as theUnscaledDataTypeto save storage space and then transformed by a scaling equation on the fly when they are returned byData. The raw data can be accessed withUnscaledData. If False, the raw data are returned as is, with no transformation needed, andUnscaledDataTypeandDataTypeare the same, andUnscaledDatareturns the same values asData. Read only.
- property DataType
(
str) Numeric data type of the grid, after the scaling function (if any) has been applied to the raw data.numpy.ndarrays returned byDatahave this type. Read only. Allowed values꞉'int8','uint8','int16','uint16','int32','uint32','float32','float64'. Case sensitive.
- property DatasetID
(
str) Dataset ID to access. You can find the Dataset ID by going to the Copernicus Marine Data Store, viewing your product of interest, clicking on Data Access, and scrolling to the Dataset ID table. The dataset must have 2, 3, or 4 dimensions. Two of the dimensions must be longitude and latitude. The third and fourth dimension can be depth or time. Read only. Minimum length꞉ 1.
- property Dimensions
(
str) Dimensions of this grid. Read only. Allowed values꞉'yx','zyx','tyx','tzyx'. Case sensitive.
- property DisplayName
(
str) Informal name of this object, suitable to be displayed to the user. Read only. Minimum length꞉ 1.
- property Log10Transform
(
bool) “If True, alog10(base 10 logarithm) function will be applied to the data after it is downloaded before further processing. This transformation may be useful when working with data that are always positive but heavily skewed, such as chlorophyll concentration or other biological oceanographic data. For example, it is a common practice tolog10transform chlorophyll data before detecting chlorophyll fronts or utilizing chlorophyll in a species distribution model.Note that it is only possible to take the logarithm of a positive number. If the data contain values less than or equal to zero, a warning will be issued and they will be treated as missing values. Read only.
- property MaxCoords
(
object) Maximum coordinate value for each cell (i.e., the coordinates of the cells’ right edges), indexed using the 1-character dimension of interest and optionally arangeto retrieve anumpy.ndarrayof coordinates (e.g.MaxCoords['x', 0:4]) or an integer to retrieve afloatfor a single coordinate (e.g.MaxCoords['x', 10]). Coordinates for thetdimension are returned asdatetimeinstances. Read only.
- property MinCoords
(
object) Minimum coordinate value for each cell (i.e., the coordinates of the cells’ left edges), indexed using the 1-character dimension of interest and optionally arangeto retrieve anumpy.ndarrayof coordinates (e.g.MinCoords['x', 0:4]) or an integer to retrieve afloatfor a single coordinate (e.g.MinCoords['x', 10]). Coordinates for thetdimension are returned asdatetimeinstances. Read only.
- property NoDataValue
(
objectorNone)intorfloatvalue that indicates that cells ofDatashould be interpreted as having no data (these are also known as missing, NA, or NULL cells), orNoneif all cells must have data. Read only.
- property ParentCollection
(
DatasetCollectionorNone) ParentDatasetCollectionthat this object is part of (if any). Read only.
- property Shape
(
tupleofint) Same length asDimensions. Length (number of grid cells) of each dimension. Read only.
- property TCountPerSemiRegularPeriod
(
intorNone) Number of time slices per semi-regular period (i.e. per year).Noneif the grid’s dimensions do not contain atcoordinate or thetcoordinate is not semi-regular. Read only.
- property TIncrementUnit
(
strorNone) Unit of thetcoordinate.Noneif the grid’s dimensions do not contain atcoordinate. Read only. Allowed values꞉'year','month','day','hour','minute','second'. Case sensitive.
- property TSemiRegularity
(
strorNone) Type of semi-regularity used for thetcoordinate.Noneif the grid’s dimensions do not contain atcoordinate or thetcoordinate is not semi-regular. Read only. Allowed values꞉'annual'. Case sensitive.
- property UnscaledData
(
object) This grid’s data underlying raw data, before it has been transformed by a scaling equation.UnscaledDatais indexable using slices (e.g.grid.UnscaledData[:, 5:10, -10:]) or integers (e.g.grid.UnscaledData[0,1,-2]) or both in combination. Strides and negative indexes are supported in the traditional manner. If the grid is writable,UnscaledDatacan be assigned to write values to the grid, e.g.grid.UnscaledData[0,1] = 5orgrid.UnscaledData[:,:] = numpy.zeros(grid.Shape). Returns and acceptsnumpy.ndarray,float, andint. Read only.
- property UnscaledDataType
(
str) Numeric data type of the grid’s raw data, before it has been transformed by a scaling equation.numpy.ndarrays returned byUnscaledDatahave this type. If no transformation is needed (DataIsScaledis False), thenUnscaledDataTypeandScaledDataTypeare the same, andUnscaledDatareturns the same values asData. Read only. Allowed values꞉'int8','uint8','int16','uint16','int32','uint32','float32','float64'. Case sensitive.
- property UnscaledNoDataValue
(
objectorNone)intorfloatvalue that indicates that cells ofUnscaledDatashould be interpreted as having no data (these are also known as missing, NA, or NULL cells), orNoneif all cells must have data. Read only.
- property VariableShortName
(
str) “Short name” of the variable to access. You can find the variable’s short name by going to to the Copernicus Marine Data Store, viewing your product of interest, clicking on Data Access, scrolling to the Dataset ID table, and clicking on Form under the Subset column. When the form appears, look under the Variables heading. Each variable has a long description in black font, followed by the variable short name and units (in brackets) in a lighter color. Do not include the units as part of the short name. Read only. Minimum length꞉ 1.
Methods
Closes any open files or connections associated with this object and releases any other resources allocated to access it.
Converts a spatial reference from one format to another, such as an OGC WKT string to a Proj4 string.
Deletes the lazy property with the specified name.
Returns a list of all queryable attributes.
Given a
tupleorlistof coordinates, returns alistofintindices intoDatafor the cell that contains the coordinates.Returns the value of the lazy property with the specified name.
Returns the queryable attribute with the specified name.
Returns the value of the queryable attribute with the specified name.
Returns a list queryable attributes having the specified data type.
Returns the spatial reference of this dataset.
Returns True if the specified lazy property has a value.
Sets the lazy property with the specified name to the specified value.
Sets the spatial reference of this dataset.
Tests whether a capability is supported by this class or an instance of it.