-
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 bad thumbnails #997
Fix bad thumbnails #997
Conversation
Hello @bhilbert4, Thank you for updating !
Comment last updated at 2022-07-22 17:29:15 UTC |
We also need to explicitly set the figure size for thumbnail images now, with these changes. At the moment that is hardwired to be 3x3. Is this appropriate? We don't want the figures to be much larger than necessary, since that would slow down image loading and therefore the JWQL webpages. |
Tests on the test server were successful. I didn't see any bad thumbnails when using this code. Also, running generate_preview_images is a lot faster when it ignores all of the guide star tracking files. I feel like this has been a long battle that @BradleySappington, @mfixstsci, and I have been fighting. I'm excited for it to be over. 🤞 @mfixstsci I think this is ready for review. |
I'm absurdly excited |
@bhilbert4 @bhilbert4 lets go! I am going to start my review |
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 @bhilbert4 I know you and @BradleySappington have been working hard on this and hope this solves it once and for all.
Fixed a small conflict that came about after the merge of #968 |
This PR makes some tweaks to the preview image generator in an effort to finally fix the bad thumbnail images that have been plaguing us forever.
Previously, the thumbnail images were created using matplotlib's imshow() function. This function creates an AxesImage object. However, preview images are generated by first creating a matplotlib Figure object, and then populating the axes of that object with an AxesImage object via imshow(). It turns out that
plt.close
only closes Figure objects. This means that thumbnail images were not being closed at the end of the preview image generation process, and this must have been leading to multiple images open at the same time, resulting in bad thumbnail images.This PR changes the thumbnail creation to be like that of the preview images. We first create a Figure object and then populate that using imshow. Local testing on several programs showed no bad thumbnails while using this. We should try a larger scale test on the server, but it looks promising that this PR will put an end to our bad thumbnail images.
I also fixed a small bug that was preventing some thumbnails from being created, where NaN values in the data were causing bad min/max values for the display.
Resolves #958