|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvisad.data.vis5d.V5DStruct
An object representing the structure of a .v5d file.
| Field Summary | |
int |
CompressMode
1, 2 or 4 = # bytes per grid point |
(package private) int |
CurPos
current position of file pointer |
int[] |
DateStamp
Date in YYDDD format |
String |
FileVersion
9-character version number |
(package private) int |
FirstGridPos
position of first grid in file |
(package private) int[] |
GridSize
size of each grid |
int[] |
LowLev
Lowest level per variable |
float[] |
MaxVal
Maximum variable data values |
short[][] |
McFile
McIDAS file number in 1..9999 |
short[][] |
McGrid
McIDAS grid number in 1..? |
float[] |
MinVal
Minimum variable data values |
(package private) char |
Mode
'r' = read, 'w' = write |
int |
Nc
Number of columns |
int[] |
Nl
Number of levels per variable |
int |
Nr
Number of rows |
int |
NumTimes
Number of time steps |
int |
NumVars
Number of variables |
float[] |
ProjArgs
Map projection arguments. |
int |
Projection
Which map projection |
(package private) int |
SumGridSizes
sum of GridSize[0..NumVars-1] |
static int |
TAG_BOTTOMBOUND
real*4 BottomBound (PHASED OUT) |
static int |
TAG_CENTCOL
real*4 CentralCol (PHASED OUT) |
static int |
TAG_CENTLAT
real*4 CentralLat (PHASED OUT) |
static int |
TAG_CENTLON
real*4 CentralLon (PHASED OUT) |
static int |
TAG_CENTROW
real*4 CentralRow (PHASED OUT) |
static int |
TAG_COLINC
real*4 ColInc (PHASED OUT) |
static int |
TAG_COMPRESS
int*4 CompressMode; (#bytes/grid) |
static int |
TAG_DATE
int*4 t; int*4 DateStamp[t] |
static int |
TAG_END
|
static int |
TAG_HEIGHT
int*4 l; real*4 Height[l] (PHASED OUT) |
static int |
TAG_ID
hex encoding of "V5D\n" |
static int |
TAG_LAT1
real*4 Lat1 (PHASED OUT) |
static int |
TAG_LAT2
real*4 Lat2 (PHASED OUT) |
static int |
TAG_LEVINC
real*4 LevInc (PHASED OUT) |
static int |
TAG_LOWLEV_VAR
int*4 var; int*4 LowLev[var] |
static int |
TAG_MAXVAL
int*4 var; real*4 MaxVal[var] |
static int |
TAG_MINVAL
int*4 var; real*4 MinVal[var] |
static int |
TAG_NC
int*4 Nc |
static int |
TAG_NL
int*4 Nl (Nl for all vars) |
static int |
TAG_NL_VAR
int*4 var; int*4 Nl[var] |
static int |
TAG_NORTHBOUND
real*4 NorthBound (PHASED OUT) |
static int |
TAG_NR
int*4 Nr |
static int |
TAG_NUMTIMES
int*4 NumTimes |
static int |
TAG_NUMVARS
int*4 NumVars |
static int |
TAG_POLE_COL
real*4 PoleCol (PHASED OUT) |
static int |
TAG_POLE_ROW
real*4 PoleRow (PHASED OUT) |
static int |
TAG_PROJ_ARGS
int*4 n; real*4 ProjArgs[0..n-1] |
static int |
TAG_PROJECTION
int*4 projection. |
static int |
TAG_ROTATION
real*4 Rotation (PHASED OUT) |
static int |
TAG_ROWINC
real*4 RowInc (PHASED OUT) |
static int |
TAG_TIME
int*4 t; int*4 TimeStamp[t] |
static int |
TAG_UNITS
int *4 var; char*20 Units[var] |
static int |
TAG_VARNAME
int*4 var; char*10 VarName[var] |
static int |
TAG_VERSION
char*10 FileVersion |
static int |
TAG_VERT_ARGS
int*4 n; real*4 VertArgs[0..n-1] |
static int |
TAG_VERTICAL_SYSTEM
int*4 VerticalSystem |
static int |
TAG_WESTBOUND
real*4 WestBound (PHASED OUT) |
int[] |
TimeStamp
Time in HHMMSS format |
char[][] |
Units
19-character units for variables |
char[][] |
VarName
9-character variable names |
float[] |
VertArgs
Vertical Coordinate System arguments. |
int |
VerticalSystem
Which vertical coordinate system |
| Constructor Summary | |
(package private) |
V5DStruct()
Construct and initialize a V5DStruct to reasonable initial values. |
| Method Summary | |
static int |
getUnsignedByte(byte b)
Convert a signed byte to an unsigned one, and return it in an int |
static int |
getUnsignedInt(byte b1,
byte b2,
byte b3,
byte b4)
Convert four signed bytes to an unsigned short, and return it in an int |
static int |
getUnsignedShort(byte b1,
byte b2)
Convert two signed bytes to an unsigned short, and return it in an int |
(package private) int |
grid_position(int time,
int vr)
Compute the location of a compressed grid within a file. |
(package private) boolean |
read_comp_grid(int time,
int vr,
float[] ga,
float[] gb,
byte[] compdata1)
Read a compressed grid from a COMP* file. |
(package private) boolean |
read_comp_header()
Read the header from a COMP* file and return results in the V5DStruct. |
(package private) boolean |
read_v5d_header()
Read a v5d file header. |
static V5DStruct |
v5d_open(byte[] name,
int name_length,
int[] sizes,
int[] n_levels,
String[] var_names,
String[] var_units,
int[] map_proj,
float[] projargs,
int[] vert_sys,
float[] vert_args,
double[] times)
Open a Vis5D file |
void |
v5d_read(int time,
int vr,
float[] ranges,
float[] data)
Read from a Vis5D file |
(package private) boolean |
v5dCloseFile()
Close a v5d file which was opened with open_v5d_file() or create_v5d_file(). |
(package private) boolean |
v5dCreateFile(String filename)
Open a v5d file for writing. |
(package private) boolean |
v5dGetMcIDASgrid(int time,
int vr,
int[] mcfile,
int[] mcgrid)
Get the McIDAS file number and grid number associated with the grid identified by time and var. |
(package private) boolean |
v5dReadCompressedGrid(int time,
int vr,
float[] ga,
float[] gb,
byte[] compdata)
Read a compressed grid from a v5d file. |
(package private) boolean |
v5dReadGrid(int time,
int vr,
float[] data)
Read a grid from a v5d file, decompress it and return it. |
(package private) boolean |
v5dSetMcIDASgrid(int time,
int vr,
int mcfile,
int mcgrid)
Set the McIDAS file number and grid number associated with the grid identified by time and var. |
(package private) int |
v5dSizeofGrid(int time,
int vr)
Return the size (in bytes) of the 3-D grid specified by time and var. |
(package private) boolean |
v5dVerifyStruct()
Do some checking that the information in a V5DStruct is valid. |
(package private) boolean |
v5dWriteCompressedGrid(int time,
int vr,
float[] ga,
float[] gb,
byte[] compdata)
Write a compressed grid to a v5d file. |
(package private) boolean |
v5dWriteGrid(int time,
int vr,
float[] data)
Compress a grid and write it to a v5d file. |
(package private) boolean |
write_tag(int tag,
int length,
boolean newfile)
|
(package private) boolean |
write_v5d_header()
Write the information in the given V5DStruct as a v5d file header. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int TAG_ID
public static final int TAG_VERSION
public static final int TAG_NUMTIMES
public static final int TAG_NUMVARS
public static final int TAG_VARNAME
public static final int TAG_NR
public static final int TAG_NC
public static final int TAG_NL
public static final int TAG_NL_VAR
public static final int TAG_LOWLEV_VAR
public static final int TAG_TIME
public static final int TAG_DATE
public static final int TAG_MINVAL
public static final int TAG_MAXVAL
public static final int TAG_COMPRESS
public static final int TAG_UNITS
public static final int TAG_VERTICAL_SYSTEM
public static final int TAG_VERT_ARGS
public static final int TAG_BOTTOMBOUND
public static final int TAG_LEVINC
public static final int TAG_HEIGHT
public static final int TAG_PROJECTION
public static final int TAG_PROJ_ARGS
public static final int TAG_NORTHBOUND
public static final int TAG_WESTBOUND
public static final int TAG_ROWINC
public static final int TAG_COLINC
public static final int TAG_LAT1
public static final int TAG_LAT2
public static final int TAG_POLE_ROW
public static final int TAG_POLE_COL
public static final int TAG_CENTLON
public static final int TAG_CENTLAT
public static final int TAG_CENTROW
public static final int TAG_CENTCOL
public static final int TAG_ROTATION
public static final int TAG_END
public int NumTimes
public int NumVars
public int Nr
public int Nc
public int[] Nl
public int[] LowLev
public char[][] VarName
public char[][] Units
public int[] TimeStamp
public int[] DateStamp
public float[] MinVal
public float[] MaxVal
public short[][] McFile
public short[][] McGrid
public int VerticalSystem
public float[] VertArgs
IF VerticalSystem==0 THEN
-- Linear scale, equally-spaced levels in generic units
VertArgs[0] = Height of bottom-most grid level in generic units
VertArgs[1] = Increment between levels in generic units
ELSE IF VerticalSystem==1 THEN
-- Linear scale, equally-spaced levels in km
VertArgs[0] = Height of bottom grid level in km
VertArgs[1] = Increment between levels in km
ELSE IF VerticalSystem==2 THEN
-- Linear scale, Unequally spaced levels in km
VertArgs[0] = Height of grid level 0 (bottom) in km
... ...
VertArgs[n] = Height of grid level n in km
ELSE IF VerticalSystem==3 THEN
-- Linear scale, Unequally spaced levels in mb
VertArgs[0] = Pressure of grid level 0 (bottom) in mb
... ...
VertArgs[n] = Pressure of grid level n in mb
ENDIF
public int Projection
public float[] ProjArgs
IF Projection==0 THEN
-- Rectilinear grid, generic units
ProjArgs[0] = North bound, Y coordinate of grid row 0
ProjArgs[1] = West bound, X coordiante of grid column 0
ProjArgs[2] = Increment between rows
ProjArgs[3] = Increment between colums
NOTES: X coordinates increase to the right, Y increase upward.
NOTES: Coordinate system is right-handed.
ELSE IF Projection==1 THEN
-- Cylindrical equidistant (Old VIS-5D)
-- Rectilinear grid in lat/lon
ProjArgs[0] = Latitude of grid row 0, north bound, in degrees
ProjArgs[1] = Longitude of grid column 0, west bound, in deg.
ProjArgs[2] = Increment between rows in degrees
ProjArgs[3] = Increment between rows in degrees
NOTES: Coordinates (degrees) increase to the left and upward.
ELSE IF Projection==2 THEN
-- Lambert conformal
ProjArgs[0] = Standared Latitude 1 of conic projection
ProjArgs[1] = Standared Latitude 2 of conic projection
ProjArgs[2] = Row of North/South pole
ProjArgs[3] = Column of North/South pole
ProjArgs[4] = Longitude which is parallel to columns
ProjArgs[5] = Increment between grid columns in km
ELSE IF Projection==3 THEN
-- Polar Stereographic
ProjArgs[0] = Latitude of center of projection
ProjArgs[1] = Longitude of center of projection
ProjArgs[2] = Grid row of center of projection
ProjArgs[3] = Grid column of center of projection
ProjArgs[4] = Increment between grid columns at center in km
ELSE IF Projection==4 THEN
-- Rotated
ProjArgs[0] = Latitude on rotated globe of grid row 0
ProjArgs[1] = Longitude on rotated globe of grid column 0
ProjArgs[2] = Degrees of latitude on rotated globe between
grid rows
ProjArgs[3] = Degrees of longitude on rotated globe between
grid columns
ProjArgs[4] = Earth latitude of (0, 0) on rotated globe
ProjArgs[5] = Earth longitude of (0, 0) on rotated globe
ProjArgs[6] = Clockwise rotation of rotated globe in degrees
ENDIF
public int CompressMode
public String FileVersion
char Mode
int CurPos
int FirstGridPos
int[] GridSize
int SumGridSizes
| Constructor Detail |
V5DStruct()
| Method Detail |
public static V5DStruct v5d_open(byte[] name,
int name_length,
int[] sizes,
int[] n_levels,
String[] var_names,
String[] var_units,
int[] map_proj,
float[] projargs,
int[] vert_sys,
float[] vert_args,
double[] times)
throws IOException,
BadFormException
IOException
BadFormException
public void v5d_read(int time,
int vr,
float[] ranges,
float[] data)
throws IOException,
BadFormException
IOException
BadFormExceptionpublic static int getUnsignedByte(byte b)
public static int getUnsignedShort(byte b1,
byte b2)
public static int getUnsignedInt(byte b1,
byte b2,
byte b3,
byte b4)
int v5dSizeofGrid(int time,
int vr)
time - timestepvr - variable
int grid_position(int time,
int vr)
throws BadFormException
time - timestep
vr variable
BadFormExceptionboolean v5dVerifyStruct()
boolean v5dGetMcIDASgrid(int time,
int vr,
int[] mcfile,
int[] mcgrid)
time - timestepvr - variablemcfile - one-element int array for storing McIDAS grid file numbermcgrid - one-element int array for storing McIDAS grid number
boolean v5dSetMcIDASgrid(int time,
int vr,
int mcfile,
int mcgrid)
time - timestepvr - variablemcfile - McIDAS grid file numbermcgrid - McIDAS grid number
boolean read_comp_header()
throws IOException
IOException
boolean read_comp_grid(int time,
int vr,
float[] ga,
float[] gb,
byte[] compdata1)
throws IOException,
BadFormException
IOException
BadFormException
boolean read_v5d_header()
throws IOException,
BadFormException
IOException
BadFormException
boolean v5dReadCompressedGrid(int time,
int vr,
float[] ga,
float[] gb,
byte[] compdata)
throws IOException,
BadFormException
time - timestepvr - variablega - array to store grid (de)compression valuesgb - array to store grid (de)compression valuescompdata - address of where to store compressed grid data
IOException
BadFormException
boolean v5dReadGrid(int time,
int vr,
float[] data)
throws IOException,
BadFormException
time - timestepvr - variabledata - array to put grid data
IOException
BadFormException
boolean write_tag(int tag,
int length,
boolean newfile)
throws IOException
IOException
boolean write_v5d_header()
throws IOException
IOException
boolean v5dCreateFile(String filename)
throws IOException
filename - name of v5d file to create
IOException
boolean v5dWriteCompressedGrid(int time,
int vr,
float[] ga,
float[] gb,
byte[] compdata)
throws IOException,
BadFormException
time - timestepvr - variablega - the GA (de)compression value arraygb - the GB (de)compression value arraycompdata - array of compressed data values
IOException
BadFormException
boolean v5dWriteGrid(int time,
int vr,
float[] data)
throws IOException,
BadFormException
time - timestepvr - variabledata - array of uncompressed grid data
IOException
BadFormException
boolean v5dCloseFile()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||