├── .gitignore ├── .readthedocs.yml ├── AUTHORS ├── CHANGES.rst ├── MANIFEST.in ├── README.rst ├── doc └── images │ └── am_plot.png ├── docs ├── Makefile ├── conf.py ├── index.rst ├── make.bat └── mskpy │ └── index.rst ├── examples └── hb-cal.py ├── licenses ├── DAVINT_LICENSE ├── LICENSE.rst ├── README.rst └── TEMPLATE_LICENCE.rst ├── mskpy ├── __init__.py ├── _astropy_init.py ├── asteroid.py ├── calib.py ├── catalogs.py ├── comet.py ├── config.py ├── conftest.py ├── data │ ├── E490_00a_AM0.txt │ ├── E490_00a_AM0_abridged.txt │ ├── dustphaseHM_table.txt │ ├── e490-lowres.txt │ ├── filters │ │ ├── 2mass │ │ │ ├── hrsr.tbl │ │ │ ├── jrsr.tbl │ │ │ └── krsr.tbl │ │ ├── cousins │ │ │ ├── cousins_i_004_syn.fits │ │ │ └── cousins_r_004_syn.fits │ │ ├── johnson │ │ │ ├── johnson_b_004_syn.fits │ │ │ ├── johnson_u_004_syn.fits │ │ │ └── johnson_v_004_syn.fits │ │ ├── lsst │ │ │ ├── total_g.dat │ │ │ ├── total_i.dat │ │ │ ├── total_r.dat │ │ │ ├── total_u.dat │ │ │ ├── total_y.dat │ │ │ └── total_z.dat │ │ ├── mko │ │ │ ├── nsfcam_hmk_trans.dat │ │ │ ├── nsfcam_jmk_trans.dat │ │ │ ├── nsfcam_kmk_trans.dat │ │ │ ├── nsfcam_kpmk_trans.dat │ │ │ ├── nsfcam_ksmk_trans.dat │ │ │ ├── nsfcam_lpmk_trans.dat │ │ │ └── nsfcam_mpmk_trans.dat │ │ ├── panstarrs │ │ │ └── tonry12-transmission.txt │ │ ├── sofia │ │ │ ├── FOR-20um-542-090-091.txt │ │ │ ├── FOR-30um-542-84-85.txt │ │ │ ├── Lakeshore_24um_5000_18-28um_double.txt │ │ │ ├── Lakeshore_33um_4587_28-40um_double.txt │ │ │ ├── Lakeshore_34um_5007_28-40um_double.txt │ │ │ ├── Lakeshore_38um_5130_5144_double.txt │ │ │ ├── N06611.txt │ │ │ ├── OCLI_N06276-9_2.txt │ │ │ ├── OCLI_N07688-9A_1.txt │ │ │ ├── OCLI_N08606-9_1.txt │ │ │ ├── OCLI_N11035-9A.txt │ │ │ ├── OCLI_N11282-9_1.txt │ │ │ ├── OCLI_NO5352-8_2.txt │ │ │ └── notes.txt │ │ ├── spitzer │ │ │ ├── 080924ch1trans_full.txt │ │ │ ├── 080924ch2trans_full.txt │ │ │ ├── 080924ch3trans_full.txt │ │ │ ├── 080924ch4trans_full.txt │ │ │ ├── MIPSfiltsumm.txt │ │ │ ├── bluePUtrans.txt │ │ │ ├── mips160.txt │ │ │ ├── mips24.txt │ │ │ ├── mips70.txt │ │ │ └── redPUtrans.txt │ │ ├── usno40 │ │ │ ├── ccd_qe.txt │ │ │ ├── readme.txt │ │ │ ├── usno_g.res │ │ │ ├── usno_i.res │ │ │ ├── usno_r.res │ │ │ ├── usno_u.res │ │ │ └── usno_z.res │ │ └── wise │ │ │ ├── RSR-W1.txt │ │ │ ├── RSR-W2.txt │ │ │ ├── RSR-W3.txt │ │ │ └── RSR-W4.txt │ ├── gen-e490.py │ ├── tr_13800ft_2.5mm_15-25.txt │ ├── tr_13800ft_2.5mm_7.4_14.0.txt │ ├── tr_13800ft_3.4mm_15-25.txt │ ├── tr_14000ft_3.3mm_7.0_14.0.txt │ ├── tr_9100ft_5.7mm_7.2_13.6.txt │ ├── wehrli85.txt │ └── wehrli85_smoothed0.005.txt ├── ephem │ ├── __init__.py │ ├── core.py │ ├── geom.py │ ├── ssobj.py │ └── state.py ├── graphics.py ├── image │ ├── __init__.py │ ├── analysis.py │ ├── core.py │ └── process.py ├── instruments │ ├── __init__.py │ ├── hst.py │ ├── instrument.py │ ├── irtf.py │ ├── jwst.py │ ├── sofia.py │ ├── spitzer.py │ └── vis.py ├── lib │ └── __init__.py ├── modeling.py ├── models │ ├── __init__.py │ ├── dust.py │ ├── psg │ │ ├── __init__.py │ │ └── test │ │ │ ├── __init__.py │ │ │ ├── psg_cfg.txt │ │ │ ├── psg_rad.txt │ │ │ └── test_psg.py │ └── surfaces.py ├── observing │ ├── __init__.py │ ├── core.py │ └── finding.py ├── photometry │ ├── __init__.py │ ├── core.py │ ├── hb.py │ └── outbursts.py ├── polarimetry.py └── util.py ├── pyproject.toml ├── runtests.py ├── scripts ├── D2m ├── H2D ├── ads ├── center-target ├── comet-fest ├── decam-dl.py ├── ds9-ext ├── ephemeris ├── horizons2dct-tcs ├── irs-plot ├── lmi-dither └── transit ├── setup.cfg ├── setup.py ├── src └── davint │ ├── davint.f │ ├── davint.pyf │ ├── fdump.f │ ├── i1mach.f │ ├── j4save.f │ ├── setup_package.py │ ├── xercnt.f │ ├── xerhlt.f │ ├── xermsg.f │ ├── xerprn.f │ ├── xersve.f │ └── xgetua.f ├── tests ├── test_comet.py ├── test_ephem.py ├── test_image.py ├── test_instruments.py ├── test_models.py ├── test_photometry.py └── test_util.py └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | 3 | # Compiled files 4 | *.py[cod] 5 | *.a 6 | *.o 7 | *.so 8 | __pycache__ 9 | 10 | # Ignore .c files by default to avoid including generated code. If you want to 11 | # add a non-generated .c extension, use `git add -f filename.c`. 12 | *.c 13 | 14 | # Other generated files 15 | */version.py 16 | */cython_version.py 17 | htmlcov 18 | .coverage 19 | MANIFEST 20 | .ipynb_checkpoints 21 | 22 | # Sphinx 23 | docs/api 24 | docs/_build 25 | 26 | # Eclipse editor project files 27 | .project 28 | .pydevproject 29 | .settings 30 | 31 | # Pycharm editor project files 32 | .idea 33 | 34 | # Floobits project files 35 | .floo 36 | .flooignore 37 | 38 | # Visual Studio Code project files 39 | .vscode 40 | .hypothesis 41 | 42 | # Packages/installer info 43 | *.egg 44 | *.egg-info 45 | dist 46 | build 47 | eggs 48 | .eggs 49 | parts 50 | bin 51 | var 52 | sdist 53 | develop-eggs 54 | .installed.cfg 55 | distribute-*.tar.gz 56 | lib 57 | !mskpy/lib 58 | lib64 59 | 60 | # Other 61 | .cache 62 | .tox 63 | .*.sw[op] 64 | *~ 65 | .project 66 | .pydevproject 67 | .settings 68 | pip-wheel-metadata/ 69 | .venv 70 | 71 | # Installer logs 72 | pip-log.txt 73 | 74 | # Unit test / coverage reports 75 | .coverage 76 | .tox 77 | nosetests.xml 78 | 79 | # Mac OSX 80 | .DS_Store 81 | 82 | mskpy/version.py 83 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | image: latest 5 | 6 | python: 7 | version: 3.7 8 | install: 9 | - method: pip 10 | path: . 11 | extra_requirements: 12 | - docs 13 | - all 14 | 15 | formats: [] 16 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Michael S. Kelley 2 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | include CHANGES.rst 3 | include setup.cfg 4 | include LICENSE.rst 5 | include pyproject.toml 6 | 7 | recursive-include mskpy *.pyx *.c *.pxd *.txt *.dat *.tbl 8 | recursive-include docs * 9 | recursive-include licenses * 10 | recursive-include scripts * 11 | 12 | prune build 13 | prune docs/_build 14 | prune docs/api 15 | 16 | global-exclude *.pyc *.o 17 | -------------------------------------------------------------------------------- /doc/images/am_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/doc/images/am_plot.png -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | 15 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest 16 | 17 | #This is needed with git because git doesn't create a dir if it's empty 18 | $(shell [ -d "_static" ] || mkdir -p _static) 19 | 20 | help: 21 | @echo "Please use \`make ' where is one of" 22 | @echo " html to make standalone HTML files" 23 | @echo " dirhtml to make HTML files named index.html in directories" 24 | @echo " singlehtml to make a single large HTML file" 25 | @echo " pickle to make pickle files" 26 | @echo " json to make JSON files" 27 | @echo " htmlhelp to make HTML files and a HTML help project" 28 | @echo " qthelp to make HTML files and a qthelp project" 29 | @echo " devhelp to make HTML files and a Devhelp project" 30 | @echo " epub to make an epub" 31 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 32 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 33 | @echo " text to make text files" 34 | @echo " man to make manual pages" 35 | @echo " changes to make an overview of all changed/added/deprecated items" 36 | @echo " linkcheck to check all external links for integrity" 37 | 38 | clean: 39 | -rm -rf $(BUILDDIR) 40 | -rm -rf api 41 | -rm -rf generated 42 | 43 | html: 44 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 45 | @echo 46 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 47 | 48 | dirhtml: 49 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 50 | @echo 51 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 52 | 53 | singlehtml: 54 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 55 | @echo 56 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 57 | 58 | pickle: 59 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 60 | @echo 61 | @echo "Build finished; now you can process the pickle files." 62 | 63 | json: 64 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 65 | @echo 66 | @echo "Build finished; now you can process the JSON files." 67 | 68 | htmlhelp: 69 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 70 | @echo 71 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 72 | ".hhp project file in $(BUILDDIR)/htmlhelp." 73 | 74 | qthelp: 75 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 76 | @echo 77 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 78 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 79 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Astropy.qhcp" 80 | @echo "To view the help file:" 81 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Astropy.qhc" 82 | 83 | devhelp: 84 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 85 | @echo 86 | @echo "Build finished." 87 | @echo "To view the help file:" 88 | @echo "# mkdir -p $$HOME/.local/share/devhelp/Astropy" 89 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Astropy" 90 | @echo "# devhelp" 91 | 92 | epub: 93 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 94 | @echo 95 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 96 | 97 | latex: 98 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 99 | @echo 100 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 101 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 102 | "(use \`make latexpdf' here to do that automatically)." 103 | 104 | latexpdf: 105 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 106 | @echo "Running LaTeX files through pdflatex..." 107 | make -C $(BUILDDIR)/latex all-pdf 108 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 109 | 110 | text: 111 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 112 | @echo 113 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 114 | 115 | man: 116 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 117 | @echo 118 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 119 | 120 | changes: 121 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 122 | @echo 123 | @echo "The overview file is in $(BUILDDIR)/changes." 124 | 125 | linkcheck: 126 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 127 | @echo 128 | @echo "Link check complete; look for any errors in the above output " \ 129 | "or in $(BUILDDIR)/linkcheck/output.txt." 130 | 131 | doctest: 132 | @echo "Run 'python setup.py test' in the root directory to run doctests " \ 133 | @echo "in the documentation." 134 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Documentation 2 | ============= 3 | 4 | This is the documentation for mskpy. 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | mskpy/index.rst 10 | 11 | .. note:: The layout of this directory is simply a suggestion. To follow 12 | traditional practice, do *not* edit this page, but instead place 13 | all documentation for the package inside ``mskpy/``. 14 | You can follow this practice or choose your own layout. 15 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | if NOT "%PAPER%" == "" ( 11 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 12 | ) 13 | 14 | if "%1" == "" goto help 15 | 16 | if "%1" == "help" ( 17 | :help 18 | echo.Please use `make ^` where ^ is one of 19 | echo. html to make standalone HTML files 20 | echo. dirhtml to make HTML files named index.html in directories 21 | echo. singlehtml to make a single large HTML file 22 | echo. pickle to make pickle files 23 | echo. json to make JSON files 24 | echo. htmlhelp to make HTML files and a HTML help project 25 | echo. qthelp to make HTML files and a qthelp project 26 | echo. devhelp to make HTML files and a Devhelp project 27 | echo. epub to make an epub 28 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 29 | echo. text to make text files 30 | echo. man to make manual pages 31 | echo. changes to make an overview over all changed/added/deprecated items 32 | echo. linkcheck to check all external links for integrity 33 | echo. doctest to run all doctests embedded in the documentation if enabled 34 | goto end 35 | ) 36 | 37 | if "%1" == "clean" ( 38 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 39 | del /q /s %BUILDDIR%\* 40 | del /q /s api 41 | del /q /s generated 42 | goto end 43 | ) 44 | 45 | if "%1" == "html" ( 46 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 47 | if errorlevel 1 exit /b 1 48 | echo. 49 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 50 | goto end 51 | ) 52 | 53 | if "%1" == "dirhtml" ( 54 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 55 | if errorlevel 1 exit /b 1 56 | echo. 57 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 58 | goto end 59 | ) 60 | 61 | if "%1" == "singlehtml" ( 62 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 63 | if errorlevel 1 exit /b 1 64 | echo. 65 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 66 | goto end 67 | ) 68 | 69 | if "%1" == "pickle" ( 70 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 71 | if errorlevel 1 exit /b 1 72 | echo. 73 | echo.Build finished; now you can process the pickle files. 74 | goto end 75 | ) 76 | 77 | if "%1" == "json" ( 78 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 79 | if errorlevel 1 exit /b 1 80 | echo. 81 | echo.Build finished; now you can process the JSON files. 82 | goto end 83 | ) 84 | 85 | if "%1" == "htmlhelp" ( 86 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 87 | if errorlevel 1 exit /b 1 88 | echo. 89 | echo.Build finished; now you can run HTML Help Workshop with the ^ 90 | .hhp project file in %BUILDDIR%/htmlhelp. 91 | goto end 92 | ) 93 | 94 | if "%1" == "qthelp" ( 95 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 96 | if errorlevel 1 exit /b 1 97 | echo. 98 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 99 | .qhcp project file in %BUILDDIR%/qthelp, like this: 100 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Astropy.qhcp 101 | echo.To view the help file: 102 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Astropy.ghc 103 | goto end 104 | ) 105 | 106 | if "%1" == "devhelp" ( 107 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 108 | if errorlevel 1 exit /b 1 109 | echo. 110 | echo.Build finished. 111 | goto end 112 | ) 113 | 114 | if "%1" == "epub" ( 115 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 116 | if errorlevel 1 exit /b 1 117 | echo. 118 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 119 | goto end 120 | ) 121 | 122 | if "%1" == "latex" ( 123 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 124 | if errorlevel 1 exit /b 1 125 | echo. 126 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 127 | goto end 128 | ) 129 | 130 | if "%1" == "text" ( 131 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 132 | if errorlevel 1 exit /b 1 133 | echo. 134 | echo.Build finished. The text files are in %BUILDDIR%/text. 135 | goto end 136 | ) 137 | 138 | if "%1" == "man" ( 139 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 140 | if errorlevel 1 exit /b 1 141 | echo. 142 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 143 | goto end 144 | ) 145 | 146 | if "%1" == "changes" ( 147 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 148 | if errorlevel 1 exit /b 1 149 | echo. 150 | echo.The overview file is in %BUILDDIR%/changes. 151 | goto end 152 | ) 153 | 154 | if "%1" == "linkcheck" ( 155 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 156 | if errorlevel 1 exit /b 1 157 | echo. 158 | echo.Link check complete; look for any errors in the above output ^ 159 | or in %BUILDDIR%/linkcheck/output.txt. 160 | goto end 161 | ) 162 | 163 | if "%1" == "doctest" ( 164 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 165 | if errorlevel 1 exit /b 1 166 | echo. 167 | echo.Testing of doctests in the sources finished, look at the ^ 168 | results in %BUILDDIR%/doctest/output.txt. 169 | goto end 170 | ) 171 | 172 | :end 173 | -------------------------------------------------------------------------------- /docs/mskpy/index.rst: -------------------------------------------------------------------------------- 1 | ******************* 2 | mskpy Documentation 3 | ******************* 4 | 5 | This is the documentation for mskpy. 6 | 7 | Reference/API 8 | ============= 9 | 10 | .. automodapi:: mskpy 11 | -------------------------------------------------------------------------------- /examples/hb-cal.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import astropy.units as u 3 | from astropy.io import ascii 4 | from astropy.table import Table 5 | from mskpy import photometry 6 | 7 | phot = ascii.read(''' 8 | # standard star photometry 9 | # m : apparent magnitude (Farnham et al. 2000) 10 | # m_inst : instrumental magnitude 11 | # z : zenith angle in degrees 12 | # 13 | filter m m_inst m_inst unc z airmass 14 | ------ ----- ------- ---------- ------ ------- 15 | RC 7.766 -13.877 0.004 59.932 1.989 16 | RC 7.766 -13.902 0.003 48.062 1.494 17 | RC 7.448 -14.236 0.001 42.090 1.346 18 | RC 7.448 -14.211 0.003 42.553 1.356 19 | BC 7.68 -14.482 0.007 59.565 1.968 20 | BC 7.68 -14.604 0.006 47.767 1.486 21 | BC 7.784 -14.518 0.005 42.690 1.359 22 | BC 7.784 -14.543 0.005 41.977 1.344 23 | CN 7.619 -13.936 0.008 60.297 2.011 24 | CN 7.619 -14.137 0.007 48.360 1.503 25 | CN 7.748 -14.096 0.003 42.210 1.349 26 | CN 7.748 -14.071 0.006 42.422 1.353 27 | OH 7.414 -8.746 0.037 60.691 2.036 28 | OH 7.414 -9.731 0.014 48.685 1.512 29 | OH 7.536 -9.955 0.009 42.339 1.351 30 | OH 7.536 -9.942 0.012 42.289 1.351 31 | ''') 32 | 33 | h = 2361 * u.m # elevation of LDT 34 | 35 | # first, calibrate the easy filters 36 | cal = [] 37 | for filt in ('CN', 'BC', 'RC'): 38 | data = phot[phot['filter'] == filt] 39 | 40 | # calibrate magnitude with extinction proportional to airmass 41 | fit, fit_unc = photometry.cal_airmass( 42 | data['m_inst'], data['m_inst unc'], data['m'], data['airmass']) 43 | 44 | # best fit for each data point: 45 | model = (data['m'] - fit[0] + fit[1] * data['airmass']) 46 | 47 | # residuals from best fit: 48 | residuals = model - data['m_inst'] 49 | 50 | # save results 51 | # filter, N, magzp, magzp unc, Ex, Ex unc, toz, toz unc, mean residuals 52 | # stdev residuals, standard error 53 | cal.append(( 54 | filt, 55 | len(data), 56 | fit[0], 57 | fit_unc[0], 58 | fit[1], 59 | fit_unc[1], 60 | np.ma.masked, # ozone parameter not calculated 61 | np.ma.masked, 62 | np.mean(residuals), 63 | np.std(residuals, ddof=1), 64 | np.std(residuals, ddof=1) / np.sqrt(len(data)) 65 | )) 66 | 67 | # OH extinction has multiple components, here we use BC to help isolate the ozone component 68 | data = phot[phot['filter'] == 'OH'] 69 | bc = cal[1] 70 | Ex_BC = cal[1][4] 71 | 72 | # see cal_oh for explanation of parameters and return values 73 | fit, fit_unc = photometry.hb.cal_oh( 74 | data['m_inst'], data['m_inst unc'], data['m'], data['z'] * u.deg, 75 | 'b', 'b', Ex_BC, h) 76 | 77 | # use best-fit ozone parameter and BC extinction to calculate total extinction in OH 78 | ext_oh = photometry.hb.ext_total_oh(fit[1], data['z'] * u.deg, 'b', 'b', 79 | Ex_BC, h) 80 | model = data['m'] - fit[0] + ext_oh 81 | residuals = model - data['m_inst'] 82 | 83 | # save results 84 | cal.append(( 85 | 'OH', 86 | len(data), 87 | fit[0], 88 | fit_unc[0], 89 | np.ma.masked, # not calculated for OH 90 | np.ma.masked, 91 | fit[1], 92 | fit_unc[1], 93 | np.mean(residuals), 94 | np.std(residuals, ddof=1), 95 | np.std(residuals, ddof=1) / np.sqrt(len(data)) 96 | )) 97 | 98 | cal = Table( 99 | rows=cal, 100 | names=['filter', 'N', 'magzp', 'magzp unc', 'Ex', 'Ex unc', 101 | 'toz', 'toz unc', 'mean residuals', 'stdev residuals', 102 | 'standard error']) 103 | 104 | for col in cal.colnames[2:]: 105 | cal[col].format = '{:.3f}' 106 | 107 | cal.pprint_all() 108 | -------------------------------------------------------------------------------- /licenses/DAVINT_LICENSE: -------------------------------------------------------------------------------- 1 | davint.f and associated files from SLATEC Common Mathematical Library, 2 | Version 4.1, July 1993. 3 | 4 | The SLATEC Common Mathematical Library is issued by the following 5 | 6 | Air Force Weapons Laboratory, Albuquerque 7 | Lawrence Livermore National Laboratory, Livermore 8 | Los Alamos National Laboratory, Los Alamos 9 | National Institute of Standards and Technology, Washington 10 | National Energy Research Supercomputer Center, Livermore 11 | Oak Ridge National Laboratory, Oak Ridge 12 | Sandia National Laboratories, Albuquerque 13 | Sandia National Laboratories, Livermore 14 | 15 | All questions concerning the distribution of the library should be 16 | directed to the NATIONAL ENERGY SOFTWARE CENTER, 9700 Cass Ave., 17 | Argonne, Illinois 60439, and not to the authors of the subprograms. 18 | 19 | * * * * * Notice * * * * * 20 | 21 | This material was prepared as an account of work sponsored by the 22 | United States Government. Neither the United States, nor the 23 | Department of Energy, nor the Department of Defense, nor any of their 24 | employees, nor any of their contractors, subcontractors, or their 25 | employees, makes any warranty, expressed or implied, or assumes any 26 | legal liability or responsibility for the accuracy, completeness, or 27 | usefulness of any information, apparatus, product, or process 28 | disclosed, or represents that its use would not infringe upon 29 | privately owned rights. 30 | -------------------------------------------------------------------------------- /licenses/LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020, Michael S. P. Kelley 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the University of Maryland nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /licenses/README.rst: -------------------------------------------------------------------------------- 1 | Licenses 2 | ======== 3 | 4 | This directory holds license and credit information for the package, 5 | works the package is derived from, and/or datasets. 6 | 7 | Ensure that you pick a package license which is in this folder and it matches 8 | the one mentioned in the top level README.rst file. If you are using the 9 | pre-rendered version of this template check for the word 'Other' in the README. 10 | -------------------------------------------------------------------------------- /licenses/TEMPLATE_LICENCE.rst: -------------------------------------------------------------------------------- 1 | This project is based upon the Astropy package template 2 | (https://github.com/astropy/package-template/) which is licensed under the terms 3 | of the following license. 4 | 5 | --- 6 | 7 | Copyright (c) 2018, Astropy Developers 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without modification, 11 | are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | * Redistributions in binary form must reproduce the above copyright notice, this 16 | list of conditions and the following disclaimer in the documentation and/or 17 | other materials provided with the distribution. 18 | * Neither the name of the Astropy Team nor the names of its contributors may be 19 | used to endorse or promote products derived from this software without 20 | specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 29 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /mskpy/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | mskpy --- MSK's personal library for astronomy and stuff. 5 | ========================================================= 6 | 7 | .. autosummary:: 8 | :toctree: generated/ 9 | 10 | Modules 11 | ------- 12 | asteroid - Defines an asteroid for observing, flux estimates. 13 | calib - Photometric calibration. 14 | comet - Defines a comet for observing, flux estimates. 15 | config - mskpy configuration parameters. 16 | ephem - Solar System object ephemerides (requires SpiceyPy). 17 | graphics - Helper functions for making plots (requires matplotlib). 18 | image - Image generators, analysis, and processing. 19 | instruments - Cameras, spectrometers, etc. for astronomy. 20 | modeling - For fitting models to data. 21 | models - Surface and dust models. 22 | observing - Tools for observing preparations. 23 | photometry - Tools for photometry. 24 | polarimetry - Classes and functions for polarimetry. 25 | util - Grab bag of utility functions. 26 | 27 | """ 28 | 29 | from ._astropy_init import * # noqa 30 | 31 | from . import config 32 | 33 | from . import image 34 | from . import util 35 | 36 | from .util import * 37 | from .image import * 38 | 39 | from . import calib 40 | from . import instruments 41 | from . import models 42 | from . import modeling 43 | from . import observing 44 | 45 | # depends on SpiceyPy 46 | try: 47 | import spiceypy as spice 48 | _spiceypy = True 49 | except ImportError: 50 | _spiceypy = False 51 | raise UserWarning( 52 | "MSKPY: spiceypy not available. ephem, asteroid, and comet modules will not be loaded.") 53 | 54 | if _spiceypy: 55 | from . import ephem 56 | from . import asteroid 57 | from . import comet 58 | 59 | from .ephem import * 60 | from .comet import * 61 | from .asteroid import * 62 | 63 | # depends on matplotlib 64 | try: 65 | import matplotlib 66 | _matplotlib = True 67 | except ImportError: 68 | _matplotlib = False 69 | raise UserWarning( 70 | "MSKPY: matplotlib not available. Graphics module will not be loaded.") 71 | 72 | if _matplotlib: 73 | from . import graphics 74 | from .graphics import * 75 | 76 | from astropy.io import registry 77 | from astropy.table import Table 78 | registry.register_reader('horizons.csv', Table, util.horizons_csv) 79 | del registry, Table 80 | -------------------------------------------------------------------------------- /mskpy/_astropy_init.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | import os 3 | 4 | __all__ = ['__version__', 'test'] 5 | 6 | try: 7 | from .version import version as __version__ 8 | except ImportError: 9 | __version__ = '' 10 | 11 | # Create the test function for self test 12 | from astropy.tests.runner import TestRunner 13 | test = TestRunner.make_test_runner_in(os.path.dirname(__file__)) 14 | -------------------------------------------------------------------------------- /mskpy/asteroid.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | asteroid --- Asteroids! 5 | ======================= 6 | 7 | 8 | .. autosummary:: 9 | :toctree: generated/ 10 | 11 | Classes 12 | ------- 13 | Asteroid 14 | 15 | """ 16 | 17 | __all__ = [ 18 | 'Asteroid', 19 | ] 20 | 21 | import numpy as np 22 | import astropy.units as u 23 | from .ephem import SolarSysObject 24 | 25 | class Asteroid(SolarSysObject): 26 | """An asteroid. 27 | 28 | Parameters 29 | ---------- 30 | state : State 31 | The location of the asteroid. 32 | D : Quantity 33 | Diameter. 34 | Ap : float 35 | Geometric albedo. 36 | reflected : SurfaceRadiation, optional 37 | A model of the reflected light. If `None` a `DAp` model will be 38 | initialized (including `**kwargs`). 39 | thermal : SurfaceRadiation, optional 40 | A model of the thermal emission. If `None` a `NEATM` model will 41 | be initialized (including `**kwargs`). 42 | name : string, optional 43 | A name for this object. 44 | **kwargs 45 | Additional keywords for the default `reflected` and `thermal` 46 | models. 47 | 48 | Methods 49 | ------- 50 | fluxd : Total flux density as seen by an observer. 51 | 52 | """ 53 | 54 | _D = None 55 | _Ap = None 56 | 57 | def __init__(self, state, D, Ap, reflected=None, thermal=None, 58 | name=None, **kwargs): 59 | from .ephem import State 60 | from .models import SurfaceRadiation, DAp, NEATM 61 | 62 | SolarSysObject.__init__(self, state, name=name) 63 | 64 | assert isinstance(D, u.Quantity), "D must be a Quantity." 65 | 66 | if reflected is None: 67 | self.reflected = DAp(D, Ap, **kwargs) 68 | else: 69 | self.reflected = reflected 70 | self.reflected.D = self.D 71 | self.reflected.Ap = self.Ap 72 | assert isinstance(self.reflected, SurfaceRadiation) 73 | 74 | if thermal is None: 75 | self.thermal = NEATM(D, Ap, **kwargs) 76 | else: 77 | self.thermal = thermal 78 | assert isinstance(self.thermal, SurfaceRadiation) 79 | 80 | self.D = D 81 | self.Ap = Ap 82 | 83 | @property 84 | def Ap(self): 85 | return self._Ap 86 | 87 | @Ap.setter 88 | def Ap(self, p): 89 | self._Ap = p 90 | if self._Ap < 0: 91 | self._Ap = 0 92 | self.reflected.Ap = self._Ap 93 | self.thermal.Ap = self._Ap 94 | 95 | @property 96 | def D(self): 97 | return self._D 98 | 99 | @D.setter 100 | def D(self, d): 101 | assert isinstance(d, u.Quantity) 102 | self._D = d 103 | self.reflected.D = d 104 | self.thermal.D = d 105 | 106 | def fluxd(self, observer, date, wave, reflected=True, thermal=True, 107 | ltt=False, unit=u.Unit('W / (m2 um)'), **kwargs): 108 | """Total flux density as seen by an observer. 109 | 110 | Parameters 111 | ---------- 112 | observer : SolarSysObject 113 | The observer. 114 | date : string, float, astropy Time, datetime 115 | The time of the observation in any format acceptable to 116 | `observer`. 117 | wave : Quantity 118 | The wavelengths to compute `fluxd`. 119 | reflected : bool, optional 120 | If `True` include the reflected light model. 121 | thermal : bool, optional 122 | If `True` include the thermal emission model. 123 | ltt : bool, optional 124 | Set to `True` to correct the object's position for light 125 | travel time. 126 | unit : astropy Unit 127 | The return unit, must be flux density. 128 | 129 | Returns 130 | ------- 131 | fluxd : Quantity 132 | 133 | """ 134 | 135 | fluxd = np.zeros(np.size(wave.value)) * unit 136 | if self.D.value <= 0: 137 | return fluxd 138 | 139 | g = observer.observe(self, date, ltt=ltt) 140 | 141 | if reflected: 142 | fluxd += self.reflected.fluxd(g, wave, unit=unit) 143 | if thermal: 144 | fluxd += self.thermal.fluxd(g, wave, unit=unit) 145 | 146 | return fluxd 147 | 148 | # update module docstring 149 | from .util import autodoc 150 | autodoc(globals()) 151 | del autodoc 152 | 153 | -------------------------------------------------------------------------------- /mskpy/config.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | config --- mskpy configuration 4 | ============================== 5 | 6 | """ 7 | 8 | import os.path 9 | import configparser 10 | 11 | 12 | def _find_config(): 13 | """Locate the config file.""" 14 | fn = os.path.join(os.path.expanduser("~"), '.config', 'mskpy', 15 | 'mskpy.cfg') 16 | if not os.path.exists(fn): 17 | _create_config(fn) 18 | 19 | return fn 20 | 21 | 22 | _defaults = ( 23 | # (section, parameter, value) 24 | ('ephem.core', 'kernel_path', os.path.sep.join( 25 | [os.path.expanduser("~"), 'data', 'kernels'])), 26 | ('calib', 'cohen_path', os.path.sep.join( 27 | [os.path.expanduser("~"), 'data', 'mid-ir'])), 28 | ('calib', 'solar_spectra_path', os.path.sep.join( 29 | [os.path.expanduser("~"), 'data', 'calibration', 'solar-spec'])), 30 | ('spex', 'spextool_path', os.path.sep.join( 31 | [os.path.expanduser("~"), 'local', 'idl', 'irtf', 'Spextool'])), 32 | ('irs', 'rogue_masks_path', os.path.sep.join([os.path.expanduser( 33 | "~"), 'data', 'spitzer', 'irs', 'calibration', 'rogue-masks'])), 34 | ('irs', 'spice_path', os.path.sep.join( 35 | [os.path.expanduser("~"), 'local', 'spitzer', 'spice'])), 36 | ('irac', 'psf_path', os.path.sep.join( 37 | [os.path.expanduser("~"), 'data', 'spitzer', 'calibration', 'irac'])), 38 | ) 39 | 40 | 41 | def _create_config(fn): 42 | from configparser import DuplicateSectionError 43 | path = os.path.dirname(fn) 44 | d = path.split(os.path.sep) 45 | for i in range(len(d)): 46 | x = os.path.sep.join(d[:i+1]) 47 | if len(x) == 0: 48 | continue 49 | if not os.path.exists(x): 50 | os.mkdir(x) 51 | 52 | home = os.path.expanduser("~") 53 | config, updated = _verify_config(configparser.RawConfigParser()) 54 | 55 | with open(fn, 'w') as outf: 56 | config.write(outf) 57 | 58 | 59 | def _verify_config(c): 60 | """Verifies that all sections are contained in `c`, else adds them.""" 61 | from configparser import DuplicateSectionError 62 | 63 | updated = False 64 | for section, parameter, value in _defaults: 65 | try: 66 | c.add_section(section) 67 | updated = True 68 | except DuplicateSectionError: 69 | pass 70 | 71 | if c.get(section, parameter, fallback=None) is None: 72 | c.set(section, parameter, value) 73 | updated = True 74 | 75 | return c, updated 76 | 77 | 78 | config_file = _find_config() 79 | if not os.path.exists(config_file): 80 | _create_config(config_file) 81 | 82 | config = configparser.RawConfigParser() 83 | config.read(config_file) 84 | c, updated = _verify_config(config) 85 | if updated: 86 | config = c 87 | with open(config_file, 'w') as outf: 88 | config.write(outf) 89 | -------------------------------------------------------------------------------- /mskpy/conftest.py: -------------------------------------------------------------------------------- 1 | """Configure Test Suite. 2 | 3 | This file is used to configure the behavior of pytest when using the Astropy 4 | test infrastructure. It needs to live inside the package in order for it to 5 | get picked up when running the tests inside an interpreter using 6 | packagename.test 7 | 8 | """ 9 | 10 | import os 11 | 12 | from astropy.version import version as astropy_version 13 | 14 | # For Astropy 3.0 and later, we can use the standalone pytest plugin 15 | if astropy_version < '3.0': 16 | from astropy.tests.pytest_plugins import * # noqa 17 | del pytest_report_header 18 | ASTROPY_HEADER = True 19 | else: 20 | try: 21 | from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS 22 | ASTROPY_HEADER = True 23 | except ImportError: 24 | ASTROPY_HEADER = False 25 | 26 | 27 | def pytest_configure(config): 28 | """Configure Pytest with Astropy. 29 | 30 | Parameters 31 | ---------- 32 | config : pytest configuration 33 | 34 | """ 35 | if ASTROPY_HEADER: 36 | 37 | config.option.astropy_header = True 38 | 39 | # Customize the following lines to add/remove entries from the list of 40 | # packages for which version numbers are displayed when running the tests. 41 | PYTEST_HEADER_MODULES.pop('Pandas', None) 42 | PYTEST_HEADER_MODULES['scikit-image'] = 'skimage' 43 | 44 | from . import __version__ 45 | packagename = os.path.basename(os.path.dirname(__file__)) 46 | TESTED_VERSIONS[packagename] = __version__ 47 | 48 | # Uncomment the last two lines in this block to treat all DeprecationWarnings as 49 | # exceptions. For Astropy v2.0 or later, there are 2 additional keywords, 50 | # as follow (although default should work for most cases). 51 | # To ignore some packages that produce deprecation warnings on import 52 | # (in addition to 'compiler', 'scipy', 'pygments', 'ipykernel', and 53 | # 'setuptools'), add: 54 | # modules_to_ignore_on_import=['module_1', 'module_2'] 55 | # To ignore some specific deprecation warning messages for Python version 56 | # MAJOR.MINOR or later, add: 57 | # warnings_to_ignore_by_pyver={(MAJOR, MINOR): ['Message to ignore']} 58 | # from astropy.tests.helper import enable_deprecations_as_exceptions # noqa 59 | # enable_deprecations_as_exceptions() 60 | -------------------------------------------------------------------------------- /mskpy/data/E490_00a_AM0_abridged.txt: -------------------------------------------------------------------------------- 1 | # Reference: ASTM, 2000. Standard Solar Constant and Air Mass Zero 2 | # Solar Spectral Irradiance Tables, Standard E490-00, American Society 3 | # for Testing and Materials, West Conshohocken, PA. 4 | # 5 | # Table 4: Abridged version 6 | # 7 | # Wavelength(micron) E-490 (W/m2/micron) 8 | 1.400000000000000133e-01 9.833000000000000074e-02 9 | 1.600000000000000033e-01 3.195000000000000062e-01 10 | 1.799999999999999933e-01 2.041999999999999815e+00 11 | 2.000000000000000111e-01 1.083000000000000007e+01 12 | 2.200000000000000011e-01 4.492999999999999972e+01 13 | 2.300000000000000100e-01 4.964000000000000057e+01 14 | 2.399999999999999911e-01 5.182999999999999829e+01 15 | 2.500000000000000000e-01 5.981000000000000227e+01 16 | 2.600000000000000089e-01 1.290999999999999943e+02 17 | 2.700000000000000178e-01 2.220999999999999943e+02 18 | 2.800000000000000266e-01 2.129000000000000057e+02 19 | 2.899999999999999800e-01 4.410000000000000000e+02 20 | 2.999999999999999889e-01 5.260000000000000000e+02 21 | 3.099999999999999978e-01 6.345000000000000000e+02 22 | 3.200000000000000067e-01 7.465000000000000000e+02 23 | 3.300000000000000155e-01 9.487000000000000455e+02 24 | 3.400000000000000244e-01 9.472999999999999545e+02 25 | 3.499999999999999778e-01 9.695000000000000000e+02 26 | 3.599999999999999867e-01 9.852000000000000455e+02 27 | 3.699999999999999956e-01 1.129000000000000000e+03 28 | 3.800000000000000044e-01 1.091000000000000000e+03 29 | 3.900000000000000133e-01 1.093000000000000000e+03 30 | 4.000000000000000222e-01 1.518000000000000000e+03 31 | 4.099999999999999756e-01 1.712000000000000000e+03 32 | 4.199999999999999845e-01 1.740000000000000000e+03 33 | 4.299999999999999933e-01 1.625000000000000000e+03 34 | 4.400000000000000022e-01 1.826000000000000000e+03 35 | 4.500000000000000111e-01 2.030000000000000000e+03 36 | 4.600000000000000200e-01 2.077000000000000000e+03 37 | 4.699999999999999734e-01 2.049000000000000000e+03 38 | 4.799999999999999822e-01 2.057000000000000000e+03 39 | 4.899999999999999911e-01 1.955000000000000000e+03 40 | 5.000000000000000000e-01 1.948000000000000000e+03 41 | 5.100000000000000089e-01 1.911000000000000000e+03 42 | 5.200000000000000178e-01 1.806000000000000000e+03 43 | 5.300000000000000266e-01 1.861000000000000000e+03 44 | 5.400000000000000355e-01 1.861000000000000000e+03 45 | 5.500000000000000444e-01 1.867000000000000000e+03 46 | 5.600000000000000533e-01 1.808000000000000000e+03 47 | 5.699999999999999512e-01 1.797000000000000000e+03 48 | 5.799999999999999600e-01 1.801000000000000000e+03 49 | 5.899999999999999689e-01 1.758000000000000000e+03 50 | 5.999999999999999778e-01 1.745000000000000000e+03 51 | 6.199999999999999956e-01 1.663000000000000000e+03 52 | 6.400000000000000133e-01 1.610000000000000000e+03 53 | 6.600000000000000311e-01 1.527000000000000000e+03 54 | 6.800000000000000488e-01 1.485000000000000000e+03 55 | 6.999999999999999556e-01 1.438000000000000000e+03 56 | 7.199999999999999734e-01 1.360000000000000000e+03 57 | 7.500000000000000000e-01 1.272000000000000000e+03 58 | 8.000000000000000444e-01 1.132000000000000000e+03 59 | 9.000000000000000222e-01 8.826000000000000227e+02 60 | 1.000000000000000000e+00 7.197000000000000455e+02 61 | 1.199999999999999956e+00 4.871000000000000227e+02 62 | 1.399999999999999911e+00 3.425000000000000000e+02 63 | 1.600000000000000089e+00 2.435000000000000000e+02 64 | 1.800000000000000044e+00 1.670999999999999943e+02 65 | 2.000000000000000000e+00 1.150000000000000000e+02 66 | 2.200000000000000178e+00 8.173000000000000398e+01 67 | 2.399999999999999911e+00 5.878000000000000114e+01 68 | 2.600000000000000089e+00 4.385999999999999943e+01 69 | 2.799999999999999822e+00 3.342999999999999972e+01 70 | 3.000000000000000000e+00 2.592999999999999972e+01 71 | 3.200000000000000178e+00 2.044999999999999929e+01 72 | 3.399999999999999911e+00 1.635999999999999943e+01 73 | 3.600000000000000089e+00 1.325999999999999979e+01 74 | 3.799999999999999822e+00 1.086999999999999922e+01 75 | 4.000000000000000000e+00 8.977000000000000313e+00 76 | 4.500000000000000000e+00 5.674000000000000377e+00 77 | 5.000000000000000000e+00 3.690999999999999837e+00 78 | 6.000000000000000000e+00 1.879000000000000004e+00 79 | 7.000000000000000000e+00 1.022000000000000020e+00 80 | 8.000000000000000000e+00 6.040999999999999703e-01 81 | 1.000000000000000000e+01 2.662999999999999812e-01 82 | 1.500000000000000000e+01 6.106000000000000316e-02 83 | 2.000000000000000000e+01 1.754999999999999963e-02 84 | 5.000000000000000000e+01 1.768999999999999956e-03 85 | -------------------------------------------------------------------------------- /mskpy/data/filters/2mass/hrsr.tbl: -------------------------------------------------------------------------------- 1 | #\CHAR INPUT = hrsr.in.txt 2 | #\CHAR OUTPUT = hrsr.tbl 3 | #\CHAR TITLE = 2MASS H-BAND TOTAL RESPONSE 4 | #\CHAR TITLEY = RSR 5 | #|n |xlam |yval | 6 | #|i |r |r | 7 | 1 1.289 0.0000 8 | 2 1.315 0.0000 9 | 3 1.341 0.0000 10 | 4 1.368 0.0000 11 | 5 1.397 0.0000 12 | 6 1.418 0.0000 13 | 7 1.440 0.0005 14 | 8 1.462 0.0028 15 | 9 1.478 0.0081 16 | 10 1.486 0.0287 17 | 11 1.493 0.0871 18 | 12 1.504 0.2014 19 | 13 1.515 0.4382 20 | 14 1.528 0.6864 21 | 15 1.539 0.8181 22 | 16 1.546 0.8821 23 | 17 1.551 0.9118 24 | 18 1.556 0.9269 25 | 19 1.565 0.9293 26 | 20 1.572 0.8727 27 | 21 1.577 0.8566 28 | 22 1.583 0.8826 29 | 23 1.592 0.9181 30 | 24 1.597 0.9267 31 | 25 1.602 0.9076 32 | 26 1.613 0.9260 33 | 27 1.619 0.9205 34 | 28 1.628 0.9242 35 | 29 1.633 0.9235 36 | 30 1.642 0.9418 37 | 31 1.648 0.9491 38 | 32 1.657 0.9807 39 | 33 1.659 0.9937 40 | 34 1.671 1.0000 41 | 35 1.684 0.9561 42 | 36 1.701 0.9241 43 | 37 1.715 0.9821 44 | 38 1.727 0.9916 45 | 39 1.739 0.9887 46 | 40 1.746 0.9792 47 | 41 1.751 0.9682 48 | 42 1.753 0.9370 49 | 43 1.756 0.9190 50 | 44 1.764 0.8423 51 | 45 1.775 0.6671 52 | 46 1.785 0.2694 53 | 47 1.790 0.4516 54 | 48 1.796 0.1731 55 | 49 1.803 0.1077 56 | 50 1.810 0.0707 57 | 51 1.813 0.0051 58 | 52 1.818 0.0200 59 | 53 1.828 0.0004 60 | 54 1.835 0.0000 61 | 55 1.850 0.0001 62 | 56 1.871 0.0000 63 | 57 1.893 0.0000 64 | 58 1.914 0.0000 65 | 66 | -------------------------------------------------------------------------------- /mskpy/data/filters/2mass/jrsr.tbl: -------------------------------------------------------------------------------- 1 | #\CHAR INPUT = jrsr.in.txt 2 | #\CHAR OUTPUT = jrsr.tbl 3 | #\CHAR TITLE = 2MASS J-BAND TOTAL RESPONSE 4 | #\CHAR TITLEY = RSR 5 | #|n |xlam |yval | 6 | #|i |r |r | 7 | 1 1.062 0.0000 8 | 2 1.066 0.0004 9 | 3 1.070 0.0015 10 | 4 1.075 0.0027 11 | 5 1.078 0.0055 12 | 6 1.082 0.0123 13 | 7 1.084 0.0203 14 | 8 1.087 0.0306 15 | 9 1.089 0.0405 16 | 10 1.093 0.0515 17 | 11 1.096 0.0564 18 | 12 1.102 0.0718 19 | 13 1.105 0.2736 20 | 14 1.107 0.3410 21 | 15 1.109 0.3584 22 | 16 1.112 0.3801 23 | 17 1.116 0.3307 24 | 18 1.117 0.2395 25 | 19 1.120 0.2501 26 | 20 1.123 0.2833 27 | 21 1.128 0.2582 28 | 22 1.129 0.2515 29 | 23 1.132 0.5381 30 | 24 1.134 0.2232 31 | 25 1.138 0.5369 32 | 26 1.140 0.1102 33 | 27 1.143 0.5292 34 | 28 1.147 0.2619 35 | 29 1.154 0.3202 36 | 30 1.159 0.1743 37 | 31 1.164 0.6070 38 | 32 1.167 0.6179 39 | 33 1.170 0.6763 40 | 34 1.173 0.7279 41 | 35 1.175 0.7465 42 | 36 1.179 0.8304 43 | 37 1.182 0.7903 44 | 38 1.186 0.8096 45 | 39 1.188 0.8369 46 | 40 1.192 0.8360 47 | 41 1.195 0.7499 48 | 42 1.199 0.7080 49 | 43 1.202 0.6988 50 | 44 1.209 0.7049 51 | 45 1.216 0.7004 52 | 46 1.221 0.7328 53 | 47 1.227 0.7057 54 | 48 1.231 0.8424 55 | 49 1.236 0.9219 56 | 50 1.240 0.9525 57 | 51 1.244 0.9676 58 | 52 1.247 0.9595 59 | 53 1.253 0.9227 60 | 54 1.255 0.8930 61 | 55 1.258 0.8529 62 | 56 1.260 0.8023 63 | 57 1.265 0.7501 64 | 58 1.270 0.6781 65 | 59 1.275 0.6524 66 | 60 1.279 0.6388 67 | 61 1.286 0.6424 68 | 62 1.292 0.6486 69 | 63 1.297 0.6824 70 | 64 1.302 0.7529 71 | 65 1.305 0.7759 72 | 66 1.307 0.8118 73 | 67 1.310 0.7770 74 | 68 1.313 0.7210 75 | 69 1.316 0.9525 76 | 70 1.319 0.8551 77 | 71 1.323 0.8414 78 | 72 1.326 1.0000 79 | 73 1.330 0.8947 80 | 74 1.333 0.8549 81 | 75 1.334 0.5379 82 | 76 1.336 0.2799 83 | 77 1.339 0.9065 84 | 78 1.343 0.6893 85 | 79 1.346 0.5533 86 | 80 1.349 0.2432 87 | 81 1.353 0.0144 88 | 82 1.355 0.0002 89 | 83 1.360 0.0401 90 | 84 1.363 0.0045 91 | 85 1.370 0.0003 92 | 86 1.373 0.0372 93 | 87 1.377 0.0005 94 | 88 1.383 0.0000 95 | 89 1.388 0.0001 96 | 90 1.392 0.0033 97 | 91 1.395 0.0003 98 | 92 1.396 0.0085 99 | 93 1.397 0.0254 100 | 94 1.398 0.1184 101 | 95 1.400 0.0001 102 | 96 1.401 0.0001 103 | 97 1.402 0.0521 104 | 98 1.404 0.0104 105 | 99 1.406 0.0478 106 | 100 1.407 0.0004 107 | 101 1.410 0.0024 108 | 102 1.412 0.0053 109 | 103 1.416 0.0086 110 | 104 1.421 0.0007 111 | 105 1.426 0.0003 112 | 106 1.442 0.0004 113 | 107 1.450 0.0000 114 | 115 | -------------------------------------------------------------------------------- /mskpy/data/filters/2mass/krsr.tbl: -------------------------------------------------------------------------------- 1 | #\CHAR INPUT = krsr.in.txt 2 | #\CHAR OUTPUT = krsr.tbl 3 | #\CHAR TITLE = 2MASS K-BAND TOTAL RESPONSE 4 | #\CHAR TITLEY = RSR 5 | #|n |xlam |yval | 6 | #|i |r |r | 7 | 1 1.900 0.0000 8 | 2 1.915 0.0000 9 | 3 1.927 0.0000 10 | 4 1.934 0.0002 11 | 5 1.939 0.0005 12 | 6 1.948 0.0054 13 | 7 1.957 0.0119 14 | 8 1.962 0.0197 15 | 9 1.969 0.0422 16 | 10 1.976 0.0873 17 | 11 1.981 0.1528 18 | 12 1.989 0.2482 19 | 13 1.990 0.1902 20 | 14 1.998 0.2339 21 | 15 2.008 0.2946 22 | 16 2.014 0.3982 23 | 17 2.019 0.3366 24 | 18 2.028 0.6207 25 | 19 2.037 0.7650 26 | 20 2.045 0.7464 27 | 21 2.061 0.6251 28 | 22 2.072 0.7255 29 | 23 2.075 0.6895 30 | 24 2.082 0.7879 31 | 25 2.089 0.8181 32 | 26 2.099 0.8228 33 | 27 2.106 0.8633 34 | 28 2.113 0.8778 35 | 29 2.120 0.8549 36 | 30 2.124 0.8953 37 | 31 2.138 0.9189 38 | 32 2.145 0.9268 39 | 33 2.155 0.9267 40 | 34 2.169 0.9009 41 | 35 2.176 0.9228 42 | 36 2.185 0.8428 43 | 37 2.197 0.9459 44 | 38 2.208 0.9804 45 | 39 2.213 0.9879 46 | 40 2.218 0.9848 47 | 41 2.232 0.9647 48 | 42 2.237 0.9816 49 | 43 2.248 0.9834 50 | 44 2.256 0.9613 51 | 45 2.260 0.9792 52 | 46 2.263 1.0000 53 | 47 2.265 0.9632 54 | 48 2.270 0.9812 55 | 49 2.272 0.9681 56 | 50 2.276 0.9109 57 | 51 2.277 0.9821 58 | 52 2.281 0.8896 59 | 53 2.284 0.8918 60 | 54 2.286 0.9424 61 | 55 2.291 0.8404 62 | 56 2.293 0.8042 63 | 57 2.295 0.7077 64 | 58 2.297 0.6576 65 | 59 2.299 0.5607 66 | 60 2.306 0.4437 67 | 61 2.311 0.3482 68 | 62 2.316 0.2302 69 | 63 2.320 0.1626 70 | 64 2.325 0.1360 71 | 65 2.328 0.0921 72 | 66 2.335 0.0624 73 | 67 2.339 0.0431 74 | 68 2.344 0.0340 75 | 69 2.346 0.0310 76 | 70 2.352 0.0118 77 | 71 2.361 0.0068 78 | 72 2.363 0.0007 79 | 73 2.370 0.0030 80 | 74 2.375 0.0021 81 | 75 2.384 0.0004 82 | 76 2.399 0.0000 83 | 84 | -------------------------------------------------------------------------------- /mskpy/data/filters/cousins/cousins_i_004_syn.fits: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/mskpy/data/filters/cousins/cousins_i_004_syn.fits -------------------------------------------------------------------------------- /mskpy/data/filters/cousins/cousins_r_004_syn.fits: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/mskpy/data/filters/cousins/cousins_r_004_syn.fits -------------------------------------------------------------------------------- /mskpy/data/filters/johnson/johnson_b_004_syn.fits: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/mskpy/data/filters/johnson/johnson_b_004_syn.fits -------------------------------------------------------------------------------- /mskpy/data/filters/johnson/johnson_u_004_syn.fits: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/mskpy/data/filters/johnson/johnson_u_004_syn.fits -------------------------------------------------------------------------------- /mskpy/data/filters/johnson/johnson_v_004_syn.fits: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/mskpy/data/filters/johnson/johnson_v_004_syn.fits -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/FOR-20um-542-090-091.txt: -------------------------------------------------------------------------------- 1 | 1 16.306 0.000 2 | 2 16.358 0.001 3 | 3 16.410 0.002 4 | 4 16.462 0.002 5 | 5 16.514 0.002 6 | 6 16.567 0.003 7 | 7 16.620 0.003 8 | 8 16.674 0.003 9 | 9 16.727 0.005 10 | 10 16.781 0.007 11 | 11 16.836 0.009 12 | 12 16.891 0.014 13 | 13 16.946 0.022 14 | 14 17.002 0.032 15 | 15 17.057 0.046 16 | 16 17.114 0.070 17 | 17 17.170 0.111 18 | 18 17.227 0.178 19 | 19 17.285 0.270 20 | 20 17.343 0.377 21 | 21 17.401 0.479 22 | 22 17.459 0.550 23 | 23 17.518 0.593 24 | 24 17.578 0.613 25 | 25 17.638 0.620 26 | 26 17.698 0.625 27 | 27 17.758 0.634 28 | 28 17.819 0.639 29 | 29 17.881 0.644 30 | 30 17.943 0.650 31 | 31 18.005 0.660 32 | 32 18.068 0.669 33 | 33 18.131 0.673 34 | 34 18.195 0.670 35 | 35 18.259 0.665 36 | 36 18.323 0.662 37 | 37 18.388 0.664 38 | 38 18.454 0.664 39 | 39 18.520 0.662 40 | 40 18.586 0.653 41 | 41 18.653 0.643 42 | 42 18.720 0.634 43 | 43 18.788 0.632 44 | 44 18.856 0.632 45 | 45 18.925 0.636 46 | 46 18.994 0.640 47 | 47 19.064 0.639 48 | 48 19.135 0.636 49 | 49 19.205 0.642 50 | 50 19.277 0.646 51 | 51 19.349 0.641 52 | 52 19.421 0.625 53 | 53 19.494 0.613 54 | 54 19.568 0.610 55 | 55 19.642 0.620 56 | 56 19.717 0.641 57 | 57 19.792 0.666 58 | 58 19.868 0.684 59 | 59 19.944 0.689 60 | 60 20.021 0.679 61 | 61 20.099 0.678 62 | 62 20.177 0.683 63 | 63 20.256 0.694 64 | 64 20.335 0.699 65 | 65 20.415 0.694 66 | 66 20.496 0.680 67 | 67 20.577 0.671 68 | 68 20.659 0.663 69 | 69 20.742 0.658 70 | 70 20.825 0.656 71 | 71 20.909 0.657 72 | 72 20.994 0.650 73 | 73 21.079 0.644 74 | 74 21.165 0.637 75 | 75 21.252 0.621 76 | 76 21.339 0.609 77 | 77 21.428 0.596 78 | 78 21.516 0.567 79 | 79 21.606 0.528 80 | 80 21.697 0.490 81 | 81 21.788 0.476 82 | 82 21.880 0.467 83 | 83 21.972 0.455 84 | 84 22.066 0.446 85 | 85 22.160 0.420 86 | 86 22.255 0.361 87 | 87 22.351 0.267 88 | 88 22.448 0.158 89 | 89 22.546 0.078 90 | 90 22.644 0.031 91 | 91 22.743 0.013 92 | 92 22.843 0.007 93 | 93 22.945 0.004 94 | 94 23.047 0.002 95 | 95 23.149 0.001 96 | 96 23.253 0.000 97 | 97 23.358 0.000 98 | -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/FOR-30um-542-84-85.txt: -------------------------------------------------------------------------------- 1 | 1 26.058 0.001 2 | 2 26.189 0.001 3 | 3 26.322 0.001 4 | 4 26.456 0.001 5 | 5 26.592 0.001 6 | 6 26.729 0.001 7 | 7 26.868 0.002 8 | 8 27.008 0.001 9 | 9 27.149 0.002 10 | 10 27.292 0.002 11 | 11 27.436 0.004 12 | 12 27.582 0.005 13 | 13 27.730 0.009 14 | 14 27.879 0.013 15 | 15 28.030 0.023 16 | 16 28.182 0.037 17 | 17 28.336 0.073 18 | 18 28.492 0.132 19 | 19 28.649 0.220 20 | 20 28.808 0.286 21 | 21 28.969 0.337 22 | 22 29.132 0.367 23 | 23 29.296 0.388 24 | 24 29.463 0.398 25 | 25 29.631 0.404 26 | 26 29.802 0.407 27 | 27 29.974 0.413 28 | 28 30.148 0.413 29 | 29 30.324 0.414 30 | 30 30.503 0.409 31 | 31 30.683 0.405 32 | 32 30.866 0.396 33 | 33 31.051 0.385 34 | 34 31.238 0.375 35 | 35 31.427 0.364 36 | 36 31.619 0.351 37 | 37 31.813 0.335 38 | 38 32.009 0.318 39 | 39 32.208 0.304 40 | 40 32.409 0.287 41 | 41 32.613 0.271 42 | 42 32.819 0.259 43 | 43 33.028 0.239 44 | 44 33.240 0.217 45 | 45 33.455 0.204 46 | 46 33.672 0.192 47 | 47 33.892 0.183 48 | 48 34.115 0.177 49 | 49 34.341 0.172 50 | 50 34.570 0.164 51 | 51 34.802 0.154 52 | 52 35.037 0.145 53 | 53 35.275 0.135 54 | 54 35.517 0.122 55 | 55 35.762 0.102 56 | 56 36.010 0.072 57 | 57 36.262 0.043 58 | 58 36.517 0.020 59 | 59 36.776 0.004 60 | 60 37.039 0.000 61 | 61 37.306 0.001 62 | 62 37.576 0.007 63 | 63 37.850 0.016 64 | 64 38.128 0.027 65 | 65 38.411 0.037 66 | 66 38.698 0.046 67 | 67 38.988 0.049 68 | 68 39.284 0.048 69 | 69 39.584 0.047 70 | 70 39.888 0.045 71 | 71 40.197 0.037 72 | 72 40.511 0.027 73 | 73 40.830 0.016 74 | 74 41.154 0.011 75 | 75 41.484 0.008 76 | 76 41.818 0.005 77 | 77 42.158 0.003 78 | 78 42.504 0.003 79 | 79 42.855 0.002 80 | 80 43.212 0.001 81 | -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/Lakeshore_24um_5000_18-28um_double.txt: -------------------------------------------------------------------------------- 1 | 750 18.00509328 0.001033484 2 | 751 18.06782662 0.001087662 3 | 752 18.13100193 0.001144423 4 | 753 18.19462058 0.001251112 5 | 754 18.25868392 0.001284127 6 | 755 18.32320335 0.001393241 7 | 756 18.38818037 0.001503947 8 | 757 18.45361647 0.001707212 9 | 758 18.51952337 0.001841199 10 | 759 18.58590274 0.00198543 11 | 760 18.65275619 0.002115968 12 | 761 18.72009582 0.002370427 13 | 762 18.78792342 0.002429301 14 | 763 18.85624077 0.002507891 15 | 764 18.92506036 0.002473969 16 | 765 18.99438412 0.002511784 17 | 766 19.06421399 0.002387095 18 | 767 19.13456286 0.00234753 19 | 768 19.20543283 0.00221029 20 | 769 19.27682602 0.002049713 21 | 770 19.34875571 0.001837275 22 | 771 19.42122421 0.001878164 23 | 772 19.4942338 0.00173311 24 | 773 19.56779821 0.00165767 25 | 774 19.64191994 0.001541502 26 | 775 19.71660534 0.001530944 27 | 776 19.79185696 0.00140589 28 | 777 19.86768914 0.001423281 29 | 778 19.94410465 0.001411912 30 | 779 20.02110625 0.001577446 31 | 780 20.09870878 0.001713406 32 | 781 20.17691523 0.002077277 33 | 782 20.25572857 0.002364601 34 | 783 20.33516418 0.002906541 35 | 784 20.41522527 0.003326229 36 | 785 20.49591506 0.004029775 37 | 786 20.57724946 0.004707312 38 | 787 20.65923196 0.005839054 39 | 788 20.74186603 0.007068495 40 | 789 20.82516813 0.008940501 41 | 790 20.90914204 0.010853264 42 | 791 20.99379151 0.013479582 43 | 792 21.0791336 0.015963084 44 | 793 21.16517237 0.020049087 45 | 794 21.25191188 0.024426533 46 | 795 21.33936981 0.029219902 47 | 796 21.42755056 0.034958716 48 | 797 21.51645848 0.041790071 49 | 798 21.60611194 0.048972318 50 | 799 21.69651565 0.057585313 51 | 800 21.78767432 0.066119797 52 | 801 21.87960702 0.080325309 53 | 802 21.97231883 0.092977243 54 | 803 22.06581482 0.107497491 55 | 804 22.16011481 0.125776906 56 | 805 22.25522425 0.144885972 57 | 806 22.35114861 0.166142814 58 | 807 22.44790851 0.190855834 59 | 808 22.54550472 0.216823683 60 | 809 22.6439584 0.250496847 61 | 810 22.74327572 0.283440603 62 | 811 22.84346289 0.318043212 63 | 812 22.9445419 0.358931594 64 | 813 23.0465194 0.402463994 65 | 814 23.14940207 0.443868809 66 | 815 23.25321284 0.488678033 67 | 816 23.35795885 0.533681532 68 | 817 23.4636473 0.577168401 69 | 818 23.57030208 0.62175559 70 | 819 23.67793089 0.66219248 71 | 820 23.78654148 0.693862011 72 | 821 23.89615876 0.73908409 73 | 822 24.00679104 0.769455805 74 | 823 24.11844666 0.783412985 75 | 824 24.23115162 0.797273089 76 | 825 24.34491486 0.801210455 77 | 826 24.45974537 0.7999163 78 | 827 24.57567033 0.788092961 79 | 828 24.69269936 0.772840546 80 | 829 24.81084214 0.750443464 81 | 830 24.93012709 0.726185358 82 | 831 25.05056456 0.690924028 83 | 832 25.17216502 0.650735204 84 | 833 25.29495818 0.61080399 85 | 834 25.41895522 0.577650161 86 | 835 25.5441674 0.539991589 87 | 836 25.67062585 0.505550151 88 | 837 25.79834261 0.469590724 89 | 838 25.92732984 0.435146962 90 | 839 26.05762017 0.390881917 91 | 840 26.18922659 0.363803313 92 | 841 26.32216221 0.334377804 93 | 842 26.45646126 0.310559995 94 | 843 26.59213777 0.2830838 95 | 844 26.72920588 0.250695383 96 | 845 26.86770156 0.233889175 97 | 846 27.00763992 0.21696051 98 | 847 27.14903626 0.195468768 99 | 848 27.29192838 0.181079015 100 | 849 27.43633262 0.165351698 101 | 850 27.58226549 0.152013198 102 | 851 27.72976677 0.139233907 103 | 852 27.87885411 0.127625848 104 | 853 28.02954538 0.113619151 105 | 854 28.18188249 0.105917963 106 | 855 28.33588451 0.094573471 107 | 856 28.49157077 0.087015501 108 | 857 28.64898547 0.078783845 109 | 858 28.80814925 0.074875785 110 | 859 28.96908304 0.069357963 111 | -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/Lakeshore_33um_4587_28-40um_double.txt: -------------------------------------------------------------------------------- 1 | 853 28.02954538 0.001076263 2 | 854 28.18188249 0.001252902 3 | 855 28.33588451 0.001446619 4 | 856 28.49157077 0.001807932 5 | 857 28.64898547 0.002171134 6 | 858 28.80814925 0.002598514 7 | 859 28.96908304 0.002926518 8 | 860 29.13183349 0.003287862 9 | 861 29.29642297 0.003560783 10 | 862 29.46287413 0.003832217 11 | 863 29.6312363 0.003773598 12 | 864 29.80153371 0.003591038 13 | 865 29.97379092 0.00327032 14 | 866 30.14806014 0.003064634 15 | 867 30.32436763 0.002633333 16 | 868 30.50274006 0.00232241 17 | 869 30.68323275 0.002016514 18 | 870 30.8658742 0.002191178 19 | 871 31.05069336 0.002500047 20 | 872 31.23774895 0.003367098 21 | 873 31.42707191 0.004908036 22 | 874 31.61869373 0.008216536 23 | 875 31.81267678 0.017206199 24 | 876 32.00905472 0.033455922 25 | 877 32.20786181 0.062716838 26 | 878 32.4091644 0.114527284 27 | 879 32.61299915 0.186719139 28 | 880 32.81940336 0.249264642 29 | 881 33.02844773 0.349777735 30 | 882 33.24017221 0.428729253 31 | 883 33.45461747 0.437958195 32 | 884 33.67185898 0.403540276 33 | 885 33.89194029 0.352417354 34 | 886 34.11490583 0.280947384 35 | 887 34.34083623 0.221655088 36 | 888 34.5697791 0.141424132 37 | 889 34.80178296 0.102907251 38 | 890 35.03693418 0.079771393 39 | 891 35.2752848 0.062581927 40 | 892 35.51688793 0.042430891 41 | 893 35.76183618 0.03129782 42 | 894 36.01018656 0.022655578 43 | 895 36.26199728 0.020517153 44 | 896 36.51736784 0.017787263 45 | 897 36.77636074 0.015240544 46 | 898 37.03903989 0.012559371 47 | 899 37.30551237 0.010893932 48 | 900 37.57584685 0.008605933 49 | 901 37.85011355 0.007763051 50 | 902 38.12842798 0.006618791 51 | 903 38.41086567 0.005731062 52 | 904 38.69750393 0.005080616 53 | 905 38.9884676 0.00467384 54 | 906 39.28383989 0.003949988 55 | 907 39.58370608 0.003318447 56 | 908 39.88820135 0.002878138 57 | 909 40.19741756 0.002726734 58 | 910 40.51144894 0.002245429 59 | 911 40.8304422 0.002317496 60 | 912 41.15449893 0.002053288 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/Lakeshore_34um_5007_28-40um_double.txt: -------------------------------------------------------------------------------- 1 | 853 28.02954538 0.000907417 2 | 854 28.18188249 0.00116658 3 | 855 28.33588451 0.001490077 4 | 856 28.49157077 0.001885895 5 | 857 28.64898547 0.002519504 6 | 858 28.80814925 0.003189647 7 | 859 28.96908304 0.003945823 8 | 860 29.13183349 0.005024322 9 | 861 29.29642297 0.006572355 10 | 862 29.46287413 0.008525039 11 | 863 29.6312363 0.00999893 12 | 864 29.80153371 0.011768323 13 | 865 29.97379092 0.014898814 14 | 866 30.14806014 0.017955276 15 | 867 30.32436763 0.020975845 16 | 868 30.50274006 0.026728293 17 | 869 30.68323275 0.033781153 18 | 870 30.8658742 0.041380836 19 | 871 31.05069336 0.054935344 20 | 872 31.23774895 0.065685435 21 | 873 31.42707191 0.07935596 22 | 874 31.61869373 0.094717449 23 | 875 31.81267678 0.12188261 24 | 876 32.00905472 0.150585596 25 | 877 32.20786181 0.184089738 26 | 878 32.4091644 0.22494408 27 | 879 32.61299915 0.268838309 28 | 880 32.81940336 0.302963277 29 | 881 33.02844773 0.391053743 30 | 882 33.24017221 0.478114304 31 | 883 33.45461747 0.531954923 32 | 884 33.67185898 0.592345884 33 | 885 33.89194029 0.650356925 34 | 886 34.11490583 0.687794718 35 | 887 34.34083623 0.718333375 36 | 888 34.5697791 0.710162335 37 | 889 34.80178296 0.696544975 38 | 890 35.03693418 0.663971559 39 | 891 35.2752848 0.637964341 40 | 892 35.51688793 0.569146217 41 | 893 35.76183618 0.516007471 42 | 894 36.01018656 0.393449839 43 | 895 36.26199728 0.345563272 44 | 896 36.51736784 0.305837425 45 | 897 36.77636074 0.267590082 46 | 898 37.03903989 0.225547677 47 | 899 37.30551237 0.197319681 48 | 900 37.57584685 0.156255686 49 | 901 37.85011355 0.131246074 50 | 902 38.12842798 0.113161192 51 | 903 38.41086567 0.097011754 52 | 904 38.69750393 0.081562162 53 | 905 38.9884676 0.071862329 54 | 906 39.28383989 0.058336161 55 | 907 39.58370608 0.045158248 56 | 908 39.88820135 0.040340682 57 | 909 40.19741756 0.038045244 58 | 910 40.51144894 0.029984697 59 | 911 40.8304422 0.026348562 60 | 912 41.15449893 0.022880707 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/Lakeshore_38um_5130_5144_double.txt: -------------------------------------------------------------------------------- 1 | 839 26.05762017 -0.000162327 2 | 840 26.18922659 -6.23556E-05 3 | 841 26.32216221 -0.000453992 4 | 842 26.45646126 -0.00035676 5 | 843 26.59213777 0.000957593 6 | 844 26.72920588 0.000829093 7 | 845 26.86770156 -0.000390867 8 | 846 27.00763992 -0.000542577 9 | 847 27.14903626 0.000340337 10 | 848 27.29192838 0.000788615 11 | 849 27.43633262 0.001258428 12 | 850 27.58226549 0.0016972 13 | 851 27.72976677 0.001252329 14 | 852 27.87885411 0.000493297 15 | 853 28.02954538 0.000381555 16 | 854 28.18188249 0.000771437 17 | 855 28.33588451 0.000273542 18 | 856 28.49157077 0.000839332 19 | 857 28.64898547 0.001260523 20 | 858 28.80814925 0.000651965 21 | 859 28.96908304 0.000534808 22 | 860 29.13183349 0.000884418 23 | 861 29.29642297 0.000722201 24 | 862 29.46287413 0.000609415 25 | 863 29.6312363 0.000890638 26 | 864 29.80153371 0.00056581 27 | 865 29.97379092 -0.000580197 28 | 866 30.14806014 -0.000606191 29 | 867 30.32436763 0.000562301 30 | 868 30.50274006 0.001073466 31 | 869 30.68323275 0.000743774 32 | 870 30.8658742 0.002330565 33 | 871 31.05069336 0.002113717 34 | 872 31.23774895 0.001183021 35 | 873 31.42707191 0.001061983 36 | 874 31.61869373 0.002074288 37 | 875 31.81267678 0.002479088 38 | 876 32.00905472 0.003754326 39 | 877 32.20786181 0.005137905 40 | 878 32.4091644 0.006612692 41 | 879 32.61299915 0.00871103 42 | 880 32.81940336 0.0118088 43 | 881 33.02844773 0.01527271 44 | 882 33.24017221 0.01786714 45 | 883 33.45461747 0.02149944 46 | 884 33.67185898 0.02661418 47 | 885 33.89194029 0.03293763 48 | 886 34.11490583 0.04197875 49 | 887 34.34083623 0.05313959 50 | 888 34.5697791 0.07064816 51 | 889 34.80178296 0.09000024 52 | 890 35.03693418 0.109738 53 | 891 35.2752848 0.1353989 54 | 892 35.51688793 0.1748191 55 | 893 35.76183618 0.2187398 56 | 894 36.01018656 0.2833329 57 | 895 36.26199728 0.3421297 58 | 896 36.51736784 0.4008957 59 | 897 36.77636074 0.4717422 60 | 898 37.03903989 0.545193 61 | 899 37.30551237 0.6090234 62 | 900 37.57584685 0.6760613 63 | 901 37.85011355 0.7149589 64 | 902 38.12842798 0.7277419 65 | 903 38.41086567 0.7179273 66 | 904 38.69750393 0.6870592 67 | 905 38.9884676 0.6475071 68 | 906 39.28383989 0.5950754 69 | 907 39.58370608 0.4979013 70 | 908 39.88820135 0.4436406 71 | 909 40.19741756 0.3899212 72 | 910 40.51144894 0.3212294 73 | 911 40.8304422 0.2586885 74 | 912 41.15449893 0.2116805 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/N06611.txt: -------------------------------------------------------------------------------- 1 | 1 6.3947 5.379E-5 2 | 2 6.3989 0.002026 3 | 3 6.4027 0.001988 4 | 4 6.4080 0.005965 5 | 5 6.4165 0.005879 6 | 6 6.4256 0.011833 7 | 7 6.4314 0.011774 8 | 8 6.4368 0.019781 9 | 9 6.4448 0.025746 10 | 10 6.4533 0.037750 11 | 11 6.4613 0.051776 12 | 12 6.4688 0.073867 13 | 13 6.4757 0.097978 14 | 14 6.4837 0.13215 15 | 15 6.4917 0.18044 16 | 16 6.4971 0.22270 17 | 17 6.5019 0.26698 18 | 18 6.5062 0.31127 19 | 19 6.5084 0.34349 20 | 20 6.5121 0.38980 21 | 21 6.5159 0.44216 22 | 22 6.5207 0.50659 23 | 23 6.5234 0.54284 24 | 24 6.5256 0.58110 25 | 25 6.5288 0.62943 26 | 26 6.5320 0.67373 27 | 27 6.5358 0.71198 28 | 28 6.5390 0.74419 29 | 29 6.5428 0.77237 30 | 30 6.5460 0.78442 31 | 31 6.5508 0.78841 32 | 32 6.5561 0.77425 33 | 33 6.5603 0.75607 34 | 34 6.5651 0.73184 35 | 35 6.5699 0.70156 36 | 36 6.5746 0.66927 37 | 37 6.5810 0.64503 38 | 38 6.5885 0.62077 39 | 39 6.5954 0.60861 40 | 40 6.6028 0.60854 41 | 41 6.6098 0.61653 42 | 42 6.6172 0.63056 43 | 43 6.6242 0.65064 44 | 44 6.6306 0.67476 45 | 45 6.6380 0.70088 46 | 46 6.6455 0.73304 47 | 47 6.6530 0.75513 48 | 48 6.6610 0.76916 49 | 49 6.6695 0.76504 50 | 50 6.6759 0.74684 51 | 51 6.6817 0.71253 52 | 52 6.6865 0.67218 53 | 53 6.6913 0.62377 54 | 54 6.6971 0.55721 55 | 55 6.7023 0.48864 56 | 56 6.7066 0.43218 57 | 57 6.7118 0.36361 58 | 58 6.7192 0.27487 59 | 59 6.7251 0.21637 60 | 60 6.7309 0.16795 61 | 61 6.7388 0.12555 62 | 62 6.7473 0.087181 63 | 63 6.7585 0.054826 64 | 64 6.7761 0.028453 65 | 65 6.7894 0.018243 66 | 66 6.8027 0.012064 67 | 67 6.8117 0.007942 68 | 68 6.8218 0.005825 69 | 69 6.8309 0.003719 70 | 70 6.8410 0.003617 71 | 71 6.8490 0.003537 72 | 72 6.8559 0.001452 73 | -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/OCLI_N06276-9_2.txt: -------------------------------------------------------------------------------- 1 | 459 6.187804827 0.000815322 2 | 460 6.195199588 0.002918703 3 | 461 6.202608197 0.002464745 4 | 462 6.210038403 0.004163719 5 | 463 6.217482566 0.004656587 6 | 464 6.224948473 0.009973578 7 | 465 6.232428447 0.01281163 8 | 466 6.239930312 0.02000897 9 | 467 6.247446356 0.02874288 10 | 468 6.254984441 0.04731208 11 | 469 6.262536816 0.07609809 12 | 470 6.270111382 0.1404626 13 | 471 6.277700353 0.2563417 14 | 472 6.285311667 0.4410468 15 | 473 6.292937499 0.6530172 16 | 474 6.300585828 0.789969 17 | 475 6.308248792 0.8156683 18 | 476 6.315934408 0.7887476 19 | 477 6.323634775 0.7662304 20 | 478 6.33135795 0.7610742 21 | 479 6.339095994 0.7662362 22 | 480 6.346857005 0.7845667 23 | 481 6.354633004 0.7897656 24 | 482 6.362432129 0.7809029 25 | 483 6.370246363 0.7790894 26 | 484 6.378083883 0.7912918 27 | 485 6.385936635 0.8054931 28 | 486 6.393812835 0.8072208 29 | 487 6.40170439 0.7750542 30 | 488 6.409619557 0.6869568 31 | 489 6.417550203 0.3479743 32 | 490 6.425504627 0.2082997 33 | 491 6.433474655 0.1430689 34 | 492 6.441468629 0.07774219 35 | 493 6.449478334 0.05335445 36 | 494 6.457512153 0.02870291 37 | 495 6.465561831 0.02236786 38 | 496 6.473635795 0.01213788 39 | 497 6.481725747 0.01174228 40 | 498 6.489840155 0.00352029 41 | 499 6.497970684 0.007514259 42 | 500 6.506125843 0.002374978 43 | 501 6.514297254 0.006700959 44 | 502 6.522493471 0.001581911 45 | 503 6.530706074 0.001560104 46 | 504 6.53894366 0.001169505 47 | 48 | -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/OCLI_N07688-9A_1.txt: -------------------------------------------------------------------------------- 1 | 592 7.355153131 0.05006483 2 | 593 7.36559809 0.05239977 3 | 594 7.376078198 0.03950711 4 | 595 7.386582716 0.1152019 5 | 596 7.397122667 0.2421894 6 | 597 7.407687253 0.2162225 7 | 598 7.418287562 0.1821873 8 | 599 7.428912734 0.2167341 9 | 600 7.439573921 0.3072948 10 | 601 7.4502602 0.3917033 11 | 602 7.46098279 0.4930996 12 | 603 7.471730707 0.573655 13 | 604 7.482515233 0.6390418 14 | 605 7.49332532 0.6780901 15 | 606 7.50417232 0.6986962 16 | 607 7.51504512 0.7043442 17 | 608 7.525955138 0.704244 18 | 609 7.536891198 0.6991047 19 | 610 7.547864785 0.7058695 20 | 611 7.558864659 0.710284 21 | 612 7.569902371 0.7233382 22 | 613 7.580966619 0.7385085 23 | 614 7.592069021 0.7555829 24 | 615 7.603198209 0.7475086 25 | 616 7.614365872 0.7416531 26 | 617 7.625560574 0.821345 27 | 618 7.636794074 0.9513328 28 | 619 7.64805487 0.9478387 29 | 620 7.659354791 0.9784373 30 | 621 7.670682269 0.9469587 31 | 622 7.682049202 0.9647626 32 | 623 7.693443955 0.9122676 33 | 624 7.704878498 0.8976827 34 | 625 7.716341127 0.8667225 35 | 626 7.727843885 0.8551711 36 | 627 7.739374999 0.8496695 37 | 628 7.750946584 0.8439593 38 | 629 7.762546798 0.8271729 39 | 630 7.774187831 0.8217454 40 | 631 7.785857768 0.8090027 41 | 632 7.797568874 0.8126901 42 | 633 7.809309165 0.8126048 43 | 634 7.82109098 0.822667 44 | 635 7.832902263 0.8312723 45 | 636 7.844755428 0.8368072 46 | 637 7.856638349 0.8257445 47 | 638 7.868563515 0.8061626 48 | 639 7.880518727 0.7787654 49 | 640 7.892516553 0.7612841 50 | 641 7.904544718 0.7480814 51 | 642 7.916615868 0.7394626 52 | 643 7.928717657 0.7100179 53 | 644 7.940862807 0.6216946 54 | 645 7.953038896 0.4671388 55 | 646 7.965258728 0.2969919 56 | 647 7.977509804 0.1666005 57 | 648 7.989805009 0.08957243 58 | 649 8.002131768 0.0511111 59 | 650 8.014503045 0.03159366 60 | 651 8.02690619 0.02050396 61 | 652 8.039354247 0.01262586 62 | 653 8.05183449 0.008428868 63 | 654 8.064360045 0.006302875 64 | 655 8.076918107 0.00373929 65 | 656 8.089521885 0.001805923 66 | 657 8.102158496 0.001700563 67 | 658 8.114841233 0.001683956 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/OCLI_N08606-9_1.txt: -------------------------------------------------------------------------------- 1 | 661 8.153115509 9.00971E-06 2 | 662 8.165958406 0.000729827 3 | 663 8.178835138 0.000702131 4 | 664 8.191759254 0.00065727 5 | 665 8.204717548 0.000774801 6 | 666 8.217723658 0.00136228 7 | 667 8.230764292 0.001173493 8 | 668 8.243853177 0.000830687 9 | 669 8.256976939 0.001733662 10 | 670 8.270149392 0.003303913 11 | 671 8.283357079 0.00412459 12 | 672 8.296613903 0.004558117 13 | 673 8.309906322 0.004581067 14 | 674 8.323248331 0.006467931 15 | 675 8.336626301 0.008154747 16 | 676 8.350054317 0.009630089 17 | 677 8.363518666 0.01127482 18 | 678 8.377033525 0.01529764 19 | 679 8.390585092 0.02162704 20 | 680 8.404187639 0.02974216 21 | 681 8.417827275 0.04095477 22 | 682 8.431518365 0.0603483 23 | 683 8.445246931 0.08787403 24 | 684 8.459027432 0.1310822 25 | 685 8.4728458 0.1959485 26 | 686 8.486709389 0.2864631 27 | 687 8.500625646 0.4280643 28 | 688 8.514587617 0.6038901 29 | 689 8.528588254 0.7410872 30 | 690 8.54263501 0.8383015 31 | 691 8.556735434 0.8891676 32 | 692 8.570882484 0.9067098 33 | 693 8.58506902 0.9084145 34 | 694 8.599302597 0.904826 35 | 695 8.613590868 0.8999656 36 | 696 8.627926701 0.8928568 37 | 697 8.642302863 0.8787801 38 | 698 8.656727013 0.8498678 39 | 699 8.671206911 0.793587 40 | 700 8.68573533 0.6968806 41 | 701 8.700304946 0.560714 42 | 702 8.714923522 0.4119767 43 | 703 8.729598927 0.280347 44 | 704 8.744323841 0.1810303 45 | 705 8.759090841 0.1143542 46 | 706 8.773907802 0.07278959 47 | 707 8.788782701 0.04792254 48 | 708 8.803708122 0.03177972 49 | 709 8.818676546 0.02122252 50 | 710 8.833695957 0.01387213 51 | 711 8.848774445 0.009372608 52 | 712 8.86389664 0.006977276 53 | 713 8.879078494 0.00519459 54 | 714 8.894312443 0.002627208 55 | 715 8.909590818 0.001329518 56 | 716 8.924921773 0.000768025 57 | 717 8.940313573 0.000358179 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/OCLI_N11035-9A.txt: -------------------------------------------------------------------------------- 1 | 796 10.35006293 0.000558928 2 | 797 10.37076415 0.001913327 3 | 798 10.39154619 0.003709312 4 | 799 10.41241276 0.005383004 5 | 800 10.43336331 0.007213368 6 | 801 10.45439833 0.009514241 7 | 802 10.47551835 0.01546579 8 | 803 10.49672387 0.02929915 9 | 804 10.51801541 0.05216657 10 | 805 10.53939351 0.09049334 11 | 806 10.56085869 0.1559959 12 | 807 10.58241148 0.2584891 13 | 808 10.60405242 0.3967061 14 | 809 10.62578206 0.5493538 15 | 810 10.64760206 0.6797723 16 | 811 10.66950959 0.7621659 17 | 812 10.6915086 0.8005005 18 | 813 10.71359851 0.8122173 19 | 814 10.7357799 0.8165258 20 | 815 10.75805332 0.8238223 21 | 816 10.78041935 0.832777 22 | 817 10.80287858 0.8387193 23 | 818 10.82543158 0.8362387 24 | 819 10.84807895 0.8216955 25 | 820 10.87082127 0.8002164 26 | 821 10.89365915 0.7770828 27 | 822 10.91659319 0.7585641 28 | 823 10.939624 0.7486411 29 | 824 10.96275219 0.7487653 30 | 825 10.98597838 0.7594589 31 | 826 11.00930319 0.7764905 32 | 827 11.03272726 0.7936314 33 | 828 11.05625122 0.8079581 34 | 829 11.07987571 0.818381 35 | 830 11.10360138 0.8226472 36 | 831 11.12742887 0.822781 37 | 832 11.15135884 0.8232383 38 | 833 11.17539197 0.8238293 39 | 834 11.1995289 0.8238406 40 | 835 11.22377033 0.8256095 41 | 836 11.24811692 0.8283958 42 | 837 11.2725681 0.8298975 43 | 838 11.29712837 0.8299937 44 | 839 11.32179333 0.8298209 45 | 840 11.3465688 0.8282 46 | 841 11.37145036 0.8272712 47 | 842 11.39644388 0.8262448 48 | 843 11.4215462 0.8244766 49 | 844 11.44675935 0.813531 50 | 845 11.47208406 0.7692008 51 | 846 11.49752108 0.6627262 52 | 847 11.52307115 0.5016431 53 | 848 11.54873369 0.337484 54 | 849 11.57451348 0.2127791 55 | 850 11.60040592 0.1343107 56 | 851 11.62641717 0.08773901 57 | 852 11.65254262 0.06056735 58 | 853 11.67878847 0.04243817 59 | 854 11.70515008 0.02928483 60 | 855 11.73163372 0.01889743 61 | 856 11.7582347 0.01219735 62 | 857 11.78495937 0.006852499 63 | 858 11.81180302 0.003909525 64 | 859 11.83877062 0.001386774 65 | 860 11.86586165 0.000160485 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/OCLI_N11282-9_1.txt: -------------------------------------------------------------------------------- 1 | 826 11.00930319 0.000238912 2 | 827 11.03272726 0.001074396 3 | 828 11.05625122 0.001957112 4 | 829 11.07987571 0.001468306 5 | 830 11.10360138 0.003171206 6 | 831 11.12742887 0.004231949 7 | 832 11.15135884 0.008449834 8 | 833 11.17539197 0.02021559 9 | 834 11.1995289 0.05994287 10 | 835 11.22377033 0.2015609 11 | 836 11.24811692 0.4795297 12 | 837 11.2725681 0.6497691 13 | 838 11.29712837 0.6026022 14 | 839 11.32179333 0.5546952 15 | 840 11.3465688 0.5806854 16 | 841 11.37145036 0.6262023 17 | 842 11.39644388 0.6230479 18 | 843 11.4215462 0.5191091 19 | 844 11.44675935 0.3300395 20 | 845 11.47208406 0.157032 21 | 846 11.49752108 0.06107094 22 | 847 11.52307115 0.02317979 23 | 848 11.54873369 0.009898012 24 | 849 11.57451348 0.004933049 25 | 850 11.60040592 0.00082685 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/OCLI_NO5352-8_2.txt: -------------------------------------------------------------------------------- 1 | 287 5.134042139 3.47222E-05 2 | 288 5.139129072 0.000145348 3 | 289 5.144228741 0.000385073 4 | 290 5.14933589 0.000428865 5 | 291 5.154455847 0.00053768 6 | 292 5.159583333 0.00078098 7 | 293 5.164723698 0.001178333 8 | 294 5.169871642 0.001190461 9 | 295 5.175032538 0.001587358 10 | 296 5.180201064 0.001512375 11 | 297 5.185382614 0.00255401 12 | 298 5.190571845 0.003342882 13 | 299 5.195774173 0.004036975 14 | 300 5.200984234 0.0044321 15 | 301 5.206207465 0.005737829 16 | 302 5.211438482 0.007776315 17 | 303 5.216682743 0.01197604 18 | 304 5.221934842 0.01568302 19 | 305 5.227200259 0.02057482 20 | 306 5.232473568 0.02814955 21 | 307 5.237760271 0.0401895 22 | 308 5.243054918 0.05818074 23 | 309 5.248363036 0.08446107 24 | 310 5.253679152 0.1224693 25 | 311 5.259008814 0.1767794 26 | 312 5.264346529 0.2533189 27 | 313 5.269697867 0.3534211 28 | 314 5.275057313 0.4731751 29 | 315 5.280430461 0.5991346 30 | 316 5.285811771 0.6912052 31 | 317 5.291206861 0.7517439 32 | 318 5.296610169 0.7795996 33 | 319 5.302027336 0.7833176 34 | 320 5.307452778 0.7786752 35 | 321 5.312892158 0.7742111 36 | 322 5.31833987 0.7736981 37 | 323 5.323801599 0.779081 38 | 324 5.329271718 0.7889877 39 | 325 5.334755935 0.8024201 40 | 326 5.340248599 0.8175588 41 | 327 5.345755443 0.8304197 42 | 328 5.351270793 0.8420249 43 | 329 5.356800405 0.847317 44 | 330 5.36233858 0.8468011 45 | 331 5.367891101 0.8423673 46 | 332 5.373452244 0.836142 47 | 333 5.379027816 0.8274576 48 | 334 5.384612071 0.8207011 49 | 335 5.390210838 0.8126738 50 | 336 5.395818349 0.8054993 51 | 337 5.401440456 0.7925046 52 | 338 5.407071368 0.7728946 53 | 339 5.412716962 0.737131 54 | 340 5.418371422 0.691449 55 | 341 5.42404065 0.6044135 56 | 342 5.429718806 0.5097699 57 | 343 5.435411817 0.4209584 58 | 344 5.441113818 0.3302037 59 | 345 5.446830762 0.2446698 60 | 346 5.452556758 0.1802878 61 | 347 5.458297786 0.1324576 62 | 348 5.464047931 0.09593223 63 | 349 5.469813195 0.06323367 64 | 350 5.47558764 0.04813069 65 | 351 5.481377295 0.03337123 66 | 352 5.487176195 0.02450614 67 | 353 5.492990395 0.01753588 68 | 354 5.498813906 0.01326047 69 | 355 5.504652808 0.009337429 70 | 356 5.510501086 0.007861692 71 | 357 5.516364848 0.005651399 72 | 358 5.522238053 0.004936716 73 | 359 5.528126833 0.003729687 74 | 360 5.534025123 0.003202595 75 | 361 5.539939083 0.001738065 76 | 362 5.54586262 0.001352859 77 | 363 5.551801921 0.000946366 78 | 364 5.557750867 0.00097238 79 | 365 5.563715672 0.000163357 80 | 366 5.569690192 0.000610703 81 | 367 5.575680665 0.000402488 82 | 368 5.581680923 0.000333297 -------------------------------------------------------------------------------- /mskpy/data/filters/sofia/notes.txt: -------------------------------------------------------------------------------- 1 | # From forcast.astro.cornell.edu/Filters 2 | # 2010-06-21 3 | -------------------------------------------------------------------------------- /mskpy/data/filters/spitzer/mips24.txt: -------------------------------------------------------------------------------- 1 | # 2 | #MIPS imaging filter bandpasses 21 March 2000 3 | #24 microns 4 | # 5 | #lambda response 6 | 18.005 0.000237 7 | 18.068 0.000231 8 | 18.131 0.000173 9 | 18.194 1.17E-05 10 | 18.258 0.000229 11 | 18.323 0.000228 12 | 18.388 0.000237 13 | 18.453 0.000241 14 | 18.519 0.000245 15 | 18.586 0.000573 16 | 18.652 0.000595 17 | 18.720 0.000401 18 | 18.788 0.000135 19 | 18.856 0.000275 20 | 18.925 0.000277 21 | 18.994 0.000185 22 | 19.064 0.00019 23 | 19.134 0.000644 24 | 19.205 0.000764 25 | 19.277 0.000557 26 | 19.348 0.000657 27 | 19.421 0.000736 28 | 19.494 0.001573 29 | 19.567 0.002129 30 | 19.642 0.003627 31 | 19.716 0.004662 32 | 19.792 0.00671 33 | 19.867 0.008835 34 | 19.944 0.012914 35 | 20.021 0.0145 36 | 20.098 0.019532 37 | 20.177 0.024468 38 | 20.255 0.031953 39 | 20.335 0.050973 40 | 20.415 0.076447 41 | 20.496 0.120929 42 | 20.577 0.177656 43 | 20.659 0.252554 44 | 20.742 0.377777 45 | 20.825 0.528659 46 | 20.909 0.735924 47 | 20.993 0.813463 48 | 21.079 0.857335 49 | 21.165 0.882477 50 | 21.252 0.907091 51 | 21.339 0.932828 52 | 21.427 0.957009 53 | 21.516 0.973634 54 | 21.606 0.984957 55 | 21.696 0.991663 56 | 21.787 0.997749 57 | 21.879 1 58 | 21.972 0.998522 59 | 22.065 0.988564 60 | 22.160 0.970058 61 | 22.255 0.935205 62 | 22.351 0.926258 63 | 22.448 0.899796 64 | 22.545 0.880798 65 | 22.644 0.865925 66 | 22.743 0.856114 67 | 22.843 0.857699 68 | 22.944 0.856779 69 | 23.046 0.850509 70 | 23.149 0.83452 71 | 23.253 0.815473 72 | 23.358 0.795473 73 | 23.463 0.775875 74 | 23.570 0.752764 75 | 23.678 0.746808 76 | 23.786 0.777653 77 | 23.896 0.798943 78 | 24.006 0.839877 79 | 24.118 0.876265 80 | 24.231 0.911819 81 | 24.345 0.929431 82 | 24.459 0.924876 83 | 24.575 0.917978 84 | 24.692 0.897806 85 | 24.810 0.879948 86 | 24.930 0.859096 87 | 25.050 0.833534 88 | 25.172 0.803216 89 | 25.295 0.77089 90 | 25.419 0.736609 91 | 25.544 0.695704 92 | 25.670 0.649479 93 | 25.798 0.602661 94 | 25.927 0.558191 95 | 26.057 0.519174 96 | 26.189 0.486209 97 | 26.322 0.455974 98 | 26.456 0.428693 99 | 26.592 0.406171 100 | 26.729 0.381986 101 | 26.867 0.354378 102 | 27.007 0.326682 103 | 27.149 0.296838 104 | 27.292 0.261178 105 | 27.436 0.225878 106 | 27.582 0.195445 107 | 27.729 0.170226 108 | 27.878 0.148445 109 | 28.029 0.130555 110 | 28.181 0.117945 111 | 28.335 0.107676 112 | 28.491 0.097827 113 | 28.649 0.088869 114 | 28.808 0.080512 115 | 28.969 0.072124 116 | 29.131 0.060997 117 | 29.296 0.051086 118 | 29.462 0.042525 119 | 29.631 0.035384 120 | 29.801 0.029764 121 | 29.973 0.025596 122 | 30.148 0.021807 123 | 30.324 0.01919 124 | 30.502 0.016606 125 | 30.683 0.013779 126 | 30.865 0.011002 127 | 31.050 0.008476 128 | 31.237 0.006381 129 | 31.427 0.004758 130 | 31.618 0.003471 131 | 31.812 0.002394 132 | 32.009 0.001482 133 | 32.207 0.000727 134 | -------------------------------------------------------------------------------- /mskpy/data/filters/spitzer/mips70.txt: -------------------------------------------------------------------------------- 1 | # 2 | #MIPS imaging filter bandpasses 21 March 2000 3 | # 4 | #70 microns NB 5 | # 6 | #lambda response 7 | 49.95998 -0.00029 8 | 50.21104 6.6E-05 9 | 50.46463 0.000866 10 | 50.7208 0.001816 11 | 50.97958 0.002936 12 | 51.24101 0.004346 13 | 51.50514 0.006087 14 | 51.772 0.00817 15 | 52.04165 0.010677 16 | 52.31412 0.01409 17 | 52.58946 0.018454 18 | 52.86771 0.023109 19 | 53.14892 0.027443 20 | 53.43314 0.032523 21 | 53.72041 0.040173 22 | 54.01079 0.049711 23 | 54.30433 0.060504 24 | 54.60108 0.073617 25 | 54.90108 0.090147 26 | 55.2044 0.109523 27 | 55.51109 0.12962 28 | 55.82121 0.145772 29 | 56.13481 0.153541 30 | 56.45196 0.158599 31 | 56.77271 0.170037 32 | 57.09713 0.189803 33 | 57.42527 0.214929 34 | 57.75721 0.241451 35 | 58.09301 0.263499 36 | 58.43273 0.279945 37 | 58.77645 0.294817 38 | 59.12424 0.312668 39 | 59.47617 0.336648 40 | 59.83232 0.369982 41 | 60.19275 0.412077 42 | 60.55756 0.454126 43 | 60.92681 0.491189 44 | 61.3006 0.526436 45 | 61.67899 0.559559 46 | 62.06209 0.59515 47 | 62.44998 0.641587 48 | 62.84275 0.694072 49 | 63.24049 0.73797 50 | 63.64329 0.77468 51 | 64.05126 0.808052 52 | 64.4645 0.827862 53 | 64.8831 0.838341 54 | 65.30717 0.848857 55 | 65.73682 0.860528 56 | 66.17217 0.869998 57 | 66.61331 0.883175 58 | 67.06038 0.903375 59 | 67.51349 0.923421 60 | 67.97277 0.945281 61 | 68.43834 0.970016 62 | 68.91032 0.984766 63 | 69.38887 0.989037 64 | 69.87411 0.995237 65 | 70.36618 1 66 | 70.86523 0.998268 67 | 71.37141 0.999989 68 | 71.88487 1.000645 69 | 72.40578 0.992201 70 | 72.93429 0.982083 71 | 73.47057 0.972578 72 | 74.01479 0.958518 73 | 74.56714 0.938603 74 | 75.1278 0.917937 75 | 75.69695 0.883038 76 | 76.27479 0.832029 77 | 76.86152 0.781721 78 | 77.45734 0.729882 79 | 78.06248 0.670221 80 | 78.67714 0.611989 81 | 79.30157 0.558421 82 | 79.93598 0.505731 83 | 80.58062 0.456761 84 | 81.23575 0.416541 85 | 81.90162 0.379062 86 | 82.57849 0.340729 87 | 83.26664 0.307558 88 | 83.96636 0.279367 89 | 84.67794 0.250857 90 | 85.40169 0.223651 91 | 86.13791 0.200818 92 | 86.88693 0.178981 93 | 87.6491 0.159608 94 | 88.42475 0.144221 95 | 89.21426 0.130385 96 | 90.01799 0.117319 97 | 90.83634 0.107147 98 | 91.6697 0.098924 99 | 92.51849 0.089555 100 | 93.38315 0.081557 101 | 94.26413 0.075779 102 | 95.16188 0.06901 103 | 96.0769 0.061375 104 | 97.00968 0.056092 105 | 97.96076 0.051865 106 | 98.93067 0.046722 107 | 99.91997 0.04214 108 | 100.9293 0.038231 109 | 101.9592 0.034554 110 | 103.0103 0.033021 111 | 104.0833 0.03299 112 | 105.1789 0.032422 113 | 106.2978 0.030687 114 | 107.4408 0.030265 115 | 108.6087 0.030992 116 | 109.8022 0.03027 117 | 111.0222 0.02935 118 | -------------------------------------------------------------------------------- /mskpy/data/filters/spitzer/redPUtrans.txt: -------------------------------------------------------------------------------- 1 | #;*** IRS Red-Peakup Filter 2 | #;*** RQExTransmission at 2.0 volts USED IN NOMINAL OPERATIONS 3 | #;*** 4 | #;*** The first column is wavelength in microns. They second 5 | #;*** is "RQExT", which is the product of the detector's 6 | #;*** responsive quantum efficiency (QE times photoconductive 7 | #;*** gain) and the filter transmission. That is, if you 8 | #;*** multiply incident photons/second at some wavelength by 9 | #;*** RQExT at that wavelength, then you get electrons/second 10 | #;*** contributed by the incident light at that wavelength. 11 | #;*** These data represent the same curve that is provided in 12 | #;*** the SMART software package, and represent a revised 13 | #;*** (improved) version of the peak-up filter transmission 14 | #;*** curve shown in Figure 7.39 of the Spitzer Observer's 15 | #;*** Manual (v5.0). 16 | #;*** 17 | 14.3243 2.15E-02 18 | 14.3640 -1.32E-02 19 | 14.4038 7.22E-03 20 | 14.4440 3.29E-03 21 | 14.4843 -4.04E-03 22 | 14.5249 -8.52E-03 23 | 14.5657 -4.29E-03 24 | 14.6067 -1.22E-02 25 | 14.6480 -1.24E-02 26 | 14.6895 1.09E-02 27 | 14.7312 6.69E-03 28 | 14.7732 1.09E-02 29 | 14.8154 5.91E-03 30 | 14.8578 4.87E-03 31 | 14.9005 -6.79E-03 32 | 14.9435 6.84E-03 33 | 14.9867 3.35E-03 34 | 15.0301 7.48E-03 35 | 15.0738 1.03E-02 36 | 15.1177 7.28E-03 37 | 15.1619 4.76E-04 38 | 15.2064 4.64E-03 39 | 15.2511 3.71E-03 40 | 15.2961 2.59E-03 41 | 15.3414 4.91E-03 42 | 15.3869 6.74E-03 43 | 15.4327 1.73E-03 44 | 15.4787 2.94E-03 45 | 15.5251 5.04E-03 46 | 15.5717 8.09E-03 47 | 15.6186 6.06E-03 48 | 15.6658 3.44E-03 49 | 15.7133 4.95E-03 50 | 15.7610 -3.50E-03 51 | 15.8091 -8.23E-03 52 | 15.8574 -8.71E-03 53 | 15.9061 -5.80E-04 54 | 15.9550 -1.04E-02 55 | 16.0043 -8.07E-03 56 | 16.0538 -8.27E-03 57 | 16.1037 -6.01E-03 58 | 16.1538 -6.95E-03 59 | 16.2043 4.91E-03 60 | 16.2551 6.13E-03 61 | 16.3062 9.37E-03 62 | 16.3577 7.62E-03 63 | 16.4094 2.79E-03 64 | 16.4615 -1.61E-03 65 | 16.5140 2.07E-03 66 | 16.5667 -1.08E-03 67 | 16.6198 -1.75E-03 68 | 16.6733 -7.53E-04 69 | 16.7271 3.87E-04 70 | 16.7812 -4.31E-03 71 | 16.8357 -7.15E-03 72 | 16.8905 -6.42E-03 73 | 16.9457 -3.98E-03 74 | 17.0013 -6.85E-03 75 | 17.0572 -5.34E-03 76 | 17.1135 -2.63E-03 77 | 17.1702 1.96E-03 78 | 17.2272 3.00E-04 79 | 17.2846 5.41E-03 80 | 17.3424 5.76E-03 81 | 17.4006 9.51E-03 82 | 17.4592 1.51E-02 83 | 17.5182 6.13E-03 84 | 17.5776 8.97E-03 85 | 17.6374 1.21E-02 86 | 17.6975 1.16E-02 87 | 17.7582 1.55E-03 88 | 17.8192 1.28E-02 89 | 17.8806 5.67E-03 90 | 17.9425 1.13E-02 91 | 18.0048 1.70E-02 92 | 18.0675 3.32E-02 93 | 18.1307 5.38E-02 94 | 18.1943 8.80E-02 95 | 18.2584 1.29E-01 96 | 18.3229 2.06E-01 97 | 18.3879 3.24E-01 98 | 18.4533 5.19E-01 99 | 18.5192 7.66E-01 100 | 18.5856 1.09E+00 101 | 18.6525 1.42E+00 102 | 18.7198 1.70E+00 103 | 18.7876 1.88E+00 104 | 18.8559 2.03E+00 105 | 18.9248 2.08E+00 106 | 18.9941 2.15E+00 107 | 19.0639 2.18E+00 108 | 19.1343 2.09E+00 109 | 19.2051 1.99E+00 110 | 19.2765 1.97E+00 111 | 19.3485 2.05E+00 112 | 19.4209 2.07E+00 113 | 19.4939 2.06E+00 114 | 19.5675 2.09E+00 115 | 19.6416 2.18E+00 116 | 19.7163 2.16E+00 117 | 19.7916 2.17E+00 118 | 19.8674 2.12E+00 119 | 19.9438 2.15E+00 120 | 20.0208 2.08E+00 121 | 20.0984 2.06E+00 122 | 20.1766 2.03E+00 123 | 20.2554 2.01E+00 124 | 20.3348 1.99E+00 125 | 20.4149 1.98E+00 126 | 20.4956 1.96E+00 127 | 20.5769 1.93E+00 128 | 20.6589 1.90E+00 129 | 20.7416 1.87E+00 130 | 20.8248 1.85E+00 131 | 20.9088 1.85E+00 132 | 20.9935 1.86E+00 133 | 21.0788 1.88E+00 134 | 21.1648 1.92E+00 135 | 21.2516 1.95E+00 136 | 21.3390 1.97E+00 137 | 21.4272 1.99E+00 138 | 21.5161 2.01E+00 139 | 21.6058 2.01E+00 140 | 21.6962 2.01E+00 141 | 21.7873 2.00E+00 142 | 21.8793 1.99E+00 143 | 21.9720 1.97E+00 144 | 22.0655 1.96E+00 145 | 22.1598 1.94E+00 146 | 22.2549 1.92E+00 147 | 22.3508 1.88E+00 148 | 22.4475 1.84E+00 149 | 22.5452 1.81E+00 150 | 22.6436 1.79E+00 151 | 22.7429 1.77E+00 152 | 22.8431 1.77E+00 153 | 22.9442 1.78E+00 154 | 23.0461 1.78E+00 155 | 23.1491 1.75E+00 156 | 23.2528 1.72E+00 157 | 23.3576 1.68E+00 158 | 23.4633 1.63E+00 159 | 23.5700 1.59E+00 160 | 23.6775 1.58E+00 161 | 23.7862 1.61E+00 162 | 23.8958 1.66E+00 163 | 24.0064 1.71E+00 164 | 24.1181 1.75E+00 165 | 24.2308 1.78E+00 166 | 24.3445 1.78E+00 167 | 24.4594 1.74E+00 168 | 24.5753 1.72E+00 169 | 24.6923 1.67E+00 170 | 24.8104 1.63E+00 171 | 24.9298 1.58E+00 172 | 25.0502 1.54E+00 173 | 25.1718 1.48E+00 174 | 25.2946 1.42E+00 175 | 25.4185 1.35E+00 176 | 25.5438 1.29E+00 177 | 25.6702 1.21E+00 178 | 25.7979 1.14E+00 179 | 25.9269 1.07E+00 180 | 26.0572 1.00E+00 181 | 26.1888 9.38E-01 182 | 26.3217 8.67E-01 183 | 26.4560 8.23E-01 184 | 26.5917 7.77E-01 185 | 26.7288 7.33E-01 186 | 26.8673 6.93E-01 187 | 27.0072 6.62E-01 188 | 27.1486 6.20E-01 189 | 27.2915 5.79E-01 190 | 27.4359 5.38E-01 191 | 27.5818 4.92E-01 192 | 27.7293 4.44E-01 193 | 27.8784 4.03E-01 194 | 28.0291 3.63E-01 195 | 28.1814 3.36E-01 196 | 28.3354 2.98E-01 197 | 28.4912 2.70E-01 198 | 28.6485 2.38E-01 199 | 28.8077 2.14E-01 200 | 28.9686 1.83E-01 201 | 29.1313 1.67E-01 202 | 29.2960 1.49E-01 203 | 29.4624 1.34E-01 204 | 29.6308 1.15E-01 205 | 29.8010 1.01E-01 206 | 29.9733 8.56E-02 207 | 30.1475 6.99E-02 208 | 30.3239 5.64E-02 209 | 30.5022 4.40E-02 210 | 30.6828 2.93E-02 211 | 30.8653 1.78E-02 212 | 31.0502 1.14E-02 213 | 31.2372 7.69E-03 214 | 31.4266 5.53E-03 215 | 31.6182 4.50E-03 216 | 31.8122 3.56E-03 217 | 32.0085 2.52E-03 218 | 32.2074 1.73E-03 219 | 32.4086 1.36E-03 220 | 32.6125 1.34E-03 221 | 32.8188 1.34E-03 222 | 33.0279 1.21E-03 223 | 33.2396 8.47E-04 224 | 33.4541 6.82E-04 225 | 33.6713 5.51E-04 226 | 33.8914 3.99E-04 227 | 34.1143 2.30E-04 228 | 34.3403 1.34E-04 229 | 34.5692 2.73E-05 230 | 34.8013 -4.44E-05 231 | 35.0363 -7.74E-05 232 | -------------------------------------------------------------------------------- /mskpy/data/filters/usno40/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | These files are response (QE) functions for the USNO 40-inch/SITe 1024^2 3 | UV-coated CCD as best we understand at this point (011218). The z 4 | functions are quite uncertain, as we have no measurements of the USNO 5 | CCD at all; though the response through the visible and even into the uv 6 | is quite constant from device to device, the far IR response is quite 7 | variable. The QEs have been corrected for IR scattering and are the 8 | appropriate responses for point sources, NOT extended objects. These 9 | corrections are probably as uncertain as the underlying response is. 10 | 11 | The system as defined is NOT an AB system, quite, because the magnitudes 12 | of the standards as defined in Fukugita et al are extrapolated to vacuum, 13 | and agree reasonably well with the response functions here which have been 14 | modified slightly for temperature effects. The USNO system, however, is 15 | defined as the natural system of the USNO telescope/CCD combination, which 16 | has a median airmass of about 1.3. The standards SHOULD HAVE been defined 17 | with slightly different zero points: +17 should have had magnitudes 18 | defined as 19 | 20 | 10.51 9.64 9.35 9.25 9.22 21 | 22 | instead of the numbers 23 | 24 | 10.56 9.64 9.35 9.25 9.23 25 | 26 | Which define the zeropoints of the system. 27 | 28 | Likewise +26 2606 should have been DEFINED as 29 | 30 | 10.73 9.89 9.60 9.51 9.48; 31 | 32 | the OBSERVED numbers (+17 defines the system alone, which is not a good idea) 33 | are 34 | 35 | 10.76 9.89 9.60 9.50 9.49 36 | 37 | as were used. Thus to get to the USNO AB system, one must add 38 | 39 | -.04 0.0 0.0 0.0 -0.01 40 | 41 | to the USNO magnitudes as observed. 42 | 43 | 44 | The calculations for the colors from the energy distributions with the 45 | response functions here are 46 | 47 | 48 | USNO 1.3 airmasses (V=0) 49 | 50 | 176 +17 4708 0.00 1.07 0.20 -0.09 -0.19 -0.22 0.88 0.29 0.10 0.02 51 | 177 +26 2606 0.00 1.04 0.20 -0.09 -0.18 -0.21 0.84 0.29 0.09 0.03 52 | 178 hd19445 0.00 1.02 0.21 -0.10 -0.20 -0.24 0.81 0.31 0.10 0.03 53 | 179 hd84937 0.00 0.98 0.16 -0.08 -0.14 -0.15 0.82 0.24 0.07 0.01 54 | 55 | 56 | USNO 0 airmasses (V=0) 57 | 58 | 176 +17 4708 0.00 1.11 0.21 -0.09 -0.19 -0.22 0.91 0.30 0.10 0.03 59 | 177 +26 2606 0.00 1.08 0.21 -0.09 -0.18 -0.21 0.87 0.30 0.09 0.03 60 | 178 hd19445 0.00 1.06 0.22 -0.10 -0.20 -0.24 0.83 0.32 0.10 0.04 61 | 179 hd84937 0.00 1.02 0.17 -0.08 -0.14 -0.15 0.85 0.25 0.07 0.01 62 | 63 | Observations (The +17 mags are DEFINED) 64 | 65 | +17 4708 10.560, 9.640 9.350 9.250 9.230 66 | +26 2606 10.761 9.891 9.604 9.503 9.486 67 | 68 | V-based mags OBS 69 | 70 | +17 4708 1.12 0.20 -0.09 -0.19 -0.21 (9.44) 71 | +26 2606 1.07 0.20 -0.09 -0.19 -0.20 (9.69) 72 | 73 | from AB calculations, add 74 | 75 | 0.04 0.0 0.0 0.0 0.01 76 | 77 | To get to observed values, or subtract to go from obs -> AB 78 | 79 | 80 | jeg011218 81 | 82 | 83 | -------------------------------------------------------------------------------- /mskpy/data/filters/usno40/usno_g.res: -------------------------------------------------------------------------------- 1 | \ FILE: /surtel/filters/usno/usno_g.res 2 | \ Created Tue Dec 04 11:35:40 2001 3 | \ lam vac air1.0 air1.3 air1.6 air1.9 4 | 3630 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 5 | 3680 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 6 | 3730 0.00000 0.00000 0.00000 0.00000 0.00000 7 | 3780 0.00048 0.00033 0.00030 0.00027 0.00024 8 | 3830 0.00893 0.00622 0.00558 0.00501 0.00449 9 | 3880 0.05384 0.03817 0.03442 0.03105 0.02800 10 | 3930 0.11165 0.08082 0.07335 0.06657 0.06042 11 | 3980 0.17106 0.12650 0.11556 0.10555 0.09642 12 | 4030 0.21967 0.16538 0.15188 0.13948 0.12810 13 | 4080 0.29012 0.22148 0.20425 0.18836 0.17371 14 | 4130 0.31400 0.24264 0.22458 0.20787 0.19240 15 | 4180 0.34319 0.26825 0.24914 0.23139 0.21491 16 | 4230 0.35647 0.28161 0.26239 0.24447 0.22778 17 | 4280 0.34381 0.27432 0.25636 0.23957 0.22388 18 | 4330 0.38717 0.31181 0.29221 0.27383 0.25662 19 | 4380 0.38128 0.30983 0.29113 0.27356 0.25705 20 | 4430 0.40641 0.33315 0.31386 0.29570 0.27858 21 | 4480 0.40627 0.33587 0.31723 0.29963 0.28301 22 | 4530 0.41968 0.34976 0.33115 0.31353 0.29685 23 | 4580 0.42600 0.35768 0.33941 0.32207 0.30562 24 | 4630 0.43143 0.36470 0.34677 0.32972 0.31351 25 | 4680 0.43407 0.36912 0.35160 0.33491 0.31901 26 | 4730 0.43410 0.37097 0.35389 0.33759 0.32205 27 | 4780 0.43146 0.37034 0.35375 0.33790 0.32276 28 | 4830 0.44100 0.38025 0.36371 0.34789 0.33276 29 | 4880 0.44549 0.38588 0.36961 0.35402 0.33909 30 | 4930 0.44841 0.38988 0.37387 0.35850 0.34378 31 | 4980 0.45192 0.39407 0.37821 0.36298 0.34837 32 | 5030 0.44444 0.38844 0.37306 0.35829 0.34410 33 | 5080 0.44881 0.39305 0.37771 0.36297 0.34881 34 | 5130 0.45457 0.39884 0.38349 0.36874 0.35455 35 | 5180 0.45156 0.39697 0.38192 0.36744 0.35351 36 | 5230 0.45005 0.39652 0.38173 0.36750 0.35380 37 | 5280 0.44660 0.39442 0.37998 0.36608 0.35268 38 | 5330 0.44057 0.39002 0.37601 0.36251 0.34950 39 | 5380 0.42125 0.37371 0.36052 0.34780 0.33553 40 | 5430 0.31373 0.27880 0.26910 0.25973 0.25070 41 | 5480 0.13353 0.11881 0.11471 0.11076 0.10695 42 | 5530 0.04888 0.04353 0.04204 0.04060 0.03921 43 | 5580 0.01955 0.01742 0.01683 0.01626 0.01570 44 | 5630 0.00731 0.00652 0.00630 0.00609 0.00588 45 | 5680 -0.00011 -0.00010 -0.00010 -0.00010 -0.00009 46 | 5730 0.00000 0.00000 0.00000 0.00000 0.00000 47 | 5780 0.00000 0.00000 0.00000 0.00000 0.00000 48 | 5830 0.00000 0.00000 0.00000 0.00000 0.00000 49 | \ leff 4720 4741 4747 4753 4759 50 | \ qtdll 0.12964 0.10889 0.10340 0.09820 0.09329 -------------------------------------------------------------------------------- /mskpy/data/filters/usno40/usno_i.res: -------------------------------------------------------------------------------- 1 | \ FILE: /surtel/filters/usno/usno_i.res 2 | \ Created Tue Dec 04 11:36:19 2001 3 | \ lam vac air1.0 air1.3 air1.6 air1.9 4 | 6430 0.00282 0.00263 0.00258 0.00253 0.00248 5 | 6480 0.00281 0.00263 0.00258 0.00253 0.00248 6 | 6530 0.00281 0.00263 0.00258 0.00254 0.00249 7 | 6580 0.00280 0.00263 0.00258 0.00254 0.00249 8 | 6630 0.00280 0.00263 0.00258 0.00253 0.00248 9 | 6680 0.00279 0.00261 0.00256 0.00251 0.00246 10 | 6730 0.00693 0.00649 0.00637 0.00624 0.00612 11 | 6780 0.02552 0.02423 0.02385 0.02348 0.02312 12 | 6830 0.07164 0.06684 0.06547 0.06412 0.06280 13 | 6880 0.14991 0.13282 0.12809 0.12352 0.11912 14 | 6930 0.24042 0.21827 0.21203 0.20597 0.20008 15 | 6980 0.31680 0.29924 0.29417 0.28918 0.28428 16 | 7030 0.36739 0.35119 0.34647 0.34181 0.33722 17 | 7080 0.39594 0.38879 0.38667 0.38456 0.38246 18 | 7130 0.40939 0.39395 0.38944 0.38497 0.38056 19 | 7180 0.41383 0.36630 0.35314 0.34044 0.32821 20 | 7230 0.41305 0.37914 0.36951 0.36014 0.35100 21 | 7280 0.40966 0.37495 0.36512 0.35555 0.34623 22 | 7330 0.40575 0.38286 0.37625 0.36976 0.36338 23 | 7380 0.40138 0.38130 0.37548 0.36974 0.36409 24 | 7430 0.39677 0.37834 0.37299 0.36770 0.36249 25 | 7480 0.39004 0.37102 0.36549 0.36005 0.35469 26 | 7530 0.38112 0.35889 0.35248 0.34619 0.34000 27 | 7580 0.37065 0.34955 0.34345 0.33747 0.33158 28 | 7630 0.36043 0.23602 0.20786 0.18307 0.16123 29 | 7680 0.35212 0.33562 0.33082 0.32609 0.32143 30 | 7730 0.34597 0.33130 0.32702 0.32279 0.31862 31 | 7780 0.34006 0.32538 0.32110 0.31688 0.31271 32 | 7830 0.33312 0.31759 0.31307 0.30862 0.30423 33 | 7880 0.32441 0.30933 0.30494 0.30062 0.29635 34 | 7930 0.31461 0.30295 0.29954 0.29617 0.29283 35 | 7980 0.30492 0.29803 0.29599 0.29396 0.29195 36 | 8030 0.29616 0.29150 0.29012 0.28875 0.28738 37 | 8080 0.28844 0.28000 0.27752 0.27506 0.27262 38 | 8130 0.28121 0.26115 0.25542 0.24981 0.24433 39 | 8180 0.27398 0.24468 0.23652 0.22863 0.22100 40 | 8230 0.26657 0.23574 0.22720 0.21898 0.21105 41 | 8280 0.25727 0.23241 0.22543 0.21866 0.21210 42 | 8330 0.24744 0.23466 0.23096 0.22731 0.22372 43 | 8380 0.22753 0.21789 0.21508 0.21231 0.20957 44 | 8430 0.17354 0.16597 0.16376 0.16158 0.15943 45 | 8480 0.09048 0.08657 0.08543 0.08431 0.08320 46 | 8530 0.03446 0.03302 0.03260 0.03218 0.03177 47 | 8580 0.01226 0.01177 0.01162 0.01148 0.01134 48 | 8630 0.00466 0.00448 0.00442 0.00437 0.00431 49 | \ leff 7583 7584 7585 7585 7585 50 | \ qtdll 0.07063 0.06589 0.06459 0.06333 0.06211 -------------------------------------------------------------------------------- /mskpy/data/filters/usno40/usno_r.res: -------------------------------------------------------------------------------- 1 | \ FILE: /surtel/filters/usno/usno_r.res 2 | \ Created Tue Dec 04 11:35:57 2001 3 | \ lam vac air1.0 air1.3 air1.6 air1.9 4 | 5230 0.00000 0.00000 0.00000 0.00000 0.00000 5 | 5280 0.00000 0.00000 0.00000 0.00000 0.00000 6 | 5330 -0.00001 -0.00001 -0.00001 -0.00001 -0.00001 7 | 5380 0.00129 0.00115 0.00111 0.00107 0.00103 8 | 5430 0.02186 0.01943 0.01875 0.01810 0.01747 9 | 5480 0.09726 0.08654 0.08356 0.08068 0.07790 10 | 5530 0.22022 0.19612 0.18942 0.18294 0.17669 11 | 5580 0.30848 0.27490 0.26556 0.25654 0.24782 12 | 5630 0.37540 0.33473 0.32341 0.31248 0.30191 13 | 5680 0.41713 0.37219 0.35968 0.34759 0.33590 14 | 5730 0.43044 0.38442 0.37160 0.35920 0.34722 15 | 5780 0.45827 0.40983 0.39632 0.38326 0.37063 16 | 5830 0.46276 0.41467 0.40124 0.38825 0.37568 17 | 5880 0.46808 0.42059 0.40731 0.39444 0.38198 18 | 5930 0.47567 0.42893 0.41582 0.40311 0.39080 19 | 5980 0.45958 0.41625 0.40407 0.39224 0.38076 20 | 6030 0.45903 0.41796 0.40637 0.39511 0.38415 21 | 6080 0.47507 0.43501 0.42366 0.41261 0.40185 22 | 6130 0.48164 0.44320 0.43228 0.42162 0.41123 23 | 6180 0.47961 0.44304 0.43263 0.42246 0.41253 24 | 6230 0.47151 0.43688 0.42700 0.41734 0.40789 25 | 6280 0.46629 0.43309 0.42360 0.41431 0.40523 26 | 6330 0.47223 0.43953 0.43017 0.42101 0.41205 27 | 6380 0.47491 0.44291 0.43373 0.42475 0.41595 28 | 6430 0.47146 0.44052 0.43164 0.42294 0.41442 29 | 6480 0.47198 0.44188 0.43323 0.42475 0.41644 30 | 6530 0.47159 0.44253 0.43417 0.42596 0.41792 31 | 6580 0.46501 0.43701 0.42894 0.42102 0.41325 32 | 6630 0.46112 0.43268 0.42450 0.41647 0.40860 33 | 6680 0.46193 0.43187 0.42323 0.41478 0.40649 34 | 6730 0.46033 0.43122 0.42286 0.41465 0.40661 35 | 6780 0.45216 0.42917 0.42251 0.41595 0.40948 36 | 6830 0.41676 0.38885 0.38084 0.37301 0.36533 37 | 6880 0.30167 0.26729 0.25776 0.24857 0.23971 38 | 6930 0.15345 0.13931 0.13533 0.13146 0.12770 39 | 6980 0.06400 0.06046 0.05943 0.05842 0.05743 40 | 7030 0.02572 0.02459 0.02426 0.02393 0.02361 41 | 7080 0.01069 0.01050 0.01044 0.01038 0.01033 42 | 7130 0.00472 0.00455 0.00449 0.00444 0.00439 43 | 7180 0.00224 0.00198 0.00191 0.00184 0.00178 44 | 7230 0.00112 0.00102 0.00100 0.00097 0.00095 45 | \ leff 6204 6211 6213 6215 6217 46 | \ qtdll 0.10212 0.09367 0.09128 0.08896 0.08670 -------------------------------------------------------------------------------- /mskpy/data/filters/usno40/usno_u.res: -------------------------------------------------------------------------------- 1 | \ FILE: /surtel/filters/usno/usno_u.res 2 | \ Created Tue Dec 04 11:35:03 2001 3 | \ lam vac air1.0 air1.3 air1.6 air1.9 4 | 2980 0.00006 0.00000 0.00000 0.00000 0.00000 5 | 3005 0.00012 0.00001 0.00001 0.00000 0.00000 6 | 3030 0.00078 0.00010 0.00006 0.00003 0.00002 7 | 3055 0.00328 0.00055 0.00032 0.00019 0.00011 8 | 3080 0.01061 0.00220 0.00137 0.00086 0.00053 9 | 3105 0.02313 0.00571 0.00375 0.00247 0.00162 10 | 3130 0.04150 0.01188 0.00816 0.00561 0.00385 11 | 3155 0.06555 0.02259 0.01641 0.01192 0.00866 12 | 3180 0.08696 0.03411 0.02576 0.01945 0.01469 13 | 3205 0.10517 0.04523 0.03512 0.02727 0.02117 14 | 3230 0.12773 0.05855 0.04633 0.03667 0.02902 15 | 3255 0.14634 0.07052 0.05665 0.04551 0.03656 16 | 3280 0.16120 0.08069 0.06556 0.05327 0.04329 17 | 3305 0.17775 0.09222 0.07574 0.06221 0.05109 18 | 3330 0.18779 0.10046 0.08327 0.06902 0.05721 19 | 3355 0.19577 0.10742 0.08972 0.07494 0.06259 20 | 3380 0.20279 0.11320 0.09504 0.07979 0.06699 21 | 3405 0.21102 0.11965 0.10092 0.08513 0.07180 22 | 3430 0.21718 0.12436 0.10520 0.08900 0.07529 23 | 3455 0.21109 0.12263 0.10419 0.08853 0.07522 24 | 3480 0.21180 0.12618 0.10802 0.09247 0.07916 25 | 3505 0.22420 0.13702 0.11820 0.10196 0.08796 26 | 3530 0.22251 0.13843 0.12006 0.10413 0.09031 27 | 3555 0.21329 0.13427 0.11687 0.10172 0.08853 28 | 3580 0.21809 0.13851 0.12087 0.10548 0.09205 29 | 3605 0.22169 0.14206 0.12430 0.10876 0.09517 30 | 3630 0.20859 0.13511 0.11860 0.10411 0.09139 31 | 3655 0.20229 0.13258 0.11680 0.10290 0.09065 32 | 3680 0.20748 0.13761 0.12166 0.10756 0.09509 33 | 3705 0.20295 0.13604 0.12066 0.10701 0.09491 34 | 3730 0.18390 0.12436 0.11059 0.09835 0.08745 35 | 3755 0.16873 0.11497 0.10247 0.09133 0.08140 36 | 3780 0.15936 0.10935 0.09766 0.08723 0.07791 37 | 3805 0.14399 0.09950 0.08906 0.07972 0.07135 38 | 3830 0.11957 0.08328 0.07471 0.06703 0.06013 39 | 3855 0.09243 0.06492 0.05839 0.05252 0.04724 40 | 3880 0.06573 0.04660 0.04203 0.03791 0.03419 41 | 3905 0.04097 0.02934 0.02654 0.02401 0.02172 42 | 3930 0.02178 0.01576 0.01431 0.01298 0.01178 43 | 3955 0.00999 0.00731 0.00666 0.00606 0.00552 44 | 3980 0.00389 0.00288 0.00263 0.00240 0.00220 45 | 4005 0.00129 0.00096 0.00088 0.00081 0.00074 46 | 4030 0.00034 0.00026 0.00024 0.00022 0.00020 47 | 4055 0.00006 0.00004 0.00004 0.00004 0.00003 48 | 4080 0.00001 0.00001 0.00001 0.00001 0.00001 49 | 4105 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 50 | 4130 0.00000 0.00000 0.00000 0.00000 0.00000 51 | \ leff 3510 3539 3546 3554 3561 52 | \ qtdll 0.03789 0.02239 0.01921 0.01652 0.01423 -------------------------------------------------------------------------------- /mskpy/data/filters/usno40/usno_z.res: -------------------------------------------------------------------------------- 1 | \ FILE: /surtel/filters/usno/usno_z.res 2 | \ Created Tue Dec 04 11:36:31 2001 3 | \ lam vac air1.0 air1.3 air1.6 air1.9 4 | 7730 0.00003 0.00003 0.00003 0.00003 0.00003 5 | 7800 0.00003 0.00003 0.00003 0.00003 0.00003 6 | 7870 0.00013 0.00012 0.00012 0.00012 0.00012 7 | 7940 0.00062 0.00060 0.00059 0.00059 0.00058 8 | 8010 0.00248 0.00244 0.00242 0.00241 0.00240 9 | 8080 0.00845 0.00820 0.00813 0.00806 0.00799 10 | 8150 0.02389 0.02177 0.02117 0.02059 0.02002 11 | 8220 0.05252 0.04643 0.04474 0.04311 0.04155 12 | 8290 0.09052 0.08244 0.08016 0.07794 0.07579 13 | 8360 0.12920 0.12389 0.12234 0.12081 0.11929 14 | 8430 0.16093 0.15391 0.15186 0.14984 0.14785 15 | 8500 0.18175 0.17398 0.17171 0.16948 0.16727 16 | 8570 0.19355 0.18565 0.18334 0.18107 0.17882 17 | 8640 0.19778 0.18982 0.18749 0.18519 0.18292 18 | 8710 0.19711 0.18883 0.18641 0.18402 0.18167 19 | 8780 0.19312 0.18469 0.18223 0.17981 0.17742 20 | 8850 0.18697 0.17905 0.17674 0.17446 0.17221 21 | 8920 0.17949 0.16964 0.16679 0.16399 0.16124 22 | 8990 0.17091 0.14724 0.14080 0.13464 0.12875 23 | 9060 0.16157 0.14517 0.14059 0.13615 0.13184 24 | 9130 0.15156 0.13536 0.13085 0.12649 0.12227 25 | 9200 0.14133 0.13166 0.12889 0.12618 0.12353 26 | 9270 0.13084 0.11372 0.10903 0.10454 0.10023 27 | 9340 0.12025 0.07931 0.07000 0.06179 0.05453 28 | 9410 0.10949 0.07911 0.07177 0.06510 0.05905 29 | 9480 0.09879 0.06915 0.06213 0.05582 0.05016 30 | 9550 0.08814 0.06350 0.05756 0.05216 0.04728 31 | 9620 0.07773 0.06326 0.05947 0.05591 0.05256 32 | 9690 0.06775 0.06260 0.06114 0.05971 0.05831 33 | 9760 0.05800 0.05193 0.05023 0.04859 0.04700 34 | 9830 0.04841 0.04600 0.04530 0.04461 0.04394 35 | 9900 0.03913 0.03776 0.03736 0.03696 0.03656 36 | 9970 0.03062 0.02944 0.02910 0.02876 0.02842 37 | 10040 0.02334 0.02238 0.02210 0.02182 0.02154 38 | 10110 0.01735 0.01659 0.01638 0.01616 0.01595 39 | 10180 0.01233 0.01177 0.01161 0.01145 0.01130 40 | 10250 0.00800 0.00764 0.00753 0.00742 0.00732 41 | 10320 0.00443 0.00422 0.00416 0.00410 0.00404 42 | 10390 0.00186 0.00177 0.00175 0.00172 0.00170 43 | 10460 0.00049 0.00046 0.00046 0.00045 0.00045 44 | 10530 0.00003 0.00002 0.00002 0.00002 0.00002 45 | 10600 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 46 | 10670 0.00002 0.00002 0.00002 0.00002 0.00002 47 | 10740 0.00001 0.00001 0.00001 0.00001 0.00001 48 | 10810 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 49 | 10880 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 50 | 10950 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 51 | 11020 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 52 | 11090 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 53 | 11160 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 54 | 11230 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 55 | \ leff 8945 8925 8919 8914 8909 56 | \ qtdll 0.02630 0.02378 0.02311 0.02248 0.02187 -------------------------------------------------------------------------------- /mskpy/data/gen-e490.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | w, f = np.loadtxt('E490_00a_AM0.txt').T 4 | h1 = np.histogram(w, bins=np.logspace(np.log10(min(w)), np.log10(10.01), 200)) 5 | h2 = np.histogram(w, bins=h1[1], weights=f) 6 | 7 | i = w > 10.0 8 | f_sm = np.r_[h2[0] / h1[0], f[i]] 9 | w_sm = np.r_[(h2[1][1:] + h2[1][:-1]) / 2.0, w[i]] 10 | 11 | j = np.isfinite(f_sm) 12 | e490 = np.c_[w_sm[j], f_sm[j]] 13 | 14 | with open('e490-lowres.txt', 'w') as outf: 15 | outf.write('''# E490, histogrammed up to 10 um. 16 | # wave (um) flux (W/m2/um) 17 | ''') 18 | np.savetxt(outf, e490) 19 | -------------------------------------------------------------------------------- /mskpy/data/tr_13800ft_3.4mm_15-25.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/mskpy/data/tr_13800ft_3.4mm_15-25.txt -------------------------------------------------------------------------------- /mskpy/ephem/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | ephem --- Ephemeris tools 4 | ========================= 5 | 6 | Requres SpiceyPy. 7 | 8 | Classes 9 | ------- 10 | Geom 11 | SolarSysObject 12 | SpiceObject 13 | 14 | Functions 15 | --------- 16 | getgeom 17 | getxyz 18 | summarizegeom 19 | 20 | Built-in SolarSysObjects 21 | ------------------------ 22 | Sun, Mercury, Venus, Earth, Moon, Mars, Jupiter, Saturn, Uranus, 23 | Neptune, PlutoSys. Optional: Spitzer, DeepImpact, Kepler, Earth_L2. 24 | 25 | Exceptions 26 | ---------- 27 | ObjectError 28 | 29 | 30 | About kernels 31 | ------------- 32 | 33 | See `find_kernel` for a description of how `ephem` tries to determine 34 | kernel file names from object names. 35 | 36 | Three SPICE kernels are required: 37 | - naif.tls : a leap seconds kernel, 38 | - pck.tpc : a planetary constants kernel, 39 | - planets.bsp : a planetary ephemeris kernel, e.g., de431. 40 | 41 | There are five optional kernels: 42 | - L2.bsp : an ephemeris kernel for the second Lagrange point in the Earth-Sun system, https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/lagrange_point/ 43 | - spitzer.bsp : an ephemeris kernel for the Spitzer Space Telescope, ftp://naif.jpl.nasa.gov/pub/naif/SIRTF/kernels/spk/ 44 | - kepler.bsp : an ephemeris kernel for the Kepler Telescope, https://archive.stsci.edu/pub/k2/spice/ 45 | - deepimpact.txt : an ephemeris meta-kernel for Deep Impact Flyby, ftp://naif.jpl.nasa.gov/pub/naif/ 46 | - naif-names.txt : your own body to ID code mappings. 47 | 48 | About dates 49 | ----------- 50 | 51 | Most functions accept multiple types of dates: calendar strings, 52 | Julian dates, `Time`, or `datetime`. If the scale is not defined (as 53 | it is for `Time` instances), we assume the scale is UTC. 54 | 55 | """ 56 | 57 | from ..util import autodoc 58 | import astropy.units as u 59 | 60 | from . import core 61 | from . import geom 62 | from . import state 63 | from . import ssobj 64 | 65 | from .geom import * 66 | from .state import * 67 | from .ssobj import * 68 | 69 | __all__ = geom.__all__ + state.__all__ + ssobj.__all__ 70 | 71 | # load up a few objects 72 | 73 | # G * Masses are from Standish, E.M. (1998) "JPL Planetary and Lunar 74 | # Ephemerides, DE405/LE405", JPL IOM 312.F-98-048. 75 | GM_sun = 1.32712440017987e20 * u.m**3 / u.s**2 76 | GM_planets = [ 77 | 22032.080, 78 | 324858.599, 79 | 398600.433, 80 | 42828.314, 81 | 126712767.863, 82 | 37940626.063, 83 | 5794549.007, 84 | 6836534.064, 85 | 981.601, 86 | ] 87 | GM_ast = [62.375, 13.271, 17.253] # Ceres, Pallas, Vesta 88 | GM_moon = 4902.801 89 | GM_earth_sys = 403503.233 90 | 91 | # load 'em if you got 'em 92 | try: 93 | Sun = getspiceobj("Sun", kernel="planets.bsp", GM=GM_sun) 94 | Mercury = getspiceobj("Mercury", kernel="planets.bsp", GM=GM_planets[0]) 95 | Venus = getspiceobj("Venus", kernel="planets.bsp", GM=GM_planets[1]) 96 | EarthSys = getspiceobj("3", kernel="planets.bsp", GM=GM_earth_sys) 97 | Earth = getspiceobj("399", kernel="planets.bsp", GM=GM_planets[2]) 98 | Moon = getspiceobj("301", kernel="planets.bsp", GM=GM_moon) 99 | Mars = getspiceobj("4", name="Mars", kernel="planets.bsp", GM=GM_planets[3]) 100 | Jupiter = getspiceobj("5", name="Jupiter", kernel="planets.bsp", GM=GM_planets[4]) 101 | Saturn = getspiceobj("6", name="Saturn", kernel="planets.bsp", GM=GM_planets[5]) 102 | Uranus = getspiceobj("7", name="Uranus", kernel="planets.bsp", GM=GM_planets[6]) 103 | Neptune = getspiceobj("8", name="Neptune", kernel="planets.bsp", GM=GM_planets[7]) 104 | PlutoSys = getspiceobj("9", name="PlutoSys", kernel="planets.bsp", GM=GM_planets[8]) 105 | _loaded_objects = dict( 106 | sun=Sun, 107 | mercury=Mercury, 108 | venus=Venus, 109 | earth=Earth, 110 | moon=Moon, 111 | mars=Mars, 112 | jupiter=Jupiter, 113 | saturn=Saturn, 114 | uranus=Uranus, 115 | neptune=Neptune, 116 | pluto=PlutoSys, 117 | ) 118 | __all__.extend(["Sun", "Earth", "Moon"]) 119 | except OSError: 120 | pass 121 | 122 | try: 123 | Earth_L2 = getspiceobj("392", kernel="L2.bsp", name="Earth L2") 124 | _loaded_objects["earth_l2"] = Earth_L2 125 | __all__.append("Earth_L2") 126 | except OSError: 127 | pass 128 | 129 | try: 130 | Spitzer = getspiceobj("-79", kernel="spitzer.bsp", name="Spitzer") 131 | _loaded_objects["spitzer"] = Spitzer 132 | __all__.append("Spitzer") 133 | except OSError: 134 | pass 135 | 136 | try: 137 | JWST = getspiceobj("-170", kernel="jwst_rec.bsp", name="JWST") 138 | _loaded_objects["jwst"] = JWST 139 | __all__.append("JWST") 140 | except OSError: 141 | pass 142 | 143 | try: 144 | DeepImpact = getspiceobj("-140", kernel="deepimpact.txt", name="Deep Impact") 145 | _loaded_objects["deepimpact"] = DeepImpact 146 | __all__.append("DeepImpact") 147 | except OSError: 148 | pass 149 | 150 | try: 151 | Kepler = getspiceobj("-227", kernel="kepler.bsp", name="Kepler") 152 | _loaded_objects["kepler"] = Kepler 153 | __all__.append("Kepler") 154 | except OSError: 155 | pass 156 | 157 | try: 158 | TESS = getspiceobj("-95", kernel="tess.txt", name="TESS") 159 | _loaded_objects["tess"] = TESS 160 | __all__.append("TESS") 161 | except OSError: 162 | pass 163 | 164 | # update module docstring 165 | autodoc(globals()) 166 | del autodoc 167 | -------------------------------------------------------------------------------- /mskpy/instruments/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | instruments --- Cameras, spectrometers, etc. for astronomy. 5 | =========================================================== 6 | 7 | Instruments can be used observe a `SolarSysObject`. 8 | 9 | Classes 10 | ------- 11 | Instrument 12 | Camera 13 | CircularApertureSpectrometer 14 | LongSlitSpectrometer 15 | 16 | """ 17 | 18 | from . import instrument 19 | from . import hst 20 | from . import irtf 21 | from . import spitzer 22 | from . import vis 23 | 24 | from .instrument import * 25 | from .hst import * 26 | from .irtf import * 27 | from .spitzer import * 28 | from .vis import * 29 | from .jwst import * 30 | 31 | # update module docstring 32 | from ..util import autodoc 33 | autodoc(globals()) 34 | del autodoc 35 | -------------------------------------------------------------------------------- /mskpy/instruments/hst.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | hst --- Hubble instruments. 5 | ================================ 6 | 7 | Classes 8 | ------- 9 | WFC3 10 | 11 | """ 12 | 13 | from ..util import autodoc 14 | import numpy as np 15 | import astropy.units as u 16 | 17 | try: 18 | from ..ephem import Earth 19 | except ImportError: 20 | Earth = None 21 | 22 | from .instrument import Instrument, Camera, LongSlitSpectrometer 23 | 24 | __all__ = ['WFC3UVIS'] 25 | 26 | 27 | class WFC3UVIS(Camera): 28 | """Wide Field Camera 3 UV Visible 29 | 30 | Attributes 31 | ---------- 32 | 33 | Examples 34 | -------- 35 | 36 | """ 37 | 38 | def __init__(self): 39 | w = [0.438, 0.606, 0.775] * u.um 40 | shape = (4096, 2051) 41 | ps = 0.0395 * u.arcsec 42 | location = Earth 43 | Camera.__init__(self, w, shape, ps, location=location) 44 | 45 | def diffusion(self, wave, im): 46 | """Simulate UVIS's charge diffusion. 47 | 48 | Parameters 49 | ---------- 50 | wave : float 51 | The effective wavelength of the image. [micron] 52 | im : ndarray 53 | The image to process. 54 | 55 | Returns 56 | ------- 57 | newim : ndarray 58 | The processed image. 59 | 60 | Notes 61 | ----- 62 | Based on diffusion parameters from STScI Instrument Science Report 63 | 2008-014. 64 | 65 | """ 66 | 67 | from astropy.convolution import convolve 68 | 69 | w0 = [0.250, 0.810] # micron 70 | k0 = np.array([[[0.027, 0.111, 0.027], 71 | [0.111, 0.432, 0.111], 72 | [0.027, 0.111, 0.027]], 73 | [[0.002, 0.037, 0.002], 74 | [0.037, 0.844, 0.037], 75 | [0.002, 0.037, 0.002]]]) 76 | dk = (k0[1] - k0[0]) / (w0[1] - w0[0]) 77 | k = k0[0] + dk * (wave - w0[0]) 78 | k /= k.sum() 79 | return convolve(im, k, boundary='extend') 80 | 81 | 82 | # update module docstring 83 | autodoc(globals()) 84 | del autodoc 85 | -------------------------------------------------------------------------------- /mskpy/instruments/jwst.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | import enum 3 | import numpy as np 4 | import matplotlib.pyplot as plt 5 | import astropy.units as u 6 | from astropy.table import Table 7 | from astropy.io import ascii, fits 8 | from astropy.wcs import WCS 9 | from photutils.aperture import ( 10 | RectangularAperture, 11 | CircularAperture, 12 | aperture_photometry, 13 | ) 14 | from ..image.analysis import gcentroid, UnableToCenter 15 | 16 | 17 | class Shape(enum.Enum): 18 | CIRCLE = "circle" 19 | SQUARE = "square" 20 | 21 | 22 | class JWSTSpectrum: 23 | def __init__(self, wave, spec, unc, x=None, y=None): 24 | self.wave = wave 25 | self.spec = spec 26 | self.unc = unc 27 | self.x = x 28 | self.y = y 29 | 30 | def save(self, fn, meta, overwrite=True, **kwargs): 31 | data = (self.wave, self.spec, self.unc) 32 | names = ("wave", "spec", "unc") 33 | if self.x is not None: 34 | data += (self.x, self.y) 35 | names += ("x", "y") 36 | tab = Table(data, names=names) 37 | tab.meta.update(meta) 38 | tab.write(fn, overwrite=overwrite, **kwargs) 39 | 40 | @classmethod 41 | def read(cls, fn): 42 | tab = ascii.read(fn) 43 | data = cls( 44 | tab["wave"].quantity, 45 | tab["spec"].quantity, 46 | tab["unc"].quantity, 47 | tab["x"].data, 48 | tab["y"].data, 49 | ) 50 | data.meta = tab.meta 51 | return data 52 | 53 | @classmethod 54 | def from_cube( 55 | cls, 56 | fn, 57 | x, 58 | y, 59 | shape="circle", 60 | size=3, 61 | unit=u.mJy, 62 | centroid_by_wavelength=False, 63 | centroid_window=5, 64 | centroid_options=None, 65 | ): 66 | """Simple spectral extraction from a data cube. 67 | 68 | 69 | Parameters 70 | ---------- 71 | fn : str 72 | FITS file of spectral data cube. 73 | 74 | x, y : float 75 | Aperture center. 76 | 77 | shape : Shape or str, optional 78 | Circle or square. 79 | 80 | size : int, optional 81 | Circle radius or square side length. 82 | 83 | unit : astropy.units.Unit, optional 84 | Spectral data unit. 85 | 86 | centroid_by_wavelength : bool, optional 87 | If `True`, then refine the centroid for each wavelength. If a 88 | centroid fails, the spectrum will be NaN for that wavelength. 89 | 90 | centroid_window : int, optional 91 | Median this number of wavelengths together before centroiding. Best 92 | to use an odd value. 93 | 94 | centroid_options : dict 95 | Additional keyword arguments for `mskpy.image.gcentroid`. Default: 96 | {"box": 5}. 97 | 98 | """ 99 | 100 | _centroid_options = {"box": 5} 101 | if centroid_options is not None: 102 | _centroid_options.update(centroid_options) 103 | 104 | hdu = fits.open(fn) 105 | cube = hdu["SCI"].data 106 | cube_unc = hdu["ERR"].data 107 | N = cube.shape[0] 108 | 109 | shape = Shape(shape) 110 | 111 | if shape == Shape.CIRCLE: 112 | aper = CircularAperture((x, y), size) 113 | else: 114 | aper = RectangularAperture((x, y), size, size) 115 | 116 | wcs = WCS(hdu["SCI"]) 117 | wave = wcs.all_pix2world(x, y, np.arange(N), 0)[2] * 1e6 * u.um 118 | omega = wcs.proj_plane_pixel_area() 119 | conv = (1 * u.MJy / u.sr * omega).to_value(unit, u.spectral_density(wave)) 120 | if conv.size == 1: 121 | conv = conv * np.ones(N) 122 | 123 | spec = [] 124 | unc = [] 125 | cx = [] 126 | cy = [] 127 | for i in range(N): 128 | if not np.any(np.isfinite(cube[i])): 129 | spec.append(0) 130 | unc.append(0) 131 | cx.append(0) 132 | cy.append(0) 133 | continue 134 | 135 | if centroid_by_wavelength: 136 | hw = centroid_window // 2 137 | s = np.s_[max(0, i - hw) : min(N, i + hw + 1)] 138 | 139 | with warnings.catch_warnings(): 140 | warnings.simplefilter("ignore", RuntimeWarning) 141 | im = np.nanmedian(cube[s], 0) 142 | 143 | try: 144 | yx = gcentroid(im, aper.positions[::-1], **_centroid_options) 145 | except UnableToCenter: 146 | spec.append(np.nan) 147 | unc.append(np.nan) 148 | cx.append(np.nan) 149 | cy.append(np.nan) 150 | continue 151 | aper.positions = yx[::-1] 152 | 153 | phot = aperture_photometry( 154 | cube[i] * conv[i], 155 | aper, 156 | error=cube_unc[i] * conv[i], 157 | ) 158 | spec.append(phot["aperture_sum"][0]) 159 | unc.append(phot["aperture_sum_err"][0]) 160 | cx.append(aper.positions[0]) 161 | cy.append(aper.positions[1]) 162 | 163 | return cls(wave, spec * unit, unc * unit, cx, cy) 164 | 165 | def plot(self, ax=None, **kwargs): 166 | if ax is None: 167 | ax = plt.gca() 168 | ds = kwargs.get("drawstyle", kwargs.get("ds", "steps-mid")) 169 | ax.errorbar(self.wave, self.spec, self.unc, ds=ds, **kwargs) 170 | -------------------------------------------------------------------------------- /mskpy/instruments/sofia.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | spitzer --- Spitzer instruments. 5 | ================================ 6 | 7 | Classes 8 | ------- 9 | IRAC 10 | 11 | """ 12 | 13 | from ..util import autodoc 14 | import numpy as np 15 | import astropy.units as u 16 | 17 | try: 18 | from ..ephem import Earth 19 | except ImportError: 20 | Earth = None 21 | 22 | from .instrument import Camera, LongSlitSpectrometer 23 | 24 | __all__ = ['FLITECAM'] 25 | 26 | 27 | class FLITECAM(object): 28 | """FLITECAM. 29 | 30 | Attributes 31 | ---------- 32 | camera : Direct imaging mode. 33 | grism : Dictionary of spectroscopy modes. 34 | 35 | """ 36 | 37 | shape = (1024, 1024) 38 | ps = 0.475 * u.arcsec 39 | location = Earth 40 | readnoise = 40 * u.electron 41 | welldepth = 80e3 * u.electron 42 | 43 | def __init__(self): 44 | w = [1.25, 1.64, 2.12, 3.05, 3.55, 3.61, 4.81, 4.87] * u.um 45 | self.camera = Camera(w, self.shape, self.ps, location=self.location) 46 | 47 | R = 1700 48 | modes = { 49 | 'A1LM': (4.395, 5.533), 50 | 'A2KL': (2.211, 2.722), 51 | 'A3Hw': (1.493, 1.828), 52 | 'B1LM': (3.303, 4.074), 53 | 'B2Hw': (1.675, 2.053), 54 | 'B3J': (1.142, 1.385), 55 | 'C2LM': (2.758, 3.399), 56 | 'C3Kw': (1.854, 2.276), 57 | 'C4Hw': (1.408, 1.718)} 58 | 59 | self.grism = dict() 60 | for k, v in modes.items(): 61 | dlam = ((v[1] - v[0]) / self.shape[1]) * u.um 62 | self.grism[k] = LongSlitSpectrometer( 63 | np.mean(v) * u.um, self.shape, self.ps, 2.1, dlam, 64 | self.location) 65 | 66 | 67 | # update module docstring 68 | autodoc(globals()) 69 | del autodoc 70 | -------------------------------------------------------------------------------- /mskpy/instruments/vis.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | vis --- Visual-band instruments. 5 | ================================ 6 | 7 | Classes 8 | ------- 9 | OptiPol 10 | 11 | """ 12 | 13 | from ..util import autodoc 14 | import numpy as np 15 | import astropy.units as u 16 | 17 | try: 18 | from ..ephem import Earth 19 | except ImportError: 20 | Earth = None 21 | 22 | from .instrument import Instrument, Camera 23 | 24 | __all__ = ['OptiPol'] 25 | 26 | 27 | class OptiPol(Camera): 28 | """University of Minnesota's optical imaging polarimeter. 29 | 30 | Effective wavelengths are for an A0V star. 31 | 32 | Methods 33 | ------- 34 | read : Read an Optipol image from a file. 35 | 36 | """ 37 | 38 | top = slice(500, 1000) 39 | bot = slice(None, 500) 40 | x = slice(-1000, None) 41 | 42 | def __init__(self): 43 | # UBVRI 44 | w = [0.37, 0.44, 0.54, 0.64, 0.80] * u.um 45 | 46 | shape = (500, 1000) 47 | ps = 0.2 * u.arcsec 48 | location = Earth 49 | Camera.__init__(self, w, shape, ps, location=location) 50 | 51 | def read(self, filename, dark=0, flats=[1, 1], header=False): 52 | """Read an OptiPol image from a file. 53 | 54 | Parameters 55 | ---------- 56 | filename : string 57 | The name of the file. 58 | dark : array, optional 59 | A full-sized dark frame to subtract from the image. 60 | flats : array, optional 61 | The flat-field corrections: `[top_flat, bottom_flat]`. 62 | header : bool, optional 63 | Set to `True` to return the file's FITS header. 64 | 65 | Returns 66 | ------- 67 | top, bot : Image 68 | The top and bottom frames, split from the original, and, 69 | optionally, dark subtracted and flat-field corrected. 70 | header : astropy FITS header, optional 71 | The image's FITS header. 72 | 73 | """ 74 | 75 | from astropy.io import fits 76 | from ..image import Image 77 | 78 | im = fits.getdata(filename) - dark 79 | top = Image(im[self.top, self.x] / flats[0]) 80 | bot = Image(im[self.bot, self.x] / flats[1]) 81 | 82 | if header: 83 | return top, bot, fits.getheader(filename) 84 | else: 85 | return top, bot 86 | 87 | def readQU(self, qfile, ufile, dark=0, qflats=[1, 1], uflats=[1, 1]): 88 | """Read a QU sequence from files. 89 | 90 | Parameters 91 | ---------- 92 | qfile, ufile : string 93 | The names of the files. 94 | dark : array, optional 95 | A full-sized dark frame to subtract from the image. 96 | qflats, uflats : array, optional 97 | The flat-field corrections for the Q and U frames: 98 | `[top_flat, bottom_flat]`. 99 | 100 | Returns 101 | ------- 102 | pol : HalfWavePlate 103 | The images as a polarization object. 104 | 105 | """ 106 | 107 | from astropy.io import fits 108 | from ..polarimetry import HalfWavePlate 109 | 110 | qtb = self.read(qfile, dark=dark, flats=qflats) 111 | utb = self.read(ufile, dark=dark, flats=uflats) 112 | 113 | return HalfWavePlate((qtb[0], utb[0], qtb[1], utb[1])) 114 | 115 | 116 | # update module docstring 117 | autodoc(globals()) 118 | del autodoc 119 | -------------------------------------------------------------------------------- /mskpy/lib/__init__.py: -------------------------------------------------------------------------------- 1 | from .davint import davint 2 | -------------------------------------------------------------------------------- /mskpy/modeling.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | modeling --- Models for fitting data. 4 | ===================================== 5 | 6 | Module under development and waiting for final Astropy modeling API. 7 | 8 | .. autosummary:: 9 | :toctree: generated/ 10 | 11 | ComaSED 12 | 13 | """ 14 | 15 | import numpy as np 16 | import astropy.units as u 17 | #from astropy.modeling import Parameter, ParametricModel 18 | 19 | __all__ = [ 20 | # 'ComaSED' 21 | ] 22 | 23 | #class ComaSED(ParametricModel): 24 | # """A simple, semi-empirical coma SED, based on Afrho. 25 | # 26 | # Parameters 27 | # ---------- 28 | # geom : dict of Quantity, or ephem.Geom 29 | # The observing geometry via keywords rh, delta, and phase. 30 | # rap : Quantity 31 | # Aperture radius in length or angular units. 32 | # Afrho : Quantity 33 | # In units of length. 34 | # ef2af : float, optional 35 | # Conversion from episilon-f_therm to A-f_sca. 36 | # Tscale : float, optional 37 | # Temperature scale factor. 38 | # unit : astropy Unit, optional 39 | # The output flux density units. 40 | # 41 | # Examples 42 | # -------- 43 | # 44 | # Fit IRAC photometry of 67P/Churyumov-Gerasimenko, ignoring any 45 | # possible gas contribution at 4.5 um. 46 | # 47 | # >>> import astropy.units as u 48 | # >>> from astropy.modeling import fitting 49 | # >>> from mskpy.modeling import ComaSED 50 | # >>> wave = np.array([3.55, 4.49, 5.73, 7.87]) 51 | # >>> flux = array([1.49e-15, 3.31e-15, 1.08e-14, 2.92e-14]) # W/m2/um 52 | # >>> geom = dict(rh=1.490 * u.au, delta=1.669 * u.au, phase=35.7 * u.deg) 53 | # >>> rap = 7.32 * u.arcsec 54 | # >>> coma = ComaSED(geom, rap, 1000 * u.cm) 55 | # >>> fit = fitting.NonLinearLSQFitter(coma) 56 | # >>> fit(wave, flux) 57 | # >>> print(fit.model(wave) - flux) / flux 58 | # [ 0.04580127 -0.06261374 0.00882257 -0.00058844] 59 | # 60 | # """ 61 | # 62 | # param_names = ['Afrho', 'ef2af', 'Tscale'] 63 | # deriv = None # compute numerical derivatives 64 | # 65 | # def __init__(self, geom, rap, Afrho, phasef=None, ef2af=2.0, Tscale=1.1, 66 | # unit=u.Unit('W/(m2 um)'), param_dim=1): 67 | # from .models import dust 68 | # 69 | # assert isinstance(Afrho, u.Quantity) 70 | # assert isinstance(rap, u.Quantity) 71 | # 72 | # if phasef is None: 73 | # phasef = dust.phaseK 74 | # self.phasef = phasef 75 | # assert hasattr(self.phasef, '__call__') 76 | # 77 | # self._Afrho = Parameter(name='Afrho', val=Afrho.centimeter, 78 | # mclass=self, param_dim=param_dim) 79 | # self._ef2af = Parameter(name='ef2af', val=ef2af, mclass=self, 80 | # param_dim=param_dim) 81 | # self._Tscale = Parameter(name='Tscale', val=Tscale, mclass=self, 82 | # param_dim=param_dim) 83 | # self.geom = geom 84 | # self.rap = rap 85 | # self.unit = unit 86 | # 87 | # ParametricModel.__init__(self, self.param_names, n_inputs=1, 88 | # n_outputs=1, param_dim=param_dim) 89 | # self.linear = False 90 | # 91 | # self.reflected = dust.AfrhoScattered(Afrho, phasef=phasef) 92 | # self.thermal = dust.AfrhoThermal(Afrho, ef2af=ef2af, Tscale=Tscale) 93 | # 94 | # def eval(self, wave, params): 95 | # self.reflected.Afrho = params[0] * u.cm 96 | # self.reflected.phasef = self.phasef 97 | # self.thermal.Afrho = params[0] * u.cm 98 | # self.thermal.ef2af = params[1] 99 | # self.thermal.Tscale = params[2] 100 | # f = self.reflected.fluxd(self.geom, wave * u.um, self.rap, 101 | # unit=self.unit).value 102 | # f += self.thermal.fluxd(self.geom, wave * u.um, self.rap, 103 | # unit=self.unit).value 104 | # return f 105 | # 106 | # def __call__(self, wave): 107 | # from astropy.modeling import _convert_input, _convert_output 108 | # wave, format = _convert_input(wave, self.param_dim) 109 | # result = self.eval(wave, self.param_sets) 110 | # return _convert_output(result, format) 111 | 112 | # update module docstring 113 | #from .util import autodoc 114 | #autodoc(globals()) 115 | #del autodoc 116 | 117 | -------------------------------------------------------------------------------- /mskpy/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | A model library 5 | =============== 6 | 7 | .. autosummary:: 8 | :toctree: generated/ 9 | 10 | Surface Models 11 | -------------- 12 | SurfaceRadiation 13 | DAp 14 | HG 15 | NEATM 16 | 17 | Dust Models 18 | ----------- 19 | AfrhoRadiation 20 | AfrhoScattered 21 | AfrhoThermal 22 | 23 | Phase functions 24 | --------------- 25 | phaseK 26 | phaseH 27 | phaseHG 28 | phaseHM 29 | lambertian 30 | 31 | """ 32 | 33 | __all__ = [ 34 | 'surfaces', 35 | 'dust' 36 | ] 37 | 38 | from . import surfaces 39 | from . import dust 40 | 41 | from .surfaces import * 42 | from .dust import * 43 | 44 | # update module docstring 45 | from ..util import autodoc 46 | autodoc(globals()) 47 | del autodoc 48 | 49 | -------------------------------------------------------------------------------- /mskpy/models/psg/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | 3 | """ 4 | Support for the Planetary Spectrum Generator 5 | ============================================ 6 | """ 7 | 8 | __all__ = ["PSGConfig", "PSGModel"] 9 | 10 | import os 11 | import re 12 | from collections import UserDict, defaultdict 13 | import requests 14 | import numpy as np 15 | from astropy.io import ascii 16 | from astropy.table import Table 17 | import astropy.units as u 18 | from sbpy.spectroscopy.sources import SpectralSource 19 | 20 | 21 | class PSGError(Exception): 22 | pass 23 | 24 | 25 | class PSGConfig(UserDict): 26 | @classmethod 27 | def from_file(cls, filename): 28 | with open(filename, "r") as config: 29 | contents = config.read(-1) 30 | 31 | config = cls() 32 | 33 | pattern = r"^<([^<>]+)>([^<>]*)\n" 34 | for match in re.finditer(pattern, contents, re.MULTILINE): 35 | config[match[1]] = cls._parse_value(match[2]) 36 | 37 | return config 38 | 39 | @classmethod 40 | def _parse_value(cls, value): 41 | patterns = [ 42 | ("none", "^$"), 43 | ("integer", r"[+-]?\d+$"), 44 | ("float", r"[+-]?\d+(\.\d+)?(([eE][+-]?\d+){0,1})?$"), 45 | ("list", r"([^,]+,)+[^,]+$"), 46 | ("string", r".+$"), 47 | ] 48 | pattern = "|".join(["(?P<%s>%s)" % pair for pair in patterns]) 49 | match = re.match(pattern, value.rstrip()) 50 | kind = match.lastgroup 51 | v = match.group() 52 | if kind == "none": 53 | return None 54 | elif kind == "integer": 55 | return int(v) 56 | elif kind == "float": 57 | return float(v) 58 | elif kind == "list": 59 | return cls._parse_list(v) 60 | elif kind == "string": 61 | return v 62 | else: 63 | raise ValueError("Unparsable value: {}".format(v)) 64 | 65 | @classmethod 66 | def _parse_list(cls, values): 67 | value_list = [] 68 | for value in values.split(","): 69 | value_list.append(cls._parse_value(value)) 70 | return value_list 71 | 72 | def __str__(self): 73 | s = "" 74 | for key, value in self.items(): 75 | s += f"<{key}>{self._format_value(value)}\n" 76 | return s 77 | 78 | def write(self, filename, overwrite=False): 79 | """Write to file. 80 | 81 | 82 | Parameters 83 | ---------- 84 | filename : string 85 | The name of the file. 86 | 87 | overwrite : bool, optional 88 | If the file exists, overwrite it. 89 | 90 | """ 91 | 92 | if os.path.exists(filename) and not overwrite: 93 | raise RuntimeError("File exists, overwrite it with overwrite=True.") 94 | 95 | with open(filename, "w") as outf: 96 | for key, value in self.items(): 97 | outf.write(f"<{key}>{self._format_value(value)}\n") 98 | 99 | @classmethod 100 | def _format_value(cls, value): 101 | if isinstance(value, (list, tuple, np.ndarray)): 102 | formatted_value = ",".join([cls._format_value(v) for v in value]) 103 | elif value is None: 104 | formatted_value = "" 105 | else: 106 | formatted_value = str(value) 107 | return formatted_value 108 | 109 | def run(self, fn): 110 | """Run the PSG with this configuration. 111 | 112 | 113 | Parameters 114 | ---------- 115 | 116 | fn : string 117 | Save results to this file name. An existing file will be 118 | overwritten. 119 | 120 | """ 121 | 122 | data = {"file": str(self)} 123 | response = requests.post("https://psg.gsfc.nasa.gov/api.php", data=data) 124 | response.raise_for_status() 125 | 126 | if len(ascii.read(response.text)) == 0: 127 | raise PSGError(response.text) 128 | 129 | with open(fn, "w") as outf: 130 | outf.write(response.text) 131 | 132 | 133 | class PSGModel: 134 | """PSG model spectra.""" 135 | 136 | def __init__(self, fn): 137 | with open(fn, "r") as model: 138 | reading_data = False 139 | rows = [] 140 | for line in model: 141 | line = line.strip() 142 | if len(line) == 0: 143 | continue 144 | elif line.startswith("# Molecules considered:"): 145 | molecules = [x.strip() for x in line.split(":")[1].split(",")] 146 | continue 147 | elif line.startswith("# Molecular sources"): 148 | sources = [x.strip() for x in line.split(":")[1].split(",")] 149 | if len(set(sources)) != len(sources): 150 | raise ValueError( 151 | "Molecular source names are not unique:" + ",".join(sources) 152 | ) 153 | 154 | self.sources = sources 155 | self.molecules = defaultdict(list) 156 | for m, source in zip(molecules, sources): 157 | self.molecules[m].append(source) 158 | 159 | continue 160 | elif line.startswith("# Wave/freq"): 161 | reading_data = True 162 | self.source_molecules = defaultdict(list) 163 | columns = line[2:].split() 164 | n = len(sources) 165 | columns = ["wave"] + columns[1:-n] + sources 166 | continue 167 | 168 | if reading_data: 169 | data = [float(x) for x in line.split()] 170 | row = {k: v for k, v in zip(columns, data)} 171 | rows.append(row) 172 | 173 | self.data = Table(rows) 174 | 175 | def bin(self, wave): 176 | """Bin the data to these wavelengths (μm). This changes the data in-place.""" 177 | 178 | class Spectrum(SpectralSource): 179 | pass 180 | 181 | data = [wave] 182 | for k in self.data.colnames[1:]: 183 | spectrum = Spectrum.from_array( 184 | self.data["wave"] * u.um, self.data[k] * u.Jy 185 | ) # actual unit is not important, right? 186 | data.append(spectrum.observe(wave * u.um, unit=u.Jy)) 187 | self.data = Table(data, names=self.data.colnames) 188 | 189 | def __getitem__(self, k): 190 | if k in self.molecules: 191 | spec = 0 192 | for source in self.molecules[k]: 193 | spec = spec + self.data[source].data 194 | 195 | return spec 196 | else: 197 | return self.data[k].data 198 | -------------------------------------------------------------------------------- /mskpy/models/psg/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkelley/mskpy/90307980c09ef88b71dea2ec4087db3a0520e521/mskpy/models/psg/test/__init__.py -------------------------------------------------------------------------------- /mskpy/models/psg/test/psg_cfg.txt: -------------------------------------------------------------------------------- 1 | Comet 2 | 22P 3 | 2022/08/25 15:49 4 | 3.0 5 | 0.600 6 | rho 7 | 2.18333 8 | 10.36409 9 | 0.0 10 | 0.00 11 | 79.4 12 | G 13 | 5777 14 | 1.0 15 | 21.70 16 | 0.00 17 | -5.887 18 | 0.00000000 19 | 0.54859700,1.55485,2459656.39479300,120.83604,162.91098,4.739776 20 | 90.00 21 | 343.70 22 | Observatory 23 | 0.0 24 | 0.0 25 | arcsec 26 | 1.4182 27 | AU 28 | 0.0 29 | G 30 | 5777 31 | 0 32 | 51.396 33 | 48.121 34 | 1.000e+00 35 | -1.000000e+00 36 | 0.000000e+00 37 | User 38 | 1 39 | 0.00,0.00 40 | 0.947 41 | 0.000 42 | Non-LTE for H2O, Qatm:2.00e+26, njets:0, matm:18, lifetime:77000, Xmol:1.00e+00, Tkin:80.0, vexp:541.4, Cscl:9.00, escl:1.00e+00 43 | Coma 44 | 541.40 45 | 1e27 46 | gas 47 | 30 48 | 4 49 | CH4,C2H6,CH3OH,CH3OH 50 | GSFC[CH4],GSFC[C2H6],GSFC[CH3OH],GSFC[CH3OH_V9] 51 | 1,1,1,1 52 | pct,pct,pct,pct 53 | 132000.0,91000.0,80000.0,80000.0 54 | 0 55 | 0 56 | 0 57 | Rayleigh,Refraction,CIA_all,UV_all 58 | Lommel-Seeliger 59 | ISO 60 | 186.4000 61 | 0.0400 62 | 0.9600 63 | 1.0000 64 | ratio 65 | 0 66 | user 67 | 3.2 68 | 3.6 69 | um 70 | 2500 71 | RP 72 | SINGLE 73 | 5.64 74 | 0.6 75 | arcsec 76 | 1 77 | 2.0 78 | 1.0 79 | NO 80 | 1 81 | 1 82 | 300 83 | 1 84 | 1 85 | 1000 86 | 10 87 | 1 88 | N 89 | N 90 | N 91 | Y 92 | N 93 | Y 94 | mJy 95 | Y 96 | 02-01 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /mskpy/models/psg/test/test_psg.py: -------------------------------------------------------------------------------- 1 | from astropy.utils.data import get_pkg_data_filename 2 | from mskpy.models import psg 3 | 4 | 5 | def test_parse_config(): 6 | filename = get_pkg_data_filename("psg_cfg.txt", "mskpy.models.psg.test") 7 | config = psg.PSGConfig.from_file(filename) 8 | 9 | assert config["OBJECT"] == "Comet" 10 | assert config["OBJECT-NAME"] == "22P" 11 | assert config["OBJECT-OBS-VELOCITY"] == -5.887 12 | assert config["ATMOSPHERE-TYPE"] == ["GSFC[CH4]", 13 | "GSFC[C2H6]", "GSFC[CH3OH]", "GSFC[CH3OH_V9]"] 14 | assert config["ATMOSPHERE-WEIGHT"] == 541.40 15 | assert config["ATMOSPHERE-NGAS"] == 4 16 | assert config["ATMOSPHERE-PRESSURE"] == 1e27 17 | assert config["ATMOSPHERE-AEROS"] == None 18 | 19 | 20 | def test_config_str(): 21 | config = psg.PSGConfig() 22 | config["OBJECT"] = "Comet" 23 | config["OBJECT-NAME"] = "22P" 24 | config["OBJECT-OBS-VELOCITY"] = -5.887 25 | config["ATMOSPHERE-TYPE"] = ["GSFC[CH4]", 26 | "GSFC[C2H6]", "GSFC[CH3OH]", "GSFC[CH3OH_V9]"] 27 | config["ATMOSPHERE-WEIGHT"] = 541.40 28 | config["ATMOSPHERE-NGAS"] = 4 29 | config["ATMOSPHERE-PRESSURE"] = 1e27 30 | config["ATMOSPHERE-AEROS"] = None 31 | 32 | s = str(config) 33 | assert s == """Comet 34 | 22P 35 | -5.887 36 | GSFC[CH4],GSFC[C2H6],GSFC[CH3OH],GSFC[CH3OH_V9] 37 | 541.4 38 | 4 39 | 1e+27 40 | 41 | """ 42 | 43 | 44 | def test_parse_model(): 45 | filename = get_pkg_data_filename("psg_rad.txt", "mskpy.models.psg.test") 46 | model = psg.PSGModel(filename) 47 | columns = ["wave", "Total", "22P", "Nucleus", "Dust", 48 | "GSFC[CH4]", "GSFC[C2H6]", "GSFC[CH3OH]", "GSFC[CH3OH_V9]"] 49 | values = [3.267386380, 1.4972492e-05, 3.34337e-02, 2.60666e-02, 50 | 7.35209e-03, 1.48372e-06, 2.71464e-07, 1.34468e-06, 1.19062e-05] 51 | for k, v in zip(columns, values): 52 | assert model[k][521] == v 53 | assert model[521][k] == v 54 | 55 | assert model["CH4"][521] == values[5] 56 | assert model["C2H6"][521] == values[6] 57 | assert model["CH3OH"][521] == values[7] + values[8] 58 | -------------------------------------------------------------------------------- /mskpy/photometry/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | photometry --- Tools for working with photometry. 4 | ================================================= 5 | 6 | .. autosummary:: 7 | :toctree: generated/ 8 | 9 | Modules 10 | ------- 11 | hb - Hale-Bopp filter set calibration. 12 | 13 | Functions 14 | --------- 15 | airmass_app 16 | airmass_loc 17 | cal_airmass 18 | cal_color_airmass 19 | 20 | """ 21 | 22 | import numpy as np 23 | import astropy.units as u 24 | 25 | from .core import * 26 | from .outbursts import * 27 | from . import hb 28 | 29 | __all__ = [ 30 | 'airmass_app', 31 | 'airmass_loc', 32 | 'cal_airmass', 33 | 'cal_color_airmass', 34 | 'hb' 35 | ] 36 | 37 | # update module docstring 38 | from ..util import autodoc 39 | autodoc(globals()) 40 | del autodoc 41 | -------------------------------------------------------------------------------- /mskpy/photometry/core.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | core --- Core code for photometry. 4 | ================================== 5 | 6 | .. autosummary:: 7 | :toctree: generated/ 8 | 9 | Functions 10 | --------- 11 | airmass_app 12 | airmass_loc 13 | cal_airmass 14 | cal_color_airmass 15 | 16 | """ 17 | 18 | from ..util import autodoc 19 | import numpy as np 20 | import astropy.units as u 21 | 22 | __all__ = [ 23 | 'airmass_app', 24 | 'airmass_loc', 25 | 'cal_airmass', 26 | 'cal_color', 27 | 'cal_color_airmass', 28 | ] 29 | 30 | 31 | def airmass_app(z_true, h): 32 | """Apparent airmass. 33 | 34 | Hardie's 1962 formula, with a correction for atmospheric 35 | refraction. Used by Farnham and Schleicher 2000. 36 | 37 | For OH, use `airmass_loc`. 38 | 39 | Parameters 40 | ---------- 41 | z_true : Angle or Quantity 42 | The object's true zenith angle. 43 | h : Quantity 44 | The observer's elevation. 45 | 46 | """ 47 | 48 | tan = np.tan(z_true) 49 | exp = np.exp(-h.to(u.km).value / 8.0) 50 | z_app = z_true - (60.4 * tan - 0.0668 * tan**3) / 3600. * exp * u.deg 51 | sec = 1.0 / np.cos(z_app) 52 | X = (sec - 0.0018167 * (sec - 1) - 0.002875 * (sec - 1)**2 53 | - 0.0008083 * (sec - 1)**3) 54 | return X.value 55 | 56 | 57 | def airmass_loc(z_true): 58 | """Airmass based on local zenith angle. 59 | 60 | Use for OH extinction. 61 | 62 | Parameters 63 | ---------- 64 | z : Angle or Quantity 65 | The object's true zenith angle. 66 | 67 | """ 68 | 69 | R = 6378. 70 | H = 22. 71 | X = (R + H) / np.sqrt((R + H)**2 - (R * np.sin(z_true))**2) 72 | return X.value 73 | 74 | 75 | def cal_airmass(m, munc, M, X, guess=(25., -0.1), 76 | covar=False): 77 | """Calibraton coefficients, based on airmass. 78 | 79 | Parameters 80 | ---------- 81 | m : array 82 | Instrumental (uncalibrated) magnitude. 83 | munc : array 84 | Uncertainties on m. 85 | M : array 86 | Calibrated magnitude. 87 | X : array 88 | Airmass. 89 | guess : array, optional 90 | An intial guess for the fitting algorithm. 91 | covar : bool, optional 92 | Set to `True` to return the covariance matrix. 93 | 94 | Results 95 | ------- 96 | A : ndarray 97 | The photometric zero point, and airmass correction slope. [mag, 98 | mag/airmass] 99 | unc or cov : ndarray 100 | Uncertainties on each parameter, based on least-squares fitting, 101 | or the covariance matrix, if `covar` is `True`. 102 | 103 | """ 104 | 105 | from scipy.optimize import leastsq 106 | 107 | def chi(A, m, munc, M, X): 108 | model = M - A[0] + A[1] * X 109 | chi = (np.array(m) - model) / np.array(munc) 110 | return chi 111 | 112 | output = leastsq(chi, guess, args=(m, munc, M, X), 113 | full_output=True, epsfcn=1e-3) 114 | fit = output[0] 115 | cov = output[1] 116 | err = np.sqrt(np.diag(cov)) 117 | 118 | if covar: 119 | return fit, cov 120 | else: 121 | return fit, err 122 | 123 | 124 | def cal_color_airmass(m, munc, M, color, X, guess=(25., -0.1, -0.01), 125 | covar=False): 126 | """Calibraton coefficients, based on airmass and color index. 127 | 128 | Parameters 129 | ---------- 130 | m : array 131 | Instrumental (uncalibrated) magnitude. 132 | munc : array 133 | Uncertainties on m. 134 | M : array 135 | Calibrated magnitude. 136 | color : array 137 | Calibrated color index, e.g., V - R. 138 | X : array 139 | Airmass. 140 | guess : array, optional 141 | An initial guess for the fitting algorithm. 142 | covar : bool, optional 143 | Set to `True` to return the covariance matrix. 144 | 145 | Results 146 | ------- 147 | A : ndarray 148 | The photometric zero point, airmass correction slope, and color 149 | correction slope. [mag, mag/airmass, mag/color index] 150 | unc or cov : ndarray 151 | Uncertainties on each parameter, based on least-squares fitting, 152 | or the covariance matrix, if `covar` is `True`. 153 | 154 | """ 155 | 156 | from scipy.optimize import leastsq 157 | 158 | def chi(A, m, munc, M, color, X): 159 | model = M - A[0] + A[1] * X + A[2] * color 160 | chi = (np.array(m) - model) / np.array(munc) 161 | return chi 162 | 163 | output = leastsq(chi, guess, args=(m, munc, M, color, X), 164 | full_output=True, epsfcn=1e-3) 165 | fit = output[0] 166 | cov = output[1] 167 | err = np.sqrt(np.diag(cov)) 168 | 169 | if covar: 170 | return fit, cov 171 | else: 172 | return fit, err 173 | 174 | 175 | def cal_color(m, munc, M, color, guess=(25., -0.01), 176 | covar=False): 177 | """Calibraton coefficients, based on color index. 178 | 179 | Parameters 180 | ---------- 181 | m : array 182 | Instrumental (uncalibrated) magnitude. 183 | munc : array 184 | Uncertainties on m. 185 | M : array 186 | Calibrated magnitude. 187 | color : array 188 | Calibrated color index, e.g., V - R. 189 | guess : array, optional 190 | An initial guess for the fitting algorithm. 191 | covar : bool, optional 192 | Set to `True` to return the covariance matrix. 193 | 194 | Results 195 | ------- 196 | A : ndarray 197 | The photometric zero point and color correction slope. [mag, 198 | mag/color index] 199 | 200 | unc or cov : ndarray 201 | Uncertainties on each parameter, based on least-squares fitting, 202 | or the covariance matrix, if `covar` is `True`. 203 | 204 | """ 205 | 206 | from scipy.optimize import leastsq 207 | 208 | def chi(A, m, munc, M, color): 209 | model = M - A[0] + A[1] * color 210 | chi = (np.array(m) - model) / np.array(munc) 211 | return chi 212 | 213 | output = leastsq(chi, guess, args=(m, munc, M, color), 214 | full_output=True, epsfcn=1e-3) 215 | fit = output[0] 216 | cov = output[1] 217 | err = np.sqrt(np.diag(cov)) 218 | 219 | if covar: 220 | return fit, cov 221 | else: 222 | return fit, err 223 | 224 | 225 | # update module docstring 226 | autodoc(globals()) 227 | del autodoc 228 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | 3 | requires = ["setuptools", 4 | "setuptools_scm", 5 | "wheel", 6 | "extension-helpers", 7 | "oldest-supported-numpy"] 8 | 9 | build-backend = 'setuptools.build_meta' 10 | -------------------------------------------------------------------------------- /scripts/D2m: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """Diameter/radius to magnitude.""" 3 | 4 | import os 5 | import sys 6 | import argparse 7 | import numpy as np 8 | import astropy.units as u 9 | from astropy.coordinates import Angle 10 | 11 | 12 | def parse_args(): 13 | parser = argparse.ArgumentParser( 14 | description=__doc__, 15 | formatter_class=argparse.ArgumentDefaultsHelpFormatter 16 | ) 17 | 18 | if 'R2m' in os.path.basename(sys.argv[0]): 19 | parser.add_argument( 20 | 'R', type=u.Quantity, 21 | help='radius and unit, e.g., "1 km"') 22 | else: 23 | parser.add_argument( 24 | 'D', type=u.Quantity, 25 | help='diameter and unit, e.g., "1 km"') 26 | 27 | parser.add_argument( 28 | '--rh', type=u.Quantity, default='1 au', 29 | help='heliocentric distance and unit, default "1 au"') 30 | parser.add_argument( 31 | '--delta', type=u.Quantity, default='1 au', 32 | help='target-observer distance and unit, default "1 au"') 33 | 34 | phase_group = parser.add_mutually_exclusive_group() 35 | phase_group.add_argument( 36 | '--observer', type=u.Quantity, default='1 au', 37 | help='observer\'s heliocentric distance and unit for phase angle calculation, default "1 au"') 38 | phase_group.add_argument( 39 | '--phase', type=u.Quantity, 40 | help='phase angle and unit (overrides --observer)') 41 | 42 | phase_function_group = parser.add_mutually_exclusive_group() 43 | phase_function_group.add_argument( 44 | '--beta', type=u.Quantity, default='0.04 mag/deg', 45 | help='phase function slope and unit (mag/angle)') 46 | phase_function_group.add_argument( 47 | '-G', type=float, 48 | help='G-parameter from HG photometric mode (overrides --beta)') 49 | 50 | return parser.parse_args() 51 | 52 | 53 | def phase_angle(args): 54 | if args.phase is not None: 55 | return args.phase 56 | 57 | cos_phase = ( 58 | (args.rh**2 + args.delta**2 - args.observer**2) 59 | / (2 * args.rh * args.delta) 60 | ) 61 | 62 | return Angle(np.arccos(cos_phase)) 63 | 64 | 65 | if __name__ == "__main__": 66 | args = parse_args() 67 | 68 | phase = phase_angle(args) 69 | -------------------------------------------------------------------------------- /scripts/H2D: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import argparse 3 | import numpy as np 4 | import astropy.units as u 5 | parser = argparse.ArgumentParser(description='Convert asteroid absolute magnitude to diamter.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) 6 | parser.add_argument('H', type=float, help='Absolute magnitude (rh=Delta=1 au, phase=0 deg).') 7 | parser.add_argument('Ap', type=float, help='Geometric albedo.') 8 | parser.add_argument('--Msun', type=float, action='store', default=-26.76, help='Absolute magnitude of the Sun.') 9 | args = parser.parse_args() 10 | D = (2 / np.sqrt(args.Ap) * 10**(0.2 * (args.Msun - args.H)) * u.au).to(u.km) 11 | if D.value < 1.0: 12 | print('{:.3g}'.format(D)) 13 | else: 14 | print('{:.2f}'.format(D)) 15 | -------------------------------------------------------------------------------- /scripts/ads: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import argparse 3 | import ads 4 | 5 | parser = argparse.ArgumentParser(description='NASA ADS query tool') 6 | parser.add_argument('--first-author') 7 | parser.add_argument('--author', nargs='*', help='may be repeated') 8 | parser.add_argument('--year') 9 | parser.add_argument('--refereed', action='store_true') 10 | parser.add_argument('--abstract') 11 | parser.add_argument('--title') 12 | 13 | args = vars(parser.parse_args()) 14 | 15 | query = dict() 16 | for k in ['first_author', 'author', 'year', 'abstract', 'title']: 17 | if args.get(k) is not None: 18 | query[k] = args.get(k) 19 | if len(query) == 0: 20 | raise ValueError('No search terms specified.') 21 | 22 | if args['refereed']: 23 | query['property'] = 'refereed' 24 | 25 | bibcodes = [article.bibcode for article in ads.SearchQuery(**query)] 26 | if len(bibcodes) == 0: 27 | print('No articles found.') 28 | else: 29 | bibtex = ads.ExportQuery(bibcodes=bibcodes, format='bibtex').execute() 30 | print(bibtex) 31 | -------------------------------------------------------------------------------- /scripts/center-target: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import argparse 4 | import numpy as np 5 | import pyds9 6 | from astropy.io import fits 7 | from astropy.wcs import WCS 8 | from mskpy.image.analysis import gcentroid, UnableToCenter 9 | 10 | parser = argparse.ArgumentParser(description='Manually find target centers in FITS images.', epilog='For images with matching OBJECT keywords that have not been previously centered. Once the first image in a sequence has been centered, use the WCS to guess the location of the object in subsequent frames.') 11 | parser.add_argument('file', nargs='+', help='FITS images to center.') 12 | parser.add_argument('--center-keys', default='CX,CY', help='FITS header keywords to use for x and y centers. Default: CX,CY.') 13 | parser.add_argument('--no-use-wcs', action='store_true', dest='use_wcs', help='Do not use the WCS to guess the location of the source.') 14 | 15 | args = parser.parse_args() 16 | kx, ky = args.center_keys.split(',') 17 | 18 | objects = dict() 19 | 20 | ds9 = pyds9.DS9('center-target') 21 | ds9.set('frame 1') 22 | ds9.set('scale log') 23 | ds9.set('scale mode 99.5') 24 | ds9.set('cmap viridis') 25 | 26 | box = 7 27 | for fn in args.file: 28 | with fits.open(fn, mode='update') as hdu: 29 | ds9.set('frame 1') 30 | ds9.set_pyfits(hdu) 31 | ds9.set('mode crosshair') 32 | 33 | print("\n\n{}\n".format(fn)) 34 | 35 | try: 36 | wcs = WCS(hdu[0].header) 37 | except ValueError as e: 38 | wcs = None 39 | 40 | obj = hdu[0].header['OBJECT'] 41 | 42 | if kx in hdu[0].header and ky in hdu[0].header: 43 | cyx = hdu[0].header[ky], hdu[0].header[kx] 44 | ds9.set('crosshair {} {} image'.format(cyx[1] + 1, cyx[0] + 1)) 45 | ds9.set('pan to {} {} image'.format(cyx[1] + 1, cyx[0] + 1)) 46 | print("Object already centered, crosshair updated to: y, x = {}.".format(cyx)) 47 | else: 48 | if obj in objects and args.use_wcs and wcs is not None: 49 | cyx = wcs.wcs_world2pix(objects[obj], 0)[0][::-1] 50 | ds9.set('crosshair {} {} image'.format(cyx[1] + 1, cyx[0] + 1)) 51 | ds9.set('pan to {} {} image'.format(cyx[1] + 1, cyx[0] + 1)) 52 | print("Object not centered, but I have guessed its location: y, x = {}.".format(cyx)) 53 | 54 | print("Mark object center with crosshair.") 55 | 56 | print(""" 57 | [enter] center 58 | [d] delete previous center keywords and skip to next file 59 | [s] skip 60 | [q] quit 61 | """.format(fn)) 62 | sys.stdin.flush() 63 | inp = sys.stdin.readline().strip().lower() 64 | if inp == 'd': 65 | if kx in hdu[0].header: 66 | del hdu[0].header[kx] 67 | if ky in hdu[0].header: 68 | del hdu[0].header[ky] 69 | continue 70 | elif inp == 's': 71 | continue 72 | elif inp == 'q': 73 | break 74 | 75 | recenter = True 76 | while recenter: 77 | guess = np.array(ds9.get('crosshair image').split(), float) 78 | guess = guess[::-1] - 1 # DS9 xy to Python yx 79 | print('Box = {}'.format(box)) 80 | try: 81 | cyx = gcentroid(hdu[0].data, guess, box=box) 82 | except UnableToCenter: 83 | print('Unable to center.') 84 | cyx = 0, 0 85 | 86 | ds9.set('frame 1') 87 | ds9.set('crosshair {} {} image'.format(cyx[1] + 1, cyx[0] + 1)) 88 | ds9.set('pan to {} {} image'.format(cyx[1] + 1, cyx[0] + 1)) 89 | 90 | print(""" guess y, x = {} 91 | center y, x = {} 92 | 93 | [a] accept center and skip to next file 94 | [r] re-center with current crosshair position 95 | [-] re-center with smaller box size 96 | [+] re-center with larger box size 97 | [s] skip this file 98 | [q] quit without accepting center 99 | """.format(guess, cyx)) 100 | 101 | sys.stdin.flush() 102 | inp = '' 103 | while inp not in ['a', 'r', '-', '+', 's', 'q']: 104 | inp = sys.stdin.readline().strip() 105 | 106 | inp = inp[0].lower() 107 | if inp == 'a': 108 | hdu[0].header[ky] = cyx[0], 'Estimated y position of target, 0-based index' 109 | hdu[0].header[kx] = cyx[1], 'Estimated x position of target, 0-based index' 110 | recenter = False 111 | elif inp == 'r': 112 | pass 113 | elif inp == '-': 114 | box = max(3, box - 2) 115 | elif inp == '+': 116 | box = min(hdu[0].data.shape[0], hdu[0].data.shape[1], box + 2) 117 | elif inp == 's': 118 | recenter = False 119 | elif inp == 'q': 120 | recenter = False 121 | 122 | if inp == 'q': 123 | break 124 | 125 | if wcs is not None: 126 | objects[obj] = wcs.wcs_pix2world([cyx[::-1]], 0) 127 | 128 | del ds9 129 | -------------------------------------------------------------------------------- /scripts/comet-fest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | import argparse 4 | import numpy as np 5 | import astropy.units as u 6 | from astropy.time import Time 7 | from astropy.table import Table 8 | import mskpy 9 | from mskpy import ephem, between, Coma, Asteroid 10 | 11 | today = Time.now() 12 | 13 | 14 | class ListAction(argparse.Action): 15 | def __call__(self, parser, namespace, values, option_string=None): 16 | v = [float(x) for x in values.split(',')] 17 | setattr(namespace, self.dest, v) 18 | 19 | 20 | parser = argparse.ArgumentParser(description='Generate an ephemeris.') 21 | parser.add_argument('target', type=str, nargs='+', 22 | help='name of the target') 23 | parser.add_argument('--date', type=Time, default=today, 24 | help='observation date, UT') 25 | parser.add_argument('--wave', type=str, action=ListAction, default=[0.3, 30], 26 | help='wavelength range in μm, default: 0.3, 30 μm') 27 | parser.add_argument('-n', type=int, default=10, 28 | help='number of wavelength steps, default: 100 log-spaced') 29 | parser.add_argument('--linear', action='store_true', 30 | help='use linear scaling for wavelength steps') 31 | 32 | parser.add_argument('--observer', type=str, default='Earth', 33 | help='observer, default: Earth') 34 | 35 | parser.add_argument('--kernel', type=str, action='append', default=[], 36 | help='load this kernel') 37 | 38 | parser.add_argument('--afrho', type=float, 39 | help='Afrho parameter at phase angle = 0 [cm], default 100') 40 | parser.add_argument('-k', type=float, default=-2.0, 41 | help='Afrho heliocentric distance power-law slope, default: -2') 42 | parser.add_argument('--dt', type=float, default=0.0, 43 | help='time offset for activity scaling, <0 for post-perihelion peak [days]') 44 | parser.add_argument('--rh', type=float, default=1.0, 45 | help='Afrho parameter specified at this rh [AU], default: 1') 46 | parser.add_argument('--ef2af', type=float, default=3.5, 47 | help='ratio of IR emissivity to albedo, default: 3.5') 48 | parser.add_argument('--tscale', type=float, default=1.1, 49 | help='effective temperature scale factor, default: 1.1') 50 | parser.add_argument('--phasef', type=str, default='phaseHM', 51 | help='phase function (phaseK, phaseH, phaseHM), default: phaseHM') 52 | 53 | parser.add_argument('-D', type=float, 54 | help='asteroid diameter [km], default 1') 55 | parser.add_argument('--eta', type=float, default=1.0, 56 | help='IR-beaming parameter, default: 1') 57 | parser.add_argument('--Ap', type=float, default=0.04, 58 | help='asteroid/nucleus geometric albedo, default: 0.04') 59 | 60 | parser.add_argument('--rap', type=float, default=1.0, 61 | help='aperture radius [arcsec], default: 1') 62 | parser.add_argument('--unit', type=u.Unit, default='Jy', 63 | help='flux density unit, default: Jy') 64 | parser.add_argument('--format', default='.4g', 65 | help='format for flux density columns') 66 | 67 | args = parser.parse_args() 68 | if args.target == []: 69 | parser.print_help() 70 | print() 71 | sys.exit() 72 | 73 | if len(args.kernel) > 0: 74 | for k in args.kernel: 75 | ephem.core.load_kernel(k) 76 | 77 | if (len(args.target) == 1 78 | and args.target[0].isdigit() 79 | and len(args.target[0]) < 6): 80 | # asteroid designation 81 | target = ephem.getspiceobj(int(args.target[0]) + 2000000) 82 | else: 83 | target = ephem.getspiceobj(' '.join(args.target)) 84 | 85 | try: 86 | if args.observer == 'L2': 87 | observer = ephem.Earth_L2 88 | else: 89 | observer = eval('ephem.' + args.observer.capitalize()) 90 | except AttributeError: 91 | observer = ephem.getspiceobj(' '.join(args.observer)) 92 | 93 | if args.linear: 94 | wave = np.linspace(args.wave[0], args.wave[1], args.n) * u.um 95 | else: 96 | wave = np.logspace(np.log10(args.wave[0]), np.log10(args.wave[1]), 97 | args.n) * u.um 98 | 99 | if args.afrho is None and args.D is None: 100 | print('Nothing to do.') 101 | sys.exit() 102 | 103 | names = ['wave'] 104 | data = [wave] 105 | total = 0 106 | if args.afrho is not None: 107 | afrho1 = args.afrho / args.rh**args.k * u.cm 108 | coma = Coma(target.state, afrho1, k=args.k, dt=args.dt * u.day, 109 | ef2af=args.ef2af, Tscale=args.tscale, 110 | phasef=getattr(mskpy.models, args.phasef)) 111 | 112 | _args = (observer, args.date, wave) 113 | opts = dict(rap=args.rap * u.arcsec, unit=args.unit) 114 | refl = coma.fluxd(*_args, reflected=True, thermal=False, **opts) 115 | thrm = coma.fluxd(*_args, reflected=False, thermal=True, **opts) 116 | 117 | names.append('coma refl') 118 | data.append(refl) 119 | 120 | names.append('coma thrm') 121 | data.append(thrm) 122 | 123 | names.append('coma total') 124 | data.append(refl + thrm) 125 | 126 | total = total + refl + thrm 127 | 128 | if args.D is not None: 129 | asteroid = Asteroid(target.state, args.D * u.km, args.Ap, eta=args.eta) 130 | 131 | _args = (observer, args.date, wave) 132 | opts = dict(unit=args.unit) 133 | refl = asteroid.fluxd(*_args, reflected=True, thermal=False, **opts) 134 | thrm = asteroid.fluxd(*_args, reflected=False, thermal=True, **opts) 135 | 136 | names.append('surface refl') 137 | data.append(refl) 138 | 139 | names.append('surface thrm') 140 | data.append(thrm) 141 | 142 | names.append('surface total') 143 | data.append(refl + thrm) 144 | 145 | total = total + refl + thrm 146 | 147 | data.insert(1, total) 148 | names.insert(1, 'total') 149 | tab = Table(data=data, names=names) 150 | for k in tab.colnames[1:]: 151 | tab[k].format = '{:' + args.format + '}' 152 | 153 | tab.pprint(max_lines=-1, max_width=-1) 154 | -------------------------------------------------------------------------------- /scripts/ds9-ext: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import random 5 | import argparse 6 | from astropy.io import fits 7 | import pyds9 8 | 9 | parser = argparse.ArgumentParser() 10 | parser.add_argument('files', nargs='*') 11 | parser.add_argument('--scale', default='zscale', help='image scale') 12 | parser.add_argument('--cmap', '-c', default='viridis') 13 | parser.add_argument('--ext', default=0, help='load this extension') 14 | 15 | args = parser.parse_args() 16 | 17 | sfx = ''.join(random.sample('qwertyuiopasdfghjklzxcvbnm0987654321', 4)) 18 | ds9 = pyds9.DS9('ds9-ext-{}'.format(sfx)) 19 | ds9.set('scale mode {}'.format(args.scale)) 20 | ds9.set('cmap {}'.format(args.cmap)) 21 | 22 | for i, f in enumerate(args.files): 23 | with fits.open(f) as hdu: 24 | new_hdu = fits.HDUList() 25 | if args.ext not in hdu: 26 | print('{} missing extension {}'.format(f, args.ext)) 27 | continue 28 | 29 | new_hdu.append(fits.PrimaryHDU()) 30 | new_hdu.append(fits.ImageHDU( 31 | hdu[args.ext].data, hdu[args.ext].header, 32 | name=os.path.basename(f))) 33 | 34 | ds9.set('frame {}'.format(i + 1)) 35 | ds9.set_pyfits(new_hdu) 36 | -------------------------------------------------------------------------------- /scripts/horizons2dct-tcs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """Generate ephemeris files for DCT. 3 | 4 | Requires the `callhorizons` module and Python 3.2 or later. 5 | 6 | 2015-10-24: Initial version. Requires Python 2.6 or later. 7 | 8 | 2016-01-12: Requires Python 2.7 or later. 9 | 10 | 2017-09-28: Requires Python 3.2 or later. Gets HORIZONS ephemeris itself. 11 | 12 | - Michael S. P. Kelley, UMD 13 | 14 | """ 15 | 16 | import sys 17 | import os.path 18 | import argparse 19 | import datetime 20 | import callhorizons 21 | 22 | month = dict() 23 | for i, m in enumerate('Jan Feb Mar Apr May Jun' 24 | ' Jul Aug Sep Oct Nov Dec'.split()): 25 | month[m] = '{0:02d}'.format(i + 1) 26 | 27 | parser = argparse.ArgumentParser(description='Generate ephemeris files for DCT. Dates assume the format "YYYY-MM-DD HH:MM", where HH:MM is optional.') 28 | parser.add_argument('target', nargs='+', help='Target name.') 29 | parser.add_argument('--start', help='Default now.') 30 | parser.add_argument('--end', help='Default start + 24 hr.') 31 | parser.add_argument('--step', default='3m', help='Time step size, default 3m.') 32 | parser.add_argument('-o', help='Output file name.') 33 | args = parser.parse_args() 34 | 35 | def dh2hms(dh, format="{:02d} {:02d} {:05.2f}"): 36 | """Decimal hours as HH:MM:SS.SSS, or similar. 37 | 38 | Will work for degrees, too. 39 | 40 | Parameters 41 | ---------- 42 | dh : float 43 | format : string, optional 44 | Use this format, e.g., for [+/-]HH:MM, use "{:+02d}:{:02d}". 45 | 46 | Returns 47 | ------- 48 | hms : string 49 | 50 | """ 51 | 52 | sign = -1 if dh < 0 else 1 53 | dh = abs(dh) 54 | hh = int(dh) 55 | mm = int((dh - hh) * 60.0) 56 | ss = ((dh - hh) * 60.0 - mm) * 60.0 57 | if ss >= 60: 58 | ss -= 60 59 | mm += 1 60 | if mm >= 60: 61 | mm -= 60 62 | hh += 1 63 | return format.format(sign * hh, mm, ss) 64 | 65 | def dd2dms(dd): 66 | return dh2hms(dd, format='{:+02d} {:02d} {:04.1f}') 67 | 68 | target = ' '.join(args.target) 69 | if args.o is None: 70 | fn = target.replace('/', '').replace(' ', '').lower() + '.txt' 71 | else: 72 | fn = args.o 73 | 74 | if os.path.exists(fn): 75 | raise FileExistsError(fn) 76 | 77 | start = args.start 78 | if start is None: 79 | d = datetime.datetime.now(datetime.timezone.utc) 80 | start = d.isoformat()[:16].replace('T', ' ') 81 | 82 | end = args.end 83 | if end is None: 84 | d = datetime.datetime(*[int(x) for x in start.replace('-', ' ').replace(':', ' ').split()]) 85 | end = (d + datetime.timedelta(1)).isoformat()[:16].replace('T', ' ') 86 | 87 | q = callhorizons.query(target) 88 | q.set_epochrange(start, end, '3m') 89 | q.get_ephemerides('G37') 90 | if len(q) <= 0: 91 | raise ValueError('No output from HORIZONS.') 92 | 93 | with open(fn, 'w') as outf: 94 | for i in range(len(q)): 95 | d = q[i]['datetime'] 96 | ymd, hm = d.split() 97 | y, m, d = ymd.split('-') 98 | hm = hm.split(':') 99 | ra = dh2hms(q[i]['RA'] / 15) 100 | dec = dd2dms(q[i]['DEC']) 101 | outf.write('{0} {1} {2} {3} {4} 00 {5} {6}\n'.format( 102 | y, month[m], d, hm[0], hm[1], ra, dec)) 103 | -------------------------------------------------------------------------------- /scripts/irs-plot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import argparse 3 | import matplotlib.pyplot as plt 4 | from mskpy.instruments import spitzer 5 | 6 | parser = argparse.ArgumentParser(description='Plot Spitzer/IRS data.') 7 | parser.add_argument('files', nargs='*', help='Spitzer IRS spectral tables.') 8 | 9 | args = parser.parse_args() 10 | 11 | irs = spitzer.IRSCombine(args.files) 12 | fig = plt.figure(1) 13 | fig.clear() 14 | plt.minorticks_on() 15 | irs.plot('raw') 16 | plt.show() 17 | 18 | -------------------------------------------------------------------------------- /scripts/transit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import argparse 4 | import datetime 5 | import itertools 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from matplotlib import ticker 9 | import astropy.units as u 10 | import mskpy 11 | from mskpy import getspiceobj, date2time, cal2time 12 | from mskpy import ephem, Sun, Earth 13 | from mskpy.observing import plot_transit_time 14 | 15 | today = datetime.date.today() 16 | 17 | class ListAction(argparse.Action): 18 | def __call__(self, parser, namespace, values, option_string=None): 19 | v = [x.strip() for x in ' '.join(values).split(',')] 20 | setattr(namespace, self.dest, v) 21 | 22 | parser = argparse.ArgumentParser(description='Generate a plot of transit times.') 23 | parser.add_argument('target', type=str, action=ListAction, nargs='*', 24 | help='Comma-separated list of targets.') 25 | 26 | parser.add_argument('--start', type=str, action='store', 27 | default=today.isoformat(), 28 | help='The first day, YYYY-MM-DD [today].') 29 | parser.add_argument('--end', type=str, action='store', default=None, 30 | help='The last day, YYYY-MM-DD [start + n].') 31 | parser.add_argument('-n', type=int, action='store', default=365, 32 | help='The number of days to plot, if end is not specified.') 33 | 34 | parser.add_argument('--observer', type=str, action='store', default='Earth', 35 | help='The observer.') 36 | 37 | parser.add_argument('-o', type=str, action='store', default='transit.pdf', 38 | help='Plot file name') 39 | 40 | args = parser.parse_args() 41 | if args.target == ['']: 42 | parser.print_help() 43 | print() 44 | sys.exit() 45 | 46 | if args.end is None: 47 | start = cal2time(args.start) 48 | end = datetime.date.fromordinal(start.datetime.toordinal() 49 | + args.n).isoformat() 50 | n = args.n + 1 51 | else: 52 | end = args.end 53 | n = int(util.cal2time(end).jd - util.cal2time(args.start).jd + 1) 54 | 55 | targets = [ephem.getspiceobj(t) for t in args.target] 56 | 57 | try: 58 | observer = eval('ephem.' + args.observer.capitalize()) 59 | except AttributeError: 60 | observer = ephem.getspiceobj(' '.join(args.observer)) 61 | 62 | date_range = date2time([start, end]) 63 | jd = np.arange(date_range[0].jd, date_range[1].jd) 64 | if jd[-1] != date_range[1].jd: 65 | jd = np.concatenate((jd, [date_range[1].jd])) 66 | dates = date2time(jd) 67 | g_sun = Earth.observe(Sun, jd) 68 | 69 | fig = plt.figure(1, (10, 10)) 70 | fig.clear() 71 | ax = plt.gca() 72 | 73 | style = itertools.cycle(itertools.product(['-', '--', '-.', ':'], 'bgrcym')) 74 | for target in targets: 75 | ls, color = next(style) 76 | plot_transit_time(target, g_sun, observer=observer, ax=ax, 77 | color=color, ls=ls) 78 | 79 | plt.setp(ax, xlim=[-7, 7], xlabel='Transit time (hr)') 80 | 81 | f = lambda x, pos: mskpy.dh2hms(x % 24.0, '{:02d}:{:02d}') 82 | plt.setp(ax.xaxis, minor_locator=ticker.AutoMinorLocator(), 83 | major_formatter=ticker.FuncFormatter(f)) 84 | 85 | ax.invert_yaxis() 86 | mskpy.nicelegend(frameon=False, loc='upper left', bbox_to_anchor=(1.0, 0.95)) 87 | mskpy.niceplot() 88 | fig.subplots_adjust(right=0.8) 89 | plt.draw() 90 | plt.savefig(args.o) 91 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = mskpy 3 | author = Michael S. P. Kelley 4 | author_email = msk@astro.umd.edu 5 | license = BSD 3-Clause 6 | license_file = licenses/LICENSE.rst 7 | url = https://github.com/mkelley/mskpy 8 | description = "MSK's personal Python library, mostly for astronomy work." 9 | long_description = file: README.rst 10 | long_description_content_type = text/x-rst 11 | edit_on_github = False 12 | github_project = mkelley/mskpy 13 | 14 | [options] 15 | zip_safe = False 16 | include_package_data = True 17 | packages = find: 18 | python_requires = >=3.8 19 | setup_requires = setuptools_scm 20 | install_requires = 21 | astropy 22 | numpy 23 | sbpy 24 | spiceypy>=1.1 25 | scipy 26 | synphot>=1.0 27 | photutils 28 | pytz 29 | scripts = 30 | scripts/ephemeris 31 | scripts/transit 32 | scripts/comet-fest 33 | scripts/center-target 34 | scripts/H2D 35 | scripts/ds9-ext 36 | scripts/ads 37 | 38 | [options.entry_points] 39 | console_scripts = 40 | astropy-package-template-example = packagename.example_mod:main 41 | 42 | [options.extras_require] 43 | test = 44 | pytest-astropy 45 | docs = 46 | sphinx-astropy 47 | 48 | [options.package_data] 49 | mskpy = data/*,data/filters/*/*,models/psg/test/psg_cfg.txt 50 | 51 | 52 | [tool:pytest] 53 | testpaths = "mskpy" "docs" 54 | astropy_header = true 55 | doctest_plus = enabled 56 | text_file_format = rst 57 | addopts = --doctest-rst 58 | 59 | [coverage:run] 60 | omit = 61 | mskpy/_astropy_init* 62 | mskpy/conftest.py 63 | mskpy/*setup_package* 64 | mskpy/tests/* 65 | mskpy/*/tests/* 66 | mskpy/extern/* 67 | mskpy/version* 68 | */mskpy/_astropy_init* 69 | */mskpy/conftest.py 70 | */mskpy/*setup_package* 71 | */mskpy/tests/* 72 | */mskpy/*/tests/* 73 | */mskpy/extern/* 74 | */mskpy/version* 75 | 76 | [coverage:report] 77 | exclude_lines = 78 | # Have to re-enable the standard pragma 79 | pragma: no cover 80 | # Don't complain about packages we have installed 81 | except ImportError 82 | # Don't complain if tests don't hit assertions 83 | raise AssertionError 84 | raise NotImplementedError 85 | # Don't complain about script hooks 86 | def main\(.*\): 87 | # Ignore branches that don't pertain to this version of Python 88 | pragma: py{ignore_python_version} 89 | # Don't complain about IPython completion helper 90 | def _ipython_key_completions_ 91 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 3 | 4 | # NOTE: The configuration for the package, including the name, version, and 5 | # other information are set in the setup.cfg file. 6 | 7 | import os 8 | import sys 9 | 10 | from setuptools import setup 11 | 12 | from extension_helpers import get_extensions 13 | 14 | # First provide helpful messages if contributors try and run legacy commands 15 | # for tests or docs. 16 | 17 | TEST_HELP = """ 18 | Note: running tests is no longer done using 'python setup.py test'. Instead 19 | you will need to run: 20 | 21 | tox -e test 22 | 23 | If you don't already have tox installed, you can install it with: 24 | 25 | pip install tox 26 | 27 | If you only want to run part of the test suite, you can also use pytest 28 | directly with:: 29 | 30 | pip install -e .[test] 31 | pytest 32 | 33 | For more information, see: 34 | 35 | http://docs.astropy.org/en/latest/development/testguide.html#running-tests 36 | """ 37 | 38 | if 'test' in sys.argv: 39 | print(TEST_HELP) 40 | sys.exit(1) 41 | 42 | DOCS_HELP = """ 43 | Note: building the documentation is no longer done using 44 | 'python setup.py build_docs'. Instead you will need to run: 45 | 46 | tox -e build_docs 47 | 48 | If you don't already have tox installed, you can install it with: 49 | 50 | pip install tox 51 | 52 | You can also build the documentation with Sphinx directly using:: 53 | 54 | pip install -e .[docs] 55 | cd docs 56 | make html 57 | 58 | For more information, see: 59 | 60 | http://docs.astropy.org/en/latest/install.html#builddocs 61 | """ 62 | 63 | if 'build_docs' in sys.argv or 'build_sphinx' in sys.argv: 64 | print(DOCS_HELP) 65 | sys.exit(1) 66 | 67 | VERSION_TEMPLATE = """ 68 | # Note that we need to fall back to the hard-coded version if either 69 | # setuptools_scm can't be imported or setuptools_scm can't determine the 70 | # version, so we catch the generic 'Exception'. 71 | try: 72 | from setuptools_scm import get_version 73 | version = get_version(root='..', relative_to=__file__) 74 | except Exception: 75 | version = '{version}' 76 | """.lstrip() 77 | 78 | setup(use_scm_version={'write_to': os.path.join('mskpy', 'version.py'), 79 | 'write_to_template': VERSION_TEMPLATE}, 80 | ext_modules=get_extensions()) 81 | -------------------------------------------------------------------------------- /src/davint/davint.pyf: -------------------------------------------------------------------------------- 1 | ! -*- f90 -*- 2 | ! Note: the context of this file is case sensitive. 3 | 4 | python module davint ! in 5 | interface ! in :davint 6 | subroutine davint(x,y,n,xlo,xup,ans,ierr) ! in :davint:davint.f 7 | double precision dimension(*) :: x 8 | double precision dimension(*) :: y 9 | integer :: n 10 | double precision :: xlo 11 | double precision :: xup 12 | double precision intent(out) :: ans 13 | integer intent(out) :: ierr 14 | end subroutine davint 15 | end interface 16 | end python module davint 17 | 18 | ! This file was auto-generated with f2py (version:2). 19 | ! See http://cens.ioc.ee/projects/f2py2e/ 20 | -------------------------------------------------------------------------------- /src/davint/fdump.f: -------------------------------------------------------------------------------- 1 | *DECK FDUMP 2 | SUBROUTINE FDUMP 3 | C***BEGIN PROLOGUE FDUMP 4 | C***PURPOSE Symbolic dump (should be locally written). 5 | C***LIBRARY SLATEC (XERROR) 6 | C***CATEGORY R3 7 | C***TYPE ALL (FDUMP-A) 8 | C***KEYWORDS ERROR, XERMSG 9 | C***AUTHOR Jones, R. E., (SNLA) 10 | C***DESCRIPTION 11 | C 12 | C ***Note*** Machine Dependent Routine 13 | C FDUMP is intended to be replaced by a locally written 14 | C version which produces a symbolic dump. Failing this, 15 | C it should be replaced by a version which prints the 16 | C subprogram nesting list. Note that this dump must be 17 | C printed on each of up to five files, as indicated by the 18 | C XGETUA routine. See XSETUA and XGETUA for details. 19 | C 20 | C Written by Ron Jones, with SLATEC Common Math Library Subcommittee 21 | C 22 | C***REFERENCES (NONE) 23 | C***ROUTINES CALLED (NONE) 24 | C***REVISION HISTORY (YYMMDD) 25 | C 790801 DATE WRITTEN 26 | C 861211 REVISION DATE from Version 3.2 27 | C 891214 Prologue converted to Version 4.0 format. (BAB) 28 | C***END PROLOGUE FDUMP 29 | C***FIRST EXECUTABLE STATEMENT FDUMP 30 | RETURN 31 | END 32 | -------------------------------------------------------------------------------- /src/davint/j4save.f: -------------------------------------------------------------------------------- 1 | *DECK J4SAVE 2 | FUNCTION J4SAVE (IWHICH, IVALUE, ISET) 3 | C***BEGIN PROLOGUE J4SAVE 4 | C***SUBSIDIARY 5 | C***PURPOSE Save or recall global variables needed by error 6 | C handling routines. 7 | C***LIBRARY SLATEC (XERROR) 8 | C***TYPE INTEGER (J4SAVE-I) 9 | C***KEYWORDS ERROR MESSAGES, ERROR NUMBER, RECALL, SAVE, XERROR 10 | C***AUTHOR Jones, R. E., (SNLA) 11 | C***DESCRIPTION 12 | C 13 | C Abstract 14 | C J4SAVE saves and recalls several global variables needed 15 | C by the library error handling routines. 16 | C 17 | C Description of Parameters 18 | C --Input-- 19 | C IWHICH - Index of item desired. 20 | C = 1 Refers to current error number. 21 | C = 2 Refers to current error control flag. 22 | C = 3 Refers to current unit number to which error 23 | C messages are to be sent. (0 means use standard.) 24 | C = 4 Refers to the maximum number of times any 25 | C message is to be printed (as set by XERMAX). 26 | C = 5 Refers to the total number of units to which 27 | C each error message is to be written. 28 | C = 6 Refers to the 2nd unit for error messages 29 | C = 7 Refers to the 3rd unit for error messages 30 | C = 8 Refers to the 4th unit for error messages 31 | C = 9 Refers to the 5th unit for error messages 32 | C IVALUE - The value to be set for the IWHICH-th parameter, 33 | C if ISET is .TRUE. . 34 | C ISET - If ISET=.TRUE., the IWHICH-th parameter will BE 35 | C given the value, IVALUE. If ISET=.FALSE., the 36 | C IWHICH-th parameter will be unchanged, and IVALUE 37 | C is a dummy parameter. 38 | C --Output-- 39 | C The (old) value of the IWHICH-th parameter will be returned 40 | C in the function value, J4SAVE. 41 | C 42 | C***SEE ALSO XERMSG 43 | C***REFERENCES R. E. Jones and D. K. Kahaner, XERROR, the SLATEC 44 | C Error-handling Package, SAND82-0800, Sandia 45 | C Laboratories, 1982. 46 | C***ROUTINES CALLED (NONE) 47 | C***REVISION HISTORY (YYMMDD) 48 | C 790801 DATE WRITTEN 49 | C 891214 Prologue converted to Version 4.0 format. (BAB) 50 | C 900205 Minor modifications to prologue. (WRB) 51 | C 900402 Added TYPE section. (WRB) 52 | C 910411 Added KEYWORDS section. (WRB) 53 | C 920501 Reformatted the REFERENCES section. (WRB) 54 | C***END PROLOGUE J4SAVE 55 | LOGICAL ISET 56 | INTEGER IPARAM(9) 57 | SAVE IPARAM 58 | DATA IPARAM(1),IPARAM(2),IPARAM(3),IPARAM(4)/0,2,0,10/ 59 | DATA IPARAM(5)/1/ 60 | DATA IPARAM(6),IPARAM(7),IPARAM(8),IPARAM(9)/0,0,0,0/ 61 | C***FIRST EXECUTABLE STATEMENT J4SAVE 62 | J4SAVE = IPARAM(IWHICH) 63 | IF (ISET) IPARAM(IWHICH) = IVALUE 64 | RETURN 65 | END 66 | -------------------------------------------------------------------------------- /src/davint/setup_package.py: -------------------------------------------------------------------------------- 1 | from glob import glob 2 | from numpy.distutils.core import Extension 3 | 4 | 5 | def get_extensions(): 6 | return [ 7 | Extension( 8 | name='mskpy.lib.davint', 9 | sources=glob('*.f') 10 | ) 11 | ] 12 | -------------------------------------------------------------------------------- /src/davint/xercnt.f: -------------------------------------------------------------------------------- 1 | *DECK XERCNT 2 | SUBROUTINE XERCNT (LIBRAR, SUBROU, MESSG, NERR, LEVEL, KONTRL) 3 | C***BEGIN PROLOGUE XERCNT 4 | C***SUBSIDIARY 5 | C***PURPOSE Allow user control over handling of errors. 6 | C***LIBRARY SLATEC (XERROR) 7 | C***CATEGORY R3C 8 | C***TYPE ALL (XERCNT-A) 9 | C***KEYWORDS ERROR, XERROR 10 | C***AUTHOR Jones, R. E., (SNLA) 11 | C***DESCRIPTION 12 | C 13 | C Abstract 14 | C Allows user control over handling of individual errors. 15 | C Just after each message is recorded, but before it is 16 | C processed any further (i.e., before it is printed or 17 | C a decision to abort is made), a call is made to XERCNT. 18 | C If the user has provided his own version of XERCNT, he 19 | C can then override the value of KONTROL used in processing 20 | C this message by redefining its value. 21 | C KONTRL may be set to any value from -2 to 2. 22 | C The meanings for KONTRL are the same as in XSETF, except 23 | C that the value of KONTRL changes only for this message. 24 | C If KONTRL is set to a value outside the range from -2 to 2, 25 | C it will be moved back into that range. 26 | C 27 | C Description of Parameters 28 | C 29 | C --Input-- 30 | C LIBRAR - the library that the routine is in. 31 | C SUBROU - the subroutine that XERMSG is being called from 32 | C MESSG - the first 20 characters of the error message. 33 | C NERR - same as in the call to XERMSG. 34 | C LEVEL - same as in the call to XERMSG. 35 | C KONTRL - the current value of the control flag as set 36 | C by a call to XSETF. 37 | C 38 | C --Output-- 39 | C KONTRL - the new value of KONTRL. If KONTRL is not 40 | C defined, it will remain at its original value. 41 | C This changed value of control affects only 42 | C the current occurrence of the current message. 43 | C 44 | C***REFERENCES R. E. Jones and D. K. Kahaner, XERROR, the SLATEC 45 | C Error-handling Package, SAND82-0800, Sandia 46 | C Laboratories, 1982. 47 | C***ROUTINES CALLED (NONE) 48 | C***REVISION HISTORY (YYMMDD) 49 | C 790801 DATE WRITTEN 50 | C 861211 REVISION DATE from Version 3.2 51 | C 891214 Prologue converted to Version 4.0 format. (BAB) 52 | C 900206 Routine changed from user-callable to subsidiary. (WRB) 53 | C 900510 Changed calling sequence to include LIBRARY and SUBROUTINE 54 | C names, changed routine name from XERCTL to XERCNT. (RWC) 55 | C 920501 Reformatted the REFERENCES section. (WRB) 56 | C***END PROLOGUE XERCNT 57 | CHARACTER*(*) LIBRAR, SUBROU, MESSG 58 | C***FIRST EXECUTABLE STATEMENT XERCNT 59 | RETURN 60 | END 61 | -------------------------------------------------------------------------------- /src/davint/xerhlt.f: -------------------------------------------------------------------------------- 1 | *DECK XERHLT 2 | SUBROUTINE XERHLT (MESSG) 3 | C***BEGIN PROLOGUE XERHLT 4 | C***SUBSIDIARY 5 | C***PURPOSE Abort program execution and print error message. 6 | C***LIBRARY SLATEC (XERROR) 7 | C***CATEGORY R3C 8 | C***TYPE ALL (XERHLT-A) 9 | C***KEYWORDS ABORT PROGRAM EXECUTION, ERROR, XERROR 10 | C***AUTHOR Jones, R. E., (SNLA) 11 | C***DESCRIPTION 12 | C 13 | C Abstract 14 | C ***Note*** machine dependent routine 15 | C XERHLT aborts the execution of the program. 16 | C The error message causing the abort is given in the calling 17 | C sequence, in case one needs it for printing on a dayfile, 18 | C for example. 19 | C 20 | C Description of Parameters 21 | C MESSG is as in XERMSG. 22 | C 23 | C***REFERENCES R. E. Jones and D. K. Kahaner, XERROR, the SLATEC 24 | C Error-handling Package, SAND82-0800, Sandia 25 | C Laboratories, 1982. 26 | C***ROUTINES CALLED (NONE) 27 | C***REVISION HISTORY (YYMMDD) 28 | C 790801 DATE WRITTEN 29 | C 861211 REVISION DATE from Version 3.2 30 | C 891214 Prologue converted to Version 4.0 format. (BAB) 31 | C 900206 Routine changed from user-callable to subsidiary. (WRB) 32 | C 900510 Changed calling sequence to delete length of character 33 | C and changed routine name from XERABT to XERHLT. (RWC) 34 | C 920501 Reformatted the REFERENCES section. (WRB) 35 | C***END PROLOGUE XERHLT 36 | CHARACTER*(*) MESSG 37 | C***FIRST EXECUTABLE STATEMENT XERHLT 38 | STOP 39 | END 40 | -------------------------------------------------------------------------------- /src/davint/xersve.f: -------------------------------------------------------------------------------- 1 | *DECK XERSVE 2 | SUBROUTINE XERSVE (LIBRAR, SUBROU, MESSG, KFLAG, NERR, LEVEL, 3 | + ICOUNT) 4 | C***BEGIN PROLOGUE XERSVE 5 | C***SUBSIDIARY 6 | C***PURPOSE Record that an error has occurred. 7 | C***LIBRARY SLATEC (XERROR) 8 | C***CATEGORY R3 9 | C***TYPE ALL (XERSVE-A) 10 | C***KEYWORDS ERROR, XERROR 11 | C***AUTHOR Jones, R. E., (SNLA) 12 | C***DESCRIPTION 13 | C 14 | C *Usage: 15 | C 16 | C INTEGER KFLAG, NERR, LEVEL, ICOUNT 17 | C CHARACTER * (len) LIBRAR, SUBROU, MESSG 18 | C 19 | C CALL XERSVE (LIBRAR, SUBROU, MESSG, KFLAG, NERR, LEVEL, ICOUNT) 20 | C 21 | C *Arguments: 22 | C 23 | C LIBRAR :IN is the library that the message is from. 24 | C SUBROU :IN is the subroutine that the message is from. 25 | C MESSG :IN is the message to be saved. 26 | C KFLAG :IN indicates the action to be performed. 27 | C when KFLAG > 0, the message in MESSG is saved. 28 | C when KFLAG=0 the tables will be dumped and 29 | C cleared. 30 | C when KFLAG < 0, the tables will be dumped and 31 | C not cleared. 32 | C NERR :IN is the error number. 33 | C LEVEL :IN is the error severity. 34 | C ICOUNT :OUT the number of times this message has been seen, 35 | C or zero if the table has overflowed and does not 36 | C contain this message specifically. When KFLAG=0, 37 | C ICOUNT will not be altered. 38 | C 39 | C *Description: 40 | C 41 | C Record that this error occurred and possibly dump and clear the 42 | C tables. 43 | C 44 | C***REFERENCES R. E. Jones and D. K. Kahaner, XERROR, the SLATEC 45 | C Error-handling Package, SAND82-0800, Sandia 46 | C Laboratories, 1982. 47 | C***ROUTINES CALLED I1MACH, XGETUA 48 | C***REVISION HISTORY (YYMMDD) 49 | C 800319 DATE WRITTEN 50 | C 861211 REVISION DATE from Version 3.2 51 | C 891214 Prologue converted to Version 4.0 format. (BAB) 52 | C 900413 Routine modified to remove reference to KFLAG. (WRB) 53 | C 900510 Changed to add LIBRARY NAME and SUBROUTINE to calling 54 | C sequence, use IF-THEN-ELSE, make number of saved entries 55 | C easily changeable, changed routine name from XERSAV to 56 | C XERSVE. (RWC) 57 | C 910626 Added LIBTAB and SUBTAB to SAVE statement. (BKS) 58 | C 920501 Reformatted the REFERENCES section. (WRB) 59 | C***END PROLOGUE XERSVE 60 | PARAMETER (LENTAB=10) 61 | INTEGER LUN(5) 62 | CHARACTER*(*) LIBRAR, SUBROU, MESSG 63 | CHARACTER*8 LIBTAB(LENTAB), SUBTAB(LENTAB), LIB, SUB 64 | CHARACTER*20 MESTAB(LENTAB), MES 65 | DIMENSION NERTAB(LENTAB), LEVTAB(LENTAB), KOUNT(LENTAB) 66 | SAVE LIBTAB, SUBTAB, MESTAB, NERTAB, LEVTAB, KOUNT, KOUNTX, NMSG 67 | DATA KOUNTX/0/, NMSG/0/ 68 | C***FIRST EXECUTABLE STATEMENT XERSVE 69 | C 70 | IF (KFLAG.LE.0) THEN 71 | C 72 | C Dump the table. 73 | C 74 | IF (NMSG.EQ.0) RETURN 75 | C 76 | C Print to each unit. 77 | C 78 | CALL XGETUA (LUN, NUNIT) 79 | DO 20 KUNIT = 1,NUNIT 80 | IUNIT = LUN(KUNIT) 81 | IF (IUNIT.EQ.0) IUNIT = I1MACH(4) 82 | C 83 | C Print the table header. 84 | C 85 | WRITE (IUNIT,9000) 86 | C 87 | C Print body of table. 88 | C 89 | DO 10 I = 1,NMSG 90 | WRITE (IUNIT,9010) LIBTAB(I), SUBTAB(I), MESTAB(I), 91 | * NERTAB(I),LEVTAB(I),KOUNT(I) 92 | 10 CONTINUE 93 | C 94 | C Print number of other errors. 95 | C 96 | IF (KOUNTX.NE.0) WRITE (IUNIT,9020) KOUNTX 97 | WRITE (IUNIT,9030) 98 | 20 CONTINUE 99 | C 100 | C Clear the error tables. 101 | C 102 | IF (KFLAG.EQ.0) THEN 103 | NMSG = 0 104 | KOUNTX = 0 105 | ENDIF 106 | ELSE 107 | C 108 | C PROCESS A MESSAGE... 109 | C SEARCH FOR THIS MESSG, OR ELSE AN EMPTY SLOT FOR THIS MESSG, 110 | C OR ELSE DETERMINE THAT THE ERROR TABLE IS FULL. 111 | C 112 | LIB = LIBRAR 113 | SUB = SUBROU 114 | MES = MESSG 115 | DO 30 I = 1,NMSG 116 | IF (LIB.EQ.LIBTAB(I) .AND. SUB.EQ.SUBTAB(I) .AND. 117 | * MES.EQ.MESTAB(I) .AND. NERR.EQ.NERTAB(I) .AND. 118 | * LEVEL.EQ.LEVTAB(I)) THEN 119 | KOUNT(I) = KOUNT(I) + 1 120 | ICOUNT = KOUNT(I) 121 | RETURN 122 | ENDIF 123 | 30 CONTINUE 124 | C 125 | IF (NMSG.LT.LENTAB) THEN 126 | C 127 | C Empty slot found for new message. 128 | C 129 | NMSG = NMSG + 1 130 | LIBTAB(I) = LIB 131 | SUBTAB(I) = SUB 132 | MESTAB(I) = MES 133 | NERTAB(I) = NERR 134 | LEVTAB(I) = LEVEL 135 | KOUNT (I) = 1 136 | ICOUNT = 1 137 | ELSE 138 | C 139 | C Table is full. 140 | C 141 | KOUNTX = KOUNTX+1 142 | ICOUNT = 0 143 | ENDIF 144 | ENDIF 145 | RETURN 146 | C 147 | C Formats. 148 | C 149 | 9000 FORMAT ('0 ERROR MESSAGE SUMMARY' / 150 | + ' LIBRARY SUBROUTINE MESSAGE START NERR', 151 | + ' LEVEL COUNT') 152 | 9010 FORMAT (1X,A,3X,A,3X,A,3I10) 153 | 9020 FORMAT ('0OTHER ERRORS NOT INDIVIDUALLY TABULATED = ', I10) 154 | 9030 FORMAT (1X) 155 | END 156 | -------------------------------------------------------------------------------- /src/davint/xgetua.f: -------------------------------------------------------------------------------- 1 | *DECK XGETUA 2 | SUBROUTINE XGETUA (IUNITA, N) 3 | C***BEGIN PROLOGUE XGETUA 4 | C***PURPOSE Return unit number(s) to which error messages are being 5 | C sent. 6 | C***LIBRARY SLATEC (XERROR) 7 | C***CATEGORY R3C 8 | C***TYPE ALL (XGETUA-A) 9 | C***KEYWORDS ERROR, XERROR 10 | C***AUTHOR Jones, R. E., (SNLA) 11 | C***DESCRIPTION 12 | C 13 | C Abstract 14 | C XGETUA may be called to determine the unit number or numbers 15 | C to which error messages are being sent. 16 | C These unit numbers may have been set by a call to XSETUN, 17 | C or a call to XSETUA, or may be a default value. 18 | C 19 | C Description of Parameters 20 | C --Output-- 21 | C IUNIT - an array of one to five unit numbers, depending 22 | C on the value of N. A value of zero refers to the 23 | C default unit, as defined by the I1MACH machine 24 | C constant routine. Only IUNIT(1),...,IUNIT(N) are 25 | C defined by XGETUA. The values of IUNIT(N+1),..., 26 | C IUNIT(5) are not defined (for N .LT. 5) or altered 27 | C in any way by XGETUA. 28 | C N - the number of units to which copies of the 29 | C error messages are being sent. N will be in the 30 | C range from 1 to 5. 31 | C 32 | C***REFERENCES R. E. Jones and D. K. Kahaner, XERROR, the SLATEC 33 | C Error-handling Package, SAND82-0800, Sandia 34 | C Laboratories, 1982. 35 | C***ROUTINES CALLED J4SAVE 36 | C***REVISION HISTORY (YYMMDD) 37 | C 790801 DATE WRITTEN 38 | C 861211 REVISION DATE from Version 3.2 39 | C 891214 Prologue converted to Version 4.0 format. (BAB) 40 | C 920501 Reformatted the REFERENCES section. (WRB) 41 | C***END PROLOGUE XGETUA 42 | DIMENSION IUNITA(5) 43 | C***FIRST EXECUTABLE STATEMENT XGETUA 44 | N = J4SAVE(5,0,.FALSE.) 45 | DO 30 I=1,N 46 | INDEX = I+4 47 | IF (I.EQ.1) INDEX = 3 48 | IUNITA(I) = J4SAVE(INDEX,0,.FALSE.) 49 | 30 CONTINUE 50 | RETURN 51 | END 52 | -------------------------------------------------------------------------------- /tests/test_comet.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | This package contains utilities to run the test suite. 4 | """ 5 | 6 | from __future__ import print_function 7 | import numpy as np 8 | from numpy import pi 9 | import astropy.units as u 10 | from mskpy import Coma, Comet, Earth, SpiceState 11 | from mskpy.models import dust 12 | 13 | class TestComet(): 14 | # No real testing. Just exercise the routines for now. 15 | def test_coma(self): 16 | mars = SpiceState('mars', kernel='planets.bsp') 17 | c = Coma(mars, 1 * u.cm, k=-2) 18 | 19 | c = Coma(mars, 1 * u.cm, phasef=dust.phaseH) 20 | c = Coma(mars, 1 * u.cm, phasef=dust.phaseH, A=0.25, Tscale=1.05) 21 | 22 | r = dust.AfrhoScattered(1 * u.cm) 23 | t = dust.AfrhoThermal(1 * u.cm) 24 | c = Coma(mars, 1 * u.cm, reflected=r) 25 | c = Coma(mars, 1 * u.cm, thermal=t) 26 | c = Coma(mars, 1 * u.cm, reflected=r, thermal=t) 27 | 28 | def test_comet(self): 29 | from mskpy import Asteroid 30 | 31 | mars = SpiceState('mars', kernel='planets.bsp') 32 | R = 0.6 * u.km 33 | Ap = 0.04 34 | Afrho1 = 300 * u.cm 35 | 36 | nucleus = Asteroid(mars, 2 * R, Ap, eta=1.0, epsilon=0.95) 37 | coma = Coma(mars, Afrho1, S=0.0, A=0.37, Tscale=1.18) 38 | comet = Comet(mars, Afrho1, R, Ap=Ap, nucleus=nucleus, coma=coma) 39 | 40 | nucleus = dict(eta=1.0, epsilon=0.95) 41 | coma = dict(S=0.0, A=0.37, Tscale=1.18) 42 | comet = Comet(mars, Afrho1, R, Ap=Ap, nucleus=nucleus, coma=coma) 43 | -------------------------------------------------------------------------------- /tests/test_ephem.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | This package contains utilities to run the test suite. 4 | """ 5 | 6 | from __future__ import print_function 7 | import numpy as np 8 | from numpy import pi 9 | from mskpy import ephem 10 | from mskpy.ephem import core 11 | 12 | class TestEphemCore(): 13 | # No real testing. Just exercise the routines for now. 14 | def test_load_kernel(self): 15 | krn = core.find_kernel('planets') 16 | core.load_kernel(krn) 17 | 18 | def test_cal2et(self): 19 | core.cal2et('2000-1-1') 20 | 21 | def test_date2et(self): 22 | from astropy.time import Time 23 | core.date2et('2000-1-1') 24 | core.date2et(24500000.4) 25 | core.date2et(Time('2000-1-1', scale='utc')) 26 | core.date2et(('2000-1-1', 24500000.4, Time('2000-1-1', scale='utc'))) 27 | 28 | def test_jd2et(self): 29 | core.jd2et(24500000.4) 30 | 31 | def test_time2et(self): 32 | from astropy.time import Time 33 | core.time2et(Time('2000-1-1', scale='utc')) 34 | 35 | class TestEphemSolarSysObject(): 36 | def test_r(self): 37 | assert np.allclose(ephem.Sun.r('2000-1-1'), [0., 0., 0.]) 38 | 39 | def test_v(self): 40 | assert np.allclose(ephem.Sun.v('2000-1-1'), [0., 0., 0.]) 41 | 42 | def test_observe(self): 43 | g = ephem.Earth.observe(ephem.Mars, '2000-1-1') 44 | print(g.bet) 45 | print(g.date) 46 | print(g.dec) 47 | print(g.delta) 48 | print(g.lam) 49 | print(g.lambet) 50 | print(g.lelong) 51 | print(g.obsrh) 52 | print(g.phase) 53 | print(g.ra) 54 | print(g.radec) 55 | print(g.rh) 56 | print(g.ro) 57 | print(g.rt) 58 | print(g.sangle) 59 | print(g.selong) 60 | print(g.signedphase) 61 | print(g.so) 62 | print(g.st) 63 | print(g.vangle) 64 | print(g.vo) 65 | print(g.vt) 66 | 67 | def test_ephemeris(self): 68 | eph = ephem.Mars.ephemeris(ephem.Earth, ['2000-1-1', '2010-1-1'], 69 | num=10) 70 | 71 | def test_orbit(self): 72 | print(ephem.Earth.orbit('2000-1-1')) 73 | 74 | class TestGeom(): 75 | def test_geom_summary(self): 76 | g = ephem.Earth.observe(ephem.Mars, '2000-1-1') 77 | g.summary() 78 | 79 | def test_geom_reduce(self): 80 | dates = ['2000-1-1', '2005-1-1', '2010-1-1'] 81 | g = ephem.Earth.observe(ephem.Mars, dates) 82 | g.summary() 83 | -------------------------------------------------------------------------------- /tests/test_image.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | This package contains utilities to run the test suite. 4 | """ 5 | 6 | import numpy as np 7 | from numpy import pi 8 | from mskpy import image 9 | 10 | class TestImageCore(): 11 | def test_imshift(self): 12 | a = np.arange(5.0).reshape((5, 1)) 13 | b = image.imshift(a, [0.5, 0], subsample=2) 14 | assert b[0] == 2.0 15 | 16 | def test_rarray(self): 17 | r = image.rarray((10, 10), subsample=10) 18 | assert all(r[4:6, 4] == r[4:6, 5]) 19 | 20 | def test_rebin(self): 21 | a = np.ones((5, 5)) 22 | b = image.rebin(a, 5, flux=False) 23 | assert b.shape == (25, 25) 24 | assert b[0, 0] == 1.0 25 | b = image.rebin(a, 5, flux=True) 26 | assert b[0, 0] == 1 / 25. 27 | b = image.rebin(a, -5, flux=True) 28 | assert b.shape == (1, 1) 29 | assert b[0, 0] == 25. 30 | b = image.rebin(a, -4, flux=True, trim=True) 31 | assert b.shape == (1, 1) 32 | assert b[0, 0] == 16. 33 | 34 | def test_stack2grid(self): 35 | a = np.arange(16).reshape((4, 2, 2)) 36 | b = image.stack2grid(a) 37 | assert all(b[2] == np.array([8, 9, 12, 13])) 38 | 39 | def test_tarray(self): 40 | t = image.tarray((101, 101), yx=(0, 0)) 41 | assert t[0, 100] == 0.0 42 | assert t[100, 0] == pi / 2 43 | assert t[100, 100] == pi / 4 44 | t = image.tarray((101, 101), yx=(0, 0), subsample=10) 45 | assert t[0, 100] == 0.0 46 | assert t[100, 0] == pi / 2 47 | assert t[100, 100] == pi / 4 48 | 49 | def unwrap(self): 50 | im = image.rarray((101, 101)) 51 | rt, r, th, n = image.unwrap(im, [50, 50], bins=10) 52 | assert np.allclose(rt[3, :5], rt[3, 5:]) 53 | 54 | def xarray(self): 55 | x = image.xarray((5, 5)) 56 | assert x[0, 0] == 0 57 | assert x[0, 4] == 4 58 | x = image.xarray((5, 5), yx=(2, 2)) 59 | assert x[0, 0] == -2 60 | assert x[0, 4] == 2 61 | x = image.xarray((5, 5), yx=(2, 2), rot=pi / 4) 62 | assert np.allclose(x[0, 0], -2 * np.sqrt(2)) 63 | assert np.allclose(x[0, 4], 0) 64 | 65 | def yarray(self): 66 | y = image.yarray((5, 5)) 67 | assert y[0, 0] == 0 68 | assert y[4, 0] == 4 69 | y = image.yarray((5, 5), yx=(2, 2)) 70 | assert y[0, 0] == -2 71 | assert y[4, 0] == 2 72 | y = image.yarray((5, 5), yx=(2, 2), rot=pi / 4) 73 | assert np.allclose(y[4, 0], 2 * np.sqrt(2)) 74 | assert np.allclose(y[0, 0], 0) 75 | 76 | -------------------------------------------------------------------------------- /tests/test_instruments.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | This package contains utilities to run the test suite. 4 | """ 5 | 6 | import numpy as np 7 | import mskpy 8 | 9 | class TestInstruments(): 10 | def test_irac(self, test=True): 11 | import astropy.units as u 12 | from mskpy.util import planck 13 | from mskpy.instruments import IRAC 14 | 15 | irac = IRAC() 16 | 17 | # Color correction standard values from the IRAC Instrument 18 | # Handbook. Those calculations are good to ~1%. 19 | templates = dict( 20 | nu_2 = (lambda w: w.value**2 * u.Jy, 21 | [1.0037, 1.0040, 1.0052, 1.0111], 0.015), 22 | nu_1 = (lambda w: w.value**1 * u.Jy, 23 | [1.0, 1.0, 1.0, 1.0], 0.015), 24 | nu0 = (lambda w: w.value**0 * u.Jy, 25 | [1.0, 1.0, 1.0, 1.0], 0.015), 26 | nu1 = (lambda w: w.value**-1 * u.Jy, 27 | [1.0037, 1.0040, 1.0052, 1.0113], 0.015), 28 | nu2 = (lambda w: w.value**-2 * u.Jy, 29 | [1.0111, 1.0121, 1.0155, 1.0337], 0.015), 30 | bb5000 = (lambda x: planck(x, 5000., unit=u.Jy / u.sr) * u.sr, 31 | [1.0063, 1.0080, 1.0114, 1.0269], 0.015), 32 | bb2000 = (lambda x: planck(x, 2000., unit=u.Jy / u.sr) * u.sr, 33 | [0.9990, 1.0015, 1.0048, 1.0163], 0.015), 34 | bb1500 = (lambda x: planck(x, 1500., unit=u.Jy / u.sr) * u.sr, 35 | [0.9959, 0.9983, 1.0012, 1.0112], 0.015), 36 | bb1000 = (lambda x: planck(x, 1000., unit=u.Jy / u.sr) * u.sr, 37 | [0.9933, 0.9938, 0.9952, 1.0001], 0.015), 38 | bb800 = (lambda x: planck(x, 800., unit=u.Jy / u.sr) * u.sr, 39 | [0.9953, 0.9927, 0.9921, 0.9928], 0.015), 40 | bb600 = (lambda x: planck(x, 600., unit=u.Jy / u.sr) * u.sr, 41 | [1.0068, 0.9961, 0.9907, 0.9839], 0.015), 42 | bb400 = (lambda x: planck(x, 400., unit=u.Jy / u.sr) * u.sr, 43 | [1.0614, 1.0240, 1.0042, 0.9818], 0.015), 44 | bb200 = (lambda x: planck(x, 200., unit=u.Jy / u.sr) * u.sr, 45 | [1.5138, 1.2929, 1.1717, 1.1215], 0.03) 46 | ) 47 | 48 | for k, v in templates.items(): 49 | f, K0, rtol = templates[k] 50 | K = irac.ccorrection(f) 51 | print(k, (K - K0) / K0) 52 | if test: 53 | assert np.allclose(K, K0, rtol=rtol) 54 | 55 | -------------------------------------------------------------------------------- /tests/test_models.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | This package contains utilities to run the test suite. 4 | """ 5 | 6 | import numpy as np 7 | import mskpy 8 | 9 | class TestModels(): 10 | def test_neatm(self): 11 | import astropy.units as u 12 | from mskpy.models import NEATM 13 | 14 | # photometry of phaeton from Green et al. (1985, MNRaS 214, 15 | # 29-36) and modeled in the Harris (1998) NEATM paper. 16 | 17 | # um, W / (m2 um) 18 | wave = [3.53, 3.73, 4.73, 8.7, 9.7, 19 | 10.3, 10.6, 11.6, 12.5, 19.2] * u.um 20 | fluxd = 10**np.array([-14.288, -14.148, -13.584, -12.993, -12.995, 21 | -13.027, -13.012, -13.019, -13.070, -13.359]) 22 | fluxd *= u.Unit('W / (m2 um)') 23 | fderr = np.array([0.05, 0.07, 0.08, 0.04, 0.06, 24 | 0.06, 0.06, 0.05, 0.06, 0.06]) 25 | fderr *= fluxd.value / 1.0857 26 | fderr *= fluxd.unit 27 | 28 | phaethon = NEATM(5.13 * u.km, 0.11, eta=1.6, epsilon=0.9) 29 | geom = dict(rh=1.131 * u.au, delta=0.246 * u.au, phase=48.3 * u.deg) 30 | model = phaethon.fluxd(geom, wave, unit=u.Unit('W / (m2 um)')).value 31 | 32 | # results from mskpy1 are within 1%, they are probably so 33 | # large because of the formulae using different units, 34 | # constants 35 | #mskpy1_model = np.array( 36 | # [ 3.95568129e-15, 5.97434772e-15, 2.40411341e-14, 37 | # 9.93098754e-14, 1.00969494e-13, 9.95610099e-14, 38 | # 9.83586508e-14, 9.26712814e-14, 8.62076514e-14, 39 | # 4.11747414e-14]) 40 | standard = np.array( 41 | [ 3.97957168e-15, 6.00855442e-15, 2.41505664e-14, 42 | 9.95628623e-14, 1.01202048e-13, 9.97780671e-14, 43 | 9.85675688e-14, 9.28528197e-14, 8.63657659e-14, 44 | 4.12279675e-14]) 45 | 46 | assert np.allclose(standard / model, np.ones_like(model)) 47 | 48 | # def test_Dpv(self): 49 | # from mskpy.models import Dpv 50 | 51 | 52 | # phaethon = NEATM(5.13 * u.km, 0.11, 1.6, epsilon=0.9) 53 | # geom = dict(rh=1.131 * u.au, delta=0.246 * u.au, phase=48.3 * u.deg) 54 | # model = phaethon.fluxd(geom, wave, unit=u.Unit('W / (m2 um)')).value 55 | # 56 | # # results from mskpy1 are within 1%, they are probably so 57 | # # large because of the formulae using different units, 58 | # # constants 59 | # #mskpy1_model = np.array( 60 | # # [ 3.95568129e-15, 5.97434772e-15, 2.40411341e-14, 61 | # # 9.93098754e-14, 1.00969494e-13, 9.95610099e-14, 62 | # # 9.83586508e-14, 9.26712814e-14, 8.62076514e-14, 63 | # # 4.11747414e-14]) 64 | # standard = np.array( 65 | # [ 3.97957168e-15, 6.00855442e-15, 2.41505664e-14, 66 | # 9.95628623e-14, 1.01202048e-13, 9.97780671e-14, 67 | # 9.85675688e-14, 9.28528197e-14, 8.63657659e-14, 68 | # 4.12279675e-14]) 69 | # 70 | # assert np.allclose(standard / model, np.ones_like(model)) 71 | -------------------------------------------------------------------------------- /tests/test_photometry.py: -------------------------------------------------------------------------------- 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst 2 | """ 3 | This package contains utilities to run the test suite. 4 | """ 5 | 6 | import numpy as np 7 | import astropy.units as u 8 | from mskpy import photometry as P 9 | from mskpy.photometry import hb 10 | 11 | class TestHB(): 12 | """Test photometry.hb. 13 | 14 | From Dave Schleicher 2017 Mar 24: 15 | 16 | As an example, a set of values for Garradd had the following: 17 | 18 | cont. mag (u, b, g): 13.126, 12.014, 11.412 19 | flux(erg/cm/cm/s/A): 4.39e-14, 9.72e-14, 9.85e-14 20 | 21 | color excess (u-b, b-g): 0.010, 0.096 22 | cont. redden (u-b, b-g): 0.096, 1.086 23 | normal color (u-b, b-g): 0.010, 0.118 24 | 25 | A'Hearn et al. (1984, AJ 89, 579): 26 | 27 | A color excess of 0.3 mag [from 3675 to 5240 Å] corresponds to a 28 | reflectivity gradient of 18% per 1000 Å. 29 | 30 | """ 31 | 32 | def test_continuum_color(self): 33 | color = hb.continuum_color('UC', 13.126, 0, 'BC', 12.014, 0)[0] 34 | assert np.isclose(color.to('10 mag / um').value, 0.010, atol=0.001) 35 | 36 | def test_estimate_continuum_short_short_to_long(self): 37 | m = dict(UC=13.126, BC=12.014) 38 | fluxd = hb.estimate_continuum('BC', m) 39 | 40 | # test constants all from Farnham et al. 2000 41 | R_UCBC = 0.998 * ((m['UC'] - m['BC']) - 1.101) 42 | dm = m['BC'] - 0.507 + (4.453 - 5.259) * R_UCBC 43 | test = 3.616e-9 * 10**(-0.4 * dm) 44 | 45 | assert np.isclose(fluxd['GC'].to('erg/(s cm2 AA)').value, test, 46 | atol=1e-16) 47 | 48 | def test_estimate_continuum_short_long_to_long(self): 49 | m = dict(UC=13.126, BC=12.014, GC=11.412) 50 | fluxd = hb.estimate_continuum('BC', m) 51 | assert np.isclose(fluxd['GC'].to('erg/(s cm2 AA)').value, 9.85e-14, 52 | atol=1e-16) 53 | 54 | def test_estimate_continuum_long_short_to_short(self): 55 | m = dict(UC=13.126, BC=12.014, GC=11.412) 56 | fluxd = hb.estimate_continuum('BC', m) 57 | assert np.isclose(fluxd['UC'].to('erg/(s cm2 AA)').value, 4.39e-14, 58 | atol=1e-16) 59 | 60 | def test_estimate_continuum_long_long_to_short(self): 61 | m = dict(BC=12.014, GC=11.412) 62 | fluxd = hb.estimate_continuum('BC', m) 63 | 64 | # test constants all from Farnham et al. 2000 65 | R_BCGC = 1.235 * ((m['BC'] - m['GC']) - 0.507) 66 | dm = m['BC'] + 1.101 + (4.453 - 3.449) * R_BCGC 67 | test = 7.802e-9 * 10**(-0.4 * dm) 68 | 69 | assert np.isclose(fluxd['UC'].to('erg/(s cm2 AA)').value, test, 70 | atol=1e-16) 71 | 72 | def test_Rm2S(self): 73 | Rm = 0.3 * u.mag / (5240 * u.AA - 3675 * u.AA) 74 | S = hb.Rm2S(3675 * u.AA, 5240 * u.AA, Rm) 75 | 76 | alpha = 10**(0.4 * 0.3) 77 | test = (alpha - 1) / (alpha + 1) * 2 / (5.240 - 3.675) * 100 78 | 79 | assert np.isclose(S.to('10 % / um').value, test) 80 | 81 | def test_S2Rm(self): 82 | alpha = 10**(0.4 * 0.3) 83 | S = (alpha - 1) / (alpha + 1) * 2 / (5.240 - 3.675) * 100 84 | Rm = hb.S2Rm(3675 * u.AA, 5240 * u.AA, S * u.Unit('10 % / um')) 85 | 86 | test = 0.3 / (5240 * u.AA - 3675 * u.AA).to('0.1 um').value 87 | assert np.isclose(Rm.to('10 mag / um').value, test) 88 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = 3 | py{36,37,38}-test{,-alldeps,-devdeps}{,-cov} 4 | py{36,37,38}-test-numpy{116,117,118} 5 | py{36,37,38}-test-astropy{30,40,lts} 6 | build_docs 7 | linkcheck 8 | codestyle 9 | requires = 10 | setuptools >= 30.3.0 11 | pip >= 19.3.1 12 | isolated_build = true 13 | indexserver = 14 | NIGHTLY = https://pypi.anaconda.org/scipy-wheels-nightly/simple 15 | 16 | [testenv] 17 | # Suppress display of matplotlib plots generated during docs build 18 | setenv = MPLBACKEND=agg 19 | 20 | # Pass through the following environment variables which may be needed for the CI 21 | passenv = HOME WINDIR LC_ALL LC_CTYPE CC CI TRAVIS 22 | 23 | # Run the tests in a temporary directory to make sure that we don't import 24 | # this package from the source tree 25 | changedir = .tmp/{envname} 26 | 27 | # tox environments are constructed with so-called 'factors' (or terms) 28 | # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: 29 | # will only take effect if that factor is included in the environment name. To 30 | # see a list of example environments that can be run, along with a description, 31 | # run: 32 | # 33 | # tox -l -v 34 | # 35 | description = 36 | run tests 37 | alldeps: with all optional dependencies 38 | devdeps: with the latest developer version of key dependencies 39 | oldestdeps: with the oldest supported version of key dependencies 40 | cov: and test coverage 41 | numpy116: with numpy 1.16.* 42 | numpy117: with numpy 1.17.* 43 | numpy118: with numpy 1.18.* 44 | astropy30: with astropy 3.0.* 45 | astropy40: with astropy 4.0.* 46 | astropylts: with the latest astropy LTS 47 | 48 | # The following provides some specific pinnings for key packages 49 | deps = 50 | git+https://github.com/NASA-Planetary-Science/sbpy#egg=sbpy 51 | 52 | cov: coverage 53 | numpy116: numpy==1.16.* 54 | numpy117: numpy==1.17.* 55 | numpy118: numpy==1.18.* 56 | 57 | astropy30: astropy==3.0.* 58 | astropy40: astropy==4.0.* 59 | astropylts: astropy==4.0.* 60 | 61 | devdeps: :NIGHTLY:numpy 62 | devdeps: git+https://github.com/astropy/astropy.git#egg=astropy 63 | 64 | # The following indicates which extras_require from setup.cfg will be installed 65 | extras = 66 | test 67 | alldeps: all 68 | 69 | commands = 70 | pip freeze 71 | !cov: pytest --pyargs mskpy {toxinidir}/docs {posargs} 72 | cov: pytest --pyargs mskpy {toxinidir}/docs --cov mskpy --cov-config={toxinidir}/setup.cfg {posargs} 73 | cov: coverage xml -o {toxinidir}/coverage.xml 74 | 75 | [testenv:build_docs] 76 | changedir = docs 77 | description = invoke sphinx-build to build the HTML docs 78 | extras = docs 79 | commands = 80 | pip freeze 81 | sphinx-build -W -b html . _build/html 82 | 83 | [testenv:linkcheck] 84 | changedir = docs 85 | description = check the links in the HTML docs 86 | extras = docs 87 | commands = 88 | pip freeze 89 | sphinx-build -W -b linkcheck . _build/html 90 | 91 | [testenv:codestyle] 92 | skip_install = true 93 | changedir = . 94 | description = check code style, e.g. with flake8 95 | deps = flake8 96 | commands = flake8 mskpy --count --max-line-length=100 97 | --------------------------------------------------------------------------------