jdaviz icon indicating copy to clipboard operation
jdaviz copied to clipboard

Cubeviz to use wcs1d-fits from specutils to write out fitted cube

Open pllim opened this issue 2 years ago • 4 comments

Description

This pull request is to remove the unreleased jdaviz-cube writer we added in #2012 and use the improved specutils wcs1d-fits writer that Derek modifed in https://github.com/astropy/specutils/pull/1009 .

Close #2044

Blocked by

  • [x] wcs1d-fits encounters error with bool mask, so need https://github.com/astropy/specutils/pull/1051
  • [ ] Update specutils pin again when https://github.com/astropy/specutils/pull/1051 is released (>1.10)
  • [x] https://github.com/astropy/specutils/pull/1009 and the fix above need to be released and then we have to update minversion pin for specutils.
  • [x] If this PR does not make it to jdaviz v3.4, we also need to modify change log (and doc?) to withdraw a released feature.

Change log entry

  • [x] 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.

  • [x] 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.
  • [x] Do the proposed changes follow the STScI Style Guides?
  • [x] Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • [x] 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?
  • [x] 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.
  • [ ] After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

pllim avatar Mar 17 '23 20:03 pllim

@pllim astropy/specutils#1051 has now passed all tests, so you might try it for the bool mask here.

dhomeier avatar Mar 29 '23 20:03 dhomeier

@dhomeier , thanks, I'll put it on my queue.

pllim avatar Mar 29 '23 21:03 pllim

I thought @dhomeier fixed this in his specutils PR? 🤯

>           self._bitpix = DTYPE2BITPIX[data.dtype.name]
E           KeyError: 'bool'

pllim avatar May 10 '23 18:05 pllim

Yes, should have, but it's not in 1.10.0 yet.

dhomeier avatar May 10 '23 18:05 dhomeier

Codecov Report

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

Project coverage is 88.88%. Comparing base (3de1b08) to head (3b00e22). Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2094      +/-   ##
==========================================
- Coverage   88.91%   88.88%   -0.03%     
==========================================
  Files         111      111              
  Lines       17365    17348      -17     
==========================================
- Hits        15440    15420      -20     
- Misses       1925     1928       +3     

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

codecov[bot] avatar Jul 29 '24 19:07 codecov[bot]

I think at long last, this PR is finally ready because upstream fix has been released since.

pllim avatar Jul 29 '24 19:07 pllim

Not sure why RTD status report is stuck (PR too old? lol) but the build was successful: https://readthedocs.org/projects/jdaviz/builds/25146976/

pllim avatar Jul 29 '24 19:07 pllim

Hm, this works for writing out a model fit cube, but interestingly, it fails if you try to write out the original data cube that was loaded into Cubeviz (at least that's what I'm seeing with the example notebook). That also fails to write on main with format="jdaviz-cube" though, and based on the title of this PR is maybe out of scope.

rosteen avatar Jul 30 '24 18:07 rosteen

it fails if you try to write out the original data cube that was loaded into Cubeviz

Pretty sure that was a separate ticket. I don't think we support complete I/O roundtripping anywhere yet.

pllim avatar Jul 30 '24 19:07 pllim

it fails if you try to write out the original data cube that was loaded into Cubeviz

Pretty sure that was a separate ticket. I don't think we support complete I/O roundtripping anywhere yet.

In that case I'll go ahead and approve this.

rosteen avatar Jul 30 '24 19:07 rosteen

Rebased to see if RTD would report back this time. Thanks for the review!

pllim avatar Jul 30 '24 19:07 pllim