How to get geographic information of CAPPI at each altitude

94 views
Skip to first unread message

Hiromitsu Ikeda

unread,
Jan 29, 2021, 11:58:11 AM1/29/21
to wradlib-users
Hello, Everyone.

I would like to use Matplotlib's "Basemap" to draw the data for each altitude plane of the CAPPI data. Is it possible to get the latitude / longitude information corresponding to the data of each altitude plane in the array format?
I am dealing with GAMIC data, and it has been confirmed that geographic information can be obtained at each elevation angle at the following URL.

Please tell me if there is a way.

Regards,
Ikeda


Kai Muehlbauer

unread,
Mar 22, 2021, 8:44:38 AM3/22/21
to wradli...@googlegroups.com
Hi Ikeda,

for GAMIC radar data the easiest approach is to use the xarray ODIM reader:

radar_vol = wrl.io.open_odim(filename, flavour="GAMIC")

You can extract the wanted sweep like this (where N is the actual sweep
number):

swp = radar_vol[N].data

Now you can proceed with georeferencing:

swp = swp.pipe(wrl.georef.georeference_dataset)

Note: this creates x/y coordinates in azimuthal-equidistant projection.

Now you can plot on maps using xarray/cartopy like this:

import cartopy.crs as ccrs
map_proj = ccrs.PlateCarree()
aeqd = ccrs.AzimuthalEquidistant(central_latitude=swp.latitude.values,
central_longitude=swp.longitude.values,
)
fig = pl.figure(figsize=(10, 10))
ax = fig.add_subplot(111, projection=map_proj)
# you would need to subset here since we have a time dimension
swp.DBZH[0].plot(x="x", y="y", transform=aeqd)
ax.gridlines(draw_labels=True)

If you just want to have the coordinates in wgs84 or any other system,
you can move forward with:

wgs84 = wrl.georef.epsg_to_osr(4326)
swp = swp.pipe(wrl.georef.georeference_dataset, proj=wgs84)
lon = swp.x.values
lat = swp.y.values

Please also refer to the docs here:

https://docs.wradlib.org/en/stable/notebooks/fileio/wradlib_xarray_radial_odim.html
https://docs.wradlib.org/en/stable/notebooks/fileio/wradlib_odim_multi_file_dataset.html


HTH,
Kai

Am 29.01.21 um 17:58 schrieb Hiromitsu Ikeda:
> --
> 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>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/wradlib-users/a96f721a-8fe0-4762-bf6e-02120a60c23an%40googlegroups.com
> <https://groups.google.com/d/msgid/wradlib-users/a96f721a-8fe0-4762-bf6e-02120a60c23an%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Kai Muehlbauer
Institute of Geosciences, Meteorology Section, University of Bonn
Auf dem Huegel 20 | +49 228 739083
D-53121 Bonn | kai.mue...@uni-bonn.de

Kai Muehlbauer

unread,
Mar 22, 2021, 8:48:37 AM3/22/21
to wradli...@googlegroups.com
Hi Ikeda,

I just now see that you are referring to CAPPI. That would involve
keeping track of the coordinates for several sweeps and might not be as
easy as shown in my other message for a single sweep.

A complete CAPPI example including georeferencing and map-making would
be a good addition to our documentation. Please open a feature request
in the wradlib github issue tracker.

Cheers,
Kai

Am 22.03.21 um 13:44 schrieb Kai Muehlbauer:
Reply all
Reply to author
Forward
0 new messages