feder-observatory / stellarphot

Stellar aperture photometry
https://stellarphot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
4 stars 12 forks source link

Update seeing profile/aperture settings notebook to use new infrastructure #358

Closed mwcraig closed 3 months ago

mwcraig commented 3 months ago

This PR does a few things:

  1. Changes some of the layout of the seeing profile/aperture settings notebook
  2. Adds a camera selector(fixes #246)
  3. Adds an error console to that notebook to tell the user when they need to click on a star again.
  4. Saves aperture settings and camera to a partial photometry settings file.
  5. Does some internal variable renaming to make the names more meaningful.
  6. Adds a launcher entry for this notebook.

Some things to try:

  1. Hit the launcher to get a copy of this notebook.
  2. Load an image, zoom way in and shift-click far from a star. An error message should be displayed above the image.
  3. Next, shift-click on a star. You should get some plots, and some suggested aperture settings.
  4. Save the aperture settings and verify they appear properly in the json file created by this notebook.
JuanCab commented 3 months ago

To perform the initial review of the functionality of this PR, I entered the following commands on the command line:

conda create -n test-358 python=3.11 astroscrappy
conda activate test-358
pip install git+https://github.com/mwcraig/stellarphot.git@camera-nb-01
jupyter lab

Addressing some of your suggested "things to try:"

  1. Hit the launcher to get a copy of this notebook.

    This worked fine although you didn't clarify WHICH notebook to copy (there were two listed). I assumed it was the "Seeing Profile" from the context clues.

  2. Load an image, zoom way in and shift-click far from a star. An error message should be displayed above the image. Yep, "No star found at this location" error was displayed, but not when I "shift-clicked," I had to click without holding down the shift! One potential issue, if you click at several locations far from stars, multiple error messages show up and they actually push the image down the page.

  3. Next, shift-click on a star. You should get some plots, and some suggested aperture settings. Again, I had to just click and not shift-click, but yes, profiles showed up.

  4. Save the aperture settings and verify they appear properly in the json file created by this notebook. I saved the settings and the following (apparently proper JSON content) was saved:

    {
       "camera": {
           "name": "Testing",
           "data_unit": "adu",
           "gain": "10.0 electron / adu",
           "read_noise": "10.0 electron",
           "dark_current": "0.01 electron / s",
           "pixel_scale": "0.6 arcsec / pix",
           "max_data_value": "50000.0 adu"
       },
       "observatory": null,
       "passband_map": null,
       "photometry_apertures": {
           "radius": 8,
           "gap": 5,
           "annulus_width": 15,
           "fwhm": 5.650264631520387
       },
       "source_locations": null,
       "photometry_optional_settings": null,
       "logging_settings": null
    }
mwcraig commented 3 months ago

The broken test should be fixed now, @JuanCab. Not sure I like the fix, which was to save a camera if it is passed into the seeing profile widget and is not already saved...

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 76.42%. Comparing base (312fc0c) to head (e13ddc2). Report is 308 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #358 +/- ## ========================================== + Coverage 75.25% 76.42% +1.17% ========================================== Files 27 27 Lines 3601 3657 +56 ========================================== + Hits 2710 2795 +85 + Misses 891 862 -29 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JuanCab commented 3 months ago

I'll note again this issue (stated above): "if you click at several locations far from stars, multiple error messages show up and they actually push the image down the page."

mwcraig commented 3 months ago

@JuanCab @Tanner728 -- I'll open a separate PR today to add the waffle image to the repo.

mwcraig commented 3 months ago

We may want to include instructions of what right clicking does and how to restore the image to the default.

Does right-click reset the zoom?

Tanner728 commented 3 months ago

We may want to include instructions of what right clicking does and how to restore the image to the default.

Does right-click reset the zoom?

holding right-click and dragging adjusts brightness and contrast of the image depending on which way you drag your cursor while holding right-click. Then I think its just right-click to reset contrast and brightness, it could be shift right-click as well. I forgot.

mwcraig commented 3 months ago

@JuanCab -- I think I've addressed all of the review comments except the one about the waffle logo and the one I opened #360 for.