Package ucar.nc2.iosp.nids
Class Nidsiosp
- java.lang.Object
-
- ucar.nc2.iosp.AbstractIOServiceProvider
-
- ucar.nc2.iosp.nids.Nidsiosp
-
- All Implemented Interfaces:
Comparable<IOServiceProvider>
,IOServiceProvider
public class Nidsiosp extends AbstractIOServiceProvider
IOServiceProvider implementation abstract base class to read/write "version 3" netcdf files. AKA "file format version 1" files. see concrete class
-
-
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 int
fileUsed
protected ucar.nc2.iosp.nids.Nidsheader
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 Nidsiosp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 Nids file.void
open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
Open existing file, and populate ncfile with it.void
reacquire()
Reacquire any resources like file handles Used when reactivating in cache.ArrayStructure
readCircleStructData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read databyte[]
readCompData(long hoff, long doff)
Read compressed databyte[]
readCompData1(byte[] uncomp, long hoff, long doff)
Array
readData(Variable v2, Section section)
Read the data for each variable passed inArrayStructure
readGraphicSymbolData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read graphic sysmbol structure dataArrayStructure
readLinkedVectorData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read linked vector sturcture dataArray
readNestedCircleStructData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section)
Read nested dataArray
readNestedData(Variable v2, Section section)
Read nested structure dataArray
readNestedDataUnlinkVector(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section)
Read nested dataArray
readNestedGraphicSymbolData(String name, StructureMembers.Member m, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section)
Read nested graphic symbolic structure dataArray
readNestedLinkedVectorData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section)
Read nested structure dataArray
readNestedTextStringData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section)
Read nested dataArray
readNestedVectorArrowData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section)
Read nested dataArray
readNestedWindBarbData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section)
Read nested dataObject
readOneArrayData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, String vName)
Object
readOneArrayData1(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read datashort[]
readOneBeamShortData(byte[] ddata, int rLen, int xt, int level)
read one radial beam databyte[]
readOneRowData(byte[] ddata, int rLen, int xt)
Read data from encoded values and run len into regular data arrayshort[]
readOneRowData1(byte[] ddata, int rLen, int xt)
Read data from encoded values and run len into regular data arrayshort[]
readOneRowData2(byte[] ddata, int rLen, int xt)
Read data from encoded values and run len into regular data arrayObject
readOneScanData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, String vName)
Read one scan radar dataObject
readOneScanGenericData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, String vName)
Read one scan radar dataObject
readTabAlphaNumData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read dataArrayStructure
readTextStringData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read databyte[]
readUCompData(long hoff, long doff)
Read uncompressed dataArrayStructure
readUnlinkedVectorData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read dataArrayStructure
readVectorArrowData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read dataArrayStructure
readWindBarbData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List sList)
Read 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
-
readonly
protected boolean readonly
-
headerParser
protected ucar.nc2.iosp.nids.Nidsheader headerParser
-
fileUsed
protected int fileUsed
-
recStart
protected int recStart
-
debug
protected boolean debug
-
debugSize
protected boolean debugSize
-
debugSPIO
protected boolean debugSPIO
-
showHeaderBytes
protected boolean showHeaderBytes
-
-
Method Detail
-
isValidFile
public boolean isValidFile(RandomAccessFile raf)
Check if the file is a Nids 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 ncfile, CancelTask cancelTask) throws IOException
Description copied from interface:IOServiceProvider
Open existing file, and populate ncfile with it. This method is only called by the NetcdfFile constructor on itself. The provided NetcdfFile object will be empty except for the location String and the IOServiceProvider associated with this NetcdfFile object.- Specified by:
open
in interfaceIOServiceProvider
- Overrides:
open
in classAbstractIOServiceProvider
- Parameters:
raf
- the file to work on, it has already passed the isValidFile() test.ncfile
- add objects to this empty NetcdfFilecancelTask
- used to monitor user cancellation; may be null.- Throws:
IOException
- if read error
-
readNestedData
public Array readNestedData(Variable v2, Section section) throws InvalidRangeException
Read nested structure data- Throws:
InvalidRangeException
-
readData
public Array readData(Variable v2, Section section) throws 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:
InvalidRangeException
- if invalid section- See Also:
Range
-
readNestedGraphicSymbolData
public Array readNestedGraphicSymbolData(String name, StructureMembers.Member m, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section) throws InvalidRangeException
Read nested graphic symbolic structure data- Parameters:
name
- Variable name,m
- Structure mumber name,bos
- data buffer,vinfo
- variable info,section
- variable section- Returns:
- the array of member variable data
- Throws:
InvalidRangeException
-
readGraphicSymbolData
public ArrayStructure readGraphicSymbolData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read graphic sysmbol structure data- Parameters:
name
- Variable namebos
- data buffer,vinfo
- variable info,- Returns:
- the arraystructure of graphic symbol data
-
readNestedLinkedVectorData
public Array readNestedLinkedVectorData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section) throws InvalidRangeException
Read nested structure data- Parameters:
name
- Variable name,memberName
- mumber name,bos
- data buffer,vinfo
- variable info,section
- variable section- Returns:
- the array of member variable data
- Throws:
InvalidRangeException
-
readLinkedVectorData
public ArrayStructure readLinkedVectorData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read linked vector sturcture data- Parameters:
name
- Variable name,bos
- data buffer,vinfo
- variable info,- Returns:
- the arraystructure of linked vector data
-
readNestedCircleStructData
public Array readNestedCircleStructData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section) throws InvalidRangeException
Read nested data- Parameters:
name
- Variable name,memberName
- Structure mumber name,bos
- Data buffer,vinfo
- variable info,section
- variable section- Returns:
- the array of member variable data
- Throws:
InvalidRangeException
-
readCircleStructData
public ArrayStructure readCircleStructData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read data- Parameters:
name
- Variable name,bos
- Data buffer,vinfo
- variable info,- Returns:
- the arraystructure of circle struct data
-
readTabAlphaNumData
public Object readTabAlphaNumData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read data- Parameters:
bos
- Data buffer,vinfo
- variable info,- Returns:
- the array of tab data
-
readOneScanGenericData
public Object readOneScanGenericData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, String vName)
Read one scan radar data- Parameters:
bos
- Data buffervinfo
- variable info- Returns:
- the data object of scan data
-
readOneScanData
public Object readOneScanData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, String vName)
Read one scan radar data- Parameters:
bos
- Data buffervinfo
- variable info- Returns:
- the data object of scan data
-
readOneBeamShortData
public short[] readOneBeamShortData(byte[] ddata, int rLen, int xt, int level)
read one radial beam data
-
readNestedWindBarbData
public Array readNestedWindBarbData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section) throws InvalidRangeException
Read nested data- Parameters:
name
- Variable name,memberName
- Structure mumber name,bos
- Data buffer,vinfo
- variable info,section
- variable section- Returns:
- the array of member variable data
- Throws:
InvalidRangeException
-
readWindBarbData
public ArrayStructure readWindBarbData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List sList)
Read data- Parameters:
name
- Variable name,bos
- Data buffer,vinfo
- variable info,- Returns:
- the arraystructure of wind barb data
-
readNestedVectorArrowData
public Array readNestedVectorArrowData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section) throws InvalidRangeException
Read nested data- Parameters:
name
- Variable name,memberName
- Structure mumber name,bos
- Data buffer,vinfo
- variable info,section
- variable section- Returns:
- the array of member variable data
- Throws:
InvalidRangeException
-
readVectorArrowData
public ArrayStructure readVectorArrowData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read data- Parameters:
name
- Variable name,bos
- Data buffer,vinfo
- variable info,- Returns:
- the arraystructure of vector arrow data
-
readNestedTextStringData
public Array readNestedTextStringData(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section) throws InvalidRangeException
Read nested data- Parameters:
name
- Variable name,memberName
- Structure mumber name,bos
- Data buffer,vinfo
- variable info,section
- variable section- Returns:
- the array of member variable data
- Throws:
InvalidRangeException
-
readTextStringData
public ArrayStructure readTextStringData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read data- Parameters:
name
- Variable name,bos
- Data buffer,vinfo
- variable info- Returns:
- the arraystructure of text string data
-
readNestedDataUnlinkVector
public Array readNestedDataUnlinkVector(String name, String memberName, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, List<Range> section) throws InvalidRangeException
Read nested data- Parameters:
name
- Variable name,memberName
- Structure mumber name,bos
- Data buffer,vinfo
- variable info,section
- variable section- Returns:
- the array of member variable data
- Throws:
InvalidRangeException
-
readUnlinkedVectorData
public ArrayStructure readUnlinkedVectorData(String name, ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read data- Parameters:
name
- Variable name,bos
- Data buffer,vinfo
- variable info,- Returns:
- the arraystructure of unlinked vector data
-
readOneArrayData
public Object readOneArrayData(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo, String vName)
-
readOneArrayData1
public Object readOneArrayData1(ByteBuffer bos, ucar.nc2.iosp.nids.Nidsheader.Vinfo vinfo)
Read data- Parameters:
bos
- is data buffervinfo
- is variable info- Returns:
- the data object
-
readOneRowData1
public short[] readOneRowData1(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
-
readOneRowData2
public short[] readOneRowData2(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
-
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
-
readCompData1
public byte[] readCompData1(byte[] uncomp, long hoff, long doff)
-
readCompData
public byte[] readCompData(long hoff, long doff) throws IOException
Read compressed data- Parameters:
hoff
- header offsetdoff
- data offset- Returns:
- the array of data
- Throws:
IOException
-
readUCompData
public byte[] readUCompData(long hoff, long doff) throws IOException
Read uncompressed data- Parameters:
hoff
- header offsetdoff
- data offset- Returns:
- the array of data
- Throws:
IOException
-
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
-
-