ucar.nc2.iosp.nowrad
Class NOWRadiosp

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.nowrad.NOWRadiosp
All Implemented Interfaces:
IOServiceProvider

public class NOWRadiosp
extends AbstractIOServiceProvider

Created by IntelliJ IDEA. User: yuanho Date: Feb 10, 2010 Time: 11:22:03 AM To change this template use File | Settings | File Templates.


Field Summary
protected  boolean debug
           
protected  boolean debugSize
           
protected  boolean debugSPIO
           
protected  HashMap dimHash
           
protected  int fileUsed
           
protected  boolean fill
           
protected  NOWRadheader headerParser
           
protected  boolean readonly
           
protected  int recStart
           
protected  boolean showHeaderBytes
           
 
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
raf
 
Constructor Summary
NOWRadiosp()
           
 
Method Summary
static int bytesToInt(byte a, byte b, boolean swapBytes)
           
static int bytesToInt(short a, short b, boolean swapBytes)
           
 void close()
          Close the file.
 short convertunsignedByte2Short(byte b)
           
 void flush()
           
 String getFileTypeDescription()
          Get a human-readable description for this file type.
 String getFileTypeId()
          Get a unique id for this file type.
 boolean isValidFile(RandomAccessFile raf)
          checking the file
static void main(String[] args)
           
 void open(RandomAccessFile raf, NetcdfFile file, CancelTask cancelTask)
          Open the file and read the header part
 Array readData(Variable v2, Section section)
          Read the data for each variable passed in
 byte[] readOneRowData(byte[] ddata, int rLen, int xt)
          Read data from encoded values and run len into regular data array
 Object readOneScanData(ByteBuffer bos, ucar.nc2.iosp.nowrad.NOWRadheader.Vinfo vinfo, String vName)
          Read one scan radar data
static int unsignedByteToInt(byte b)
           
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
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
 

Field Detail

fileUsed

protected int fileUsed

recStart

protected int recStart

debug

protected boolean debug

debugSize

protected boolean debugSize

debugSPIO

protected boolean debugSPIO

showHeaderBytes

protected boolean showHeaderBytes

dimHash

protected HashMap dimHash

fill

protected boolean fill

headerParser

protected NOWRadheader headerParser

readonly

protected boolean readonly
Constructor Detail

NOWRadiosp

public NOWRadiosp()
Method Detail

isValidFile

public boolean isValidFile(RandomAccessFile raf)
checking the file

Parameters:
raf -
Returns:
the valid of file checking

getFileTypeId

public 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 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 file,
                 CancelTask cancelTask)
          throws IOException
Open the file and read the header part

Specified by:
open in interface IOServiceProvider
Overrides:
open in class AbstractIOServiceProvider
Parameters:
raf -
file -
cancelTask -
Throws:
IOException

readData

public Array readData(Variable v2,
                      Section section)
               throws IOException,
                      InvalidRangeException
Read the data for each variable passed in

Parameters:
v2 -
section -
Returns:
output data
Throws:
IOException
InvalidRangeException
See Also:
Range

readOneScanData

public Object readOneScanData(ByteBuffer bos,
                              ucar.nc2.iosp.nowrad.NOWRadheader.Vinfo vinfo,
                              String vName)
                       throws IOException,
                              InvalidRangeException
Read one scan radar data

Parameters:
bos - Data buffer
vinfo - variable info
Returns:
the data object of scan data
Throws:
IOException
InvalidRangeException

bytesToInt

public static int bytesToInt(short a,
                             short b,
                             boolean swapBytes)

bytesToInt

public static int bytesToInt(byte a,
                             byte b,
                             boolean swapBytes)

readOneRowData

public byte[] readOneRowData(byte[] ddata,
                             int rLen,
                             int xt)
                      throws IOException,
                             InvalidRangeException
Read data from encoded values and run len into regular data array

Parameters:
ddata - is encoded data values
Returns:
the data array of row data
Throws:
IOException
InvalidRangeException

convertunsignedByte2Short

public short convertunsignedByte2Short(byte b)

unsignedByteToInt

public static int unsignedByteToInt(byte b)

flush

public void flush()
           throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: IOServiceProvider
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:
IOException - if read error

main

public static void main(String[] args)
                 throws Exception,
                        IOException,
                        InstantiationException,
                        IllegalAccessException
Throws:
Exception
IOException
InstantiationException
IllegalAccessException


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.