Skip to content
New issue

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

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

Already on GitHub? # to your account

Add examples for working with Lambert Azimuthal projection (UKV, MOGREPS-UK) #20

Open
AlexHilson opened this issue Jun 18, 2020 · 1 comment

Comments

@AlexHilson
Copy link
Contributor

Code along the lines of the following can be used to turn the lambert azimuthal x / y co-ordinates into lat/lon. It'd be good to get a full example up to show one way of working with regional UK model data.

import pyproj
p = pyproj.Proj("+proj=laea +lon_0=-2.5 +lat_0=54.9 +x_0=0.0 +y_0=0.0 +ellps=GRS80")
# lon, lat = p(x, y, inverse=True)
lon, lat = p(-36000, -158000, inverse=True)
print (lat, lon)

53.47926025120268 -3.0422171310489534

Originally posted by @boristyukin in #19 (comment)

@AlexHilson AlexHilson changed the title Add for working with Lambert Azimuthal projection (UKV, MOGREPS-UK) Add examples for working with Lambert Azimuthal projection (UKV, MOGREPS-UK) Jun 18, 2020
@AlexHilson
Copy link
Contributor Author

Iris regridding docs are at https://scitools.org.uk/iris/docs/latest/userguide/interpolation_and_regridding.html. If the Global data works for you but the UKV data doesn't, this would be one easy method of translating the UKV grid into the Global grid.

The following is written from memory and untested:

import iris

# load data
global_cube = iris.load_cube('global_data.nc')
uk_cube = iris.load_cube('uk_data.nc')

# subset global cube so that it only contains data in the UK area of interest
global_subset = global_cube.intersection(longitude=(-2, 5), latitude=(-50, 60))

result = uk_cube.regrid(global_subset, iris.analysis.Linear)

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

No branches or pull requests

1 participant