# Read\_grid can't read output from write\_grid

**URL:** <https://openradar.discourse.group/t/read-grid-cant-read-output-from-write-grid/388>\
**Category:** Python\
**Created:** [January 25, 2024, 4:12pm UTC](https://openradar.discourse.group/t/read-grid-cant-read-output-from-write-grid/388 "2024-01-25T16:12:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaimeherriott](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/jaimeherriott/32/312_2.png) [@jaimeherriott](https://openradar.discourse.group/u/jaimeherriott)\
**Post date:** [January 25, 2024, 4:12pm UTC](https://openradar.discourse.group/t/read-grid-cant-read-output-from-write-grid/388/1 "2024-01-25T16:12:13Z")

</div>

So I am running Pyart version: 1.16.0 and I’m having issues with the time dimension reading in improperly. Details below:

NetCDF files were created using the function pyart.core.Grid.write(), e.g.,  
ncGrid = pyart.map.grid\_from\_radars(umassxpol, grid\_shape=(41,241,241),  
grid\_limits=((0,10000),(0,60000),(-30000,30000)),  
weighting\_function=‘BARNES2’,gatefilters=gf\_despeckeld)  
ncGrid.write(‘V08.nc’)

Running “ncdump -h V08.nc” shows that the time dimension is 1:  
ncdump -h V08.nc  
netcdf V08 {  
dimensions:  
time = UNLIMITED ; // (1 currently)  
z = 41 ;  
y = 241 ;  
x = 241 ;  
nradar = 1 ;  
nradar\_str\_length = 8 ;  
…}

However, when we try to read in the file V08.nc using pyart.io.read\_grid(‘V08.nc’), the following error message is produced for every variable in the file, and no data are read in.  
UserWarning: Field ZD skipped due to incorrect shape (2875, 41, 241, 241)

read\_grid seems to think the time dimension is 2875, not 1. I have no idea where the value 2875 comes from, as it doesn’t correspond to any dimension in the original data.

The problem seems to be confined specifically to this data set. The workflow works fine on other data sets from the same radar.

It’s impractical to produce a minimum working example (MWE) for this issue because it would require uploading all the radar files somewhere, and they’re quite voluminous (1.7 G). Sharing a single example file that’s causing the problem (V08.nc, 14 MB) might be more practical.

The output of both ncGrid.time and ncGrid.radar\_time only have 1 dimension (i.e. a single time.)

Any ideas?

Thanks,  
Jaime

---

<div class="post-metadata">

**Author:** ![mgrover1](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/mgrover1/32/7_2.png) [@mgrover1](https://openradar.discourse.group/u/mgrover1)\
**Post date:** [January 25, 2024, 7:30pm UTC](https://openradar.discourse.group/t/read-grid-cant-read-output-from-write-grid/388/2 "2024-01-25T19:30:58Z")

</div>

Can you share a single file as an example to debug with? And open an issue on the Py-ART github?

> **[Issues · ARM-DOE/pyart](https://github.com/ARM-DOE/pyart/issues)**
>
> The Python-ARM Radar Toolkit. A data model driven interactive toolkit for working with weather radar data. - Issues · ARM-DOE/pyart

---

<div class="post-metadata">

**Author:** ![jaimeherriott](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/jaimeherriott/32/312_2.png) [@jaimeherriott](https://openradar.discourse.group/u/jaimeherriott)\
**Post date:** [January 29, 2024, 4:33pm UTC](https://openradar.discourse.group/t/read-grid-cant-read-output-from-write-grid/388/3 "2024-01-29T16:33:57Z")

</div>

Attached is one of the files. I’ll also open the issue on Py-Art github. Thanks!

> **[V11.nc](https://drive.google.com/file/d/1s1Bh2xXuyOXD3MztmC-xFnskBjQFq8Wn/view?usp=sharing)**
>
> Google Drive file.
