-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix NaNs in "longyearbyen_ddem" example #224
Conversation
Update upstream
For opening issue: we don't want to repeat this operation after every aligned_raster.data[~np.isfinite(aligned_raster)] = reference_raster.nodata
diff = reference_raster - \
gu.Raster.from_array(aligned_raster.data, transform=reference_raster.transform, crs=reference_raster.crs, nodata=reference_raster.nodata) |
It seems that GlacioHack/geoutils#257 fixed the issues that appeared in the tests. |
I'm afraid I don't really understand the fix here! You simplify the syntax and clean up the variogram test, which is great. How does this relate to the nans in the test? |
@erikmannerfelt The example bug fix is in the example. The rest is a side fix for using the Raster class directly as input, I added a line in the main description of the PR:
|
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.
Ah! Weirdly the example code diff didn't load on my GitHub. Now it does, and it looks good!
@@ -94,9 +96,10 @@ def process_coregistered_examples(overwrite: bool =False): | |||
nuth_kaab.fit(reference_raster.data, to_be_aligned_raster.data, | |||
inlier_mask=inlier_mask, transform=reference_raster.transform) | |||
aligned_raster = nuth_kaab.apply(to_be_aligned_raster.data, transform=reference_raster.transform) |
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.
This line and the few lines below could be simplified now that Coreg methods take Rasters as arguments and with the arithmetic overloading functions !
Raster
as an input ofsample_empirical_variogram
with a tiny bug on the ground sampling distance definition fixed, and tests updatedmasked_array
orRaster
subclass duringCoreg
operations #225 to add the right behaviour directly inCoreg
classes, so that there is no operation to perform for the user downstream