nasa / SingleDop

Single Doppler Retrieval Toolkit (SingleDop)
Other
54 stars 43 forks source link

Read in netcdf files #16

Closed dcon691 closed 8 years ago

dcon691 commented 8 years ago

Is it possible for singledop to read in netcdf files outputted by Radx? I edited radar data using solo then gridded them using Radx. Is it possible to read in that netcdf file into singledop to do a wind analysis on it?

Thanks!

Code: import pyart from matplotlib import pyplot as plt import numpy as np from scipy import ndimage, signal import time import os import glob import singledop

file = '/nas/rhome/dconrad/QLCS_Tor_Cases/Albertville_20150104/ARMOR/focusTimes/gridded/20150104/ncf_20150104_014241.nc'

radar = pyart.io.read(file)

sd_test = singledop.SingleDoppler2D(L=30.0, radar=radar, range_limits=[0, 100], sweep_number=0, name_vr='V4', thin_factor=[4, 12])

display = singledop.AnalysisDisplay(sd_test) display.four_panel_plot(scale=400, legend=20, return_flag=False, thin=6, levels=-30.0+2.0*np.arange(31), name_vr='VE', name_dz='AZ')

Error:

runfile('/nas/rhome/dconrad/QLCS_Tor_Cases/Albertville_20150104/dual/Singledop/singledop.py', wdir='/nas/rhome/dconrad/QLCS_Tor_Cases/Albertville_20150104/dual/Singledop') Traceback (most recent call last): File "", line 1, in File "/common/pkgs/anaconda_python/3-2.4.0-radar/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 685, in runfile execfile(filename, namespace) File "/common/pkgs/anaconda_python/3-2.4.0-radar/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 85, in execfile exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace) File "/nas/rhome/dconrad/QLCS_Tor_Cases/Albertville_20150104/dual/Singledop/singledop.py", line 19, in radar = pyart.io.read(file) File "/common/pkgs/anaconda_python/3-2.4.0-radar/lib/python3.5/site-packages/pyart/io/auto_read.py", line 121, in read return read_cfradial(filename, **kwargs) # CF/Radial File "/common/pkgs/anaconda_python/3-2.4.0-radar/lib/python3.5/site-packages/pyart/io/cfradial.py", line 150, in read_cfradial _range = _ncvar_to_dict(ncvars['range']) KeyError: 'range'

tjlang commented 8 years ago

By design, SingleDop operates on spherical-coordinate radar data. There are no plans to alter this approach since it is inherent to the mathematical development of the algorithm (Xu et al. 2006). Using Radx to grid the data ahead of time is both unnecessary and sub-optimal. Simply input the original edited radar data in spherical coordinate form.

tjlang commented 8 years ago

Closing this issue since there are no plans to adjust SingleDop to work on gridded datasets.