org.wdssii.core
Class NetcdfBuilder

java.lang.Object
  extended by org.wdssii.core.NetcdfBuilder
All Implemented Interfaces:
Builder

public class NetcdfBuilder
extends Object
implements Builder

Reads a local/remote netcdf file (gzipped or not) and builds a DataType

Version:
$Id: NetcdfBuilder.java,v 1.8 2007/11/20 21:03:59 lakshman Exp $
Author:
Lakshman

Nested Class Summary
private static class NetcdfBuilder.FormatException
           
 
Field Summary
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
NetcdfBuilder()
           
 
Method Summary
 DataType createObject(IndexRecord rec)
          create object if the record params are netcdf ones.
 DataType createObject(String path)
          pass in the file name and obtain an object back.
private  DataType fromNetcdfFile(String path)
           
private  ucar.nc2.Variable getVariable(ucar.nc2.NetcdfFile ncfile, String name)
           
private  float[][] readData2D(ucar.nc2.NetcdfFile ncfile, String typeName)
           
private  LatLonGrid readLatLonGrid(ucar.nc2.NetcdfFile ncfile, Location nwCorner, Date gridTime, Map<String,String> attr, String typeName, float[][] values)
           
private  RadialSet readRadialSet(ucar.nc2.NetcdfFile ncfile, Location radarLoc, Date scanTime, Map<String,String> attr, String typeName, float[][] values)
           
private  float[][] readSparse2D(ucar.nc2.NetcdfFile ncfile, String typeName)
           
 
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
Constructor Detail

NetcdfBuilder

public NetcdfBuilder()
Method Detail

createObject

public DataType createObject(IndexRecord rec)
create object if the record params are netcdf ones.

Specified by:
createObject in interface Builder

createObject

public DataType createObject(String path)
pass in the file name and obtain an object back.


fromNetcdfFile

private DataType fromNetcdfFile(String path)

getVariable

private ucar.nc2.Variable getVariable(ucar.nc2.NetcdfFile ncfile,
                                      String name)
                               throws NetcdfBuilder.FormatException
Throws:
NetcdfBuilder.FormatException

readData2D

private float[][] readData2D(ucar.nc2.NetcdfFile ncfile,
                             String typeName)
                      throws IOException
Throws:
IOException

readSparse2D

private float[][] readSparse2D(ucar.nc2.NetcdfFile ncfile,
                               String typeName)
                        throws IOException
Throws:
IOException

readRadialSet

private RadialSet readRadialSet(ucar.nc2.NetcdfFile ncfile,
                                Location radarLoc,
                                Date scanTime,
                                Map<String,String> attr,
                                String typeName,
                                float[][] values)
                         throws NetcdfBuilder.FormatException,
                                IOException
Throws:
NetcdfBuilder.FormatException
IOException

readLatLonGrid

private LatLonGrid readLatLonGrid(ucar.nc2.NetcdfFile ncfile,
                                  Location nwCorner,
                                  Date gridTime,
                                  Map<String,String> attr,
                                  String typeName,
                                  float[][] values)
                           throws NetcdfBuilder.FormatException,
                                  IOException
Throws:
NetcdfBuilder.FormatException
IOException