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 intbytesToInt(byte[] bytes, boolean swapBytes)convert bytes into integerstatic intbytesToInt(byte a, byte b, boolean swapBytes)Concatenate two bytes to a 32-bit int value.voidclose()Close the file.intconvertShort2unsignedInt(short b)convert short to unsigned integershortconvertunsignedByte2Short(byte b)convert unsigned byte to shortvoidflush()Flush all data buffers to disk.byte[]getData(int offset)static DategetDate(int julianDays, int msecs)get java datebooleanisValidFile(ucar.unidata.io.RandomAccessFile raf)check if this file is a nids / tdwr filevoidsetProperty(String name, String value)static intshortsToInt(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(ucar.unidata.io.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 IOExceptionFlush all data buffers to disk.- Throws:
IOException
-
close
public void close() throws IOExceptionClose the file.- Throws:
IOException
-
-