Package uk.ac.rdg.resc.edal.dataset
Interface Dataset
-
- All Known Implementing Classes:
AbstractContinuousDomainDataset
,AbstractDataset
,DiscreteLayeredDataset
,FakeTrajectoryDatasetFactory.FakeTrajectoryDataset
,GriddedDataset
,HorizontallyDiscreteDataset
,HorizontalMesh4dDataset
,HydromodelVtkGridDataset
,HydromodelVtkUnstructuredDataset
,PointDataset
,TrajectoryDataset
public interface Dataset
Provides access to data and metadata held in underlying storage, e.g. on disk, in a database or on a remote server.- Author:
- Guy Griffiths, Jon Blower
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addVariablePlugin(VariablePlugin plugin)
Adds aVariablePlugin
to this dataset to generate derived variables from existing ones in theDataset
List<? extends ProfileFeature>
extractProfileFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, org.joda.time.DateTime targetTime)
ExtractsProfileFeature
(s) from theDataset
List<? extends PointSeriesFeature>
extractTimeseriesFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, Double targetZ)
ExtractsPointSeriesFeature
(s) from theDataset
Set<String>
getFeatureIds()
Class<? extends DiscreteFeature<?,?>>
getFeatureType(String variableId)
Determines the type of feature returned by thereadFeature(String)
method for a particular variable (feature ID)String
getId()
Class<? extends DiscreteFeature<?,?>>
getMapFeatureType(String variableId)
Determines the type of feature returned by the extractMapFeatures() methods (defined in subclasses) for a particular variableSet<VariableMetadata>
getTopLevelVariables()
Set<String>
getVariableIds()
VariableMetadata
getVariableMetadata(String variableId)
Returns theVariableMetadata
associated with a particular variable IDFeature<?>
readFeature(String featureId)
Reads an entire feature from underlying storageboolean
supportsProfileFeatureExtraction(String varId)
boolean
supportsTimeseriesExtraction(String varId)
-
-
-
Method Detail
-
getId
String getId()
- Returns:
- The ID which identifies this dataset.
-
getFeatureIds
Set<String> getFeatureIds()
- Returns:
- the IDs of features which are present in this Dataset
-
getFeatureType
Class<? extends DiscreteFeature<?,?>> getFeatureType(String variableId)
Determines the type of feature returned by thereadFeature(String)
method for a particular variable (feature ID)- Parameters:
variableId
- The ID of the variable- Returns:
- The class of the
Feature
s returned when calling thereadFeature(java.lang.String)
method for the same variable ID
-
readFeature
Feature<?> readFeature(String featureId) throws DataReadingException, VariableNotFoundException
Reads an entire feature from underlying storage- Parameters:
featureId
- The ID of the feature to read- Returns:
- The resulting
Feature
- Throws:
VariableNotFoundException
- If the requested feature is not foundDataReadingException
-
getVariableIds
Set<String> getVariableIds()
- Returns:
- the IDs of variables in this
Dataset
. Generally the term "variable" refers to a measured physical quantity
-
getVariableMetadata
VariableMetadata getVariableMetadata(String variableId) throws VariableNotFoundException
Returns theVariableMetadata
associated with a particular variable ID- Parameters:
variableId
- The variable ID to search for- Returns:
- The desired
VariableMetadata
- Throws:
VariableNotFoundException
- If the requested variable is not available
-
getTopLevelVariables
Set<VariableMetadata> getTopLevelVariables()
- Returns:
- the variables at the top level of the hierarchy.
-
addVariablePlugin
void addVariablePlugin(VariablePlugin plugin) throws EdalException
Adds aVariablePlugin
to this dataset to generate derived variables from existing ones in theDataset
- Parameters:
plugin
- TheVariablePlugin
to add- Throws:
EdalException
- If there is a problem adding the plugin
-
getMapFeatureType
Class<? extends DiscreteFeature<?,?>> getMapFeatureType(String variableId)
Determines the type of feature returned by the extractMapFeatures() methods (defined in subclasses) for a particular variable- Parameters:
variableId
- The ID of the variable- Returns:
- The class of the
Feature
s returned when calling the extractMapFeatures method for the given variable ID
-
extractProfileFeatures
List<? extends ProfileFeature> extractProfileFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, org.joda.time.DateTime targetTime) throws DataReadingException, UnsupportedOperationException, VariableNotFoundException
ExtractsProfileFeature
(s) from theDataset
- Parameters:
varIds
- The variable IDs to extract. If this isnull
then all variable IDs will be plotted. Any non-scalar parent variables will have all of their child variables extracted.bbox
-- If this
BoundingBox
is non-null
, all measurements falling within it will be returned. - If it is
null
, only measurements which match the horizontal position given bytargetPos
will be extracted. - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point.
- If this
zExtent
-- If this is non-
null
, allProfileFeature
s whose domains have any intersection with this vertical extent will be extracted. The domains of the extractedProfileFeature
s will be the entire available domains, not just the intersection. - If this is
null
, no constraint will be placed on the vertical domain of theProfileFeature
s to extract.
- If this is non-
tExtent
-- If this is non-
null
, all measurements which fall entirely within its extent will be extracted - If it is
null
only profiles matching the time specified bytargetT
will be extracted. - If
tExtent
andtargetT
are bothnull
,ProfileFeature
s for all available time values will be extracted.
- If this is non-
targetPos
-- If the
bbox
argument isnull
, only measurements which match this horizontal position will be extracted. In the case of a gridded feature, this will be the profile of the grid cell which the position falls into, but for a dataset with a continuousHorizontalDomain
only exact matches will be extracted - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point. - If this is non-
null
, the resultingCollection
will be sorted according to distance (in co-ordinate units) from the target position
- If the
targetTime
-- If
tExtent
isnull
only profiles matching the time specified by this parameter will be extracted. In the case of a gridded dataset a time is considered to match if the methodTimeAxis#contains(DateTime)
on its time axis returnstrue
for the target time. For a non-gridded dataset, the feature time must exactly match the target time. - If
tExtent
andtargetT
are bothnull
,ProfileFeature
s for all available time values will be extracted.
- If
- Returns:
- A
Collection
ofProfileFeature
s, sorted by their distance from the target horizontal position, if it exists. - Throws:
DataReadingException
- if there is a problem reading the underlying dataUnsupportedOperationException
- if not all of the requested variables have a vertical domainVariableNotFoundException
- if one or more of the specified variables are not present in this dataset
-
supportsProfileFeatureExtraction
boolean supportsProfileFeatureExtraction(String varId)
- Parameters:
varId
- The ID of the variable to extract- Returns:
true
if this dataset supports the extraction of the given variable toProfileFeature
s via theextractProfileFeatures(Set, BoundingBox, Extent, Extent, HorizontalPosition, DateTime)
method
-
extractTimeseriesFeatures
List<? extends PointSeriesFeature> extractTimeseriesFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, Double targetZ) throws DataReadingException, UnsupportedOperationException, VariableNotFoundException
ExtractsPointSeriesFeature
(s) from theDataset
- Parameters:
varIds
- The variable IDs to extract. If this isnull
then all variable IDs will be plotted. Any non-scalar parent variables will have all of their child variables extracted.bbox
-- If this
BoundingBox
is non-null
, all measurements falling within it will be returned. - If it is
null
, only measurements which match the horizontal position given bytargetPos
will be extracted. - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point.
- If this
zExtent
-- If this is non-
null
, all measurements which fall entirely within its extent will be extracted - If it is
null
only timeseries matching the depth specified bytargetZ
will be extracted. - If
zExtent
andtargetZ
are bothnull
,PointSeriesFeature
s for all available depth values will be extracted.
- If this is non-
tExtent
-- If this is non-
null
, allPointSeriesFeature
s whose domains have any intersection with this time extent will be extracted. The domains of the extractedPointSeriesFeature
s will be the entire available domains, not just the intersection. - If this is
null
, no constraint will be placed on the time domain of thePointSeriesFeature
s to extract.
- If this is non-
targetPos
-- If the
bbox
argument isnull
, only measurements which match this horizontal position will be extracted. In the case of a gridded feature, this will be the profile of the grid cell which the position falls into, but for a dataset with a continuousHorizontalDomain
only exact matches will be extracted - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point. - If this is non-
null
, the resultingCollection
will be sorted according to distance (in co-ordinate units) from the target position
- If the
targetZ
-- If
zExtent
isnull
only timeseries matching the depth specified by this parameter will be extracted. In the case of a gridded dataset a depth is considered to match if the methodVerticalAxis#contains(Double)
on its vertical axis returnstrue
for the target depth. For a non-gridded dataset, the feature depth must exactly match the target depth. - If
zExtent
andtargetZ
are bothnull
,PointSeriesFeature
s for all available time values will be extracted.
- If
- Returns:
- A
Collection
ofPointSeriesFeature
s, sorted by their distance from the target horizontal position, if it exists. - Throws:
DataReadingException
- if there is a problem reading the underlying dataUnsupportedOperationException
- if not all of the requested variables have a time domainVariableNotFoundException
- if one or more of the specified variables are not present in this dataset
-
supportsTimeseriesExtraction
boolean supportsTimeseriesExtraction(String varId)
- Parameters:
varId
- The ID of the variable to extract- Returns:
true
if this dataset supports the extraction of the given variable toPointSeriesFeature
s via theextractTimeseriesFeatures(Set, BoundingBox, Extent, Extent, HorizontalPosition, Double)
method
-
-