-
Notifications
You must be signed in to change notification settings - Fork 17
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
ENH: Consider adding lat, lon and alt option in georeferencing #243
Comments
@syedhamidali Thanks for this proposal. In #25 (comment) I've proposed to just implement radar coordinates as During enhancing plotting capabilities we've finally implemented a way to use the There is also work still going on to build this From my perspective we should not implement the conversion/transformation into xradar as proposed in #244, but guide users how to do this with these external libraries (which they might use anyway in further processing). When using our new If we (ping @openradar/developers) still want to have this functionality available from ds = ds.xradar.georeference(crs=trg_crs, names={"x": "lon", "y": "lat", "z": "alt"}) Internally we would setup Here is the functionality as MCVE: import numpy
import xarray as xr
import xradar
from pyproj import CRS, Transformer, transform
from open_radar_data import DATASETS
filename = DATASETS.fetch("cfrad.20080604_002217_000_SPOL_v36_SUR.nc")
radar = xd.io.open_cfradial1_datatree(filename, first_dim="auto")
swp = radar["sweep_0"].to_dataset().xradar.georeference()
src_crs = swp.xradar.get_crs()
trg_crs = CRS.from_user_input(4326)
names = {"x": "lon", "y": "lat", "z": "alt"}
transformer = Transformer.from_crs(src_crs, trg_crs)
(trg_x, trg_y, trg_z) = transformer.transform(swp.x, swp.y, swp.z)
swp = swp.assign_coords({
names.get("x", "x"): (swp.x.dims, trg_x),
names.get("y", "y"): (swp.y.dims, trg_y),
names.get("z", "z"): (swp.z.dims, trg_z),
})
display(swp)
|
Also pinging @openradar/xradar for feedback. |
@kmuehlbauer |
The major pain point is the last two bullet points of my above comment which also have to be addressed. I have hope, that those issues would be fixed in a possible dedicated package as laid out in that other xarray issue pydata/xarray#2288. |
There you go: https://github.com/benbovy/xproj :-) Still at the stage of a rough proof-of-concept, though. Feedback is welcome! |
Thanks @benbovy for advertising |
Description
The current georeferencing in xradar provides Cartesian coordinates (x, y, z), but there’s no direct option to include geographic coordinates (lat, lon, and alt). Adding this feature would enhance usability for users needing georeferenced datasets in geographic space.
What I Did
Attempted to use georeferencing with geo=True
The text was updated successfully, but these errors were encountered: