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

[Datastream #MZN-388937]: lightning data, td9603



Hi Nancy,

First, I apologize for the silence...

re:
> I was wondering if you had ever heard from UAlbany?

No, but I just read the code that creates the binary
data records for the NLDN data in the IDD LIGHTNING
datastream.  Just so you know: that is your source of data also.
David W is providing the IDD data to you; you are not
using the binary-packed data that is available on NOAAPort (that
data is reserved for Weather Service use).

Here is what the code does with the original 1-byte signal value from:

   int curr;
 ...
          curr = getc(stdin);
          if (curr > 127) {
            kamps = -((curr - 128) * 2);
          } else {
            kamps = (curr * 2);
          }

...
      isig = 10*150*(kamps/30.0);
      (void)swbyt2(&isig,1);

The byte-swapped value of 'isig' is what gets sent out in
the binary NLDN record for the IDD LIGHTNING datastream.

So it looks like you need to the following to get the
signal in kiloamps:

kamps = (30 * isgnl / (10*150)) / 2

Your (David W's) code is doing all of this except the final
division by 2.

I hope that this helps!

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: MZN-388937
Department: Support Datastream
Priority: Urgent
Status: Closed