Package ucar.nc2.iosp.nowrad
Class NOWRadiosp
- java.lang.Object
-
- ucar.nc2.iosp.AbstractIOServiceProvider
-
- ucar.nc2.iosp.nowrad.NOWRadiosp
-
- All Implemented Interfaces:
Comparable<IOServiceProvider>
,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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ucar.nc2.iosp.IOServiceProvider
IOServiceProvider.SortGroup
-
-
Field Summary
Fields Modifier and Type Field Description 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
location, ncfile, raf, rafOrder
-
-
Constructor Summary
Constructors Constructor Description NOWRadiosp()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
bytesToInt(byte a, byte b, boolean swapBytes)
static int
bytesToInt(short a, short b, boolean swapBytes)
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)
Check if the file is a NOWRad filevoid
open(RandomAccessFile raf, NetcdfFile file, CancelTask cancelTask)
Open the file and read the header partvoid
reacquire()
Reacquire any resources like file handles Used when reactivating in cache.Array
readData(Variable v2, Section section)
Read the data for each variable passed inbyte[]
readOneRowData(byte[] ddata, int rLen, int xt)
Read data from encoded values and run len into regular data arrayObject
readOneScanData(ByteBuffer bos, ucar.nc2.iosp.nowrad.NOWRadheader.Vinfo vinfo, String vName)
Read one scan radar data-
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
build, buildFinish, close, getDetailInfo, getFileTypeVersion, getLastModified, getStructureIterator, isBuilder, readSection, readToByteChannel, readToOutputStream, release, sendIospMessage, setNetcdfFile, streamToByteChannel, syncExtend, toStringDebug
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.iosp.IOServiceProvider
compareTo, getSortGroup
-
-
-
-
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
-
-
Method Detail
-
isValidFile
public boolean isValidFile(RandomAccessFile raf)
Check if the file is a NOWRad file- Parameters:
raf
- RandomAccessFile- Returns:
- true if valid.
-
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:
- "https://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:
- "https://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 interfaceIOServiceProvider
- Overrides:
open
in classAbstractIOServiceProvider
- Parameters:
raf
- the file to work on, it has already passed the isValidFile() test.file
- add objects to this empty NetcdfFilecancelTask
- used to monitor user cancellation; may be null.- Throws:
IOException
- if read error
-
readData
public Array readData(Variable v2, Section section) throws IOException, InvalidRangeException
Read the data for each variable passed in- Parameters:
v2
- a top-level Variablesection
- the section of data to read. There must be a Range for each Dimension in the variable, in order. Note: no nulls allowed. IOSP may not modify.- Returns:
- the requested data in a memory-resident Array
- Throws:
IOException
- if read errorInvalidRangeException
- if invalid section- See Also:
Range
-
readOneScanData
public Object readOneScanData(ByteBuffer bos, ucar.nc2.iosp.nowrad.NOWRadheader.Vinfo vinfo, String vName)
Read one scan radar data- Parameters:
bos
- Data buffervinfo
- variable info- Returns:
- the data object of scan data
-
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)
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
-
reacquire
public void reacquire() throws IOException
Description copied from interface:IOServiceProvider
Reacquire any resources like file handles Used when reactivating in cache.- Specified by:
reacquire
in interfaceIOServiceProvider
- Overrides:
reacquire
in classAbstractIOServiceProvider
- Throws:
IOException
-
-