Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while defining SRS #2

Open
arindan opened this issue Mar 22, 2023 · 0 comments
Open

Issue while defining SRS #2

arindan opened this issue Mar 22, 2023 · 0 comments

Comments

@arindan
Copy link

arindan commented Mar 22, 2023

Hi,
First of all, thanks for the nice tutorial and it is available openly. I have been trying to use your method using MCD43A1.061 data.
These are the current crs details:

`xarray.DataArray
'crs'

[1 values with dtype=int8]

Coordinates: (0)
Indexes: (0)
Attributes:

grid_mapping_name :
    sinusoidal
_CoordinateAxisTypes :
    GeoX GeoY
spatial_ref :
    PROJCS["unknown",GEOGCS["unknown",DATUM["unknown",SPHEROID["unknown",6371007.181,0]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Sinusoidal"],PARAMETER["longitude_of_center",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]
radius_of_sphere :
    6371007.181
longitude_of_central_meridian :
    0
longitude_of_projection_origin :
    0
straight_vertical_longitude_from_pole :
    0
false_easting :
    0
false_northing :
    0`

I tried the same code as in your tutorial:

`getpar = lambda a: str(ds.crs.attrs[a])

inproj = Proj(" ".join([
"+proj=sinu",
"+lon_0="+getpar("longitude_of_central_meridian"),
"+x_0="+getpar("false_easting"),
"+y_0="+getpar("false_northing"),
"+a="+getpar("radius_of_sphere"),
"+b="+getpar("radius_of_sphere"),
"+units="+"meter +no_defs"]))

outproj = Proj(init="epsg:4326")

inproj`

It shows error:

CRSError: Invalid projection: +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=meter +no_defs +type=crs: (Internal Proj Error: proj_create: Error 1027 (Invalid value for an argument): sinu: Invalid value for units)

I am using pyproj==3.4.1. Do you have any idea why this is not working?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant