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 aDataset
where 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 aHorizontalGrid
protected Number
extractPoint(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:Dataset
Determines the type of feature returned by theDataset.readFeature(String)
method for a particular variable (feature ID)- Specified by:
getFeatureType
in interfaceDataset
- Parameters:
variableId
- The ID of the variable- Returns:
- The class of the
Feature
s 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:Dataset
Reads an entire feature from underlying storage- Specified by:
readFeature
in 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:DiscreteLayeredDataset
Extracts data corresponding to aHorizontalGrid
- Specified by:
extractHorizontalData
in classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>
- Parameters:
metadata
- TheDiscreteLayeredVariableMetadata
object representing the variable to extract data fortIndex
- The time index at which to extract datazIndex
- The z index at which to extract datatargetGrid
- TheHorizontalGrid
to extract data ontodataSource
- TheDataSource
used to extract data- Returns:
- An
Array2D
containing 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:DiscreteLayeredDataset
Extracts data corresponding to a vertical profile- Specified by:
extractProfileData
in classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>
- Parameters:
metadata
- TheDiscreteLayeredVariableMetadata
object representing the variable to extract data forzs
- AList
of integer z-indices at which to extract datatIndex
- The time index at which to extract datahPos
- TheHorizontalPosition
at which to extract datadataSource
- TheDataSource
used to extract data- Returns:
- An
Array1D
containing 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:DiscreteLayeredDataset
Extracts data corresponding to a time series- Specified by:
extractTimeseriesData
in classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>
- Parameters:
metadata
- TheDiscreteLayeredVariableMetadata
object representing the variable to extract data forts
- AList
of integer t-indices at which to extract datazIndex
- The z-index at which to extract datahPos
- TheHorizontalPosition
at which to extract datadataSource
- TheDataSource
used to extract data- Returns:
- An
Array1D
containing 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:DiscreteLayeredDataset
Extract data at a point- Specified by:
extractPoint
in classDiscreteLayeredDataset<HZTDataSource,HorizontalMesh4dVariableMetadata>
- Parameters:
metadata
- TheDiscreteLayeredVariableMetadata
object representing the variable to extract data fort
- The t-index at which to extract dataz
- The z-index at which to extract datahPos
- TheHorizontalPosition
at which to extract datadataSource
- TheDataSource
used to extract data- Returns:
- The value of the data at the specified point
- Throws:
DataReadingException
- If there is a problem reading the underlying data
-
-