FeatureInstanceDCF2¶
- class s100py.s100.FeatureInstanceDCF2(recursively_create_children=False, **kywrds)¶
Bases:
s100py.s100.StartSequence,s100py.s100.GridSpacing,s100py.s100.GridOrigin,s100py.s100.FeatureInstanceBaseData Coding Format 2 is the grid format from table 10c-12 in S100 spec. Used in S102 for example.

Attributes Summary
DateTime.
- rtype
Type[str]
DateTime.
- rtype
Type[str]
Eastern extent
HDF5 naming
The attribute extentTypeCode is a Boolean value.
HDF5 naming
The latitude of the grid origin.
- rtype
Type[float]
Arc Degrees
- rtype
Type[float]
The grid origin in the vertical dimension.
- rtype
Type[float]
Cell size in the Y/latitude dimension.
- rtype
Type[float]
Cell size in the X/longitude dimension.
- rtype
Type[float]
Cell size in the vertical dimension.
- rtype
Type[float]
instance chunking will return a string but accept a string or an iterable of ints which it will format to a string.
- rtype
Type[str]
Northern extent
HDF5 naming
The number of data values groups contained in this instance group
- rtype
Type[int]
Number of grid points in the Y/latitude dimension.
- rtype
Type[int]
Number of grid points in the X/longitude dimension.
- rtype
Type[int]
Number of grid points in the vertical dimension.
- rtype
Type[int]
The total number of time records.
- rtype
Type[int]
Southern extent
HDF5 naming
Grid coordinates of the grid point to which the first in the sequence of values is to be assigned.
- rtype
Type[str]
Seconds.
- rtype
Type[int]
Vertical extent of 3-D grids minimumZ, maximumZ: Minimum and maximum values of the grid’s spatial extent along the vertical direction.
- rtype
Type[float]
Vertical extent of 3-D grids minimumZ, maximumZ: Minimum and maximum values of the grid’s spatial extent along the vertical direction.
- rtype
Type[float]
Western extent
HDF5 naming
Methods Summary
add_data(key, value)Creates a blank, empty or zero value for date_time_of_first_record
Creates a blank, empty or zero value for date_time_of_last_record
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 grid_origin_latitude
Creates a blank, empty or zero value for grid_origin_longitude
Creates a blank, empty or zero value for grid_origin_vertical
Creates a blank, empty or zero value for grid_spacing_latitudinal
Creates a blank, empty or zero value for grid_spacing_longitudinal
Creates a blank, empty or zero value for grid_spacing_vertical
initialize_properties([...])Calls the create function for all the properties of the class.
Creates a blank, empty or zero value for instance_chunking
Creates a blank, empty or zero value for num_grp
Creates a blank, empty or zero value for num_points_latitudinal
Creates a blank, empty or zero value for num_points_longitudinal
Creates a blank, empty or zero value for num_points_vertical
Creates a blank, empty or zero value for number_of_times
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 blank, empty or zero value for start_sequence
Creates a blank, empty or zero value for time_record_interval
Creates a blank, empty or zero value for vertical_extent_maximum_z
Creates a blank, empty or zero value for vertical_extent_minimum_z
write(hdf5_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
- date_time_of_first_record¶
DateTime. Time series data only
- Type
The validity time of the earliest time record. Units
- Return type
str
- date_time_of_first_record_attribute_name = 'dateTimeOfFirstRecord'¶
- date_time_of_first_record_type¶
- Return type
Type[str]
- date_time_of_last_record¶
DateTime. Time series data only
- Type
The validity time of the latest time record. Units
- Return type
str
- date_time_of_last_record_attribute_name = 'dateTimeOfLastRecord'¶
- date_time_of_last_record_type¶
- Return type
Type[str]
- east_bound_longitude¶
Eastern extent
- Return type
float
- east_bound_longitude_attribute_name = 'eastBoundLongitude'¶
HDF5 naming
- east_bound_longitude_type¶
- 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¶
- grid_origin_latitude¶
The latitude of the grid origin. Arc Degrees
- Return type
float
- grid_origin_latitude_attribute_name = 'gridOriginLatitude'¶
- grid_origin_latitude_type¶
- Return type
Type[float]
- grid_origin_longitude¶
Arc Degrees
- Type
The longitude of the grid origin. Unit
- Return type
float
- grid_origin_longitude_attribute_name = 'gridOriginLongitude'¶
- grid_origin_longitude_type¶
- Return type
Type[float]
- grid_origin_vertical¶
The grid origin in the vertical dimension. Only for 3-D grids. Units specified by product specifications
- Return type
float
- grid_origin_vertical_attribute_name = 'gridOriginVertical'¶
- grid_origin_vertical_type¶
- Return type
Type[float]
- grid_spacing_latitudinal¶
Cell size in the Y/latitude dimension. This is the Y/latitudinal component of the offset vector (8-7.1.4). Units: Arc Degrees
- Return type
float
- grid_spacing_latitudinal_attribute_name = 'gridSpacingLatitudinal'¶
- grid_spacing_latitudinal_type¶
- Return type
Type[float]
- grid_spacing_longitudinal¶
Cell size in the X/longitude dimension. This is the X/longitudinal component of the offset vector (8-7.1.4). Units: Arc Degrees
- Return type
float
- grid_spacing_longitudinal_attribute_name = 'gridSpacingLongitudinal'¶
- grid_spacing_longitudinal_type¶
- Return type
Type[float]
- grid_spacing_vertical¶
Cell size in the vertical dimension. Only for 3-D grids. Units specified by product specifications.
- Return type
float
- grid_spacing_vertical_attribute_name = 'gridSpacingVertical'¶
- grid_spacing_vertical_type¶
- Return type
Type[float]
- instance_chunking¶
instance chunking will return a string but accept a string or an iterable of ints which it will format to a string.
From S100:
Chunk size for values dataset. If present, this attribute overrides the setting in Group_F for this feature instance
The format is a comma-separated string of (string representations of) positive integers (except that there is only one number for a 1-dimensional values dataset). The number of integers in the string must correspond to the dimension of the values dataset. For example, “50” for a 1-dimensional array; “150,200” for a 2-dimensional array
Note: (1) The quotes are not part of the representation. (2) The dimension of the values dataset is its array rank, not the number of spatial dimensions for the coverage feature
- Return type
str
- instance_chunking_attribute_name = 'instanceChunking'¶
- instance_chunking_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¶
- num_grp¶
The number of data values groups contained in this instance group
- Return type
int
- num_grp_attribute_name = 'numGRP'¶
- num_grp_type¶
- Return type
Type[int]
- num_points_latitudinal¶
Number of grid points in the Y/latitude dimension. (jMax)
- Return type
int
- num_points_latitudinal_attribute_name = 'numPointsLatitudinal'¶
- num_points_latitudinal_type¶
- Return type
Type[int]
- num_points_longitudinal¶
Number of grid points in the X/longitude dimension. (iMax)
- Return type
int
- num_points_longitudinal_attribute_name = 'numPointsLongitudinal'¶
- num_points_longitudinal_type¶
- Return type
Type[int]
- num_points_vertical¶
Number of grid points in the vertical dimension. (kMax)
- Return type
int
- num_points_vertical_attribute_name = 'numPointsVertical'¶
- num_points_vertical_type¶
- Return type
Type[int]
- number_of_times¶
The total number of time records. Time series data only
- Return type
int
- number_of_times_attribute_name = 'numberOfTimes'¶
- number_of_times_type¶
- Return type
Type[int]
- south_bound_latitude¶
Southern extent
- Return type
float
- south_bound_latitude_attribute_name = 'southBoundLatitude'¶
HDF5 naming
- south_bound_latitude_type¶
- start_sequence¶
Grid coordinates of the grid point to which the first in the sequence of values is to be assigned. The choice of a valid point for the start sequence is determined by the sequencing rule. Format: n, n… (comma-separated list of grid points, one per dimension – For example, 0,0)
- Return type
str
- start_sequence_attribute_name = 'startSequence'¶
- start_sequence_type¶
- Return type
Type[str]
- time_record_interval¶
Seconds. Time series data only
- Type
The interval between time records. Units
- Return type
int
- time_record_interval_attribute_name = 'timeRecordInterval'¶
- time_record_interval_type¶
- Return type
Type[int]
- vertical_extent_maximum_z¶
Vertical extent of 3-D grids minimumZ, maximumZ: Minimum and maximum values of the grid’s spatial extent along the vertical direction. They are encoded as separate attributes
- Return type
float
- vertical_extent_maximum_z_attribute_name = 'verticalExtent.maximumZ'¶
- vertical_extent_maximum_z_type¶
- Return type
Type[float]
- vertical_extent_minimum_z¶
Vertical extent of 3-D grids minimumZ, maximumZ: Minimum and maximum values of the grid’s spatial extent along the vertical direction. They are encoded as separate attributes
- Return type
float
- vertical_extent_minimum_z_attribute_name = 'verticalExtent.minimumZ'¶
- vertical_extent_minimum_z_type¶
- Return type
Type[float]
- 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)¶
- date_time_of_first_record_create()¶
Creates a blank, empty or zero value for date_time_of_first_record
- date_time_of_last_record_create()¶
Creates a blank, empty or zero value for date_time_of_last_record
- east_bound_longitude_create()¶
- extent_type_code_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.
- grid_origin_latitude_create()¶
Creates a blank, empty or zero value for grid_origin_latitude
- grid_origin_longitude_create()¶
Creates a blank, empty or zero value for grid_origin_longitude
- grid_origin_vertical_create()¶
Creates a blank, empty or zero value for grid_origin_vertical
- grid_spacing_latitudinal_create()¶
Creates a blank, empty or zero value for grid_spacing_latitudinal
- grid_spacing_longitudinal_create()¶
Creates a blank, empty or zero value for grid_spacing_longitudinal
- grid_spacing_vertical_create()¶
Creates a blank, empty or zero value for grid_spacing_vertical
- 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
- instance_chunking_create()¶
Creates a blank, empty or zero value for instance_chunking
- north_bound_latitude_create()¶
- num_grp_create()¶
Creates a blank, empty or zero value for num_grp
- num_points_latitudinal_create()¶
Creates a blank, empty or zero value for num_points_latitudinal
- num_points_longitudinal_create()¶
Creates a blank, empty or zero value for num_points_longitudinal
- num_points_vertical_create()¶
Creates a blank, empty or zero value for num_points_vertical
- number_of_times_create()¶
Creates a blank, empty or zero value for number_of_times
- 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()¶
- start_sequence_create()¶
Creates a blank, empty or zero value for start_sequence
- time_record_interval_create()¶
Creates a blank, empty or zero value for time_record_interval
- vertical_extent_maximum_z_create()¶
Creates a blank, empty or zero value for vertical_extent_maximum_z
- vertical_extent_minimum_z_create()¶
Creates a blank, empty or zero value for vertical_extent_minimum_z
- west_bound_longitude_create()¶
- write(hdf5_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)¶