Unidata / LDM

The Unidata Local Data Manager (LDM) system includes network client and server programs designed for event-driven data distribution, and is the fundamental component of the Unidata Internet Data Distribution (IDD) system.
http://www.unidata.ucar.edu/software/ldm
Other
43 stars 27 forks source link

Enhance pqing(1) to ingest GRIB-2 products #29

Closed semmerson closed 8 years ago

semmerson commented 9 years ago

From ESupport ticket ZNI-140417:

Within the pqing source directory, there is a file, wmo_message.c. Within that file, there is a function, ids_len. This function is called to calculate the length of the GRIB bulletin. The original function assumed that the data is GRIB 1 format. I made the following changes to the function (I account for the GRIB version) to calculate the message length, recompiled pqing and the changes corrected the problem.

static int
ids_len(const char *cp)
{
    int len;
    const unsigned char *up;
    int vers = *(cp+7);
    if (vers == 1) {
        up = (const unsigned char *)cp + IDS_LEN -1 ;
        len = *up++ * 256 *256;
        len += *up++ * 256;
        len += *up;
    }
    else {
        up = (const unsigned char *)cp + 8 ;
        len = *up++ * 256 *256 * 256 *256 *256 *256 *256;
        len += *up++ * 256 *256 * 256 *256 *256 *256;
        len += *up++ * 256 *256 * 256 *256 *256;
        len += *up++ * 256 *256 * 256 *256;
        len += *up++ * 256 *256 * 256;
        len += *up++ * 256 *256;
        len += *up++ * 256;
        len += *up;
    }
    return len;
}
semmerson commented 8 years ago

Will be in the release after 6.12.14.