visad.data.vis5d
Class V5DStruct

java.lang.Object
  extended by visad.data.vis5d.V5DStruct

public class V5DStruct
extends Object

An object representing the structure of a .v5d file.


Field Summary
 int CompressMode
          1, 2 or 4 = # bytes per grid point
 int[] DateStamp
          Date in YYDDD format
 String FileVersion
          9-character version number
 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
 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
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
 
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
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_ID

public static final int TAG_ID
hex encoding of "V5D\n"

See Also:
Constant Field Values

TAG_VERSION

public static final int TAG_VERSION
char*10 FileVersion

See Also:
Constant Field Values

TAG_NUMTIMES

public static final int TAG_NUMTIMES
int*4 NumTimes

See Also:
Constant Field Values

TAG_NUMVARS

public static final int TAG_NUMVARS
int*4 NumVars

See Also:
Constant Field Values

TAG_VARNAME

public static final int TAG_VARNAME
int*4 var; char*10 VarName[var]

See Also:
Constant Field Values

TAG_NR

public static final int TAG_NR
int*4 Nr

See Also:
Constant Field Values

TAG_NC

public static final int TAG_NC
int*4 Nc

See Also:
Constant Field Values

TAG_NL

public static final int TAG_NL
int*4 Nl (Nl for all vars)

See Also:
Constant Field Values

TAG_NL_VAR

public static final int TAG_NL_VAR
int*4 var; int*4 Nl[var]

See Also:
Constant Field Values

TAG_LOWLEV_VAR

public static final int TAG_LOWLEV_VAR
int*4 var; int*4 LowLev[var]

See Also:
Constant Field Values

TAG_TIME

public static final int TAG_TIME
int*4 t; int*4 TimeStamp[t]

See Also:
Constant Field Values

TAG_DATE

public static final int TAG_DATE
int*4 t; int*4 DateStamp[t]

See Also:
Constant Field Values

TAG_MINVAL

public static final int TAG_MINVAL
int*4 var; real*4 MinVal[var]

See Also:
Constant Field Values

TAG_MAXVAL

public static final int TAG_MAXVAL
int*4 var; real*4 MaxVal[var]

See Also:
Constant Field Values

TAG_COMPRESS

public static final int TAG_COMPRESS
int*4 CompressMode; (#bytes/grid)

See Also:
Constant Field Values

TAG_UNITS

public static final int TAG_UNITS
int *4 var; char*20 Units[var]

See Also:
Constant Field Values

TAG_VERTICAL_SYSTEM

public static final int TAG_VERTICAL_SYSTEM
int*4 VerticalSystem

See Also:
Constant Field Values

TAG_VERT_ARGS

public static final int TAG_VERT_ARGS
int*4 n; real*4 VertArgs[0..n-1]

See Also:
Constant Field Values

TAG_BOTTOMBOUND

public static final int TAG_BOTTOMBOUND
real*4 BottomBound (PHASED OUT)

See Also:
Constant Field Values

TAG_LEVINC

public static final int TAG_LEVINC
real*4 LevInc (PHASED OUT)

See Also:
Constant Field Values

TAG_HEIGHT

public static final int TAG_HEIGHT
int*4 l; real*4 Height[l] (PHASED OUT)

See Also:
Constant Field Values

TAG_PROJECTION

public static final int TAG_PROJECTION
int*4 projection.
  • 0 = generic linear
  • 1 = cylindrical equidistant
  • 2 = Lambert conformal/Polar Stereo
  • 3 = rotated equidistant

    See Also:
    Constant Field Values

  • TAG_PROJ_ARGS

    public static final int TAG_PROJ_ARGS
    int*4 n; real*4 ProjArgs[0..n-1]

    See Also:
    Constant Field Values

    TAG_NORTHBOUND

    public static final int TAG_NORTHBOUND
    real*4 NorthBound (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_WESTBOUND

    public static final int TAG_WESTBOUND
    real*4 WestBound (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_ROWINC

    public static final int TAG_ROWINC
    real*4 RowInc (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_COLINC

    public static final int TAG_COLINC
    real*4 ColInc (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_LAT1

    public static final int TAG_LAT1
    real*4 Lat1 (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_LAT2

    public static final int TAG_LAT2
    real*4 Lat2 (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_POLE_ROW

    public static final int TAG_POLE_ROW
    real*4 PoleRow (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_POLE_COL

    public static final int TAG_POLE_COL
    real*4 PoleCol (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_CENTLON

    public static final int TAG_CENTLON
    real*4 CentralLon (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_CENTLAT

    public static final int TAG_CENTLAT
    real*4 CentralLat (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_CENTROW

    public static final int TAG_CENTROW
    real*4 CentralRow (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_CENTCOL

    public static final int TAG_CENTCOL
    real*4 CentralCol (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_ROTATION

    public static final int TAG_ROTATION
    real*4 Rotation (PHASED OUT)

    See Also:
    Constant Field Values

    TAG_END

    public static final int TAG_END
    See Also:
    Constant Field Values

    NumTimes

    public int NumTimes
    Number of time steps


    NumVars

    public int NumVars
    Number of variables


    Nr

    public int Nr
    Number of rows


    Nc

    public int Nc
    Number of columns


    Nl

    public int[] Nl
    Number of levels per variable


    LowLev

    public int[] LowLev
    Lowest level per variable


    VarName

    public char[][] VarName
    9-character variable names


    Units

    public char[][] Units
    19-character units for variables


    TimeStamp

    public int[] TimeStamp
    Time in HHMMSS format


    DateStamp

    public int[] DateStamp
    Date in YYDDD format


    MinVal

    public float[] MinVal
    Minimum variable data values


    MaxVal

    public float[] MaxVal
    Maximum variable data values


    McFile

    public short[][] McFile
    McIDAS file number in 1..9999


    McGrid

    public short[][] McGrid
    McIDAS grid number in 1..?


    VerticalSystem

    public int VerticalSystem
    Which vertical coordinate system


    VertArgs

    public float[] VertArgs
    Vertical Coordinate System arguments.

          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
          


    Projection

    public int Projection
    Which map projection


    ProjArgs

    public float[] ProjArgs
    Map projection arguments.

          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
          


    CompressMode

    public int CompressMode
    1, 2 or 4 = # bytes per grid point


    FileVersion

    public String FileVersion
    9-character version number

    Method Detail

    v5d_open

    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
    Open a Vis5D file

    Throws:
    IOException
    BadFormException

    v5d_read

    public void v5d_read(int time,
                         int vr,
                         float[] ranges,
                         float[] data)
                  throws IOException,
                         BadFormException
    Read from a Vis5D file

    Throws:
    IOException
    BadFormException

    getUnsignedByte

    public static int getUnsignedByte(byte b)
    Convert a signed byte to an unsigned one, and return it in an int


    getUnsignedShort

    public static int getUnsignedShort(byte b1,
                                       byte b2)
    Convert two signed bytes to an unsigned short, and return it in an int


    getUnsignedInt

    public 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