ACHMartin / seastar_project

4 stars 0 forks source link

Lat / Lon coordinate building #193

Closed DavidMcCann-NOC closed 1 year ago

DavidMcCann-NOC commented 1 year ago

There is a problem with the way the latitude and longitude coordinates are built. Currently they are created using the LatImage, LonImage or OrbLatImage, OrbLonImage variables in the OSCAR datasets.

Like all of the other data arrays there are NaNs present in these variables (e.g., those sloping edges to the aquisitions) which mean that building the coordinates like:

level2.coords['longitude'] = level1.sel(Antenna='Fore').LonImage level2.coords['latitude'] = level1.sel(Antenna='Fore').LatImage

results in NaNs present in longitude and latitude. This causes issues when trying to plot with xarray, for example, as imshow doesn't like having non-numeric or masked values in the coordinate axes.

Additionally this has until now prevented the use of joining the beam datasets by 'outer', which would be preferable.

Either we need to:

DavidMcCann-NOC commented 1 year ago

A visual example:

LatImage from the Mid antenna image Fore antenna image Aft antenna image

So we have CrossRange, GroundRange coordinates in each dataset that go further than the data present in LatImage and LonImage. It might be as simple as adding lat/lon as coordinates to each dataset before xr.concat in merge_beams. I'll try this next