edu.wisc.ssec.mcidasv.data.hydra
Class NetCDFFile

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.data.hydra.NetCDFFile
All Implemented Interfaces:
MultiDimensionReader

public class NetCDFFile
extends Object
implements MultiDimensionReader


Field Summary
(package private)  ucar.nc2.NetcdfFile ncfile
           
(package private)  HashMap<String,Class> varDataType
           
(package private)  HashMap<String,int[]> varDimLengths
           
(package private)  HashMap<String,String[]> varDimNames
           
(package private)  HashMap<String,ucar.nc2.Variable> varMap
           
(package private)  HashMap<String,String> varUnits
           
 
Constructor Summary
NetCDFFile(InputStream is)
           
NetCDFFile(String filename)
           
NetCDFFile(String filename, org.jdom2.Element root)
           
 
Method Summary
(package private)  void analyzeStructure(ucar.nc2.Structure var)
           
 void close()
           
 Object getArray(String array_name, int[] start, int[] count, int[] stride)
           
 HDFArray getArrayAttribute(String array_name, String attr_name)
           
 Class getArrayType(String array_name)
           
 String getArrayUnitString(String array_name)
           
 byte[] getByteArray(String array_name, int[] start, int[] count, int[] stride)
           
 int getDimensionLength(String dimName)
           
 int[] getDimensionLengths(String array_name)
           
 String[] getDimensionNames(String array_name)
           
 double[] getDoubleArray(String array_name, int[] start, int[] count, int[] stride)
           
 float[] getFloatArray(String array_name, int[] start, int[] count, int[] stride)
           
 HDFArray getGlobalAttribute(String attr_name)
           
 int[] getIntArray(String array_name, int[] start, int[] count, int[] stride)
           
 ucar.nc2.NetcdfFile getNetCDFFile()
           
 short[] getShortArray(String array_name, int[] start, int[] count, int[] stride)
           
 HashMap getVarMap()
           
 boolean hasArray(String name)
           
 boolean hasDimension(String name)
           
private  void init()
           
static void main(String[] args)
           
static NetCDFFile makeUnion(String filename, String other)
           
protected  Object readArray(String array_name, int[] start, int[] count, int[] stride)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

varMap

HashMap<String,ucar.nc2.Variable> varMap

varDimNames

HashMap<String,String[]> varDimNames

varDimLengths

HashMap<String,int[]> varDimLengths

varDataType

HashMap<String,Class> varDataType

varUnits

HashMap<String,String> varUnits

ncfile

ucar.nc2.NetcdfFile ncfile
Constructor Detail

NetCDFFile

public NetCDFFile(InputStream is)
           throws Exception
Throws:
Exception

NetCDFFile

public NetCDFFile(String filename)
           throws Exception
Throws:
Exception

NetCDFFile

public NetCDFFile(String filename,
                  org.jdom2.Element root)
           throws Exception
Throws:
Exception
Method Detail

makeUnion

public static NetCDFFile makeUnion(String filename,
                                   String other)
                            throws Exception
Throws:
Exception

init

private void init()
           throws Exception
Throws:
Exception

analyzeStructure

void analyzeStructure(ucar.nc2.Structure var)
                throws Exception
Throws:
Exception

getArrayType

public Class getArrayType(String array_name)
Specified by:
getArrayType in interface MultiDimensionReader

getDimensionNames

public String[] getDimensionNames(String array_name)
Specified by:
getDimensionNames in interface MultiDimensionReader

getDimensionLengths

public int[] getDimensionLengths(String array_name)
Specified by:
getDimensionLengths in interface MultiDimensionReader

getArrayUnitString

public String getArrayUnitString(String array_name)

getDimensionLength

public int getDimensionLength(String dimName)

getFloatArray

public float[] getFloatArray(String array_name,
                             int[] start,
                             int[] count,
                             int[] stride)
                      throws Exception
Specified by:
getFloatArray in interface MultiDimensionReader
Throws:
Exception

getIntArray

public int[] getIntArray(String array_name,
                         int[] start,
                         int[] count,
                         int[] stride)
                  throws Exception
Specified by:
getIntArray in interface MultiDimensionReader
Throws:
Exception

getDoubleArray

public double[] getDoubleArray(String array_name,
                               int[] start,
                               int[] count,
                               int[] stride)
                        throws Exception
Specified by:
getDoubleArray in interface MultiDimensionReader
Throws:
Exception

getShortArray

public short[] getShortArray(String array_name,
                             int[] start,
                             int[] count,
                             int[] stride)
                      throws Exception
Specified by:
getShortArray in interface MultiDimensionReader
Throws:
Exception

getByteArray

public byte[] getByteArray(String array_name,
                           int[] start,
                           int[] count,
                           int[] stride)
                    throws Exception
Specified by:
getByteArray in interface MultiDimensionReader
Throws:
Exception

getArray

public Object getArray(String array_name,
                       int[] start,
                       int[] count,
                       int[] stride)
                throws Exception
Specified by:
getArray in interface MultiDimensionReader
Throws:
Exception

readArray

protected Object readArray(String array_name,
                           int[] start,
                           int[] count,
                           int[] stride)
                    throws Exception
Throws:
Exception

getGlobalAttribute

public HDFArray getGlobalAttribute(String attr_name)
                            throws Exception
Specified by:
getGlobalAttribute in interface MultiDimensionReader
Throws:
Exception

getArrayAttribute

public HDFArray getArrayAttribute(String array_name,
                                  String attr_name)
                           throws Exception
Specified by:
getArrayAttribute in interface MultiDimensionReader
Throws:
Exception

close

public void close()
           throws Exception
Specified by:
close in interface MultiDimensionReader
Throws:
Exception

getVarMap

public HashMap getVarMap()

hasArray

public boolean hasArray(String name)

hasDimension

public boolean hasDimension(String name)

getNetCDFFile

public ucar.nc2.NetcdfFile getNetCDFFile()

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception