[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Datastream #PAV-878843]: Nexrad level III format spec



Hi Eric,

re: which NEXRAD Level III ICD to use
> Thanks.

No worries.

re:
> One last one in case you know offhand.... I have looked in the documentation 
> for the
> answer, unsuccessfully.
> 
> The file I downloaded looks like this if you open it with a txt reader.
> 
> ?
> 497
> SDUS35 KVEF 221551
> N1PLAS
> x?m?hG??~??z??nCR????H?F?????P???D?""I
> ...
> ...
> 
> The initial text header portion before the binary portion is not documented 
> anywhere
> that I can find.

NEXRAD Level III products distributed in the NOAAPort SBN should be documented 
in a
NOAAPort ICD.  Our NOAAPort SBN ingest code simply takes the products as sent in
the SBN and puts them unaltered into an appropriate LDM/IDD datastream like
NEXRAD3 for the NEXRAD Level III products.

re:
> I assume that the message header shown in figure 3.3 likely begins
> thereafter.  I don't know how many bytes to skip over and whether the text 
> portion
> shown will always be the same size.  Are you familiar with this?

Yes, we are familiar with the different ways that NEXRAD Level III products
will be formatted depending on their origin (e.g., downloaded using FTP
from NOAA; sent in the NOAAPort SBN; distributed by WSI, etc.).  The tricky
part is that each way the data can be gotten will result in slightly different
formats.  The software that we make available (e.g., GEMPAK/NAWIPS, McIDAS-X,
AWIPS-II, the IDV, and the TDS) all incorporate code that can handle all
of the possible differences in NEXRAD Level III format.

To answer your specific question, I think it is easiest to show you a snippit
of code that I wrote for use of the NEXRAD Level III products in McIDAS-X.
Consider:

      char           *p;                    /* generic pointer               */
      char            buf[101]={0};         /* working buffer                */

      /*
      ** Copy the first 100 bytes to the working buffer and null terminate it
      ** so it can be treated like a string.
      */

      (void) memcpy( buf, data, (size_t)100 );
      *(buf+100) = 0;

      /*
      ** Look for "lines" of information in buf.  A "line" of information
      ** is terminated by a sequence of 'CR CR NL' (\r\r\n).  The number
      ** of lines of information will indicate the NEXRAD product origin:
      **
      **        # lines  type  Origin
      **        -------  ----  ------------------------
      **           0       0   WSI
      **           1       1   NOAAPORT like: PIL
      **           2       2   NOAAPORT like: WMO + PIL
      **           3       3   NOAAPORT like: seq + WMO + PIL
      **           4       4   NOAAPORT LDM/SDI: SOH + seq + WMO + PIL
      **          >4      -1   unknown
      **
      ** For WSI NIDS images, the station ID will be found in a separate
      ** record at the end of the file.
      **
      ** In any of the NOAAPORT cases, the station ID will be assumed to be
      ** 6 bytes before the product header.  The offset from the beginning
      ** of the file to the product header is saved in the 'hoff' element
      ** of the 'cur' structure.
      */

      cur->type = 0;
      l = buf;
      while ( (p=strstr((const char *) l, "\r\r\n")) != (char *) NULL ) {
        l = p + 3;
        cur->type++;
      }
      cur->hoff = l - buf;

    } else {

      l = data + cur->hoff;

    }

In this snippit, cur->hoff is the offset into the product where the actual
beginning of the NEXRAD Level III product starts.  Perhaps this is enough
to get you going?

Cheers,

Tom
--
****************************************************************************
Unidata User Support                                    UCAR Unidata Program
(303) 497-8642                                                 P.O. Box 3000
address@hidden                                   Boulder, CO 80307
----------------------------------------------------------------------------
Unidata HomePage                       http://www.unidata.ucar.edu
****************************************************************************


Ticket Details
===================
Ticket ID: PAV-878843
Department: Support Datastream
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.