Look at structure of the example dataset in ToolsUI:
Look at the example dataset as a radial type and a raster type:
The Level III data is separated into the following blocks:
We identify that this is a Level III data file by reading some of
the
header record. We check the first 25 byte of the data file to search
for the "data
set ID" information which contains a string: "SDUS", that is a LDM
identifier of NEXRAD Level III product.
In this API we get all of the information:
dimensions, attributes, and variables and use them to create
NetcdfFile object. The information needed to construct these
objects is contained throughout the whole dataset.
for(int i=0; i<sinfo.nlayers ; i++ ){
while (icount < Divlen_length ) {
switch(pkcode)
{
case 18: // DPA
case 17: // (pkcode == 0x11) Digital Precipitation Array
break;
case 10: // unlinked vector packet
break;
case 1: // text and special symbol packet
break;
case 2: // text and special symbol packets
break;
case 8: //text string
break;
case 3: // Special graphic symbol packet
case 11: // Special graphic symbol packet
case 25: // Circle packet
break;
case 12: //TVS
break;
case 13: // hail positive
break;
case 14: // hail probable
break;
case 4: // wind barb
break;
case 5: // Vector Arrow Data
break;
case 23: // past position data packet
case 24: // forecast position data packet
while (poff < plen){
int pcode = bos.getShort()
switch (pcode) {
case 2: // text and special symbol packets
break;
case 6: // linked vector packet
break;
case 25: // Circle packet
break;
}
break;
default:
if ( pkcode == 0xAF1F ) { /* radial image */
hedsiz += pcode_radial( bos, hoff, hedsiz, isZ, uncompdata, pinfo.threshold) ;
break;
}
else if (pkcode == 0xBA0F ||pkcode == 0xBA07 ) { /* raster image */
hedsiz += pcode_raster( bos, (short)pkcode, hoff, hedsiz, isZ, uncompdata);
break;
}
else {
out.println( "error reading pkcode equals " + pkcode);
throw new IOException("error reading pkcode, unable to handle the product with code " + pkcode);
}
} //end of switch
}
klayer = klayer + Divlen_length + 6;
}
The readData() method is where we implement reading the data from
disk.
The level III data with radial data formats can be
contained in two dimensional arrays:
dimensions:Level III data with radial data format uses polar coordinates (elevation, azimuth, distance) to describe the location of its points in space, and it is referred as Radial Coordinate System. A Radial Coordinate System has a Elevation, Azimuth, and Distance coordinate axis. It may also has a Time coordinate axis. Generally, in our level II and level III radar products, there is a time variable at radial (elevation, azimuth), or sweep (elevation) level, so it is considered as a variable, rather than coordinate axis.
azimuth = 367;
gate = 230;
variables:
byte BaseReflectivity_RAW(azimuth=367, gate=230);
:long_name = "BREF: Base Reflectivity";
:units = "dbZ";
:_CoordinateAxes = "elevation azimuth gate rays_time latitude longitude altitude";
float BaseReflectivity(azimuth=367, gate=230);
:long_name = "BREF: Base Reflectivity";
:units = "dbZ";
:_CoordinateAxes = "elevation azimuth gate rays_time latitude longitude altitude";
dimensions:
x = 116;
y = 116;
variables:
byte EchoTop_RAW(y=116, x=116);
:long_name = "TOPS: Echo Tops";
:units = "K FT";
:_CoordinateAxes = "x y time latitude longitude altitude";
float EchoTop(y=116, x=116);
:long_name = "TOPS: Echo Tops";
:units = "K FT";
:_CoordinateAxes = "x y time latitude longitude altitude";
Level III data with raster data format uses FlatEarth Projection. This
projection surface is tangent at some point (lat0, lon0) and has a y
axis rotated from true North by some angle. We call it "flat" because
it should only be used where the spherical geometry of the earth is not
significant.
dimensions:
textStringSize = 1;
row = 13;
box = 13;
variables:
byte PrecipArray_0(Row=131, Box=131);
:long_name = "PRET: Hourly Digital Precipitation Array at Symbology Layer 0";
:units = "KM";
Structure {
short x_start;
:units = "KM";
short y_start;
:units = "KM";
String textString;
:units = "";
} textStruct_code1(textStringSize);
:long_name = "text and special symbol for code 1";