To convert between LON, LAT coordinates and EASE(2) grid ROW, COL.
Project description
ease_lonlat
Small package to convert given geographic coordinates (longitude, latitude) to EASE(2)-grid coordinates (col, row) and vice versa.
This code is inspired by the 'easeconv-0.3' software, the EASE-Grid map transformation utilities Developed and distributed by the National Snow & Ice Data Center (NSIDC), University of Colorado at Boulder. But instead of defining projections and grids "from a scratch", the pyproj library and definition of grids from NSIDC have been used.
MOTIVATION
Get SMOS (CATDS, 25km, global projection) row and col coordinates corresponding to the pixel of EASE2 grid with given lon-lat coordinates.
SUPPORTED GRIDS
'N' stands for North Polar (Lambert's equal-area, azimuthal), 'S' for South Polar (Lambert's equal-area, azimuthal) and 'G' for Global (cylindrical, equal-area) projection. 3125km means pixel size of 3.125 km, 625 means 6.25 km and 125 means 12.5 km.
- EASE2_G1km
- EASE2_G3km, EASE2_N3km, EASE2_S3km
- EASE2_G3125km, EASE2_N3125km, EASE2_S3125km
- EASE2_G625km, EASE2_N625km, EASE2_S625km
- EASE2_G9km, EASE2_N9km, EASE2_S9km
- EASE2_G125km, EASE2_N125km, EASE2_S125km
- EASE_G125km, EASE_N125km, EASE_S125km
- EASE2_G25km, EASE2_N25km, EASE2_S25km
- EASE_G25km, EASE_N25km, EASE_S25km
- EASE2_G36km, EASE2_N36km, EASE2_S36km
TESTED GRIDS
Tested on SMAP data. EASE2-grids - 9km (N, S, G), 36km (N, G).
NOT TESTED GRIDS
If you can test this code on some of the not tested grids, I would appreciate if you do it and let me know :) Especially EASE grids.
- EASE-grids - all.
- EASE2-grids - 1km, 3km, 3.125km, 6.25km and 25km
USAGE
from ease_lonlat import EASE2GRID, SUPPORTED_GRIDS
# define new grid by yourself
grid = EASE2GRID(name='EASE2_G36km', epsg=6933, x_min=-17367530.45, y_max=7314540.83, res=36032.22, n_cols=964, n_rows=406)
# or using parameters taken from NSIDC and kept in SUPPORTED_GRIDS
grid = EASE2GRID(name='EASE2_G36km', **SUPPORTED_GRIDS['EASE2_G36km'])
# convert longitude and latitude to row and col indices
point_lon = 17.4
point_lat = 49.4
# row should be 48, col should be 528
col, row = grid.lonlat2rc(lon=point_lon, lat=point_lat)
# get lon, lat of the center of the pixel
pixel_center_lon, pixel_center_lat = grid.rc2lonlat(col=col, row=row)
TODO
- Generate grid for given region (by lat/lon min/max)
- Add documentation
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ease_lonlat-0.0.3.6.tar.gz.
File metadata
- Download URL: ease_lonlat-0.0.3.6.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd91f16b7cfab471a6f38d7fa889c039a5d2325e0e7fa09834c20df0ee1f6b27
|
|
| MD5 |
498b8b6b478bbbfc745264330dc6dd2f
|
|
| BLAKE2b-256 |
d675f847815ecb94ae81bebc640c37b026be8d4b042c4da6b9cda60f5d18973c
|
Provenance
The following attestation bundles were made for ease_lonlat-0.0.3.6.tar.gz:
Publisher:
python-publish.yml on CzendaZdenda/ease_lonlat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ease_lonlat-0.0.3.6.tar.gz -
Subject digest:
bd91f16b7cfab471a6f38d7fa889c039a5d2325e0e7fa09834c20df0ee1f6b27 - Sigstore transparency entry: 1936142766
- Sigstore integration time:
-
Permalink:
CzendaZdenda/ease_lonlat@b58c7eeb9b76ed462033c637c93120371c7606d8 -
Branch / Tag:
refs/tags/v0.0.3.6 - Owner: https://github.com/CzendaZdenda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b58c7eeb9b76ed462033c637c93120371c7606d8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ease_lonlat-0.0.3.6-py3-none-any.whl.
File metadata
- Download URL: ease_lonlat-0.0.3.6-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3c58a0d10987d458580c56ba4f61f9eed67a99eae0fdbb7aa860b1b1aff55ef
|
|
| MD5 |
ee0cc7c461c2a8fdcd8c1519e04cb80c
|
|
| BLAKE2b-256 |
c350d03fc38039a47ce7cb70ee56cf8c41cc9508770af3be68f441cba8e49620
|
Provenance
The following attestation bundles were made for ease_lonlat-0.0.3.6-py3-none-any.whl:
Publisher:
python-publish.yml on CzendaZdenda/ease_lonlat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ease_lonlat-0.0.3.6-py3-none-any.whl -
Subject digest:
c3c58a0d10987d458580c56ba4f61f9eed67a99eae0fdbb7aa860b1b1aff55ef - Sigstore transparency entry: 1936142814
- Sigstore integration time:
-
Permalink:
CzendaZdenda/ease_lonlat@b58c7eeb9b76ed462033c637c93120371c7606d8 -
Branch / Tag:
refs/tags/v0.0.3.6 - Owner: https://github.com/CzendaZdenda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b58c7eeb9b76ed462033c637c93120371c7606d8 -
Trigger Event:
release
-
Statement type: