Help with Rainbow AZI file

205 views
Skip to first unread message

Tyler Russell

unread,
Nov 19, 2015, 3:11:33 PM11/19/15
to wradlib-users

Hi All,

Spyder is giving me the following errors at compile...

Traceback (most recent call last):
  File "C:\Users\EMDC METOCEAN\.spyder2\temp.py", line 69, in <module>
    ex_load_rainbow()
  File "C:\Users\EMDC METOCEAN\.spyder2\temp.py", line 26, in ex_load_rainbow
    azi = rbdict['volume']['scan']['slice']['slicedata']['rayinfo']['data']
TypeError: list indices must be integers, not str

Anyone know if this means my data (attached) is not in the right format?  I am using the wradlib Rainbow file example as source code (also above).  Thanks in advance.  

Tyler Russell
2013061908000700dBZ.azi
rainbow_example.py

Kai Mühlbauer

unread,
Nov 19, 2015, 3:41:48 PM11/19/15
to wradli...@googlegroups.com
Hi Tyler,

this has been recently discussed. Please have a look here:

https://groups.google.com/forum/m/#!topic/wradlib-users/ONmEt9VtJ30

This seems the same issue as yours, so please follow the guidelines I showed there.

If that doesn't help you at all, please come back. I'll have a closer look then.

Cheers,
Kai
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Tyler Russell

unread,
Nov 19, 2015, 3:52:54 PM11/19/15
to wradlib-users
Thanks!  I actually didn't know how that function was working and now see that I had the same problem.  Let me try a fix and get back with you.  Thanks Kai!

Tyler

Tyler Russell

unread,
Nov 19, 2015, 7:59:32 PM11/19/15
to wradlib-users, kai.mue...@uni-bonn.de
Kai,

Did a print of the .keys() from the file.  How do I know what needs to go into the dictionary?  In another way, how do I determine which or more of these I need:  rbdict['volume']['scan']['slice']['slicedata']['rayinfo']['data'], etc.  Is that what I need to adjust? Sorry lost with this data, looking to get to an output of doppler derived winds eventually with the .vol files.

Tyler

On Thursday, 19 November 2015 14:41:48 UTC-6, Kai Mühlbauer wrote:

Kai Muehlbauer

unread,
Nov 20, 2015, 3:10:27 AM11/20/15
to wradli...@googlegroups.com
Hi Tyler,

unfortunately in your file are only reflectivities, no doppler velocities.

Attached I adapted the example file to read some data. I also added a
quick explanation on how the rainbow file is laid out.

Hopefully this will help you to extract your wanted data.

Cheers,
Kai

Am 20.11.2015 um 01:59 schrieb Tyler Russell:
> Kai,
>
> Did a print of the .keys() from the file. How do I know what needs to
> go into the dictionary? In another way, how do I determine which or
> more of these I need:
> rbdict['volume']['scan']['slice']['slicedata']['rayinfo']['data'], etc.
> Is that what I need to adjust? Sorry lost with this data, looking to
> get to an output of doppler derived winds eventually with the .vol files.
>
> Tyler
>
> On Thursday, 19 November 2015 14:41:48 UTC-6, Kai Mühlbauer wrote:
>
> Hi Tyler,
>
> this has been recently discussed. Please have a look here:
>
> https://groups.google.com/forum/m/#!topic/wradlib-users/ONmEt9VtJ30
> <https://groups.google.com/forum/m/#!topic/wradlib-users/ONmEt9VtJ30>
>
> This seems the same issue as yours, so please follow the guidelines
> I showed there.
>
> If that doesn't help you at all, please come back. I'll have a
> closer look then.
>
> Cheers,
> Kai
>
> Am 19. November 2015 21:11:32 MEZ, schrieb Tyler Russell
> <opusan...@gmail.com <javascript:>>:
>
>
> Hi All,
>
> Spyder is giving me the following errors at compile...
>
> Traceback (most recent call last):
> File "C:\Users\EMDC METOCEAN\.spyder2\temp.py", line 69, in
> <module>
> ex_load_rainbow()
> File "C:\Users\EMDC METOCEAN\.spyder2\temp.py", line 26, in
> ex_load_rainbow
> azi =
> rbdict['volume']['scan']['slice']['slicedata']['rayinfo']['data']
> TypeError: list indices must be integers, not str
>
> Anyone know if this means my data (attached) is not in the right
> format? I am using the wradlib Rainbow file example as source
> code (also above). Thanks in advance.
>
> Tyler Russell
>
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-user...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Kai Muehlbauer
Meteorological Institute University of Bonn
Auf dem Huegel 20 | +49 228 739083
D-53121 Bonn | kai.mue...@uni-bonn.de
load_rainbow_example.py

Tyler Russell

unread,
Nov 20, 2015, 5:23:25 PM11/20/15
to wradlib-users, kai.mue...@uni-bonn.de
Kai,

Thanks for your help and I'll review this weekend.  Maybe there is more radar data in my .vol files.  I started randomly with the .azi file not knowing what else to try.

Tyler Russell

Tyler Russell

unread,
Dec 4, 2015, 1:01:53 PM12/4/15
to wradlib-users, kai.mue...@uni-bonn.de
Hi Kai,

Thanks so much for your info.  It was helpful!  At this point in time, I'm trying to understand the workflow you used to come up with the solution as I'm trying to learn to "help myself" in the future.  Let me see if I understand from your notes correctly.  First, this is a script, so you were able to decide 'on the fly' what you were doing?  My understanding since I'm new to Python is it runs like Matlab and does not need to compile fully at runtime.  Your steps were:

  1. Open the file from your Downloads folder into a dictionary (still unclear on the term dictionary)
  2. Print the slicedata keys from the loaded dictionary
  3. Print the rayinfo from the dictionary
  4. Radar data has 2 azimuth arrays (2 different elevations?)  - Index the printed information to zeroth spot on array
  5. Print the rawdata keys from the dictionary
  6. Extract the reflectivity data and apply a formula to do some sort of normalization?
  7. Extract the ranges from the dictionary (turned out they were broken - how did you know this?)
  8. Print out the "shape" data to find the problem in the r.shape
  9. Fix the r.shape by applying zeros to the array?
  10. Make annotation data
  11. Plot the annotation data
You then provided me code that would help me inspect the dictionaries.  Thanks! 

Appreciate all your help on this....sorry for the newbie questions, but I'm just unfamiliar.  Once I understand, I should be able to handle the coding...

Tyler
 
On Friday, 20 November 2015 02:10:27 UTC-6, Kai Muehlbauer wrote:

Tyler Russell

unread,
Feb 12, 2016, 2:52:19 PM2/12/16
to wradlib-users, kai.mue...@uni-bonn.de
Kai,

Thanks for helping earlier.  Any comments on the below would get me a long ways.  I am working with a vendor to get me some velocity data, but I feel like I should learn how to use the wradlib  library on the dbz files before we move on.  

Also, you mentioned in the comments that the array the Rainbow file format is very versatile and can change.  Does that mean that I have to examine each file and adapt code for each one?  When the data set is delivered, I will have approximately 300,000 files!  

Thanks again!

Tyler Russell


On Friday, December 4, 2015 at 12:01:53 PM UTC-6, Tyler Russell wrote:
Hi Kai,

Thanks so much for your info.  It was helpful!  At this point in time, I'm trying to understand the workflow you used to come up with the solution as I'm trying to learn to "help myself" in the future.  Let me see if I understand from your notes correctly.  First, this is a script, so you were able to decide 'on the fly' what you were doing?  My understanding since I'm new to Python is it runs like Matlab and does not need to compile fully at runtime.  Your steps were:

  1. Open the file from your Downloads folder into a dictionary (still unclear on the term dictionary)
  2. Print the slicedata keys from the loaded dictionary
  3. Print the rayinfo from the dictionary
  1. Radar data has 2 azimuth arrays (2 different elevations? Indexed 0 and 1?)  - Index the printed information to zeroth spot on array

Kai Muehlbauer

unread,
Feb 18, 2016, 3:02:43 AM2/18/16
to Tyler Russell, wradlib-users
Tyler,

to understand more of the Rainbow5 data format, you have to read the
"Instruction Manual Rainbow5 File Format". This usually comes with every
Selex (Gematronik) Software. So asking your data vendor to get access to
this manual might be a good idea.

In this manual the data file layout is extensively described.

Also your data vendor surely knows, what data (scantype, moments) is in
the provided files.

What wradlib is doing, it imports the rainbow data regardless of knowing
what is inside into a python dictionary. Then user has to know how to
handle the data inside the dictionary.

wradlib provides just an example on what to do and where to look.

I encourage you to play with the imported dictionaries, find out whats
inside etc. If you have problems with it, I suggest that you provide the
data file and a problem description so that we or other wradlib users
might help with the problem.

Cheers,
Kai



Am 12.02.2016 um 20:52 schrieb Tyler Russell:
> Kai,
>
> Thanks for helping earlier. Any comments on the below would get me a
> long ways. I am working with a vendor to get me some velocity data, but
> I feel like I should learn how to use the wradlib library on the dbz
> files before we move on.
>
> Also, you mentioned in the comments that the array the Rainbow file
> format is very versatile and can change. Does that mean that I have to
> examine each file and adapt code for each one? When the data set is
> delivered, I will have approximately 300,000 files!
>
> Thanks again!
>
> Tyler Russell
>
> On Friday, December 4, 2015 at 12:01:53 PM UTC-6, Tyler Russell wrote:
>
> Hi Kai,
>
> Thanks so much for your info. It was helpful! At this point in
> time, I'm trying to understand the workflow you used to come up with
> the solution as I'm trying to learn to "help myself" in the future.
> Let me see if I understand from your notes correctly. First, this
> is a script, so you were able to decide 'on the fly' what you were
> doing? My understanding since I'm new to Python is it runs like
> Matlab and does not need to compile fully at runtime. Your steps were:
>
> 1. Open the file from your Downloads folder into a dictionary
> (still unclear on the term dictionary)
> 2. Print the slicedata keys from the loaded dictionary
> 3. Print the rayinfo from the dictionary
> 4. Radar data has 2 azimuth arrays (2 different elevations? Indexed
> 0 and 1?) - Index the printed information to zeroth spot on array
> 5. Print the rawdata keys from the dictionary
> 6. Extract the reflectivity data and apply a formula to do some
> sort of normalization?
> 7. Extract the ranges from the dictionary (turned out they were
> broken - how did you know this?)
> 8. Print out the "shape" data to find the problem in the r.shape
> 9. Fix the r.shape by applying zeros to the array?
> 10. Make annotation data
> 11. Plot the annotation data
> > <mailto:wradlib-user...@googlegroups.com>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
Reply all
Reply to author
Forward
0 new messages