Package uk.ac.rdg.resc.edal.dataset
Class HorizontalMesh4dDataset
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.AbstractDataset
-
- uk.ac.rdg.resc.edal.dataset.HorizontallyDiscreteDataset<DS>
-
- uk.ac.rdg.resc.edal.dataset.DiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>
-
- uk.ac.rdg.resc.edal.dataset.HorizontalMesh4dDataset
-
- All Implemented Interfaces:
Serializable,Dataset
- Direct Known Subclasses:
HydromodelVtkUnstructuredDataset
public abstract class HorizontalMesh4dDataset extends DiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata> implements Serializable
Partial implementation of aDatasetwhere the horizontal layers are based on an unstructured mesh, and the vertical / time dimensions are discrete.- Author:
- Guy Griffiths
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class uk.ac.rdg.resc.edal.dataset.HorizontallyDiscreteDataset
HorizontallyDiscreteDataset.PointSeriesLocation, HorizontallyDiscreteDataset.ProfileLocation
-
-
Field Summary
-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.AbstractDataset
id, plugins, vars
-
-
Constructor Summary
Constructors Constructor Description HorizontalMesh4dDataset(String id, Collection<HorizontalMesh4dVariableMetadata> vars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Array2D<Number>extractHorizontalData(HorizontalMesh4dVariableMetadata metadata, int tIndex, int zIndex, HorizontalGrid targetGrid, HZTDataSource dataSource)Extracts data corresponding to aHorizontalGridprotected NumberextractPoint(HorizontalMesh4dVariableMetadata metadata, int t, int z, HorizontalPosition hPos, HZTDataSource dataSource)Extract data at a pointprotected Array1D<Number>extractProfileData(HorizontalMesh4dVariableMetadata metadata, List<Integer> zs, int tIndex, HorizontalPosition hPos, HZTDataSource dataSource)Extracts data corresponding to a vertical profileprotected Array1D<Number>extractTimeseriesData(HorizontalMesh4dVariableMetadata metadata, List<Integer> ts, int zIndex, HorizontalPosition hPos, HZTDataSource dataSource)Extracts data corresponding to a time seriesClass<? extends DiscreteFeature<?,?>>getFeatureType(String variableId)Determines the type of feature returned by theDataset.readFeature(String)method for a particular variable (feature ID)Feature<?>readFeature(String featureId)Reads an entire feature from underlying storage-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.DiscreteLayeredDataset
getMapFeatureType, getVariableMetadata, readUnderlyingHorizontalData, readUnderlyingPointData, readUnderlyingTemporalData, readUnderlyingVerticalData
-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.HorizontallyDiscreteDataset
extractMapFeatures, extractPointCollection, extractProfileFeatures, extractTimeseriesFeatures, extractTrajectoryFeature, getFeatureIds, getTimeIndex, getVerticalIndex, openDataSource, readSinglePoint, supportsProfileFeatureExtraction, supportsTimeseriesExtraction
-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.AbstractDataset
addVariablePlugin, getId, getTopLevelVariables, getVariableIds, isDerivedVariable
-
-
-
-
Constructor Detail
-
HorizontalMesh4dDataset
public HorizontalMesh4dDataset(String id, Collection<HorizontalMesh4dVariableMetadata> vars)
-
-
Method Detail
-
getFeatureType
public Class<? extends DiscreteFeature<?,?>> getFeatureType(String variableId)
Description copied from interface:DatasetDetermines the type of feature returned by theDataset.readFeature(String)method for a particular variable (feature ID)- Specified by:
getFeatureTypein interfaceDataset- Parameters:
variableId- The ID of the variable- Returns:
- The class of the
Features returned when calling theDataset.readFeature(java.lang.String)method for the same variable ID
-
readFeature
public Feature<?> readFeature(String featureId) throws DataReadingException, VariableNotFoundException
Description copied from interface:DatasetReads an entire feature from underlying storage- Specified by:
readFeaturein interfaceDataset- Parameters:
featureId- The ID of the feature to read- Returns:
- The resulting
Feature - Throws:
VariableNotFoundException- If the requested feature is not foundDataReadingException
-
extractHorizontalData
protected Array2D<Number> extractHorizontalData(HorizontalMesh4dVariableMetadata metadata, int tIndex, int zIndex, HorizontalGrid targetGrid, HZTDataSource dataSource) throws DataReadingException
Description copied from class:DiscreteLayeredDatasetExtracts data corresponding to aHorizontalGrid- Specified by:
extractHorizontalDatain classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>- Parameters:
metadata- TheDiscreteLayeredVariableMetadataobject representing the variable to extract data fortIndex- The time index at which to extract datazIndex- The z index at which to extract datatargetGrid- TheHorizontalGridto extract data ontodataSource- TheDataSourceused to extract data- Returns:
- An
Array2Dcontaining data which should map onto the requestedHorizontalGrid - Throws:
DataReadingException- If there is a problem reading the underlying data
-
extractProfileData
protected Array1D<Number> extractProfileData(HorizontalMesh4dVariableMetadata metadata, List<Integer> zs, int tIndex, HorizontalPosition hPos, HZTDataSource dataSource) throws DataReadingException
Description copied from class:DiscreteLayeredDatasetExtracts data corresponding to a vertical profile- Specified by:
extractProfileDatain classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>- Parameters:
metadata- TheDiscreteLayeredVariableMetadataobject representing the variable to extract data forzs- AListof integer z-indices at which to extract datatIndex- The time index at which to extract datahPos- TheHorizontalPositionat which to extract datadataSource- TheDataSourceused to extract data- Returns:
- An
Array1Dcontaining data which should map onto the requested list of indices - Throws:
DataReadingException- If there is a problem reading the underlying data
-
extractTimeseriesData
protected Array1D<Number> extractTimeseriesData(HorizontalMesh4dVariableMetadata metadata, List<Integer> ts, int zIndex, HorizontalPosition hPos, HZTDataSource dataSource) throws DataReadingException
Description copied from class:DiscreteLayeredDatasetExtracts data corresponding to a time series- Specified by:
extractTimeseriesDatain classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>- Parameters:
metadata- TheDiscreteLayeredVariableMetadataobject representing the variable to extract data forts- AListof integer t-indices at which to extract datazIndex- The z-index at which to extract datahPos- TheHorizontalPositionat which to extract datadataSource- TheDataSourceused to extract data- Returns:
- An
Array1Dcontaining data which should map onto the requested list of indices - Throws:
DataReadingException- If there is a problem reading the underlying data
-
extractPoint
protected Number extractPoint(HorizontalMesh4dVariableMetadata metadata, int t, int z, HorizontalPosition hPos, HZTDataSource dataSource) throws DataReadingException
Description copied from class:DiscreteLayeredDatasetExtract data at a point- Specified by:
extractPointin classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>- Parameters:
metadata- TheDiscreteLayeredVariableMetadataobject representing the variable to extract data fort- The t-index at which to extract dataz- The z-index at which to extract datahPos- TheHorizontalPositionat which to extract datadataSource- TheDataSourceused to extract data- Returns:
- The value of the data at the specified point
- Throws:
DataReadingException- If there is a problem reading the underlying data
-
-