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

stop counts cube from entering translator #3136

Closed
wants to merge 2 commits into from

Conversation

gibsongreen
Copy link
Contributor

@gibsongreen gibsongreen commented Aug 5, 2024

Description

On app startup, when a cube with u.count units is loaded into Cubeviz, the flux_or_sb_selected is set to 'Flux'. This would then trigger _on_flux_unit_changed(), and enter the condition for translating. An additional condition has been added to ensure that flux_or_sb_selected can be set without entering the translator when the native units are in counts.

Change log entry

  • Is a change log needed? If yes, is it added to CHANGES.rst? If you want to avoid merge conflicts,
    list the proposed change log here for review and add to CHANGES.rst before merge. If no, maintainer
    should add a no-changelog-entry-needed label.

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone. Bugfix milestone also needs an accompanying backport label.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@github-actions github-actions bot added specviz plugin Label for plugins common to multiple configurations labels Aug 5, 2024
@gibsongreen gibsongreen added cubeviz trivial Only needs one approval instead of two and removed specviz labels Aug 5, 2024
@gibsongreen gibsongreen added this to the 4.0 milestone Aug 5, 2024
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.82%. Comparing base (f4a6889) to head (1aa60fa).
Report is 125 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3136   +/-   ##
=======================================
  Coverage   88.82%   88.82%           
=======================================
  Files         112      112           
  Lines       17430    17430           
=======================================
  Hits        15482    15482           
  Misses       1948     1948           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pllim
Copy link
Contributor

pllim commented Aug 5, 2024

Thanks. Is there a way to test this in the CI, preferably without remote data?

@kecnry
Copy link
Member

kecnry commented Aug 6, 2024

Eventually we want a cube in counts to be coerced into counts/pix**2 ("surface brightness" units) and for SB<>flux to still work to toggle between counts/pix**2 and counts. This is probably covered under @cshanahan1's current work, but its not clear to me how this PR fits into that (will it need to be reverted once coercing cubes from flux into SB is implemented?).

@gibsongreen
Copy link
Contributor Author

Eventually we want a cube in counts to be coerced into counts/pix**2 ("surface brightness" units) and for SB<>flux to still work to toggle between counts/pix**2 and counts. This is probably covered under @cshanahan1's current work, but its not clear to me how this PR fits into that (will it need to be reverted once coercing cubes from flux into SB is implemented?).

With that being said, the problem should likely go away when generalizing the angle unit is implemented (and this translation becomes possible). I imagine this PR is probably not merging given when we expect the following PR to be implemented, but if the problem still arises then, we have some investigation to completed as to why. Although, I do think a test for counts cubes like what @pllim was suggesting is a great idea.

I'm not sure if this is semantics or if there is a scientific value, but, what would the angle_unit.selected be for a flux unit? Not that this is correct, right now I have a placeholder there that is 'pix' so the dropdown doesn't appear empty, and that there are angle_unit.choices.

@kecnry
Copy link
Member

kecnry commented Aug 6, 2024

I'm not sure if this is semantics or if there is a scientific value, but, what would the angle_unit.selected be for a flux unit?

(Eventually) if a cube with units of counts is imported into cubeviz, the parser should coerce that into counts/pix**2, the flux dropdown would show counts (and probably not have any other choices), the solid angle dropdown pix**2 (and probably not any other choices unless there is some information on the size of the pixel on the sky), and surface-brightness would then be computed as counts/pix**2. The spectrum viewer, which defaults to function = 'sum' would then integrate over counts/pix**2 cube, to show a spectrum in "flux" units of counts, by default.

@gibsongreen gibsongreen marked this pull request as draft August 6, 2024 14:46
@rosteen rosteen modified the milestones: 4.0, 4.1 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cubeviz plugin Label for plugins common to multiple configurations trivial Only needs one approval instead of two
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants