org.wdssii.core
Class DataEncoder

java.lang.Object
  extended by org.wdssii.core.DataEncoder
Direct Known Subclasses:
NetcdfDataEncoder, XmlDataEncoder

public abstract class DataEncoder
extends Object

Author:
lakshman

Field Summary
private  boolean compressionEnabled
           
private static org.apache.commons.logging.Log log
           
private  float sparseGridThreshold
           
 
Constructor Summary
protected DataEncoder()
           
 
Method Summary
protected static String getFormattedDate(DataType dt)
           
static String getFormattedDate(Date time)
           
protected abstract  String[] getParams(String relativeFileName)
           
 float getSparseGridThreshold()
           
 boolean isAlwaysSparseGrid()
           
 boolean isCompressionEnabled()
           
 boolean isNeverSparseGrid()
           
protected  void notifyRecord(DataType dt, String outputDir, String[] subtypes, String formattedDate, String relativeFileName)
           
 void setCompressionEnabled(boolean compression)
           
 void setCompressionEnabled(String compression)
           
 void setSparseGridThreshold(String sparseGridThreshold)
           
protected  boolean shouldWriteSparse(float[][] values, float background)
          Computes sparse grid ratio if necessary to decide whether to write sparse
protected abstract  void writeAndNotify(DataTable dt, String outputDir, String[] subtypes)
           
protected abstract  void writeAndNotify(LatLonGrid dt, String outputDir, String[] subtypes)
           
protected abstract  void writeAndNotify(PolarGrid dt, String outputDir, String[] subtypes)
           
static void writeDataAndNotify(DataType dt, String outputDir)
          Uses default subtype for product
static void writeDataAndNotify(DataType dt, String outputDir, String subtype)
           
static void writeDataAndNotify(DataType dt, String outputDir, String[] subtypes)
          The method to use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

sparseGridThreshold

private float sparseGridThreshold

compressionEnabled

private boolean compressionEnabled
Constructor Detail

DataEncoder

protected DataEncoder()
Method Detail

getSparseGridThreshold

public float getSparseGridThreshold()

isAlwaysSparseGrid

public boolean isAlwaysSparseGrid()

isNeverSparseGrid

public boolean isNeverSparseGrid()

setSparseGridThreshold

public void setSparseGridThreshold(String sparseGridThreshold)

isCompressionEnabled

public boolean isCompressionEnabled()

setCompressionEnabled

public void setCompressionEnabled(boolean compression)

setCompressionEnabled

public void setCompressionEnabled(String compression)

writeDataAndNotify

public static void writeDataAndNotify(DataType dt,
                                      String outputDir,
                                      String subtype)

writeDataAndNotify

public static void writeDataAndNotify(DataType dt,
                                      String outputDir)
Uses default subtype for product


writeDataAndNotify

public static void writeDataAndNotify(DataType dt,
                                      String outputDir,
                                      String[] subtypes)
The method to use


shouldWriteSparse

protected boolean shouldWriteSparse(float[][] values,
                                    float background)
Computes sparse grid ratio if necessary to decide whether to write sparse


notifyRecord

protected void notifyRecord(DataType dt,
                            String outputDir,
                            String[] subtypes,
                            String formattedDate,
                            String relativeFileName)
                     throws IOException
Throws:
IOException

getFormattedDate

protected static String getFormattedDate(DataType dt)

getFormattedDate

public static String getFormattedDate(Date time)

getParams

protected abstract String[] getParams(String relativeFileName)

writeAndNotify

protected abstract void writeAndNotify(PolarGrid dt,
                                       String outputDir,
                                       String[] subtypes)

writeAndNotify

protected abstract void writeAndNotify(LatLonGrid dt,
                                       String outputDir,
                                       String[] subtypes)

writeAndNotify

protected abstract void writeAndNotify(DataTable dt,
                                       String outputDir,
                                       String[] subtypes)