org.iges.grads.server
Class GradsGridExtracter

java.lang.Object
  |
  +--org.iges.anagram.AbstractModule
        |
        +--org.iges.grads.server.GradsExtracter
              |
              +--org.iges.grads.server.GradsGridExtracter
All Implemented Interfaces:
Module

public class GradsGridExtracter
extends GradsExtracter

Extracts and caches metadata for a gridded GrADS dataset.


Field Summary
protected static java.text.DecimalFormat doubleFormat
           
protected static double[] timeIntervalFreq
           
protected static java.lang.String[] timeIntervalNames
           
 
Fields inherited from class org.iges.grads.server.GradsExtracter
data, gradsInfo, metadata, storagePrefix, tasker
 
Fields inherited from class org.iges.anagram.AbstractModule
log, moduleName, parent, server
 
Constructor Summary
GradsGridExtracter()
           
 
Method Summary
protected  java.lang.String calcSpaceRes(java.lang.String dim, java.lang.String units)
          Helper for writeWebInfo()
protected  java.lang.String calcTimeRes()
          Helper for writeWebInfo()
protected  double convertGradsDateToCOARDS(java.lang.String dateString)
          Converts a GrADS date, a string with format yyyy:M:d:H or yyyy:M:d:H:m, to a udunits-compatible COARDS date, which is a floating point number in units of days since Jan 01, 0001.
protected  void load()
          Reads CTL file for dataset into internal structures
protected  double[] loadDimValues(java.lang.String dim, int size)
          Invokes GrADS to print a complete list of values for a given dimension, then parses the values into an array
protected  void printDim(java.io.PrintWriter info, java.lang.String dim, java.lang.String longName, java.lang.String units, java.lang.String resUnits, int size)
          Helper for writeWebInfo()
protected  void saveDimsForDirectSubset()
          Creates an in-memory object for use by the direct-subsetting feature, which reads directly from IEEE binary datafiles instead of invoking GrADS.
 void writeDAS()
          Takes the parsed metadata and writes a DAS file.
 void writeDDS()
          Takes the parsed metadata and writes a DAS
protected  void writeDim(java.lang.String dim)
          Writes an array of coordinate data to a temporary storage file for use by the subsetting modules
protected  void writeSubsetInfo()
          Caches any precalculated values for subsetting
 void writeWebSummary()
          Takes the parsed metadata and writes a ".info" page
 
Methods inherited from class org.iges.grads.server.GradsExtracter
configure, getHistoryString, getModuleID, loadMetadata, parse, printDODSAttributes
 
Methods inherited from class org.iges.anagram.AbstractModule
configModule, debug, debug, error, fail, fail, fail, getModuleName, info, init, toString, verbose, verbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timeIntervalNames

protected static final java.lang.String[] timeIntervalNames

timeIntervalFreq

protected static final double[] timeIntervalFreq

doubleFormat

protected static final java.text.DecimalFormat doubleFormat
Constructor Detail

GradsGridExtracter

public GradsGridExtracter()
Method Detail

writeSubsetInfo

protected void writeSubsetInfo()
                        throws AnagramException
Description copied from class: GradsExtracter
Caches any precalculated values for subsetting

Specified by:
writeSubsetInfo in class GradsExtracter
AnagramException

load

protected void load()
             throws AnagramException
Description copied from class: GradsExtracter
Reads CTL file for dataset into internal structures

Specified by:
load in class GradsExtracter
AnagramException

loadDimValues

protected double[] loadDimValues(java.lang.String dim,
                                 int size)
                          throws AnagramException
Invokes GrADS to print a complete list of values for a given dimension, then parses the values into an array

Parameters:
dim - one of "lat, "lon", "lev", "time"
AnagramException

writeDim

protected void writeDim(java.lang.String dim)
                 throws AnagramException
Writes an array of coordinate data to a temporary storage file for use by the subsetting modules

Parameters:
dim - one of "lat, "lon", "lev", "time"
AnagramException

saveDimsForDirectSubset

protected void saveDimsForDirectSubset()
Creates an in-memory object for use by the direct-subsetting feature, which reads directly from IEEE binary datafiles instead of invoking GrADS. To make this possible it is necessary to save the dimension sizes, and an ordered list of variable names with the number of vertical levels for each variable, so that byte offsets can be calculated properly.


writeDAS

public void writeDAS()
              throws AnagramException
Description copied from class: GradsExtracter
Takes the parsed metadata and writes a DAS file.

Specified by:
writeDAS in class GradsExtracter
AnagramException

writeDDS

public void writeDDS()
              throws AnagramException
Description copied from class: GradsExtracter
Takes the parsed metadata and writes a DAS

Specified by:
writeDDS in class GradsExtracter
AnagramException

writeWebSummary

public void writeWebSummary()
                     throws AnagramException
Description copied from class: GradsExtracter
Takes the parsed metadata and writes a ".info" page

Specified by:
writeWebSummary in class GradsExtracter
AnagramException

printDim

protected void printDim(java.io.PrintWriter info,
                        java.lang.String dim,
                        java.lang.String longName,
                        java.lang.String units,
                        java.lang.String resUnits,
                        int size)
Helper for writeWebInfo()


calcSpaceRes

protected java.lang.String calcSpaceRes(java.lang.String dim,
                                        java.lang.String units)
Helper for writeWebInfo()


calcTimeRes

protected java.lang.String calcTimeRes()
Helper for writeWebInfo()


convertGradsDateToCOARDS

protected double convertGradsDateToCOARDS(java.lang.String dateString)
Converts a GrADS date, a string with format yyyy:M:d:H or yyyy:M:d:H:m, to a udunits-compatible COARDS date, which is a floating point number in units of days since Jan 01, 0001.