S104Root¶
- class s100py.s104.api.S104Root(recursively_create_children=False, **kywrds)¶
Bases:
s100py.s100.S100RootThe root group contains a feature information group and N feature containers. In S104 there is one feature container ‘water level’. The coverage names are determined from the matching CoveragesAttributes Table 3 of v0.0.7

Attributes Summary
Eastern extent
HDF5 naming
- rtype
str
- rtype
Type[str]
The attribute extentTypeCode is a Boolean value.
HDF5 naming
- rtype
- rtype
str
- rtype
Type[str]
- rtype
Define S104 datatype
- rtype
str
- rtype
Type[str]
- rtype
int
- rtype
Type[int]
- rtype
date
- rtype
Type[date]
- rtype
time
- rtype
Type[time]
- rtype
str
- rtype
Type[str]
- rtype
str
- rtype
Type[str]
Northern extent
HDF5 naming
- rtype
str
- rtype
Type[str]
Southern extent
HDF5 naming
- rtype
Enumeration data type
- rtype
Define S104 datatype
- rtype
Enum
EPSG code for vertical datum for verticalDatumReference = 2
Define datatype
- rtype
Defines enumeration datatype
- rtype
Type[Enum]
- rtype
- rtype
- rtype
Type[float32]
Western extent
HDF5 naming
Methods Summary
add_data(key, value)Creates a blank, empty or zero value for epoch
Creates a blank, empty or zero value for geographic_identifier
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.
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)Returns the S100 (HDF5) names for the things that are listed in the specs for this class.
Returns a list of properties that are lists (children based on S1xxMetadataListBase).
This function autodetermines the properties implemented (which have get/set @properties and _attribute_name associated)
This function autodetermines the HDF5 or xml names and their associated property names.
Override this method if the write order of attributes/groups/dataset items is important
Creates a blank, empty or zero value for horizontal crs
Creates a blank, empty or zero value for horizontal_datum_reference
Creates a blank, empty or zero value for horizontal_datum_value
initialize_properties([...])Calls the create function for all the properties of the class.
Creates a blank, empty or zero value for issue_date
Creates a blank, empty or zero value for issue_time
Creates a blank, empty or zero value for meta_features
Creates a blank, empty or zero value for metadata
Creates a blank, empty or zero value for product_specification
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.
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)Creates a value using the first item in the enumeration of vertical_coordinate_base
Creates a blank, empty or zero value for vertical coordinate system
Creates a blank, empty or zero value for vertical_datum
Creates a blank, empty or zero value for vertical_datum_epsg
Creates a value using the first item in the enumeration of vertical_datum_reference
Creates a blank, empty or zero value for water level trend threshold
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
- east_bound_longitude¶
Eastern extent
- Return type
float
- east_bound_longitude_attribute_name = 'eastBoundLongitude'¶
HDF5 naming
- east_bound_longitude_type¶
- epoch¶
- Return type
str
- epoch_attribute_name = 'epoch'¶
- epoch_type¶
- Return type
Type[str]
- extent_type_code¶
The attribute extentTypeCode is a Boolean value. It is used to indicate whether the bounding polygon/box encompasses an area covered by the data or an area where data is not present. In S-102 it is set to 1.
- Return type
bool
- extent_type_code_attribute_name = 'extentTypeCode'¶
HDF5 naming
- extent_type_code_type¶
- feature_information¶
- Return type
- feature_information_attribute_name = 'Group_F'¶
- feature_information_type¶
- geographic_identifier¶
- Return type
str
- geographic_identifier_attribute_name = 'geographicIdentifier'¶
- geographic_identifier_type¶
- Return type
Type[str]
- horizontal_crs¶
- Return type
- horizontal_crs_attribute_name = 'horizontalCRS'¶
- horizontal_crs_type¶
Define S104 datatype
- Return type
Type[int32]
- horizontal_datum_reference¶
- Return type
str
- horizontal_datum_reference_attribute_name = 'horizontalDatumReference'¶
- horizontal_datum_reference_type¶
- Return type
Type[str]
- horizontal_datum_value¶
- Return type
int
- horizontal_datum_value_attribute_name = 'horizontalDatumValue'¶
- horizontal_datum_value_type¶
- Return type
Type[int]
- issue_date¶
- Return type
date
- issue_date_attribute_name = 'issueDate'¶
- issue_date_type¶
- Return type
Type[date]
- issue_time¶
- Return type
time
- issue_time_attribute_name = 'issueTime'¶
- issue_time_type¶
- Return type
Type[time]
- meta_features¶
- Return type
str
- meta_features_attribute_name = 'metaFeatures'¶
- meta_features_type¶
- Return type
Type[str]
- metadata¶
- Return type
str
- metadata_attribute_name = 'metadata'¶
- metadata_type¶
- Return type
Type[str]
- north_bound_latitude¶
Northern extent
- Return type
float
- north_bound_latitude_attribute_name = 'northBoundLatitude'¶
HDF5 naming
- north_bound_latitude_type¶
- product_specification¶
- Return type
str
- product_specification_attribute_name = 'productSpecification'¶
- product_specification_type¶
- Return type
Type[str]
- south_bound_latitude¶
Southern extent
- Return type
float
- south_bound_latitude_attribute_name = 'southBoundLatitude'¶
HDF5 naming
- south_bound_latitude_type¶
- vertical_coordinate_base¶
- Return type
- vertical_coordinate_base_attribute_name = 'verticalCoordinateBase'¶
- vertical_coordinate_base_type¶
Enumeration data type
- Return type
Type[VERTICAL_COORDINATE_BASE]
- vertical_coordinate_system¶
- Return type
- vertical_coordinate_system_attribute_name = 'verticalCS'¶
- vertical_coordinate_system_type¶
Define S104 datatype
- Return type
Type[int32]
- vertical_datum¶
- Return type
Enum
- vertical_datum_attribute_name = 'verticalDatum'¶
- vertical_datum_epsg¶
EPSG code for vertical datum for verticalDatumReference = 2
- Return type
- vertical_datum_epsg_attribute_name = 'verticalDatum'¶
- vertical_datum_epsg_type¶
Define datatype
- Return type
Type[int32]
- vertical_datum_reference¶
- Return type
- vertical_datum_reference_attribute_name = 'verticalDatumReference'¶
- vertical_datum_reference_type¶
Defines enumeration datatype
- Return type
Type[VERTICAL_DATUM_REFERENCE]
- vertical_datum_type¶
- Return type
Type[Enum]
- water_level¶
- Return type
- water_level_attribute_name = 'WaterLevel'¶
- water_level_trend_threshold¶
- Return type
- water_level_trend_threshold_attribute_name = 'waterLevelTrendThreshold'¶
- water_level_trend_threshold_type¶
- Return type
Type[float32]
- water_level_type¶
- west_bound_longitude¶
Western extent
- Return type
float
- west_bound_longitude_attribute_name = 'westBoundLongitude'¶
HDF5 naming
- west_bound_longitude_type¶
Methods Documentation
- add_data(key, value)¶
- east_bound_longitude_create()¶
- epoch_create()¶
Creates a blank, empty or zero value for epoch
- extent_type_code_create()¶
- feature_information_create()¶
- geographic_identifier_create()¶
Creates a blank, empty or zero value for geographic_identifier
- 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.
- horizontal_crs_create()¶
Creates a blank, empty or zero value for horizontal crs
- horizontal_datum_reference_create()¶
Creates a blank, empty or zero value for horizontal_datum_reference
- horizontal_datum_value_create()¶
Creates a blank, empty or zero value for horizontal_datum_value
- 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
- issue_date_create()¶
Creates a blank, empty or zero value for issue_date
- issue_time_create()¶
Creates a blank, empty or zero value for issue_time
- meta_features_create()¶
Creates a blank, empty or zero value for meta_features
- metadata_create()¶
Creates a blank, empty or zero value for metadata
- north_bound_latitude_create()¶
- product_specification_create()¶
Creates a blank, empty or zero value for product_specification
- 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
- 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)¶
- south_bound_latitude_create()¶
- vertical_coordinate_base_create()¶
Creates a value using the first item in the enumeration of vertical_coordinate_base
- vertical_coordinate_system_create()¶
Creates a blank, empty or zero value for vertical coordinate system
- vertical_datum_create()¶
Creates a blank, empty or zero value for vertical_datum
- vertical_datum_epsg_create()¶
Creates a blank, empty or zero value for vertical_datum_epsg
- vertical_datum_reference_create()¶
Creates a value using the first item in the enumeration of vertical_datum_reference
- water_level_create()¶
- water_level_trend_threshold_create()¶
Creates a blank, empty or zero value for water level trend threshold
- west_bound_longitude_create()¶
- 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)¶