I have two numpy
meshgrids (X, Y both 2D) in Lambert Conformal conic with the following information:
I'd like to directly (or indirectly if not possible) project them to UTM. I have both pyproj
and gdal
installed, but wasn't able to figure out how to use them. I found solutions for converting from LCC to WGS84 here and here, but couldn't use either of them since I don't have all the information needed.
Even if somehow I can convert from LCC
to WGS84
, then I can use Python UTM
package and utm.from_latlon
to get UTM
out of it.
I found the following line of code from here:
awips221 = Proj(proj='lcc', R=6371200, lat_1=50, lat_2=50,lon_0=-107, ellps='clrk66')
And then I can use transform
from pyproj
. In that case, is lat_1
and lat_2
both 25.0
in my case? What would be lon_0
and ellps
?
Using gdalinfo
we can see lCC
and WGS84
projections for the center and four corners of the grid in the picture below:
lon_0
-95 andellps
wgs84.from pyproj import transform
). Then dinelccProj
usinglccProj = Proj(proj='lcc', R=6371229, lat_1=25, lat_2=25,lon_0=-95, ellps='wgs84')
andutmProj
usingutmProj = Proj(proj='utm', zone=10, ellps='WGS84')
. Finally, I transform them withXX_UTM, YY_UTM = transform(lccProj, utmProj, XX, YY)
. However, I am not getting meaningful results. I am using zone=10 for no good reason here! Can that be the cause or I am missing something else?lccProj
defined the the previous comment, I can also dolon, lat = lccProj(XX, YY, inverse=True)
and get longitude and latitude. But these value are not correct for some reason.+proj=lcc +lat_1=25 +lat_0=25 +lon_0=-95 +k_0=1 +x_0=0 +y_0=0 +a=6371229 +b=6371229 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
. According to stackoverflow.com/questions/26452972/… you should be able to use it with pyproj.Proj