python EASE 2.0網格行列號與經緯度之間轉換


1.經緯度轉行列號

from ease_lonlat import EASE2GRID, SUPPORTED_GRIDS

# define new grid by yourself
grid = EASE2GRID(name='EASE2_T3125m', epsg=6933, x_min=-17367530.45, y_max=6756820.20, res=3128.16, n_cols=11104, n_rows=4320)

# or using parameters taken from NSIDC and kept in SUPPORTED_GRIDS
# grid = EASE2GRID(name='EASE2_G1km', **SUPPORTED_GRIDS['EASE2_G1km'])

# convert longitude and latitude to row and col indicespoint_lon = -105.647
point_lat = 40.31176

col, row = grid.lonlat2rc(lon=point_lon, lat=point_lat)

2.行列號轉經緯度

from ease_lonlat import EASE2GRID, SUPPORTED_GRIDS

# define new grid by yourself
grid = EASE2GRID(name='EASE2_T3125m', epsg=6933, x_min=-17367530.45, y_max=6756820.20, res=3128.16, n_cols=11104, n_rows=4320)

# or using parameters taken from NSIDC and kept in SUPPORTED_GRIDS
# grid = EASE2GRID(name='EASE2_G1km', **SUPPORTED_GRIDS['EASE2_G1km'])

# convert row and col to longtitude and latitude 
col = 2293
row = 645

# get lon, lat of the center of the pixel
pixel_center_lon, pixel_center_lat = grid.rc2lonlat(col=col, row=row)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM