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