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

Add GridObject class #6

Closed
Teschl opened this issue Mar 27, 2024 · 1 comment
Closed

Add GridObject class #6

Teschl opened this issue Mar 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Teschl
Copy link
Contributor

Teschl commented Mar 27, 2024

No description provided.

@wschwanghart
Copy link

There are a few things that we should consider when creating the GRIDobj-class, at least I am currently facing a couple of challenges when implementing the new MATLAB version. I am not sure whether and, if, to what degree, some design decisions should apply to the Python-version as well. First of all, instead of storing the coordinate vectors, I used to use a refmat-Matrix, and computed the coordinate vectors, if needed from the row and column indices (subscripts) from the grid. MATLAB, however, has abandoned refmat and uses a worldfilematrix instead. The matrix is a 2x3 matrix that let's you calculate coordinates from the intrinsic coordinates (the subscripts) using matrix multiplication. Perhaps, we should use this approach in Python as well.
Moreover, I usually used a columns-start-north and a rows-start-west scheme. The latter is usual, the former may vary from tif to tif. To this end, I think it is not important and I am considering to remove it. Finally, it may be important that some rasters are stored with cell reference, and others with postings reference. This may mainly be important when exporting the data or calculating extents, but not affect any analysis tools.
I am currently redesigning the object slightly, and perhaps we should discuss these changes once we are back from EGU. Still, I think that these changes can subsequently applied also to the Python version and that this would likely not create any pain.

wkearn pushed a commit that referenced this issue Apr 18, 2024
Closes #5 and #6

This commit adds a GridObject class with an info method. The GridObject constructor loads data from a file using rasterio, and `info` prints some useful information about the object. 

An example Jupyter notebook is added demonstrating the usage. The notebook requires data that can be found in wschwanghart/DEMs
@wkearn wkearn closed this as completed Apr 18, 2024
@wkearn wkearn added the enhancement New feature or request label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants