Transfer Sigmet(Iris) RAW data to human-readable format

754 views
Skip to first unread message

Chou Tat Hoi

unread,
Aug 27, 2015, 4:51:53 AM8/27/15
to Py-ART Users
Dear All,

I am trying to transfer iris raw data to human-readable format. While I follow the "RAW Product Example" in Programmer's Manual to transfer our dual-polarization RAW data, it shows a strange result. Here shows my temp code with Python. Should I decode the file to utf-8 or other format ?  The example in manual just show one record (V) how about the structure of others, such as dBZ, KDP...etc. Which python code in pyart is used to do the Sigmet(Iris) RAW data transfer? May be I could learn in that code. Thank you for your kindly assistance.



ifile = codecs.open('XXXXX.RAWXXXX,'rb')


raw_prod_bhdr = ifile.read(12)
ingest_data_header = ifile.read(76)

ifile.seek(90)
start_az = ifile.read(2)
start_el = ifile.read(2)

print ("raw_prod_bhdr",raw_prod_bhdr)
print ("ingest_data_header",ingest_data_header)
print ("start_az",start_az)
print ("start_el",start_el)

Scott Collis

unread,
Aug 27, 2015, 8:54:55 AM8/27/15
to pyart...@googlegroups.com
Hey Chou,
Have you tried a simple pyart.io.read(filename)
We already have an ingest for IRIS

No need to reinvent the wheel.. if it does not work let us know.

Cheers,
Scott
--
You received this message because you are subscribed to the Google Groups "Py-ART Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyart-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
I ride for Parkinsons research http://www.events.org/sponsorship.aspx?id=51573

Jonathan Helmus

unread,
Aug 27, 2015, 9:16:56 AM8/27/15
to pyart...@googlegroups.com
Chou,

    If you are interested in the low level layout of IRIS files checkout out the SigmetFile class [1] in Py-ART.  This class is responsible for unpacking the binary data in IRIS files and converting those structures into something more human-readable.  The source code for the class is written in Cython but may be of help [2]. 

If your goal is to read the data in the file, then use Scott's suggestion, pyart.io.read.

Cheers,

    - Jonathan Helmus


[1] http://arm-doe.github.io/pyart-docs-travis/dev_reference/generated/pyart.io._sigmetfile.SigmetFile.html
[2] https://github.com/ARM-DOE/pyart/blob/master/pyart/io/_sigmetfile.pyx

Chou Tat Hoi

unread,
Aug 27, 2015, 10:12:13 PM8/27/15
to Py-ART Users
Dear Jonathan & Scott,

I am just a beginner in radar or Python. And I would like to learn how Pyart read/decode the Sigmet format because I need to transfer and QC the data from Sigmet data to WRF. Below shows my problem after trying your suggestions. Thank you so much for your help.

1. I try the pyart.io.read function but it shows below issue.  If it is ok?  Where could I find / how to show the output result?

    

2. I try to run the "pyart.io._sigmetfile", and it shows below error. It seems cimport is not allow in my Python complier. I think I should find a way to learn Cython. (My OS is Win 7 32-bit)



Jonathan Helmus於 2015年8月27日星期四 UTC+8下午9時16分56秒寫道:
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Jonathan Helmus

unread,
Aug 28, 2015, 10:31:13 AM8/28/15
to pyart...@googlegroups.com
The warnings you are seeing from the pyart.io.read function indicate that your file contains some radar fields which Py-ART does not support, the other fields are still available just not those mentioned.  Support for reading sigmet type 18 data, SQI, was added to Py-ART two months ago [1] but may not be in the version of Py-ART you have installed.  Py-ART does not support type 55 data, HCLASS, at this time.

     Having read in data from the file you can display the data visually using the RadarDisplay class.  The Py-ART documentation have an example which shows how to do exactly this, http://arm-doe.github.io/pyart/dev/auto_examples/plotting/plot_ppi_sigmet.html.  If you want to quickly display information about the data you can use radar.info() to print out a description of the data.

The _sigmetfile.pyx module is a Cython module which must be compiled, it cannot be used like a Python module.  You can read more about Cython at, http://cython.org/.  Your installation of Py-ART should include a compiled version from which you can use the SigmetFile class as follows:

    import pyart
    sfile = pyart.io._sigmetfile.SigmetFile('XSW110520105408.RAW7HHF')

sfile is an instance of the SigmetFile class which provides low level access to data from Sigmet/IRIS files which is documented in the Developers Reference Manual [2].  Access data from Sigmet files in this manner is not the preferred method within Py-ART, using pyart.io.read_sigmet which returns a Radar instance in much preferred.

Cheers,

    - Jonathan Helmus


[1] https://github.com/ARM-DOE/pyart/pull/332
[2] http://arm-doe.github.io/pyart-docs-travis/dev_reference/generated/pyart.io._sigmetfile.SigmetFile.html

Chou Tat Hoi

unread,
Aug 30, 2015, 9:15:20 PM8/30/15
to Py-ART Users
Dear Jonathan,

Thank you, you help us a lots. I could output dBZ value now. I will learn more about Python then try the corrdinate transformation and transfer the data to WRF.

Jonathan Helmus於 2015年8月28日星期五 UTC+8下午10時31分13秒寫道:
Reply all
Reply to author
Forward
0 new messages