Package ucar.nc2.iosp.nowrad
Class NOWRadheader
- java.lang.Object
-
- ucar.nc2.iosp.nowrad.NOWRadheader
-
public class NOWRadheader extends Object
Created by IntelliJ IDEA. User: yuanho Date: Feb 10, 2010 Time: 11:21:19 AM To change this template use File | Settings | File Templates.
-
-
Constructor Summary
Constructors Constructor Description NOWRadheader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
bytesToInt(byte[] bytes, boolean swapBytes)
convert bytes into integerstatic int
bytesToInt(byte a, byte b, boolean swapBytes)
Concatenate two bytes to a 32-bit int value.void
close()
Close the file.int
convertShort2unsignedInt(short b)
convert short to unsigned integershort
convertunsignedByte2Short(byte b)
convert unsigned byte to shortvoid
flush()
Flush all data buffers to disk.byte[]
getData(int offset)
static Date
getDate(int julianDays, int msecs)
get java dateboolean
isValidFile(RandomAccessFile raf)
check if this file is a nids / tdwr filevoid
setProperty(String name, String value)
static int
shortsToInt(short s1, short s2, boolean swapBytes)
convert two short into a integer
-
-
-
Field Detail
-
mons
public static String[] mons
-
-
Method Detail
-
isValidFile
public boolean isValidFile(RandomAccessFile raf)
check if this file is a nids / tdwr file- Parameters:
raf
- input file- Returns:
- true if valid
-
getData
public byte[] getData(int offset) throws IOException
- Throws:
IOException
-
shortsToInt
public static int shortsToInt(short s1, short s2, boolean swapBytes)
convert two short into a integer- Parameters:
s1
- short ones2
- short twoswapBytes
- if swap bytes- Returns:
- integer
-
bytesToInt
public static int bytesToInt(byte[] bytes, boolean swapBytes)
convert bytes into integer- Parameters:
bytes
- bytes arrayswapBytes
- if need to swap- Returns:
- integer
-
bytesToInt
public static int bytesToInt(byte a, byte b, boolean swapBytes)
Concatenate two bytes to a 32-bit int value. a is the high order byte in the resulting int representation, unless swapBytes is true, in which b is the high order byte.- Parameters:
a
- high order byteb
- low order byteswapBytes
- byte order swap flag- Returns:
- 32-bit integer
-
convertunsignedByte2Short
public short convertunsignedByte2Short(byte b)
convert unsigned byte to short- Parameters:
b
- convert this unsigned byte- Returns:
- unsigned short
-
convertShort2unsignedInt
public int convertShort2unsignedInt(short b)
convert short to unsigned integer- Parameters:
b
- convert this short- Returns:
- unsigned integer
-
getDate
public static Date getDate(int julianDays, int msecs)
get java date
-
flush
public void flush() throws IOException
Flush all data buffers to disk.- Throws:
IOException
-
close
public void close() throws IOException
Close the file.- Throws:
IOException
-
-