-
Notifications
You must be signed in to change notification settings - Fork 378
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 GNDVI and SWI Indices #371
Conversation
Thanks for consolidating! It looks like the style tests are failing (see https://torchgeo.readthedocs.io/en/latest/user/contributing.html for more info about what is going on here) and unit tests are missing for the new indices (see https://github.com/microsoft/torchgeo/blob/main/tests/transforms/test_indices.py for example tests that you can copy). Let me know if this doesn't make sense and I can help out! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
can this be merged now. |
This still needs unit tests, you should be able to copy and modify the tests for the other indices, see |
@adamjstewart the coverage for the various indices are actually provided by test_transforms.py, I'm going to add specific tests in test_indices.py so that it is less confusing/ conforms with the standard way of doing things |
Okay I think this is good to go now |
thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, couple comments that are optional to address
tests/transforms/test_indices.py
Outdated
AppendNDVI, | ||
AppendNDWI, | ||
AppendSWI, | ||
indices, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could replace this with AppendNormalizedDifferenceIndex
for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a startling long time to figure out what you meant here
|
||
Args: | ||
index_red: index of the VRE1 band, e.g. B5 in Sentinel 2 imagery | ||
index_swir: index of the SWIR2 band, e.g. B11 in Sentinel 2 imagery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't add examples for other indices. Should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah I think it is fine
Added MNDWI to support modification of normalised difference water index (NDWI) to enhance open water features in remotely sensed imagery.
Added a new Index Soil Water Index
Style error fixed
Changed the comment to fit in the code accordingly
modified
corrected the citation
Added Dockerfile
Added GNDVI Index
Saved
deleting
Thanks again for the contribution @MATRIX4284 |
* Update indices.py Added MNDWI to support modification of normalised difference water index (NDWI) to enhance open water features in remotely sensed imagery. * Update indices.py * Update indices.py * Update indices.py Added a new Index Soil Water Index * Update indices.py Style error fixed * Update indices.py * SWI addition * Update indices.py * Update indices.py * Update indices.py * Update indices.py Changed the comment to fit in the code accordingly * Update indices.py modified * Update indices.py corrected the citation * Update indices.py * Ubuntu CUDA 11.3 docker for torchgeo * Update Dockerfile_ubuntu_1804_cuda_11_3_cudnn_8_torchgeo * Delete Dockerfile_ubuntu_1804_cuda_11_3_cudnn_8_torchgeo * Added Dockerfile Added Dockerfile * deleted docker due to wrong issue number * Added GNDVI Index Added GNDVI Index * corrected docstring * updated refernce index to doi * Added Triband Normalized Indexes * Update indices.py Saved * Updated GNDVI * Delete transforms.ipynb deleting * Added the notebook changes * Delete transforms.ipynb * Added the notebook changes * Added the spaces * Update indices.py * formatting corrected * Running black * Reset transforms * Clean up docstrings * Adding tests and adding to list of transforms exported by the module * Consistency Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
Added GNDVI and SWI Indices