Package nz.org.riskscape.netcdf
Class NetCdfRelation
java.lang.Object
nz.org.riskscape.engine.relation.BaseRelation
nz.org.riskscape.netcdf.NetCdfRelation
- All Implemented Interfaces:
AutoCloseable,nz.org.riskscape.engine.data.SelfDescribingScalarData,nz.org.riskscape.engine.pipeline.Realized,nz.org.riskscape.engine.relation.Relation
public class NetCdfRelation
extends nz.org.riskscape.engine.relation.BaseRelation
A relation created from one or more layers in a NetCDF file.
NetCDF files contain variables (similar to layers) that are indexed by one or more dimensions. Typical dimensions are lat, lon and time. Other dimensions are possible as well.
In many cases there will be a variable with the same name as the dimension that it is indexed by. These are actually the values of the dimension. Dimensions that do not have an associated variable the dimension data is the index.
For example given: lat(lat): 20, 30 lon(lon): 50, 60 data(lat, lon, t): 10, 11, 12, 20, 21, 22, 30, 31, 32
Then data(20, 50, 0) = 10, data(30, 50, 1) = 11 etc.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class nz.org.riskscape.engine.relation.BaseRelation
nz.org.riskscape.engine.relation.BaseRelation.Fields, nz.org.riskscape.engine.relation.BaseRelation.Transformer -
Field Summary
Fields inherited from class nz.org.riskscape.engine.relation.BaseRelation
skipOnInvalid, transformers -
Method Summary
Modifier and TypeMethodDescriptionprotected nz.org.riskscape.engine.relation.BaseRelationclone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields) static nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.relation.Relation>Create aRelationfrom the given layers in the NetCDF dataset.protected nz.org.riskscape.engine.relation.TupleIteratorMethods inherited from class nz.org.riskscape.engine.relation.BaseRelation
cloneWithProjectionIfSupported, cloneWithRestrictionIfSupported, cloneWithTransformer, getLimit, getOffset, getProducedType, getRawType, getSpatialMetadata, hasSkipOnInvalid, iterator, limitAndOffset, project, restrict, skipInvalid, skipOrThrow, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nz.org.riskscape.engine.pipeline.Realized
closeMethods inherited from interface nz.org.riskscape.engine.relation.Relation
calculateBounds, getScalarDataType, getType, limit, offset, size, stream, toTupleInput
-
Method Details
-
of
public static nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.relation.Relation> of(ucar.nc2.dataset.NetcdfDataset ncd, List<String> layers) Create a
Relationfrom the given layers in the NetCDF dataset.- Parameters:
ncd- NetCDF datasetlayers- layers (variables) to include in relation- Returns:
- relation or problems encountered
-
rawIterator
protected nz.org.riskscape.engine.relation.TupleIterator rawIterator()- Specified by:
rawIteratorin classnz.org.riskscape.engine.relation.BaseRelation
-
clone
protected nz.org.riskscape.engine.relation.BaseRelation clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields) - Specified by:
clonein classnz.org.riskscape.engine.relation.BaseRelation
-
getSourceInformation
-