Giter VIP home page Giter VIP logo

reftools's Introduction

REFTOOLS

10.5281/zenodo.5951177

PyPI

Documentation Status

Github Actions CI Status

Set of tools used to support creation of calibration reference files for Hubble Space Telescope (HST).

reftools's People

Contributors

bernie-simon avatar dependabot-preview[bot] avatar dependabot[bot] avatar embray avatar jdavies-st avatar jhunkeler avatar mcara avatar nden avatar philhodge avatar pllim avatar sosey avatar stsci-hack avatar stsci-sienkiew avatar stsci-ssb-ci avatar tddesjardins avatar zacharyburnett avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reftools's Issues

Retire Python 2

Python 2 will not be maintained past Jan 1, 2020 (see https://pythonclock.org/). Please remove all Python 2 compatibility and move this package to Python 3 only.

For conda recipe (including astroconda-contrib), please include the following to prevent packaging it for Python 2 (https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html?preprocessing-selectors#skipping-builds):

build: 
  skip: true  # [py2k] 

Please close this issue if it is irrelevant to your repository. This is an automated issue. If this is opened in error, please let pllim know!

DOC: Example to parse subarray

Q: There is a way to obtain the value of the different DQ flag contained only in the postage stamp?

>>> from astropy.io import fits
>>> from reftools.interpretdq import DQParser, ImageDQ
>>> dqdata = fits.getdata('jbt7a3k7q_flc.fits', 3)  # DQ, 1
>>> dqparser = DQParser.from_instrument('ACS')
>>> acsdq = ImageDQ(dqdata[:100, :100], dqparser=dqparser)
>>> acsdq.interpret_all()                                                                       
Parsing DQ flag(s)...
Done!
Run time: 0.006 s
N_FLAGGED: 366/10000 (3.660%)
FLAG=1    : 0 (0.000%)
FLAG=2    : 0 (0.000%)
FLAG=4    : 0 (0.000%)
FLAG=8    : 0 (0.000%)
FLAG=16   : 111 (1.110%)
FLAG=32   : 21 (0.210%)
FLAG=64   : 115 (1.150%)
FLAG=128  : 0 (0.000%)
FLAG=256  : 0 (0.000%)
FLAG=512  : 100 (1.000%)
FLAG=1024 : 0 (0.000%)
FLAG=2048 : 0 (0.000%)
FLAG=4096 : 49 (0.490%)
FLAG=8192 : 0 (0.000%)
FLAG=16384: 0 (0.000%)
FLAG=32768: 0 (0.000%)
>>> acsdq.data
array([[ 512,  512,  512, ...,  512,  512,  512],
       [   0,    0,    0, ..., 4144,    0,    0],
       [   0,    0,    0, ...,    0,    0,    0],
       ...,
       [   0,    0,    0, ...,    0,    0,    0],
       [   0,    0,    0, ...,    0,    0,    0],
       [   0,    0,    0, ...,    0,    0,    0]], dtype=int16)
>>> acsdq.data.shape
(100, 100)

Ref: INC0152118

What to do with the tests?

Some issues with existing tests in reftools/tests:

  • I can only get nosetests *py to run in the source build directory (not the actual source) because it cannot find the C-extension import (*.so) otherwise. So, I think the solution here is to convert the tests to use pytest. EDIT: Check if aae6e21 fixed this issue.
  • Do the tests even matter anymore? Do some of the modules even matter anymore? I have no idea what half of them are supposed to be used for, or who actually find them useful. If they are not used anymore, why waste resources maintaining or testing them?
  • Fix some tests in test_getphotpars that are currently marked as "expected failures" due to ValueError: new type not compatible with array. If it even matters, that is.

DOC: Enable RTD to fail on warnings

Currently, it fails with this with "fail on warnings" turned on:

Warning, treated as error:
autodoc: failed to import module 'getphotpars' from module 'reftools'; the following exception was raised:
.../reftools/_computephotpars.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyInt_AsLong

And also results in getphotpars page being empty.

Update with new wfc3 reference file tools

The wfc3 PCTETAB and IMPHTTAB are different from the ACS tables and require special code. This should be added to this package. Perhaps something to make a sink pixel reference file as well.

Remove AstropyDeprecationWarning from mkimpttab

There are three such warnings:

WARNING: AstropyDeprecationWarning: The new_table function is deprecated and may be removed in a future version.
        Use :meth:`BinTableHDU.from_columns` for new BINARY tables or :meth:`TableHDU.from_columns` for new ASCII tables instead. [reftools.mkimphttab]

when the following command is used:

>>> from reftools import mkimphttab
>>> mkimphttab.create_table('acs_wfc1','acs,wfc1','WFC1','Mar 01 2002 00:00:00')

DOC: Get rid of API doc warnings

I disabled "fail on warnings" for RTD in #58. If you want to enable it again, you have to fix the warnings. The CI had not run for 7 months before I touched it so no idea what happened and I don't have time to follow up on this.

reftools/getphotpars.py:docstring of reftools.getphotpars.GetPhotPars:40: WARNING: autosummary: stub file not found 'reftools.getphotpars.GetPhotPars.close'. Check your autosummary_generate setting.
reftools/getphotpars.py:docstring of reftools.getphotpars.GetPhotPars:40: WARNING: autosummary: stub file not found 'reftools.getphotpars.GetPhotPars.get_phot_pars'. Check your autosummary_generate setting.
reftools/imphtcomp.py:docstring of reftools.imphtcomp.ImphttabComp:68: WARNING: autosummary: stub file not found 'reftools.imphtcomp.ImphttabComp.make_plot'. Check your autosummary_generate setting.
reftools/imphtcomp.py:docstring of reftools.imphtcomp.ImphttabComp:68: WARNING: autosummary: stub file not found 'reftools.imphtcomp.ImphttabComp.print_diffs'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.DQParser:55: WARNING: autosummary: stub file not found 'reftools.interpretdq.DQParser.from_instrument'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.DQParser:55: WARNING: autosummary: stub file not found 'reftools.interpretdq.DQParser.interpret_array'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.DQParser:55: WARNING: autosummary: stub file not found 'reftools.interpretdq.DQParser.interpret_dqval'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.ImageDQ:38: WARNING: autosummary: stub file not found 'reftools.interpretdq.ImageDQ.dq_mask'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.ImageDQ:38: WARNING: autosummary: stub file not found 'reftools.interpretdq.ImageDQ.from_fits'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.ImageDQ:38: WARNING: autosummary: stub file not found 'reftools.interpretdq.ImageDQ.interpret_all'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.ImageDQ:38: WARNING: autosummary: stub file not found 'reftools.interpretdq.ImageDQ.interpret_pixel'. Check your autosummary_generate setting.
reftools/interpretdq.py:docstring of reftools.interpretdq.ImageDQ:38: WARNING: autosummary: stub file not found 'reftools.interpretdq.ImageDQ.pixlist'. Check your autosummary_generate setting.

Update the help

Tyler Desjardins mentions that we should consider moving emails from help[at]stsci.edu to point to the web portal where possible and appropriate. For HST (or any non-JWST), it is https://hsthelp.stsci.edu . For JWST, it is https://jwsthelp.stsci.edu . Please update info in setup.py, setup.cfg, documentation, etc as appropriate.

Please close this issue if it is irrelevant to your repository. This is an automated issue. If this is opened in error, please let pllim know!

xref spacetelescope/hstcal#317

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.