I have a rectangular matrix of geographic climate data with a 1d row of latitude coordinates (size=834) and a 1d column with longitude coordinates (size=1115). They are both in unit of m (EPSG:32630) and I would like to transform to lat/lon. When I try to do:
from pyproj import Proj, transform
inProj = Proj('epsg:32630')
outProj = Proj('epsg:4326')
x1 = precip.lon.values
x2 = precip.lat.values
x2, y2 = transform(inProj, outProj, precip.lon.values, precip.lat.values)
print (x2, y2)
I get the error:
Traceback (most recent call last):
File "<input>", line 4, in <module>
File "<conda_env>/lib/python3.7/site-packages/pyproj/transformer.py", line 759, in transform
).transform(xx=x, yy=y, zz=z, tt=tt, radians=radians, errcheck=errcheck)
File "<conda_env>/lib/python3.7/site-packages/pyproj/transformer.py", line 446, in transform
errcheck=errcheck,
File "pyproj/_transformer.pyx", line 459, in pyproj._transformer._Transformer._transform
pyproj.exceptions.ProjError: x, y, z, and time must be same size
Does anyone know how I can transform from PCS to GCS with Python without having equal amount of latitude and longitude values?