Reading an odd-format ascii file

From: Gerry Creager - NOAA Affiliate <gerry.creager_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 22 2013 - 12:55:15 MST

I'd posted this some time in the past, but don't recall seeing a solution.
I had to drop this but am now revisiting it for some upcoming field tests.

I've a file from a Vaisala CL-31 ceilometer, in the "normal" ASCII
representation that I need to read in. I intend to output the thing in a
NetCDF format consistent with what the ARM project has for ceilometer data;
I can handle that once I've got the data read in, I believe... I also want
to be able to plot the backscatter data over time.

I'm particularly stumped by the 4th line of data. The data format is
described in the manual:

*4TH LINE (5TH LINE OF MESSAGE NO. 2)*

*Example: **00000111112222233333........(5 x 770 bytes)↵*

*The two-way attenuated backscatter profile with sensitivity*

*normalized units (100000·srad·km)**-1 **unless otherwise scaled by the*

*SCALE parameter. Each sample is coded with a 20-bit HEX ASCII*

*character set; msb nibble and bit first, 2's complement. The length of*

*this line is equal to 5 times the length of the profile + 2.*

*
*

I'm thinking I should be able to read it in fairly easily to an array, and
operate on the array, then write it back out as NetCDF with the values
already corrected for extinguishment and scaling. However, I've been
unsuccessful to date.

The attached file is a single time sample.

Thanks!

gerry

-- 
Gerry Creager
NSSL/CIMMS
405.325.6731


_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Jan 22 12:55:27 2013

This archive was generated by hypermail 2.1.8 : Wed Jan 23 2013 - 20:38:31 MST