|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.nc2.dt.fmrc.ForecastModelRunInventory
public class ForecastModelRunInventory
This reads and writes XML files to summarize the inventory for a single ForecastModelRun. The underlying dataset is a GridDataset.
Tracks unique TimeCoords (aka "valid times" aka "forecast times" aka "offset hours"), and tracks the list of variables (aka grids) that use that TimeCoord. Tracks unique VertCoords; grids have a reference to one if they are 3D.
Data Structures
List VertCoord
double[] values
List TimeCoord
double[] offsetHour
List Grid
VertCoord (optional)
List Misssing
| Nested Class Summary | |
|---|---|
static class |
ForecastModelRunInventory.Grid
A Grid variable has a name, timeCoord and optionally a Vertical Coordinate, and list of Missing. |
static class |
ForecastModelRunInventory.Missing
|
static class |
ForecastModelRunInventory.TimeCoord
Represents a list of valid times. |
static class |
ForecastModelRunInventory.VertCoord
Represents a vertical coordinate. |
| Field Summary | |
|---|---|
static int |
OPEN_FORCE_NEW
|
static int |
OPEN_NORMAL
|
static int |
OPEN_XML_ONLY
|
| Method Summary | |
|---|---|
void |
close()
|
ForecastModelRunInventory.Grid |
findGrid(java.lang.String name)
|
LatLonRect |
getBB()
|
java.lang.String |
getName()
|
static double |
getOffsetInHours(java.util.Date origin,
java.util.Date date)
|
java.util.Date |
getRunDate()
Get the date of the ForecastModelRun |
java.lang.String |
getRunDateString()
Get string representation of the date of the ForecastModelRun |
java.util.List<ForecastModelRunInventory.TimeCoord> |
getTimeCoords()
Get a list of unique TimeCoords, which contain the list of variables that all use that TimeCoord. |
java.util.List<ForecastModelRunInventory.VertCoord> |
getVertCoords()
Get a list of unique VertCoords. |
static void |
main(java.lang.String[] args)
|
static void |
main2(java.lang.String[] args)
|
static ForecastModelRunInventory |
open(DiskCache2 cache,
java.lang.String ncfileLocation,
int mode,
boolean isFile)
Open a GridDataset and construct a ForecastModelRun. |
static ForecastModelRunInventory |
open(GridDataset gds,
java.util.Date runDate)
|
static ForecastModelRunInventory |
readXML(java.lang.String xmlLocation)
Construct a ForecastModelRun from its XML representation |
void |
releaseDataset()
Release and close the dataset, and allow CG. |
void |
setName(java.lang.String name)
|
org.jdom.Document |
writeDocument()
Create the XML representation |
java.lang.String |
writeXML()
Write the XML representation to a String. |
void |
writeXML(java.io.OutputStream out)
Write the XML representaion to an OutputStream. |
void |
writeXML(java.lang.String filename)
Write the XML representation to a local file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OPEN_NORMAL
public static final int OPEN_FORCE_NEW
public static final int OPEN_XML_ONLY
| Method Detail |
|---|
public void close()
throws java.io.IOException
java.io.IOExceptionpublic void setName(java.lang.String name)
public java.lang.String getName()
public java.util.Date getRunDate()
public java.lang.String getRunDateString()
public java.util.List<ForecastModelRunInventory.TimeCoord> getTimeCoords()
public java.util.List<ForecastModelRunInventory.VertCoord> getVertCoords()
public LatLonRect getBB()
public void releaseDataset()
throws java.io.IOException
java.io.IOException - on io errorpublic ForecastModelRunInventory.Grid findGrid(java.lang.String name)
public static double getOffsetInHours(java.util.Date origin,
java.util.Date date)
public void writeXML(java.lang.String filename)
throws java.io.IOException
filename - wite to this local file
java.io.IOException - on io error
public void writeXML(java.io.OutputStream out)
throws java.io.IOException
out - write to this OutputStream
java.io.IOException - on io errorpublic java.lang.String writeXML()
public org.jdom.Document writeDocument()
public static ForecastModelRunInventory readXML(java.lang.String xmlLocation)
throws java.io.IOException
xmlLocation - location of xml - assumed to be a local file.
java.io.IOException - on io error
public static ForecastModelRunInventory open(DiskCache2 cache,
java.lang.String ncfileLocation,
int mode,
boolean isFile)
throws java.io.IOException
cache - use this cache (may be null)ncfileLocation - location of the grid dataset.mode - one of OPEN_NORMAL, OPEN_FORCE_NEW, OPEN_XML_ONLY constantsisFile - if its a file: new File( ncfileLocation) makes sense, so we can check if its changed
java.io.IOException - on io error
public static ForecastModelRunInventory open(GridDataset gds,
java.util.Date runDate)
public static void main2(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||