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

Added a check crs function for rasters #707

Merged
merged 18 commits into from Jun 14, 2021
Merged

Conversation

nkorinek
Copy link
Member

@nkorinek nkorinek commented Jun 11, 2021

As per our conversation , added a very rudimentary check crs function and a few basic tests. It needs more tests (don't know how to access an HDF file for a test?) but works on my local machine as I was expecting it to. @lwasser thoughts?

crs = data_src.crs
return crs
except rio.errors.RasterioIOError as e:
print("Please only input files that can be read as a raster.\n")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkorinek can you tell me what this mearns? Will this io error be throw if the data are not in raster format or are there a list of specific file formats that rio uses? maybe some language like -

Oops, your data are not in a format that rasterio can read. Please check the rasterio documentation for accepted file formats and make sure that your data are in raster format.

The CRS object stored in the raster file.
"""

try:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkorinek what happens when you pass a raster with no crs? it may be good to have a message for - there is no crs associated with this file?

Parameters
----------
path : string
Path to the raster file.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to say Path to a raster file in a format that rasterio can read.

Copy link

@lwasser lwasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few changes on this one @nkorinek thank you!

@lwasser
Copy link

lwasser commented Jun 14, 2021

@nkorinek similar to the other PR please open an issue in earthpy about why we are adding this - the lessons repo is private.

@lwasser lwasser changed the title Added a check crs funciton for rasters Added a check crs function for rasters Jun 14, 2021
@lwasser
Copy link

lwasser commented Jun 14, 2021

thank you @nkorinek merging this!!

@lwasser lwasser merged commit 127cb06 into earthlab:main Jun 14, 2021
@nkorinek
Copy link
Member Author

Hey @lwasser sorry for the confusion, but those commits were just me merging the main branch updates into this branch, I didn't address your comments yet! Should I create a new pr with the small updates needed to address the issues you found?

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

Successfully merging this pull request may close these issues.

None yet

3 participants