Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in gridding or cfradial code. #768

Closed
zssherman opened this issue Sep 19, 2018 · 3 comments
Closed

Possible bug in gridding or cfradial code. #768

zssherman opened this issue Sep 19, 2018 · 3 comments

Comments

@zssherman
Copy link
Collaborator

zssherman commented Sep 19, 2018

After reading in a cfradial file. I tried to grid using:

grids1 = pyart.map.grid_from_radars(
    (radar, ), grid_shape=(15, 251, 251),
    grid_limits=((0, 15000.0), (-50000, 50000), (-50000, 50000)),
    fields=['reflectivity'], gridding_algo="map_gates_to_grid",
    weighting_function='BARNES', min_radius=500.0)
grids2 = pyart.map.grid_from_radars((radar, ), grid_shape=(15, 251, 251),
    grid_limits=((0, 15000.0), (-50000, 50000), (-50000, 50000)),
    fields=['reflectivity'], gridding_algo="map_to_grid",
    weighting_function='BARNES', min_radius=500.0)

And receive an error:

~/dev/pyart/pyart/map/grid_mapper.py in map_to_grid(radars, grid_shape, grid_limits, grid_origin,
grid_origin_alt, grid_projection, fields, gatefilters, map_roi, weighting_function, toa, copy_field_data, 
algorithm, leafsize, roi_func, constant_roi, z_factor, xy_factor, min_radius, h_factor, nb, bsp, **kwargs)
    489         # add gate locations to gate_locations array
    490         start, end = gate_offset[iradar], gate_offset[iradar + 1]
--> 491         gate_locations[start:end, 0] = zg_loc.flat
    492         gate_locations[start:end, 1] = yg_loc.flat
    493         gate_locations[start:end, 2] = xg_loc.flat
ValueError: setting an array element with a sequence.

The code fails using the map_to_grid algorithm. But the reason I mentioned cfradial code is that when I read in a raw sigmet file, the code works. But if I use a radar file that has been written using pyart.io.write_cfradial I encounter this error.

Will be looking into this more soon.

@scollis
Copy link
Member

scollis commented Jan 22, 2020

@zssherman did you discover anything?

@zssherman
Copy link
Collaborator Author

Yeah this should have been fixed with:
rtanamachi#1

@zssherman
Copy link
Collaborator Author

closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants