net.sourceforge.jgrib.cube
Class GribCube5D

Object
  extended by GribCube5D

public final class GribCube5D
extends Object

This class implements the so-called 5D hypercube as we can read from a dataset of grib file version 1. A 5D hypercube is used to represent with a single object what could come from a set of grib files. It ims a t representing the variation of multiple observable phenomenons over a certain grographic bounding box, at different height/depth levels, over a certain number of time dwells. It can be represented as a function from R^4 (x,y,z,t) to R^N where N is the number of sampled phenomenons. As an instance we can think about a forecast for temperature, pressure and humidity over a rectangular area, which comes with 20 different z-levels from 0 metres to 1 km of height, and with 20 different taus where the period is 6 hours starting at some mm/gg/yyyy. This is exactly an GribCube5D. In this implementation a GribCube5D is made up by a certain number of GribCube4D where the distinction between different 4D hyercubes is done over the parameter name, i.e. temperature rather than pressure

Author:
Simone Giannecchini
See Also:
.

Constructor Summary
GribCube5D()
          Default constructor.
 
Method Summary
 boolean add(GribRecord record)
          Adding 5D GribRecord to this 5D hypercube.
 GribCube4D get4DCube(String parameterName)
          Returns a 4D cube whose parameter name is the one provided.
 int getCube4DCount()
          Number fo 4D cubes in this 5D cube.
 Collection getCubes4D()
          Retrieves all the 4D cubes held in this 5D cubes
 Set getParametersNames()
          Purpose of this method is giving the user the possibility to access all the keys of the GribCube4D this 5D cube holds.
 boolean isCompatible(GribRecord record)
          Checking the compatibility between the provided record and this 5D hypercube.
 String toString()
          Debugging method it retrieves a textual description for this 5D hypercube.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GribCube5D

public GribCube5D()
Default constructor.

Method Detail

get4DCube

public GribCube4D get4DCube(String parameterName)
Returns a 4D cube whose parameter name is the one provided. In case no such a parameter exists in this cube we return null.

Parameters:
parameterName - The paramter name to look for.
Returns:
The cube4D for this parameter or null.

add

public boolean add(GribRecord record)
Adding 5D GribRecord to this 5D hypercube. The record can be added only if it is compatible. In case it is, if a 4D hypercube able to contain it is found, the record is added there, otherwise a new 4D hypercube is created on purpose for this record.

Parameters:
record - Record to add to this hypercube.
Returns:
True if the record is added, false otherwise.
See Also:
GribCube5D#isCompatible(final GribRecord record).

isCompatible

public boolean isCompatible(GribRecord record)
Checking the compatibility between the provided record and this 5D hypercube. The record is said to be compatible when it is located in a compatible 4D hypercube which means same geographical area, same basetime, same type of level.

Parameters:
record - The record to check for compatibility.
Returns:
True if compatible, false otherwise.
See Also:
GribCube4D.isWeakCompatible(GribRecord).

getParametersNames

public Set getParametersNames()
Purpose of this method is giving the user the possibility to access all the keys of the GribCube4D this 5D cube holds. Keys are parameters names.

Returns:
Set containing all the parameters names.

getCubes4D

public Collection getCubes4D()
Retrieves all the 4D cubes held in this 5D cubes

Returns:
The collection of 4D cubes.

getCube4DCount

public int getCube4DCount()
Number fo 4D cubes in this 5D cube.

Returns:
int Number fo 4D cubes in this 5D cube.

toString

public String toString()
Debugging method it retrieves a textual description for this 5D hypercube.

Overrides:
toString in class Object


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.