How to plot the pseudo RHI for Rainbow 5 by using vol data format

Hi, I’m just new here.

I want to plot RHI for radar data Rainbow 5, but all the data that I have is in the (.vol) format.
I managed to plot the PPI but couldn’t for RHI. I tried to do with the pyart but it shows “TypeError: Unknown or unsupported file format: UNKNOWN”.

How can I plot the RHI/pseudo RHI for this radar data?
Attached is the link to a sample of my radar data.

Py-ART does not fully support rainbow files - I would suggest using xradar here.

There would not be out-of-the-box support for a pseudo rhi, this is something you would likely need to implement. Taking a look at the file you shared, it looks more like a PPI file than an RHI.

import os
import pyart
import xradar
import cmweather
import numpy as np
import xarray as xr
import as ccrs
import matplotlib.pyplot as plt

import warnings

file1 = "2021110309550500dBZ.vol"

dtree =

# Fubction to add necessaey metadata, in order to export it to cfradial1 format
def correct_cfradial2(dtree):
    data = np.array('axis_z', dtype='|S32')
    attributes = {
        'standard_name': 'primary_axis_of_rotation',
        'options': 'axis_z, axis_y, axis_x'
    # Create the xarray DataArray
    dtree['primary_axis'] = xr.DataArray(data, attrs=attributes, dims=())
    fixed_angles = []
    for grp in dtree.groups:
        if "sweep" in grp:
            fixed_angle = dtree[grp]['sweep_fixed_angle'].values
            dtree[grp]['sweep_mode'] = xr.DataArray(
                np.array(dtree[grp]['sweep_mode'], dtype='|S32'),
                attrs={'standard_name': 'scan_mode_for_sweep',
     'options': 'sector, coplane, rhi, vertical_pointing, idle, azimuth_surveillance, \
     elevation_surveillance, sunscan, pointing, calibration, manual_ppi, manual_rhi'})
    fixed_angles = np.array(fixed_angles, dtype=np.float32)
    sweep_groups = np.array([f'sweep_{i}' for i in range(fixed_angles.size)])
    dtree['sweep_fixed_angle'] = xr.DataArray(fixed_angles, dims=('sweep'))
    dtree['sweep_group_name'] = xr.DataArray(sweep_groups, dims=('sweep'))
    dtree['volume_number'] = xr.DataArray(np.array(0, dtype=np.int16),
    dtree['instrument_type'] = xr.DataArray(np.array('radar', dtype='|S32'),
                                      attrs={'standard_name': 'type_of_instrument',
                                             'options': 'radar, lidar',
                                             'meta_group': 'instrument_parameters'}
    dtree['platform_type'] = xr.DataArray(
        np.array('fixed', dtype='|S32'),
        attrs={'standard_name': 'platform_type',
    'options':'fixed, vehicle, ship, aircraft_fore, aircraft_aft, aircraft_tail, aircraft_belly,\
    aircraft_roof, aircraft_nose, satellite_orbit, satellite_geostat'})
    return dtree

# Apply Correction
dtree = correct_cfradial2(dtree)

# Export to Cfradial1, filename=None, calibs=True)

# Now Let's create PsedudoRHI using Pyart
radar ='')
azi = 10 # Choose any azimuth from 0 to 360
pseudorhi = pyart.util.cross_section_ppi(radar, [azi])
display = pyart.graph.RadarDisplay(pseudorhi)
fig = plt.figure(figsize=[8, 3])
ax = plt.axes()
display.plot_rhi('DBZH', ax=ax, cmap="NWSRef")
ax.set_ylim(0, 20)


For the detailed Notebook, and how I created this animation, check this Notebook



Hi @kmuehlbauer @mgrover1 ,
This Rainbow file required the correct_cfradial2(dtree) function to be applied in order to export it to cfradial1 format and subsequently reading it with PyArt. I’m curious to know if the problem lies with the data or the Rainbow reader. What are your insights on this matter? Could it be possible that we missed adding the necessary metadata when reading the Rainbow file, or is it that the file itself lacks the essential metadata?

Hi, I see
Thank you!

That’s amazing!
I’d try and at the line

# Export to Cfradial1, filename=None, calibs=True)

it shows “AttributeError: module ‘’ has no attribute ‘to_cfradial1’”

How to fix this?

You need to update it, you may use one of the following commands:

conda update xradar -c conda-forge


mamba update xradar -c conda-forge

Thank you so much!

It works!

1 Like

@syedhamidali I think currently only a minimal set of those items are available via .coords. But I think they also do lack proper attrs. Please open an issue at xradar. Thanks!

1 Like