Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Option to use stsynphot to make IMPHTTAB #28
Fix #24 .
To make a table using
To make a table using PySynphot, do this in command line:
Then run the function as usual:
from reftools import mkimphttab mkimphttab.create_table('test_stis', 'stis', '*', 'Sep 03 2019 00:00:00')
For sanity check, which software and version would be listed under
I ran them both and used the following to quickly compare the
>>> from astropy.io import fits >>> from astropy.table import Table, setdiff >>> with fits.open('result_from_pysynphot.fits') as pf: ... t_pysyn = Table(pf.data) >>> with fits.open('result_from_stsynphot.fits') as pf: ... t_stsyn = Table(pf.data) >>> # DESCRIP is bound to be different, so remove it from comparison. >>> t_pysyn.remove_column('DESCRIP') >>> t_stsyn.remove_column('DESCRIP') >>> sdiff = setdiff(t_pysyn, t_stsyn, keys=['OBSMODE', 'DATACOL']) >>> sdiff # Length 0 is good
Or another way using simple table diff:
>>> import sys >>> from astropy.utils.diff import report_diff_values >>> identical = report_diff_values(t_pysyn, t_stsyn, fileobj=sys.stdout) >>> # You will see some output regardless but there is + and - if there is a difference. >>> identical True
I did not time them explicitly, but it felt like using PySynphot was a bit faster than using
I also generated a file from current
The files I used for comparison above are available at https://stsci.app.box.com/folder/86611518709 (permission required for access).