BathymetryCoverage

class s100py.s102.api.BathymetryCoverage(recursively_create_children=False, **kywrds)

Bases: s100py.s1xx.S1xxAttributesBase

This is the Group.NNN object that contains the grid data in a values dataset and other metadata about the grids.

4.2.1.1.1 and Figure 4.4 of v2.0.0 also see section 12.3 and table 12.5

Inheritance diagram of BathymetryCoverage

Attributes Summary

axis_names

sequence of character strings From 4.2.1.1.1.11, The attribute axisNames has the value class Sequence<CharacterString> that shall be used to assign names to the grid axis.

axis_names_attribute_name

HDF5 naming

axis_names_type

rtype

Type[str]

dimension

From 4.2.1.1.1.10, The attribute dimension has the value class Integer that shall identify the dimensionality of the grid.

dimension_attribute_name

HDF5 naming

dimension_type

extent

From 4.2.1.1.1.12, The attribute extent has the value class CV_GridEnvelope that shall contain the extent of the spatial domain of the coverage.

extent_attribute_name

HDF5 naming

extent_type

rtype

Type[GridEnvelope]

maximimum_display_scale

From 4.2.1.1.1.5, The smaller value of the ratio of the linear dimensions of the features of a dataset presented in the display and the actual dimensions of the features represented (smallest scale) of the scale range of the dataset.

maximum_depth

From 4.2.1.1.1.4, The attribute minimumDepth has the value type Real and describes the lower bound of the depth estimate for all the depth values in S102_BathymetryValues record.

maximum_depth_attribute_name

HDF5 naming

maximum_depth_type

maximum_display_scale

From 4.2.1.1.1.5, The smaller value of the ratio of the linear dimensions of the features of a dataset presented in the display and the actual dimensions of the features represented (smallest scale) of the scale range of the dataset.

maximum_display_scale_attribute_name

HDF5 naming

maximum_display_scale_type

maximum_uncertainty

From 4.2.1.1.1.7, The attribute minimumUncertainty has the value type Real and describes the lower bound of the uncertainty of the depth estimate for all the depth values in S102_BathymetryValues record.

maximum_uncertainty_attribute_name

HDF5 naming

maximum_uncertainty_type

minimum_depth

From 4.2.1.1.1.3, The attribute minimumDepth has the value type Real and describes the lower bound of the depth estimate for all the depth values in S102_BathymetryValues record.

minimum_depth_attribute_name

HDF5 naming

minimum_depth_type

minimum_display_scale

From 4.2.1.1.1.2, The larger value of the ratio of the linear dimensions of the features of a dataset presented in the display and the actual dimensions of the features represented (largest scale) of the scale range of the dataset.

minimum_display_scale_attribute_name

HDF5 naming

minimum_display_scale_type

minimum_uncertainty

From 4.2.1.1.1.6, The attribute minimumUncertainty has the value type Real and describes the lower bound of the uncertainty of the depth estimate for all the depth values in S102_BathymetryValues record.

minimum_uncertainty_attribute_name

HDF5 naming

minimum_uncertainty_type

offset_vectors

sequence of s102 Vectors From 4.2.1.1.1.9 in S102 v2.0.0 The attribute offsetVectors has the value class Sequence<Vector> that shall be a sequence of offset vector elements that determine the grid spacing in each direction.

offset_vectors_attribute_name

HDF5 naming

offset_vectors_type

origin

From 4.2.1.1.1.8, The attribute origin has the value class DirectPosition which is a position that shall locate the origin of the rectified grid in the coordinate reference system.

origin_attribute_name

HDF5 naming

origin_attribute_type

rtype

Type[DirectPosition]

origin_type

sequencing_rule

From 4.2.1.1.1.13, The attribute sequencingRule has the value class CV_SequenceRule (ISO 19123) that shall describe how the grid points are ordered for association to the elements of the sequence values.

sequencing_rule_attribute_name

HDF5 naming

sequencing_rule_type

start_sequence

From4.2.1.1.1.14, The attribute startSequence has the value class CV_GridCoordinate that shall identify the grid point to be associated with the first record in the values sequence.

start_sequence_attribute_name

HDF5 naming

start_sequence_type

values

The grids for depth and uncertainty.

values_attribute_name

HDF5 naming

values_type

rtype

Type[BathymetryValues]

write_format_str

Methods Summary

add_data(key, value)

axis_names_create()

The attribute axisNames has the value class Sequence<CharacterString> that shall be used to assign names to the grid axis.

dimension_create()

extent_create()

get_all_keys()

Gets all the non-standard keys that are contained in this object currently as well as all the standard keys (S100/HDF5 style names) that could be added.

get_compound_dtype()

Override this method if the dtype of compound dataset items is important

get_data(key)

get_hdf5_from_file(file_obj)

get_s1xx_attr(s1xx_name)

get_standard_keys()

Returns the S100 (HDF5) names for the things that are listed in the specs for this class.

get_standard_list_properties()

Returns a list of properties that are lists (children based on S1xxMetadataListBase).

get_standard_properties()

This function autodetermines the properties implemented (which have get/set @properties and _attribute_name associated)

get_standard_properties_mapping()

This function autodetermines the HDF5 or xml names and their associated property names.

get_write_order()

Override this method if the write order of attributes/groups/dataset items is important

initialize_properties([...])

Calls the create function for all the properties of the class.

maximum_depth_create()

maximum_display_scale_create()

maximum_uncertainty_create()

minimum_depth_create()

minimum_display_scale_create()

minimum_uncertainty_create()

offset_vectors_create()

origin_create()

read(group_object)

Given an h5py.File or a h5py group then read the data based on the encoded S100+ spec.

read_simple_attributes(group_object)

Reads the standard simple types (strings, ints, floats, datetimes, enums) from the given group as specified by the class specs.

sequencing_rule_create()

set_datetime_attribute(val, attribute_name, ...)

A DateTime is a combination of a date and a time type.

set_enum_attribute(val, attribute_name, ...)

Function to set an attribute that is an enumeration type using either it's string or numeric value or enumeration instance.

set_s1xx_attr(s1xx_name, val)

start_sequence_create()

values_create()

Creates a blank, empty or zero value for values

write(group_object)

write the contained data and all it's children into an HDF5 file using h5py.

write_as_xml(etree_object)

write_simple_attributes(group_object)

Attributes Documentation

axis_names

sequence of character strings From 4.2.1.1.1.11, The attribute axisNames has the value class Sequence<CharacterString> that shall be used to assign names to the grid axis. The grid axis names shall be “Latitude” and “Longitude” for unprojected data sets or “Northing” and “Easting” in a projected space

Return type

Union[ndarray, Dataset]

axis_names_attribute_name = 'axisNames'

HDF5 naming

axis_names_type
Return type

Type[str]

dimension

From 4.2.1.1.1.10, The attribute dimension has the value class Integer that shall identify the dimensionality of the grid. The value of the grid dimension in this product specification is 2. This value is fixed in this Product Specification and does not need to be encoded

Return type

int

dimension_attribute_name = 'dimension'

HDF5 naming

dimension_type
extent

From 4.2.1.1.1.12, The attribute extent has the value class CV_GridEnvelope that shall contain the extent of the spatial domain of the coverage. It uses the value class CV_GridEnvelope which provides the grid coordinate values for the diametrically opposed corners of the grid. The default is that this value is derived from the bounding box for the data set or tile in a multi tile data set

Return type

GridEnvelope

extent_attribute_name = 'extent'

HDF5 naming

extent_type
Return type

Type[GridEnvelope]

maximimum_display_scale

From 4.2.1.1.1.5, The smaller value of the ratio of the linear dimensions of the features of a dataset presented in the display and the actual dimensions of the features represented (smallest scale) of the scale range of the dataset. A list of display scale ranges is available in Table 11.1, 1st column

Return type

int

maximum_depth

From 4.2.1.1.1.4, The attribute minimumDepth has the value type Real and describes the lower bound of the depth estimate for all the depth values in S102_BathymetryValues record. This attribute is required. There is no default

Return type

float

maximum_depth_attribute_name = 'maximumDepth'

HDF5 naming

maximum_depth_type
maximum_display_scale

From 4.2.1.1.1.5, The smaller value of the ratio of the linear dimensions of the features of a dataset presented in the display and the actual dimensions of the features represented (smallest scale) of the scale range of the dataset. A list of display scale ranges is available in Table 11.1, 1st column

Return type

int

maximum_display_scale_attribute_name = 'maximumDisplayScale'

HDF5 naming

maximum_display_scale_type
maximum_uncertainty

From 4.2.1.1.1.7, The attribute minimumUncertainty has the value type Real and describes the lower bound of the uncertainty of the depth estimate for all the depth values in S102_BathymetryValues record. This attribute is required. There is no default

Return type

float

maximum_uncertainty_attribute_name = 'maximumUncertainty'

HDF5 naming

maximum_uncertainty_type
minimum_depth

From 4.2.1.1.1.3, The attribute minimumDepth has the value type Real and describes the lower bound of the depth estimate for all the depth values in S102_BathymetryValues record. This attribute is required. There is no default

Return type

float

minimum_depth_attribute_name = 'minimumDepth'

HDF5 naming

minimum_depth_type
minimum_display_scale

From 4.2.1.1.1.2, The larger value of the ratio of the linear dimensions of the features of a dataset presented in the display and the actual dimensions of the features represented (largest scale) of the scale range of the dataset. A list of display scale ranges is available in Figure 11.1, 1st column

Return type

int

minimum_display_scale_attribute_name = 'minimumDisplayScale'

HDF5 naming

minimum_display_scale_type
minimum_uncertainty

From 4.2.1.1.1.6, The attribute minimumUncertainty has the value type Real and describes the lower bound of the uncertainty of the depth estimate for all the depth values in S102_BathymetryValues record. This attribute is required. There is no default

Return type

float

minimum_uncertainty_attribute_name = 'minimumUncertainty'

HDF5 naming

minimum_uncertainty_type
offset_vectors

sequence of s102 Vectors From 4.2.1.1.1.9 in S102 v2.0.0 The attribute offsetVectors has the value class Sequence<Vector> that shall be a sequence of offset vector elements that determine the grid spacing in each direction. The data type Vector is specified in ISO/TS 19103. This attribute is required. There is no default.

Return type

Union[ndarray, Dataset]

offset_vectors_attribute_name = 'offsetVectors'

HDF5 naming

offset_vectors_type
origin

From 4.2.1.1.1.8, The attribute origin has the value class DirectPosition which is a position that shall locate the origin of the rectified grid in the coordinate reference system. This attribute is required. There is no default

Return type

DirectPosition

origin_attribute_name = 'origin'

HDF5 naming

origin_attribute_type
Return type

Type[DirectPosition]

origin_type
sequencing_rule

From 4.2.1.1.1.13, The attribute sequencingRule has the value class CV_SequenceRule (ISO 19123) that shall describe how the grid points are ordered for association to the elements of the sequence values. The default value is “Linear”. No other options are allowed. (note that for S100: Only the values “linear” (for a simple regular cell size grid) and “Morton” (for a Quad Tree Grid) shall be used for data that conforms to this standard.)

Return type

SequenceRule

sequencing_rule_attribute_name = 'sequencingRule'

HDF5 naming

sequencing_rule_type
start_sequence

From4.2.1.1.1.14, The attribute startSequence has the value class CV_GridCoordinate that shall identify the grid point to be associated with the first record in the values sequence. The default value is the lower left corner of the grid. No other options are allowed.

Return type

GridCoordinate

start_sequence_attribute_name = 'startSequence'

HDF5 naming

start_sequence_type
values

The grids for depth and uncertainty.

4.2.1.1.2.1 S102_BathymetryValues semantics

The class S102_BathymetryValues is related to BathymetryCoverage by a composition relationship in which an ordered sequence of depth values provide data values for each grid cell. The class S102_BathymetryValues inherits from S100_Grid

4.2.1.1.2.2 values

The attribute values has the value type S102_BathymetryValueRecord which is

a sequence of value items that shall assign values to the grid points.

There are two attributes in the bathymetry value record, depth and uncertainty in the S102_BathymetryValues class. The definition for the depth is defined by the depthCorrectionType attribute in the S102_DataIdentification class. The definition of the type of data in the values record is defined by the verticalUncertaintyType attribute in the S102_DataIdentification class

Return type

BathymetryValues

values_attribute_name = 'values'

HDF5 naming

values_type
Return type

Type[BathymetryValues]

write_format_str = '.%03d'

Methods Documentation

add_data(key, value)
axis_names_create()

The attribute axisNames has the value class Sequence<CharacterString> that shall be used to assign names to the grid axis. The grid axis names shall be “Latitude” and “Longitude” for unprojected data sets or “Northing” and “Easting” in a projected space.

dimension_create()
extent_create()
get_all_keys()

Gets all the non-standard keys that are contained in this object currently as well as all the standard keys (S100/HDF5 style names) that could be added.

Return type

list

get_compound_dtype()

Override this method if the dtype of compound dataset items is important

Return type

A list of dtype, None otherwise.

get_data(key)
get_hdf5_from_file(file_obj)
get_s1xx_attr(s1xx_name)
get_standard_keys()

Returns the S100 (HDF5) names for the things that are listed in the specs for this class.

Returns

The S102 HDF5 group/attribute/dataset names from this object that will be written or read from an HDF5 file. e.g. BathymetryCoverage or westBoundLongitude etc.

For the class “Root”: [‘BathymetryCoverage’, ‘Group_F’, ‘TrackingListCoverage’]

Return type

list

get_standard_list_properties()

Returns a list of properties that are lists (children based on S1xxMetadataListBase). Basically a way of finding which items will be named <name>_001, <name>_002 etc

Returns

The property names that will have auto-generated names based on their index in a list.

Return type

list

classmethod get_standard_properties()

This function autodetermines the properties implemented (which have get/set @properties and _attribute_name associated)

Returns

Names of the properties implemented.

For eample class “Root” might have (for S102): [‘bathymetry_coverage’, ‘feature_information’, ‘tracking_list_coverage’]

Return type

list

get_standard_properties_mapping()

This function autodetermines the HDF5 or xml names and their associated property names. Keys are the s100 (HDF5 spelling) strings and the values are the python style naming.

Returns

dictionary of xml element names as keys and property names as values.

For the class “Root”: {‘BathymetryCoverage’: ‘bathymetry_coverage’, ‘Group_F’: ‘feature_information’, ‘TrackingListCoverage’: ‘tracking_list_coverage’}

Return type

dict

get_write_order()

Override this method if the write order of attributes/groups/dataset items is important

Return type

A list of key names if order is important, None otherwise.

initialize_properties(recursively_create_children=False, overwrite=True)

Calls the create function for all the properties of the class. Default values will be created for each attribute that is expected to be contained in this object.

For example, say a class has simple attributes of ESPG code (int) and locatilty (str) and then a class made from S1xxAttributesBase called “extents” which has east and west inside it.

Calling initialize_properties(recursively_create_children=False) would result in EPSG=0, locality=”” and an instance of the “extents” class but NO value (nothing would be written to HDF5) for east, west.

Calling initialize_properties(recursively_create_children=True) would result in EPSG=0, locality=”” and an instance of the “extents” class but with east=0.0 and wesst=0.0 as well.

Calling initialize_properties(recursively_create_children=True, overwrite=False) with an esiting dataset, say locality=”test” would result in EPSG=0 being made, locality=”test” being retained and an instance of the “extents” class with east=0.0 and wesst=0.0 as well.

Parameters
  • recursively_create_children – True = Create children for any child data that would have other children False = Only create data for immediate children of this instance

  • overwrite – True = Overwrite existing data with new default data False = Keep existing data if it exists but create new data otherwise

Return type

None

maximum_depth_create()
maximum_display_scale_create()
maximum_uncertainty_create()
minimum_depth_create()
minimum_display_scale_create()
minimum_uncertainty_create()
offset_vectors_create()
origin_create()
read(group_object)

Given an h5py.File or a h5py group then read the data based on the encoded S100+ spec.

Parameters

group_object – The group (an h5py.File is a group too) to read from.

Return type

None

read_simple_attributes(group_object)

Reads the standard simple types (strings, ints, floats, datetimes, enums) from the given group as specified by the class specs.

Parameters

group_object – The group (an h5py.File is a group too) to read from.

Return type

None

sequencing_rule_create()
set_datetime_attribute(val, attribute_name, date_type)

A DateTime is a combination of a date and a time type. Character encoding of a DateTime must follow ISO 8601:2004 ( :2004 took away partial dates with two digit year or just month/day) EXAMPLES 19850412T101530 2001-07-17T04:50:00 2012-11-01T00:44:00+10:30 2001-07-17 19850412T101530.44 19850412T101530.44Z 19850412T101530.44+10 19850412T101530.44+1030 19850412T10:15:30Z

Parameters
  • val

  • attribute_name

  • date_type

set_enum_attribute(val, attribute_name, enum_type)

Function to set an attribute that is an enumeration type using either it’s string or numeric value or enumeration instance.

Parameters
  • val – The value as a string, int or Enum().

  • attribute_name – The S100 name (hdf5 spelling).

  • enum_type – The class of enumeration to use if an instance needs to be created.

Return type

None

set_s1xx_attr(s1xx_name, val)
start_sequence_create()
values_create()

Creates a blank, empty or zero value for values

write(group_object)

write the contained data and all it’s children into an HDF5 file using h5py.

Parameters

group_object – An h5py.File or an h5py group object

Return type

None

write_as_xml(etree_object)
write_simple_attributes(group_object)
__init__(recursively_create_children=False, **kywrds)