ucar.nc2.iosp.uamiv
Class UAMIVServiceProvider

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.uamiv.UAMIVServiceProvider
All Implemented Interfaces:
IOServiceProvider

public class UAMIVServiceProvider
extends AbstractIOServiceProvider

Class for reading CAMx flavored uamiv files. CAMx UAM-IV formatted files. uses "IOAP Conventions", handled by M3IO CoordSysBuilder

Author:
Barron Henderson barronh@gmail.com
See Also:
"http://www.camx.com/"

Constructor Summary
UAMIVServiceProvider()
           
 
Method Summary
 void close()
          Close the file.
 java.lang.String getFileTypeDescription()
          Get a human-readable description for this file type.
 java.lang.String getFileTypeId()
          Get a unique id for this file type.
 boolean isValidFile(RandomAccessFile raf)
          Check if this is a valid file for this IOServiceProvider.
 void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
          Open existing file, and populate ncfile with it.
 Array readData(Variable v2, Section wantSection)
          Read data from a top level Variable and return a memory resident Array.
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
copyToByteChannel, createValidNetcdfObjectName, getDetailInfo, getFileTypeVersion, getStructureIterator, readSection, readToByteChannel, sendIospMessage, sync, syncExtend, toStringDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UAMIVServiceProvider

public UAMIVServiceProvider()
Method Detail

isValidFile

public boolean isValidFile(RandomAccessFile raf)
                    throws java.io.IOException
Check if this is a valid file for this IOServiceProvider.

Parameters:
raf - RandomAccessFile
Returns:
true if valid.
Throws:
java.io.IOException - if read error

getFileTypeId

public java.lang.String getFileTypeId()
Description copied from interface: IOServiceProvider
Get a unique id for this file type.

Returns:
registered id of the file type
See Also:
"http://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"

getFileTypeDescription

public java.lang.String getFileTypeDescription()
Description copied from interface: IOServiceProvider
Get a human-readable description for this file type.

Returns:
description of the file type
See Also:
"http://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"

open

public void open(RandomAccessFile raf,
                 NetcdfFile ncfile,
                 CancelTask cancelTask)
          throws java.io.IOException
Open existing file, and populate ncfile with it.

Parameters:
raf - the file to work on, it has already passed the isValidFile() test.
ncfile - add objects to this NetcdfFile
cancelTask - used to monito user cancellation; may be null.
Throws:
java.io.IOException

readData

public Array readData(Variable v2,
                      Section wantSection)
               throws java.io.IOException,
                      InvalidRangeException
Read data from a top level Variable and return a memory resident Array. This Array has the same element type as the Variable, and the requested shape.

Parameters:
v2 - a top-level Variable
wantSection - List of type Range specifying the section of data to read. There must be a Range for each Dimension in the variable, in order. Note: no nulls.
Returns:
the requested data in a memory-resident Array
Throws:
java.io.IOException
InvalidRangeException
See Also:
Range

close

public void close()
           throws java.io.IOException
Close the file. It is the IOServiceProvider's job to close the file (even though it didnt open it), and to free any other resources it has used.

Specified by:
close in interface IOServiceProvider
Overrides:
close in class AbstractIOServiceProvider
Throws:
java.io.IOException