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

Cubeviz parser: Refactor parser, add ndarray support, metadata viewer #1040

Closed
wants to merge 19 commits into from

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Jan 16, 2022

Description

This pull request is to:

TODO

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 change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set? Milestone is only currently required for PRs related to Imviz MVP.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)? 🐱 🐱

@pllim pllim added this to the 2.3 milestone Jan 16, 2022
@pllim pllim added bug Something isn't working 💤 enhancement New feature or request labels Jan 16, 2022
@codecov
Copy link

codecov bot commented Jan 16, 2022

Codecov Report

Merging #1040 (e6a1f31) into main (394dea0) will increase coverage by 0.99%.
The diff coverage is 94.83%.

@@            Coverage Diff             @@
##             main    #1040      +/-   ##
==========================================
+ Coverage   76.17%   77.16%   +0.99%     
==========================================
  Files          87       87              
  Lines        6685     6813     +128     
==========================================
+ Hits         5092     5257     +165     
+ Misses       1593     1556      -37     
Impacted Files Coverage Δ
...default/plugins/gaussian_smooth/gaussian_smooth.py 82.75% <80.00%> (-0.17%) ⬇️
jdaviz/configs/cubeviz/plugins/parsers.py 95.23% <94.89%> (+32.52%) ⬆️
...z/configs/default/plugins/line_lists/line_lists.py 59.39% <100.00%> (+0.33%) ⬆️
jdaviz/configs/specviz/plugins/viewers.py 66.40% <100.00%> (+0.80%) ⬆️
jdaviz/core/validunits.py 100.00% <100.00%> (ø)
jdaviz/app.py 91.05% <0.00%> (+0.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f40a7c7...e6a1f31. Read the comment docs.

@pllim pllim force-pushed the cubeviz-parse-all-the-things branch from e6876f8 to 265f87d Compare January 20, 2022 03:19
jdaviz/configs/cubeviz/plugins/parsers.py Outdated Show resolved Hide resolved
flux = val.array << file_obj.flux.unit
elif attr == "mask":
data_type = 'mask'
flux = val << u.dimensionless_unscaled
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mask should not have units. It is basically data quality flags (unitless). Not sure why it was inheriting science data units.

flux = val

flux = np.moveaxis(flux, 1, 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really not sure what this moveaxis is for. All it did was to make the output X/Y flipped w.r.t. input. I removed it but if there is a reason for it to be there, please let me know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason for this had something to do with preserving the orientation that specutils understands and expects, or handling a difference between specutils and spectral-cube? There was also a related issue of whether or not the input cubes needed to be transposed inside the relevant specutils cube loaders. I can't quite remember. There was some discussion about it here, astropy/specutils#852, and maybe in some other jdaviz PRs/issues. @rosteen might remember more specific details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this line doesn't change where the WCS axis go, just flipping spatial, which is very confusing for me. Maybe I am missing something here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember if this was originally put in for WCS reasons, or something else. There might be unintended consequences by removing it. Maybe someone else can comment on it. Looks like it was put in by @javerbukh during the spectralcube to specutils transition.

Copy link
Contributor Author

@pllim pllim Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @javerbukh said that we no longer needs np.moveaxis.

@pllim pllim marked this pull request as ready for review January 20, 2022 04:07
@pllim pllim requested a review from havok2063 January 20, 2022 04:07
@pllim

This comment was marked as resolved.

@pllim pllim force-pushed the cubeviz-parse-all-the-things branch from bdbf102 to 5f73486 Compare January 26, 2022 22:12
@pllim pllim force-pushed the cubeviz-parse-all-the-things branch from 5f73486 to e1c0487 Compare February 3, 2022 22:50
@pllim pllim marked this pull request as draft February 4, 2022 00:03
@pllim pllim force-pushed the cubeviz-parse-all-the-things branch 2 times, most recently from 3b47227 to ef515b0 Compare February 16, 2022 14:43
pllim added a commit to pllim/jdaviz that referenced this pull request Feb 16, 2022
See JP-2280. Except for Cubeviz because that is being refactored at spacetelescope#1040
pllim added a commit to pllim/jdaviz that referenced this pull request Feb 16, 2022
See JP-2280. Except for Cubeviz because that is being refactored at spacetelescope#1040
@pllim
Copy link
Contributor Author

pllim commented Jul 2, 2022

I think this is too stale now. Also I am not sure if some of the stuff here still applies when "Cubeviz redesign" happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cubeviz Upstream fix required 💤 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cubeviz fails to fail fully when filled with faulty files
5 participants