|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wisc.ssec.mcidas.McIDASUtil
public final class McIDASUtil
Class for static McIDAS utility methods. In many cases, these methods are the Java equivalents of McIDAS library functions.
Field Summary | |
---|---|
static int |
MCMISSING
McIDAS missing value for 4-byte integers |
Constructor Summary | |
---|---|
McIDASUtil()
|
Method Summary | |
---|---|
static int |
bytesToInteger(byte[] b,
int off)
convert four consequtive bytes into a (signed) int. |
static int[] |
bytesToIntegerArray(byte[] b,
int off,
int num)
convert consequtive bytes into a (signed) int array. |
static int |
doubleLatLonToInteger(double dvalue)
Converts a double latitude/longitude to a packed integer (SIGN DDD MM SS) Java version of McIDAS ilalo function. |
static void |
flip(int[] array,
int first,
int last)
Flip the bytes of an integer array. |
static java.lang.String |
intBitsToString(int value)
convert signed int to a String representation. |
static java.lang.String |
intBitsToString(int[] values)
convert signed int array to a String representation. |
static double |
integerLatLonToDouble(int value)
Converts a packed integer (SIGN DDD MM SS) latitude/longitude to double. |
static boolean |
isChar(int value)
Check to see if the int value is the representation of a string or not. |
static long |
mcDayTimeToSecs(int yearday,
int time)
Convert day (yyddd or yyyyddd) and time (hhmmss) to seconds since the epoch (January 1, 1970, 00:00GMT). |
static int |
mcDoubleToPackedInteger(double dvalue)
Converts a double latitude/longitude or time (hours) to a packed integer (SIGN DDD/HH MM SS). |
static double |
mcPackedIntegerToDouble(int value)
Converts a packed integer (SIGN DDD/HH MM SS) latitude/longitude or time (hours) to double. |
static int[] |
mcSecsToDayTime(long secs)
Convert seconds since the epoch (January 1, 1970, 00:00GMT) to day (yyyyddd) and time (hhmmss). |
static double |
timdif(int yrday1,
int hms1,
int yrday2,
int hms2)
Calculate difference in minutes between two dates/times. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MCMISSING
Constructor Detail |
---|
public McIDASUtil()
Method Detail |
---|
public static double integerLatLonToDouble(int value)
flalo
function except returns a
double instead of a float.
value
- integer containing the packed data
public static int doubleLatLonToInteger(double dvalue)
ilalo
function.
value
- double value of lat/lon
public static double mcPackedIntegerToDouble(int value)
flalo
and ftime
functions except returns a double instead of a float.
value
- integer containing the packed data
public static int mcDoubleToPackedInteger(double dvalue)
ilalo
and m0itime
functions.
value
- double value of lat/lon or time
public static double timdif(int yrday1, int hms1, int yrday2, int hms2)
yrday1
- Year/day of first time (yyddd or yyyyddd)hms1
- Hours/minutes/seconds of first time (hhmmss).yrday2
- Year/day of second time (yyddd).hms2
- Hours/minutes/seconds of second time (hhmmss).
public static long mcDayTimeToSecs(int yearday, int time)
yearday
- year/day in either yyddd or yyyyddd format.
Only works for years > 1900.time
- time in packed integer format (hhmmss)
public static int[] mcSecsToDayTime(long secs)
secs
- seconds since the epoch
public static void flip(int[] array, int first, int last)
array[]
- array of integers to be flippedfirst
- starting element of the arraylast
- last element of array to flippublic static int bytesToInteger(byte[] b, int off)
byte[]
- array of 4 bytesoff
- is the offset into the byte arraypublic static int[] bytesToIntegerArray(byte[] b, int off, int num)
byte[]
- array of bytesoff
- is the offset into the byte arraynum
- number of integers to createpublic static java.lang.String intBitsToString(int value)
value
- - integer representation of a string
public static java.lang.String intBitsToString(int[] values)
values
- - integer array representation of a string
public static boolean isChar(int value)
value
- integer representation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |