pyreduce-astro 0.7a1__tar.gz → 0.7a2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyreduce_astro-0.7a2/.gitattributes +1 -0
- pyreduce_astro-0.7a2/.pre-commit-config.yaml +33 -0
- pyreduce_astro-0.7a2/.pyup.yml +4 -0
- pyreduce_astro-0.7a2/.readthedocs.yaml +25 -0
- pyreduce_astro-0.7a2/AGENTS.md +1 -0
- pyreduce_astro-0.7a2/CHANGELOG.md +112 -0
- pyreduce_astro-0.7a2/CLAUDE.md +285 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/PKG-INFO +1 -9
- pyreduce_astro-0.7a2/README_METIS.md +130 -0
- pyreduce_astro-0.7a2/codemeta.json +56 -0
- pyreduce_astro-0.7a2/environment.yml +19 -0
- pyreduce_astro-0.7a2/examples/aj_example.py +165 -0
- pyreduce_astro-0.7a2/examples/crires_plus_example.py +59 -0
- pyreduce_astro-0.7a2/examples/custom_instrument_example.py +76 -0
- pyreduce_astro-0.7a2/examples/harpn_example.py +52 -0
- pyreduce_astro-0.7a2/examples/harps_example.py +47 -0
- pyreduce_astro-0.7a2/examples/harps_gridsearch.py +110 -0
- pyreduce_astro-0.7a2/examples/just_one_swath.py +111 -0
- pyreduce_astro-0.7a2/examples/jwst_miri_example.py +50 -0
- pyreduce_astro-0.7a2/examples/jwst_niriss_example.py +53 -0
- pyreduce_astro-0.7a2/examples/lick_apf_example.py +50 -0
- pyreduce_astro-0.7a2/examples/mcdonald_example.py +53 -0
- pyreduce_astro-0.7a2/examples/metis_ifu_example.py +77 -0
- pyreduce_astro-0.7a2/examples/metis_lss_example.py +77 -0
- pyreduce_astro-0.7a2/examples/micado_example.py +70 -0
- pyreduce_astro-0.7a2/examples/neid_example.py +52 -0
- pyreduce_astro-0.7a2/examples/nirspec_example.py +46 -0
- pyreduce_astro-0.7a2/examples/toes_example.py +159 -0
- pyreduce_astro-0.7a2/examples/uves_callfunc.py +170 -0
- pyreduce_astro-0.7a2/examples/uves_example.py +46 -0
- pyreduce_astro-0.7a2/examples/xshooter_example.py +55 -0
- pyreduce_astro-0.7a2/ipy_startup.py +19 -0
- pyreduce_astro-0.7a2/plots_for_paper/dimensionality.py +172 -0
- pyreduce_astro-0.7a2/plots_for_paper/settings_HARPS.json +47 -0
- pyreduce_astro-0.7a2/plots_for_paper/wavecal_plot.py +137 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyproject.toml +10 -23
- pyreduce_astro-0.7a2/pyproject.toml.sav +77 -0
- pyreduce_astro-0.7a2/tools/argon.line +133 -0
- pyreduce_astro-0.7a2/tools/bpm_creator.py +123 -0
- pyreduce_astro-0.7a2/tools/create_wavelength_guess.py +530 -0
- pyreduce_astro-0.7a2/tools/download_files.py +84 -0
- pyreduce_astro-0.7a2/tools/neon.lin +4180 -0
- pyreduce_astro-0.7a2/tools/neon.line +477 -0
- pyreduce_astro-0.7a2/tools/pymultispec.py +267 -0
- pyreduce_astro-0.7a2/tools/thar.npz +0 -0
- pyreduce_astro-0.7a2/tools/wavecal_creator.py +28 -0
- pyreduce_astro-0.7a2/tools/wavecal_creator_from_existing.py +103 -0
- pyreduce_astro-0.7a2/tools/xshooter_nir.json +74 -0
- pyreduce_astro-0.7a2/uv.lock +2211 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/.gitignore +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/LICENSE +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/README.md +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/hatch_build.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/__init__.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/__main__.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/cli.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/clib/__init__.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/clib/build_extract.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/clib/slit_func_2d_xi_zeta_bd.c +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/clib/slit_func_2d_xi_zeta_bd.h +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/clib/slit_func_bd.c +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/clib/slit_func_bd.h +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/clipnflip.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/combine_frames.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/configuration.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/continuum_normalization.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/cwrappers.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/datasets.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/echelle.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/estimate_background_scatter.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/extract.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/extraction_width.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/__init__.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/aj.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/aj.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/andes.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/andes.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/common.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/common.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/crires_plus.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/crires_plus.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/filters.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/harpn.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/harpn.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/harps.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/harps.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/instrument_info.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/jwst_miri.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/jwst_miri.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/jwst_niriss.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/jwst_niriss.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/lick_apf.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/lick_apf.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/mcdonald.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/mcdonald.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/metis_ifu.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/metis_ifu.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/metis_lss.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/metis_lss.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/micado.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/micado.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/models.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/neid.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/neid.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/nirspec.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/nirspec.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/nte.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/nte.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/uves.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/uves.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/xshooter.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/instruments/xshooter.yaml +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/make_shear.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_crires_plus_det1.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_crires_plus_det2.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_crires_plus_det3.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_ctio_chiron.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_elodie.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_feros3.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_flames_giraffe.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_harps_blue.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_harps_red.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_hds_blue.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_hds_red.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_het_hrs_2x5.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_jwst_miri_lrs_slitless.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_jwst_niriss_gr700xd.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_lick_apf_.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_mcdonald.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_nes.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_nirspec_nirspec.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_sarg.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_sarg_2x2a.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_sarg_2x2b.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_subaru_hds_red.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_blue.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_blue_binned_2_2.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_middle.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_middle_2x2_split.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_middle_binned_2_2.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_red.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_red_2x2.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_red_2x2_split.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_uves_red_binned_2_2.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/masks/mask_xshooter_nir.fits.gz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/pipeline.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/rectify.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/reduce.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_AJ.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_ANDES.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_CRIRES_PLUS.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_HARPN.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_HARPS.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_JWST_MIRI.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_JWST_NIRISS.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_LICK_APF.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_MCDONALD.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_METIS_IFU.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_METIS_LSS.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_MICADO.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_NEID.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_NIRSPEC.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_NTE.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_UVES.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_XSHOOTER.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_pyreduce.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/settings/settings_schema.json +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/tools/__init__.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/tools/combine.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/trace.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/util.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/MICADO_HK_3arcsec_chip5.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/atlas/thar.fits +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/atlas/thar_list.txt +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/atlas/une.fits +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/convert.py +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/crires_plus_J1228_Open_det1.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/crires_plus_J1228_Open_det2.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/crires_plus_J1228_Open_det3.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/harpn_harpn_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/harps_blue_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/harps_blue_pol_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/harps_red_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/harps_red_pol_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/mcdonald.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/metis_lss_l_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/metis_lss_m_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/nirspec_K2.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_blue_360nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_blue_390nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_blue_437nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_middle_2x2_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_middle_565nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_middle_580nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_middle_600nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_middle_665nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_middle_860nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_red_580nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_red_600nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_red_665nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_red_760nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/uves_red_860nm_2D.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavecal/xshooter_nir.npz +0 -0
- {pyreduce_astro-0.7a1 → pyreduce_astro-0.7a2}/pyreduce/wavelength_calibration.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyreduce/_version.py export-subst
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
# Identify invalid files
|
|
6
|
+
- id: check-ast
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-json
|
|
9
|
+
- id: check-toml
|
|
10
|
+
# git checks
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
- id: check-added-large-files
|
|
13
|
+
- id: detect-private-key
|
|
14
|
+
- id: check-case-conflict
|
|
15
|
+
# Python checks
|
|
16
|
+
- id: check-docstring-first
|
|
17
|
+
- id: debug-statements
|
|
18
|
+
# General checks
|
|
19
|
+
- id: mixed-line-ending
|
|
20
|
+
exclude: ".fits"
|
|
21
|
+
- id: trailing-whitespace
|
|
22
|
+
exclude: ".fits"
|
|
23
|
+
- id: end-of-file-fixer
|
|
24
|
+
|
|
25
|
+
# Ruff - Modern Python linter and formatter (replaces isort, black, flake8, pyupgrade)
|
|
26
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
27
|
+
rev: v0.13.2
|
|
28
|
+
hooks:
|
|
29
|
+
# Run the linter
|
|
30
|
+
- id: ruff
|
|
31
|
+
args: [--fix]
|
|
32
|
+
# Run the formatter
|
|
33
|
+
- id: ruff-format
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# .readthedocs.yaml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
9
|
+
sphinx:
|
|
10
|
+
configuration: docs/conf.py
|
|
11
|
+
|
|
12
|
+
# Optionally build your docs in additional formats such as PDF and ePub
|
|
13
|
+
formats: all
|
|
14
|
+
|
|
15
|
+
# Set the version of Python and install from pyproject.toml
|
|
16
|
+
build:
|
|
17
|
+
os: ubuntu-22.04
|
|
18
|
+
tools:
|
|
19
|
+
python: "3.13"
|
|
20
|
+
|
|
21
|
+
python:
|
|
22
|
+
install:
|
|
23
|
+
- method: pip
|
|
24
|
+
path: .
|
|
25
|
+
- requirements: docs/requirements.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CLAUDE.md
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## [0.7a2] - 2025-12-23
|
|
5
|
+
|
|
6
|
+
### Added
|
|
7
|
+
- Manual API calls documentation (manual_calls.md)
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- ReadTheDocs build failing due to missing myst_parser
|
|
11
|
+
- Trace module reference in documentation
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Docs Makefile now uses uv
|
|
15
|
+
- pyproject.toml cleanup
|
|
16
|
+
|
|
17
|
+
## [0.7a1] - 2025-12-22
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- New Pipeline API with `Pipeline.from_instrument()` for simplified usage
|
|
21
|
+
- Click-based CLI replacing argparse (`uv run reduce run UVES HD132205`)
|
|
22
|
+
- Pydantic models for instrument configuration validation
|
|
23
|
+
- YAML instrument configs replacing JSON
|
|
24
|
+
- IPython startup script for interactive development
|
|
25
|
+
- `plot_dir` option to save plots as PNG files
|
|
26
|
+
- Fiber bundle tracing support for multi-fiber instruments
|
|
27
|
+
- `filter_x` and `filter_type` options for order tracing
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Rename `mode` to `arm` terminology throughout
|
|
31
|
+
- Output extension changed from `.ech` to `.fits`
|
|
32
|
+
- Documentation converted from RST to Markdown
|
|
33
|
+
- Trace detection parameters renamed (`opower` -> `degree`, `filter_size` -> `filter_y`)
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- Plotting issues with non-finite values
|
|
37
|
+
- Use `interpolate_replace_nans` for masked pixels
|
|
38
|
+
|
|
39
|
+
## [0.6.0] - 2025-12-22
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
- JSON schema validation test for instrument configurations
|
|
43
|
+
- GitHub workflow creates GitHub Release on tag push
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
- Fix test_wavecal to match WavelengthCalibration.execute() signature
|
|
47
|
+
- Fix spec fixture to match ScienceExtraction.run() signature
|
|
48
|
+
- Fix instrument schema: replace invalid 'value' keyword with standard JSON Schema 'type'
|
|
49
|
+
|
|
50
|
+
## [0.6.0b5] - 2025-10-04
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
- Include *.pyd files for Windows builds
|
|
54
|
+
- Remove redundant build test from workflow
|
|
55
|
+
|
|
56
|
+
## [0.6.0b4] - 2025-10-03
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
- workflow builds multi-arch wheels
|
|
60
|
+
- minor fixes to make build pass
|
|
61
|
+
|
|
62
|
+
## [0.6.0b3] - 2025-10-02
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
- Test organization with pytest markers (unit, instrument, slow, downloads)
|
|
66
|
+
- ANDES instrument configuration and settings
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
- CI now runs fast tests (~7s) on every push to master
|
|
70
|
+
- Test suite optimized with slow marker for tests >3s
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
- ANDES instrument configuration errors (missing decker fields, regex pattern)
|
|
74
|
+
- NIRSPEC FITS header errors with illegal keywords containing dots
|
|
75
|
+
- Pre-commit hooks now documented and working correctly
|
|
76
|
+
|
|
77
|
+
## [0.6.0b2] - 2025-10-02
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
- lazy imports
|
|
81
|
+
- cosmetic fixes like version string
|
|
82
|
+
|
|
83
|
+
## [0.6.0b1] - 2025-10-02
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
- Modern build system using uv package manager
|
|
87
|
+
- Minimum Python version now 3.11, default 3.13
|
|
88
|
+
- Migrated build system from setuptools to Hatchling (PEP 517)
|
|
89
|
+
- Replaced black, isort, flake8, and pyupgrade with Ruff
|
|
90
|
+
- Improved code formatting across entire codebase using Ruff
|
|
91
|
+
- Modernized GitHub Actions workflow (uv-based, Python 3.11-3.13 matrix)
|
|
92
|
+
- Updated documentation to reflect modern installation with uv
|
|
93
|
+
- Consolidated legacy build files (setup.py, requirements.txt) into pyproject.toml
|
|
94
|
+
- Removed automatic PyPI publishing from GitHub Actions (now manual)
|
|
95
|
+
- GitHub Actions tests now manual-only on master branch
|
|
96
|
+
- Modernized ReadTheDocs build configuration
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
- Close FITS file handles after reading to prevent resource leaks ([#28](https://github.com/ivh/PyReduce/pull/28))
|
|
100
|
+
- Store wavelength calibration in double precision instead of single ([#30](https://github.com/ivh/PyReduce/pull/30))
|
|
101
|
+
- Add fallback value for E_ORIENT header keyword ([#31](https://github.com/ivh/PyReduce/pull/31))
|
|
102
|
+
- Return final wavelength linelist with flags from calibration ([#33](https://github.com/ivh/PyReduce/pull/33))
|
|
103
|
+
- Fix MaskedArray filling in normflat routine
|
|
104
|
+
- Fix undefined TypeFilter import in NEID instrument
|
|
105
|
+
- Fix Sphinx documentation build warnings
|
|
106
|
+
- Fix pre-commit hook configuration issues
|
|
107
|
+
|
|
108
|
+
### Documentation
|
|
109
|
+
- Updated README badges for GitHub Actions and Python versions
|
|
110
|
+
- Updated installation instructions to use uv instead of pip
|
|
111
|
+
- Improved documentation build process
|
|
112
|
+
- CLAUDE.md / AGENTS.md for AI-assisted development guidance
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
PyReduce is a Python port of the REDUCE echelle spectrograph data reduction pipeline. It processes raw astronomical observations from instruments like HARPS, UVES, XSHOOTER, CRIRES+, JWST/NIRISS and others into calibrated 1D spectra.
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install
|
|
13
|
+
uv sync
|
|
14
|
+
|
|
15
|
+
# Download example data
|
|
16
|
+
uv run reduce download UVES
|
|
17
|
+
|
|
18
|
+
# Run example
|
|
19
|
+
PYREDUCE_PLOT=0 uv run python examples/uves_example.py
|
|
20
|
+
|
|
21
|
+
# Or use CLI
|
|
22
|
+
uv run reduce run UVES HD132205 --steps bias,flat,orders,science
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Package Structure
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
pyreduce/
|
|
29
|
+
├── __main__.py # Click CLI entry point
|
|
30
|
+
├── pipeline.py # Pipeline API (recommended entry point)
|
|
31
|
+
├── reduce.py # Step class implementations
|
|
32
|
+
├── configuration.py # Config loading (settings JSON)
|
|
33
|
+
├── extract.py # Optimal extraction algorithm
|
|
34
|
+
├── trace_orders.py # Order detection and tracing
|
|
35
|
+
├── wavelength_calibration.py # Wavelength solution fitting
|
|
36
|
+
├── combine_frames.py # Frame combination/calibration
|
|
37
|
+
├── echelle.py # Echelle spectrum I/O
|
|
38
|
+
├── util.py # Utilities, plotting helpers
|
|
39
|
+
├── cwrappers.py # CFFI C extension wrappers
|
|
40
|
+
│
|
|
41
|
+
├── instruments/ # Instrument definitions
|
|
42
|
+
│ ├── common.py # Base Instrument class
|
|
43
|
+
│ ├── models.py # Pydantic config models
|
|
44
|
+
│ ├── instrument_info.py # Instrument loader
|
|
45
|
+
│ ├── *.yaml # Instrument configs (one per instrument)
|
|
46
|
+
│ └── *.py # Custom instrument logic (optional)
|
|
47
|
+
│
|
|
48
|
+
├── settings/ # Reduction parameters
|
|
49
|
+
│ ├── settings_default.json
|
|
50
|
+
│ └── settings_*.json # Per-instrument settings
|
|
51
|
+
│
|
|
52
|
+
└── clib/ # C source for extraction
|
|
53
|
+
├── slit_func_bd.c
|
|
54
|
+
└── slit_func_2d_xi_zeta_bd.c
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Pipeline Steps
|
|
58
|
+
|
|
59
|
+
The reduction pipeline consists of these steps (in typical order):
|
|
60
|
+
|
|
61
|
+
| Step | Class | Description |
|
|
62
|
+
|------|-------|-------------|
|
|
63
|
+
| `mask` | `Mask` | Load bad pixel mask for detector |
|
|
64
|
+
| `bias` | `Bias` | Combine bias frames into master bias |
|
|
65
|
+
| `flat` | `Flat` | Combine flat frames, subtract bias |
|
|
66
|
+
| `orders` | `OrderTracing` | Trace echelle order positions on flat |
|
|
67
|
+
| `curvature` | `SlitCurvatureDetermination` | Measure slit tilt/shear from arc lamp |
|
|
68
|
+
| `scatter` | `BackgroundScatter` | Model inter-order scattered light |
|
|
69
|
+
| `norm_flat` | `NormalizeFlatField` | Normalize flat, extract blaze function |
|
|
70
|
+
| `wavecal_master` | `WavelengthCalibrationMaster` | Extract wavelength calibration spectrum |
|
|
71
|
+
| `wavecal_init` | `WavelengthCalibrationInitialize` | Initial line identification |
|
|
72
|
+
| `wavecal` | `WavelengthCalibrationFinalize` | Refine wavelength solution |
|
|
73
|
+
| `freq_comb_master` | `LaserFrequencyCombMaster` | Extract frequency comb spectrum |
|
|
74
|
+
| `freq_comb` | `LaserFrequencyCombFinalize` | Apply frequency comb calibration |
|
|
75
|
+
| `science` | `ScienceExtraction` | Optimally extract science spectra |
|
|
76
|
+
| `continuum` | `ContinuumNormalization` | Fit and normalize continuum |
|
|
77
|
+
| `finalize` | `Finalize` | Write final FITS output |
|
|
78
|
+
|
|
79
|
+
Each step class has:
|
|
80
|
+
- `run(files, **dependencies)` - Execute the step
|
|
81
|
+
- `save(...)` - Save results to disk
|
|
82
|
+
- `load(...)` - Load previous results
|
|
83
|
+
- `dependsOn` - List of required prior steps
|
|
84
|
+
- `savefile` - Output file path
|
|
85
|
+
|
|
86
|
+
## Configuration System
|
|
87
|
+
|
|
88
|
+
### Instrument Configs (YAML)
|
|
89
|
+
|
|
90
|
+
Location: `pyreduce/instruments/*.yaml`
|
|
91
|
+
|
|
92
|
+
Defines what the instrument IS - hardware properties and header mappings:
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
# Basic identification
|
|
96
|
+
instrument: HARPS
|
|
97
|
+
telescope: ESO-3.6m
|
|
98
|
+
arms: [red, blue]
|
|
99
|
+
|
|
100
|
+
# Detector properties
|
|
101
|
+
naxis: [4096, 4096]
|
|
102
|
+
orientation: 4
|
|
103
|
+
extension: 0
|
|
104
|
+
gain: ESO DET OUT1 CONAD # Header keyword or literal value
|
|
105
|
+
readnoise: ESO DET OUT1 RON
|
|
106
|
+
dark: 0
|
|
107
|
+
|
|
108
|
+
# Header keyword mappings (instrument → internal name)
|
|
109
|
+
date: DATE-OBS
|
|
110
|
+
target: ESO OBS TARG NAME
|
|
111
|
+
instrument_mode: ESO INS MODE
|
|
112
|
+
exposure_time: EXPTIME
|
|
113
|
+
ra: RA
|
|
114
|
+
dec: DEC
|
|
115
|
+
jd: MJD-OBS
|
|
116
|
+
|
|
117
|
+
# File classification keywords
|
|
118
|
+
kw_bias: ESO DPR TYPE
|
|
119
|
+
kw_flat: ESO DPR TYPE
|
|
120
|
+
kw_wave: ESO DPR TYPE
|
|
121
|
+
kw_spec: ESO DPR TYPE
|
|
122
|
+
id_bias: BIAS
|
|
123
|
+
id_flat: FLAT.*
|
|
124
|
+
id_wave: WAVE,THAR
|
|
125
|
+
id_spec: OBJECT
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Validated by Pydantic model `InstrumentConfig` in `models.py`.
|
|
129
|
+
|
|
130
|
+
### Reduction Settings (JSON)
|
|
131
|
+
|
|
132
|
+
Location: `pyreduce/settings/settings_*.json`
|
|
133
|
+
|
|
134
|
+
Defines HOW to reduce - algorithm parameters per step:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"bias": {
|
|
139
|
+
"degree": 0
|
|
140
|
+
},
|
|
141
|
+
"orders": {
|
|
142
|
+
"degree": 4,
|
|
143
|
+
"noise": 100,
|
|
144
|
+
"min_cluster": 500,
|
|
145
|
+
"filter_size": 120
|
|
146
|
+
},
|
|
147
|
+
"norm_flat": {
|
|
148
|
+
"extraction_width": 0.5,
|
|
149
|
+
"smooth_slitfunction": 1,
|
|
150
|
+
"oversampling": 10
|
|
151
|
+
},
|
|
152
|
+
"wavecal": {
|
|
153
|
+
"degree": [6, 6],
|
|
154
|
+
"threshold": 100,
|
|
155
|
+
"iterations": 3
|
|
156
|
+
},
|
|
157
|
+
"science": {
|
|
158
|
+
"extraction_method": "optimal",
|
|
159
|
+
"extraction_width": 0.5,
|
|
160
|
+
"oversampling": 10
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Settings cascade: `settings_default.json` < `settings_INSTRUMENT.json` < runtime overrides.
|
|
166
|
+
|
|
167
|
+
## Python API
|
|
168
|
+
|
|
169
|
+
### Recommended: Pipeline.from_instrument()
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
from pyreduce.pipeline import Pipeline
|
|
173
|
+
|
|
174
|
+
result = Pipeline.from_instrument(
|
|
175
|
+
instrument="UVES",
|
|
176
|
+
target="HD132205",
|
|
177
|
+
night="2010-04-01",
|
|
178
|
+
arm="middle",
|
|
179
|
+
steps=("bias", "flat", "orders", "science"),
|
|
180
|
+
base_dir="/data",
|
|
181
|
+
plot=1,
|
|
182
|
+
).run()
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This handles:
|
|
186
|
+
- Loading instrument config
|
|
187
|
+
- Finding and sorting input files
|
|
188
|
+
- Setting up output directory
|
|
189
|
+
- Running requested steps
|
|
190
|
+
|
|
191
|
+
### Manual Pipeline Construction
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
from pyreduce.pipeline import Pipeline
|
|
195
|
+
|
|
196
|
+
pipe = Pipeline(
|
|
197
|
+
instrument="UVES",
|
|
198
|
+
output_dir="/output",
|
|
199
|
+
arm="middle",
|
|
200
|
+
plot=0,
|
|
201
|
+
)
|
|
202
|
+
pipe.bias(bias_files)
|
|
203
|
+
pipe.flat(flat_files)
|
|
204
|
+
pipe.trace_orders()
|
|
205
|
+
pipe.extract(science_files)
|
|
206
|
+
result = pipe.run()
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Legacy API (deprecated)
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
import pyreduce
|
|
213
|
+
pyreduce.reduce.main(
|
|
214
|
+
instrument="UVES",
|
|
215
|
+
target="HD132205",
|
|
216
|
+
...
|
|
217
|
+
) # Shows deprecation warning
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## CLI Commands
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Full pipeline
|
|
224
|
+
uv run reduce run UVES HD132205 --steps bias,flat,orders
|
|
225
|
+
|
|
226
|
+
# Individual steps (top-level commands)
|
|
227
|
+
uv run reduce bias UVES HD132205
|
|
228
|
+
uv run reduce orders UVES HD132205
|
|
229
|
+
uv run reduce wavecal UVES HD132205
|
|
230
|
+
|
|
231
|
+
# Combine reduced spectra
|
|
232
|
+
uv run reduce combine --output combined.fits *.final.fits
|
|
233
|
+
|
|
234
|
+
# Download sample data
|
|
235
|
+
uv run reduce download UVES
|
|
236
|
+
|
|
237
|
+
# List steps
|
|
238
|
+
uv run reduce list-steps
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Environment Variables
|
|
242
|
+
|
|
243
|
+
- `REDUCE_DATA` - Base data directory (default: `~/REDUCE_DATA`)
|
|
244
|
+
- `PYREDUCE_PLOT` - Override plot level (0, 1, 2)
|
|
245
|
+
- `PYREDUCE_PLOT_DIR` - Save plots to directory instead of displaying
|
|
246
|
+
|
|
247
|
+
## Development
|
|
248
|
+
|
|
249
|
+
### Commands
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
uv sync # Install dependencies
|
|
253
|
+
uv run pre-commit install # Setup hooks (once)
|
|
254
|
+
uv run pytest -m unit # Fast unit tests
|
|
255
|
+
uv run pytest --instrument=UVES # Test single instrument
|
|
256
|
+
uv run ruff check --fix . # Lint and fix
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Adding Instruments
|
|
260
|
+
|
|
261
|
+
1. Create `pyreduce/instruments/name.yaml` with detector/header config
|
|
262
|
+
2. Create `pyreduce/instruments/name.py` if custom logic needed (optional)
|
|
263
|
+
3. Create `pyreduce/settings/settings_NAME.json` for reduction parameters
|
|
264
|
+
4. Add example script to `examples/name_example.py`
|
|
265
|
+
|
|
266
|
+
### Test Organization
|
|
267
|
+
|
|
268
|
+
- `@pytest.mark.unit` - Fast tests with synthetic data (~40 tests)
|
|
269
|
+
- `@pytest.mark.instrument` - Integration tests with real data (~70 tests)
|
|
270
|
+
- `@pytest.mark.slow` - Long-running tests (wavecal, continuum)
|
|
271
|
+
|
|
272
|
+
## Key Files
|
|
273
|
+
|
|
274
|
+
| File | Purpose |
|
|
275
|
+
|------|---------|
|
|
276
|
+
| `pyreduce/__main__.py` | Click CLI entry point |
|
|
277
|
+
| `pyreduce/pipeline.py` | Fluent Pipeline API, `from_instrument()` |
|
|
278
|
+
| `pyreduce/reduce.py` | Step class implementations |
|
|
279
|
+
| `pyreduce/extract.py` | Optimal extraction algorithm |
|
|
280
|
+
| `pyreduce/wavelength_calibration.py` | Wavelength solution fitting |
|
|
281
|
+
| `pyreduce/trace_orders.py` | Order detection and tracing |
|
|
282
|
+
| `pyreduce/instruments/common.py` | Base Instrument class |
|
|
283
|
+
| `pyreduce/instruments/models.py` | Pydantic config models |
|
|
284
|
+
| `pyreduce/clib/*.c` | C code for slit function decomposition |
|
|
285
|
+
| `hatch_build.py` | CFFI extension build hook |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyreduce-astro
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7a2
|
|
4
4
|
Summary: A data reduction package for echelle spectrographs
|
|
5
5
|
Project-URL: Homepage, https://github.com/ivh/PyReduce
|
|
6
6
|
Project-URL: Documentation, https://pyreduce-astro.readthedocs.io
|
|
@@ -40,14 +40,6 @@ Requires-Dist: scipy>=1.11.0
|
|
|
40
40
|
Requires-Dist: spectres>=2.2.0
|
|
41
41
|
Requires-Dist: tqdm>=4.66.0
|
|
42
42
|
Requires-Dist: wget>=3.2
|
|
43
|
-
Provides-Extra: dev
|
|
44
|
-
Requires-Dist: myst-parser>=3.0.0; extra == 'dev'
|
|
45
|
-
Requires-Dist: pre-commit>=3.5.0; extra == 'dev'
|
|
46
|
-
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
47
|
-
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
48
|
-
Requires-Dist: ruff>=0.8.0; extra == 'dev'
|
|
49
|
-
Requires-Dist: setuptools; extra == 'dev'
|
|
50
|
-
Requires-Dist: sphinx>=7.2.0; extra == 'dev'
|
|
51
43
|
Description-Content-Type: text/markdown
|
|
52
44
|
|
|
53
45
|
[](https://github.com/ivh/PyReduce/actions/workflows/python-publish.yml)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+

|
|
2
|
+
[](https://pyreduce-astro.readthedocs.io/en/latest/?badge=latest)
|
|
3
|
+
[](https://pyup.io/repos/github/nadsabha/PyReduce_ELT/)
|
|
4
|
+
|
|
5
|
+
# PyREDUCE_ELT
|
|
6
|
+
|
|
7
|
+
PyReduce_ELT is an adapted branch of the PyReduce package optimised to handle ScopeSim-simulated ELT data for MICADO and METIS (optimized for LSS_M mode only for now) instruments. Only the relevant information pertaining to operating PyReduce on ELT MICADO and METIS data are addressed in this README file, while all details of the original PyReduce package can be found in this [README.md](https://github.com/AWehrhahn/PyReduce/blob/master/README.md).
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Installation
|
|
11
|
+
------------
|
|
12
|
+
|
|
13
|
+
The most up-to-date version can be installed using python 3 command:
|
|
14
|
+
```
|
|
15
|
+
pip install git+https://github.com/nadsabha/PyReduce_ELT
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
PyReduce uses CFFI to link to the C code, on non-linux platforms you might have to install libffi.
|
|
19
|
+
See also https://cffi.readthedocs.io/en/latest/installation.html#platform-specific-instructions for details.
|
|
20
|
+
|
|
21
|
+
Output Format
|
|
22
|
+
-------------
|
|
23
|
+
PyReduce will create ``.ech`` files when run. Despite the name those are just regular ``.fits`` files and can be opened with any programm that can read ``.fits``. The data is contained in a table extension. The header contains all the keywords of the input science file, plus some extra PyReduce specific keyword, all of which start with ``e_``.
|
|
24
|
+
|
|
25
|
+
Other PyReduce outputs are ``.npz`` files. These are numpy recarrays and can be opened as in the example copied below:
|
|
26
|
+
```
|
|
27
|
+
file_py_wave='metis_lss_m.thar.npz'
|
|
28
|
+
data_npz_py_wave = np.load(file_py_wave, allow_pickle=True)
|
|
29
|
+
#load wave_cal npz file
|
|
30
|
+
lst = data_npz_py_wave.files
|
|
31
|
+
print(lst)
|
|
32
|
+
for item in lst:
|
|
33
|
+
print(item)
|
|
34
|
+
print(data_npz_py_wave[item])
|
|
35
|
+
# or
|
|
36
|
+
wave=data_npz_py_wave['wave']
|
|
37
|
+
coef=data_npz_py_wave['coef']
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
How To
|
|
41
|
+
------
|
|
42
|
+
PyReduce can be run using the provided example files, e.g.:
|
|
43
|
+
for MICADO ``examples/micado_example.py``,
|
|
44
|
+
for METIS ``examples/metis_example.py``.
|
|
45
|
+
|
|
46
|
+
In this example script, we first define the instrument and instrument mode (``LSS_M`` for METIS). Then the path to where the data are located is defined, as well as the output directory. Lastly, all the specific settings of the reduction (e.g. polynomial degrees of various fits) are defined in the json configuration files [settings_MICADO.json](https://github.com/nadsabha/PyReduce_ELT/blob/master/pyreduce/settings/settings_MICADO.json), [settings_METIS.json](https://github.com/nadsabha/PyReduce_ELT/blob/master/pyreduce/settings/settings_METIS.json), or alternatively directly within the script by adding, e.g. ``config["curvature"]["extraction_width"] = 0.77``, ``config["wavecal"]["dimensionality"] = "1D"``, etc.
|
|
47
|
+
|
|
48
|
+
Explanation of the settings paratemters can be found in [settings_schema.json](https://github.com/nadsabha/PyReduce_ELT/blob/master/pyreduce/settings/settings_schema.json).
|
|
49
|
+
|
|
50
|
+
The steps of the reduction desired to be performed are then specified. Steps that are not specified, but are still required, will be loaded from previous runs if possible, or executed otherwise.
|
|
51
|
+
All of this is then passed to pyreduce.reduce.main to start the reduction.
|
|
52
|
+
|
|
53
|
+
In this example, PyReduce will plot all intermediary results, and also plot the progres during some of the steps. Close them to continue calculations. Once you are statisified with the results you can disable them in [settings_MICADO.json](https://github.com/nadsabha/PyReduce_ELT/blob/master/pyreduce/settings/settings_MICADO.json) or [settings_METIS.json](https://github.com/nadsabha/PyReduce_ELT/blob/master/pyreduce/settings/settings_METIS.json) (with ``plot : false`` in each step) to speed up the computation.
|
|
54
|
+
|
|
55
|
+
Relevant for MICADO:
|
|
56
|
+
|
|
57
|
+
Please note that in the micado example file it is specified to return only the order trace corresponding to the center of the order on MICADO (HK band) files, i.e. fit number 4 (or 3 as per Python convention counted from bottom to up) of the traces on the pinhole frame.
|
|
58
|
+
|
|
59
|
+
Relevant for METIS:
|
|
60
|
+
|
|
61
|
+
Please note that reduce.py main script is modified to return only the order trace corresponding to the center of the slit trace on METIS LSS files, i.e. fit number 17 (or 16 as per Python convention counted from bottom to up) of the traces on the pinhole frame.
|
|
62
|
+
|
|
63
|
+
Input Data
|
|
64
|
+
------
|
|
65
|
+
|
|
66
|
+
MICADO data:
|
|
67
|
+
|
|
68
|
+
Input simulated MICADO 'raw' data can be downloaded directly from this [link](https://www.dropbox.com/sh/e3lnvtkmyjveajk/AABPHxeUdDO5AnkWCAjbM0e1a?dl=0) and placed in the input file path defined in [micado_example.py](https://github.com/nadsabha/PyReduce_ELT/blob/master/examples/micado_example.py). The files include:
|
|
69
|
+
|
|
70
|
+
• FF_detector_SPEC_3000x20_Spec_HK.fits: spectroscopic flatfield
|
|
71
|
+
|
|
72
|
+
• PINHOLE_detector_SPEC_3000x20_Spec_HK.fits: pinhole frame with the flatfiled lamp
|
|
73
|
+
|
|
74
|
+
• LL_detector_SPEC_3000x20_Spec_HK.fits: linelamp spectrum full slit
|
|
75
|
+
|
|
76
|
+
• detector_final_delta.fits: linelamp spectrum that acts as a "science" target to make pyreduce run
|
|
77
|
+
|
|
78
|
+
METIS data:
|
|
79
|
+
|
|
80
|
+
Input simulated METIS 'raw' data can be downloaded directly from this [link](https://www.dropbox.com/sh/h1dz80vsw4lwoel/AAAqJD_FGDGC-t12wgnPXVR8a?dl=0) and placed in the input file path defined in [metis_example.py](https://github.com/nadsabha/PyReduce_ELT/blob/master/examples/metis_example.py). The files include:
|
|
81
|
+
|
|
82
|
+
• lss_m_thermal.fits: spectroscopic flat field
|
|
83
|
+
|
|
84
|
+
• lss_m_pinholes.fits: pinhole frame with the flat field, used for order/trace detection and fit
|
|
85
|
+
|
|
86
|
+
• lss_m_sky.fits: sky emission line spectrum covering the full slit, used for curvature determination and the wavelength calibration
|
|
87
|
+
|
|
88
|
+
• lss_m_star.fits: sky emission line spectrum covering the full slit with a star spectrum "science" frame
|
|
89
|
+
|
|
90
|
+
Reference Papers
|
|
91
|
+
------
|
|
92
|
+
The original REDUCE paper: [doi:10.1051/0004-6361:20020175](https://doi.org/10.1051/0004-6361:20020175)
|
|
93
|
+
|
|
94
|
+
A paper describing the changes and updates of PyReduce can be found here: [https://ui.adsabs.harvard.edu/abs/2021A%26A...646A..32P/abstract](https://ui.adsabs.harvard.edu/abs/2021A%26A...646A..32P/abstract)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
Diff to reduce.py that was removed when merging
|
|
98
|
+
------
|
|
99
|
+
|
|
100
|
+
diff --git a/pyreduce/reduce.py b/pyreduce/reduce.py
|
|
101
|
+
index ba2c639..f7c2772 100755
|
|
102
|
+
--- a/pyreduce/reduce.py
|
|
103
|
+
+++ b/pyreduce/reduce.py
|
|
104
|
+
@@ -764,6 +764,26 @@ class OrderTracing(CalibrationStep):
|
|
105
|
+
plot_title=self.plot_title,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
+ # NBS: BEGINNING of fix for MICADO and METIS pinholes
|
|
109
|
+
+ print('#NBS:here!!!')
|
|
110
|
+
+ print(orders.shape) #NBS
|
|
111
|
+
+
|
|
112
|
+
+ # if len(orders) == 7:
|
|
113
|
+
+ # orders=orders[3] #NBS: MICADO fix if only 1 order on the detector, use [3::7] if 2 orders present
|
|
114
|
+
+ # orders = orders.reshape((1, 5))#NBS: to reshape it
|
|
115
|
+
+ # print(orders.shape) #NBS
|
|
116
|
+
+
|
|
117
|
+
+ # if len(orders) == 14:
|
|
118
|
+
+ # orders=orders[3::7] #NBS: MICADO fix if 2 orders on the detector
|
|
119
|
+
+ # print(orders.shape) #NBS
|
|
120
|
+
+
|
|
121
|
+
+ if len(orders) == 33:
|
|
122
|
+
+ orders=orders[16] #NBS: METIS fix For MICADO if only 1 order on the detector, use [3::7] if 2 orders present
|
|
123
|
+
+ orders = orders.reshape((1, 5))#NBS: to reshape it
|
|
124
|
+
+ print(orders.shape) #NBS
|
|
125
|
+
+
|
|
126
|
+
+ # NBS: END of fix for MICADO and METIS pinholes
|
|
127
|
+
+
|
|
128
|
+
self.save(orders, column_range)
|
|
129
|
+
|
|
130
|
+
return orders, column_range
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://w3id.org/codemeta/2.0",
|
|
4
|
+
"http://schema.org"
|
|
5
|
+
],
|
|
6
|
+
"@type": "SoftwareSourceCode",
|
|
7
|
+
"identifier": "pyreduce-astro",
|
|
8
|
+
"name": "pyreduce-astro",
|
|
9
|
+
"version": "0.6-dev",
|
|
10
|
+
"description": "A data reduction package for echelle spectrographs",
|
|
11
|
+
"license": "GPL-3.0",
|
|
12
|
+
"author": [{
|
|
13
|
+
"@type": "Person",
|
|
14
|
+
"givenName": "Thomas",
|
|
15
|
+
"familyName": "Marquart",
|
|
16
|
+
"email": "thomas.marquart@astro.uu.se"
|
|
17
|
+
},{
|
|
18
|
+
"@type": "Person",
|
|
19
|
+
"givenName": "Ansgar",
|
|
20
|
+
"familyName": "Wehrhahn",
|
|
21
|
+
"email": "ansgar.wehrhahn@physics.uu.se"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"@type": "Person",
|
|
25
|
+
"givenName": "Nikolai",
|
|
26
|
+
"familyName": "Piskunov",
|
|
27
|
+
"email": "nikolai.piskunov@physics.uu.se"
|
|
28
|
+
}],
|
|
29
|
+
"provider": {
|
|
30
|
+
"@id": "https://pypi.org",
|
|
31
|
+
"@type": "Organization",
|
|
32
|
+
"name": "The Python Package Index",
|
|
33
|
+
"url": "https://pypi.org"
|
|
34
|
+
},
|
|
35
|
+
"runtimePlatform": "Python 3",
|
|
36
|
+
"url": "https://github.com/ivh/PyReduce",
|
|
37
|
+
"codeRepository": "https://github.com/ivh/PyReduce",
|
|
38
|
+
"programmingLanguage": {
|
|
39
|
+
"@type": "ComputerLanguage",
|
|
40
|
+
"name": "Python",
|
|
41
|
+
"version": "3"
|
|
42
|
+
},
|
|
43
|
+
"operatingSystem": "POSIX :: Linux",
|
|
44
|
+
"interfaceType": "library",
|
|
45
|
+
"developmentStatus": "active",
|
|
46
|
+
"dateCreated": "2019-01-01",
|
|
47
|
+
"dateModified": "2025-02-19",
|
|
48
|
+
"keywords": [
|
|
49
|
+
"astronomy",
|
|
50
|
+
"spectroscopy",
|
|
51
|
+
"data reduction",
|
|
52
|
+
"echelle"
|
|
53
|
+
],
|
|
54
|
+
"contIntegration": "https://github.com/ivh/PyReduce/actions",
|
|
55
|
+
"issueTracker": "https://github.com/ivh/PyReduce/issues"
|
|
56
|
+
}
|