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 Classes
    Modifier and Type
    Class
    Description
    static interface 
     

    Nested 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 Type
    Method
    Description
    protected nz.org.riskscape.engine.relation.BaseRelation
    clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields)
     
     
    static nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.relation.Relation>
    of(ucar.nc2.dataset.NetcdfDataset ncd, List<String> layers)
    Create a Relation from the given layers in the NetCDF dataset.
    protected nz.org.riskscape.engine.relation.TupleIterator
     

    Methods inherited from class nz.org.riskscape.engine.relation.BaseRelation

    cloneWithProjectionIfSupported, cloneWithRestrictionIfSupported, cloneWithTransformer, getLimit, getOffset, getRawType, getSpatialMetadata, getType, hasSkipOnInvalid, iterator, limitAndOffset, project, restrict, skipInvalid, skipOrThrow, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.pipeline.Realized

    close

    Methods inherited from interface nz.org.riskscape.engine.relation.Relation

    calculateBounds, getScalarDataType, limit, offset, size, stream
  • 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 Relation from the given layers in the NetCDF dataset.

      Parameters:
      ncd - NetCDF dataset
      layers - layers (variables) to include in relation
      Returns:
      relation or problems encountered
    • rawIterator

      protected nz.org.riskscape.engine.relation.TupleIterator rawIterator()
      Specified by:
      rawIterator in class nz.org.riskscape.engine.relation.BaseRelation
    • clone

      protected nz.org.riskscape.engine.relation.BaseRelation clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields)
      Specified by:
      clone in class nz.org.riskscape.engine.relation.BaseRelation
    • getSourceInformation

      public String getSourceInformation()