ucar.nc2.iosp.nowrad
Class NOWRadheader

java.lang.Object
  extended by 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.


Field Summary
static String[] mons
           
 
Constructor Summary
NOWRadheader()
           
 
Method Summary
static int bytesToInt(byte[] bytes, boolean swapBytes)
          convert bytes into integer
static 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 integer
 short convertunsignedByte2Short(byte b)
          convert unsigned byte to short
 void flush()
          Flush all data buffers to disk.
 byte[] getData(int offset)
           
static Date getDate(int julianDays, int msecs)
          get jave date
 boolean isValidFile(RandomAccessFile raf)
          check if this file is a nids / tdwr file
 void setProperty(String name, String value)
           
static int shortsToInt(short s1, short s2, boolean swapBytes)
          convert two short into a integer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mons

public static String[] mons
Constructor Detail

NOWRadheader

public NOWRadheader()
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 Exception
Throws:
Exception

setProperty

public void setProperty(String name,
                        String value)

shortsToInt

public static int shortsToInt(short s1,
                              short s2,
                              boolean swapBytes)
convert two short into a integer

Parameters:
s1 - short one
s2 - short two
swapBytes - if swap bytes
Returns:
integer

bytesToInt

public static int bytesToInt(byte[] bytes,
                             boolean swapBytes)
convert bytes into integer

Parameters:
bytes - bytes array
swapBytes - 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 byte
b - low order byte
swapBytes - 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 -
Returns:
unsign integer

getDate

public static Date getDate(int julianDays,
                           int msecs)
get jave date

Parameters:
julianDays -
msecs -
Returns:
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


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