pyreduce-astro 0.7__tar.gz → 0.7a1__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.
Files changed (255) hide show
  1. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/.gitignore +0 -4
  2. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/PKG-INFO +19 -26
  3. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/README.md +6 -24
  4. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyproject.toml +29 -22
  5. pyreduce_astro-0.7a1/pyreduce/__main__.py +206 -0
  6. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/cli.py +3 -3
  7. pyreduce_astro-0.7a1/pyreduce/clib/build_extract.py +75 -0
  8. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/clib/slit_func_2d_xi_zeta_bd.c +118 -152
  9. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/clib/slit_func_2d_xi_zeta_bd.h +0 -2
  10. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/clib/slit_func_bd.c +5 -2
  11. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/combine_frames.py +25 -76
  12. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/configuration.py +18 -119
  13. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/continuum_normalization.py +0 -2
  14. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/cwrappers.py +62 -279
  15. pyreduce_astro-0.7a1/pyreduce/datasets.py +238 -0
  16. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/estimate_background_scatter.py +27 -28
  17. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/extract.py +359 -524
  18. pyreduce_astro-0.7/pyreduce/extraction_height.py → pyreduce_astro-0.7a1/pyreduce/extraction_width.py +17 -17
  19. pyreduce_astro-0.7a1/pyreduce/instruments/aj.py +9 -0
  20. pyreduce_astro-0.7a1/pyreduce/instruments/aj.yaml +51 -0
  21. pyreduce_astro-0.7a1/pyreduce/instruments/andes.py +102 -0
  22. pyreduce_astro-0.7a1/pyreduce/instruments/andes.yaml +72 -0
  23. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/instruments/common.py +110 -347
  24. pyreduce_astro-0.7a1/pyreduce/instruments/crires_plus.py +103 -0
  25. pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/crires_plus.yaml +2 -0
  26. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/instruments/filters.py +1 -1
  27. pyreduce_astro-0.7/pyreduce/instruments/HARPN/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/harpn.py +17 -17
  28. pyreduce_astro-0.7/pyreduce/instruments/HARPN/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/harpn.yaml +2 -2
  29. pyreduce_astro-0.7/pyreduce/instruments/HARPS/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/harps.py +21 -25
  30. pyreduce_astro-0.7/pyreduce/instruments/HARPS/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/harps.yaml +2 -2
  31. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/instruments/instrument_info.py +17 -19
  32. pyreduce_astro-0.7/pyreduce/instruments/JWST_MIRI/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/jwst_miri.py +6 -6
  33. pyreduce_astro-0.7/pyreduce/instruments/JWST_MIRI/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/jwst_miri.yaml +2 -2
  34. pyreduce_astro-0.7/pyreduce/instruments/JWST_NIRISS/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/jwst_niriss.py +16 -10
  35. pyreduce_astro-0.7/pyreduce/instruments/JWST_NIRISS/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/jwst_niriss.yaml +2 -2
  36. pyreduce_astro-0.7/pyreduce/instruments/LICK_APF/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/lick_apf.py +6 -5
  37. pyreduce_astro-0.7/pyreduce/instruments/LICK_APF/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/lick_apf.yaml +2 -2
  38. pyreduce_astro-0.7/pyreduce/instruments/MCDONALD/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/mcdonald.py +10 -8
  39. pyreduce_astro-0.7/pyreduce/instruments/MCDONALD/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/mcdonald.yaml +3 -3
  40. pyreduce_astro-0.7/pyreduce/instruments/METIS_IFU/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/metis_ifu.py +10 -7
  41. pyreduce_astro-0.7/pyreduce/instruments/METIS_IFU/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/metis_ifu.yaml +3 -3
  42. pyreduce_astro-0.7/pyreduce/instruments/METIS_LSS/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/metis_lss.py +10 -7
  43. pyreduce_astro-0.7/pyreduce/instruments/METIS_LSS/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/metis_lss.yaml +3 -3
  44. pyreduce_astro-0.7/pyreduce/instruments/MICADO/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/micado.py +10 -7
  45. pyreduce_astro-0.7/pyreduce/instruments/MICADO/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/micado.yaml +3 -3
  46. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/instruments/models.py +8 -136
  47. pyreduce_astro-0.7a1/pyreduce/instruments/neid.py +156 -0
  48. pyreduce_astro-0.7a1/pyreduce/instruments/neid.yaml +61 -0
  49. pyreduce_astro-0.7/pyreduce/instruments/NIRSPEC/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/nirspec.py +13 -13
  50. pyreduce_astro-0.7/pyreduce/instruments/NIRSPEC/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/nirspec.yaml +1 -1
  51. pyreduce_astro-0.7/pyreduce/instruments/NTE/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/nte.py +9 -7
  52. pyreduce_astro-0.7/pyreduce/instruments/NTE/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/nte.yaml +1 -1
  53. pyreduce_astro-0.7/pyreduce/instruments/UVES/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/uves.py +13 -10
  54. pyreduce_astro-0.7/pyreduce/instruments/UVES/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/uves.yaml +2 -2
  55. pyreduce_astro-0.7/pyreduce/instruments/XSHOOTER/__init__.py → pyreduce_astro-0.7a1/pyreduce/instruments/xshooter.py +8 -6
  56. pyreduce_astro-0.7/pyreduce/instruments/XSHOOTER/config.yaml → pyreduce_astro-0.7a1/pyreduce/instruments/xshooter.yaml +3 -3
  57. pyreduce_astro-0.7a1/pyreduce/make_shear.py +607 -0
  58. pyreduce_astro-0.7a1/pyreduce/masks/mask_crires_plus_det1.fits.gz +0 -0
  59. pyreduce_astro-0.7a1/pyreduce/masks/mask_crires_plus_det2.fits.gz +0 -0
  60. pyreduce_astro-0.7a1/pyreduce/masks/mask_crires_plus_det3.fits.gz +0 -0
  61. pyreduce_astro-0.7a1/pyreduce/masks/mask_ctio_chiron.fits.gz +0 -0
  62. pyreduce_astro-0.7a1/pyreduce/masks/mask_elodie.fits.gz +0 -0
  63. pyreduce_astro-0.7a1/pyreduce/masks/mask_feros3.fits.gz +0 -0
  64. pyreduce_astro-0.7a1/pyreduce/masks/mask_flames_giraffe.fits.gz +0 -0
  65. pyreduce_astro-0.7a1/pyreduce/masks/mask_harps_blue.fits.gz +0 -0
  66. pyreduce_astro-0.7a1/pyreduce/masks/mask_harps_red.fits.gz +0 -0
  67. pyreduce_astro-0.7a1/pyreduce/masks/mask_hds_blue.fits.gz +0 -0
  68. pyreduce_astro-0.7a1/pyreduce/masks/mask_hds_red.fits.gz +0 -0
  69. pyreduce_astro-0.7a1/pyreduce/masks/mask_het_hrs_2x5.fits.gz +0 -0
  70. pyreduce_astro-0.7/pyreduce/instruments/JWST_MIRI/mask_lrs_slitless.fits.gz → pyreduce_astro-0.7a1/pyreduce/masks/mask_jwst_miri_lrs_slitless.fits.gz +0 -0
  71. pyreduce_astro-0.7/pyreduce/instruments/JWST_NIRISS/mask_gr700xd.fits.gz → pyreduce_astro-0.7a1/pyreduce/masks/mask_jwst_niriss_gr700xd.fits.gz +0 -0
  72. pyreduce_astro-0.7/pyreduce/instruments/LICK_APF/mask_.fits.gz → pyreduce_astro-0.7a1/pyreduce/masks/mask_lick_apf_.fits.gz +0 -0
  73. pyreduce_astro-0.7a1/pyreduce/masks/mask_mcdonald.fits.gz +0 -0
  74. pyreduce_astro-0.7a1/pyreduce/masks/mask_nes.fits.gz +0 -0
  75. pyreduce_astro-0.7a1/pyreduce/masks/mask_nirspec_nirspec.fits.gz +0 -0
  76. pyreduce_astro-0.7a1/pyreduce/masks/mask_sarg.fits.gz +0 -0
  77. pyreduce_astro-0.7a1/pyreduce/masks/mask_sarg_2x2a.fits.gz +0 -0
  78. pyreduce_astro-0.7a1/pyreduce/masks/mask_sarg_2x2b.fits.gz +0 -0
  79. pyreduce_astro-0.7a1/pyreduce/masks/mask_subaru_hds_red.fits.gz +0 -0
  80. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_blue.fits.gz +0 -0
  81. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_blue_binned_2_2.fits.gz +0 -0
  82. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_middle.fits.gz +0 -0
  83. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_middle_2x2_split.fits.gz +0 -0
  84. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_middle_binned_2_2.fits.gz +0 -0
  85. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_red.fits.gz +0 -0
  86. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_red_2x2.fits.gz +0 -0
  87. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_red_2x2_split.fits.gz +0 -0
  88. pyreduce_astro-0.7a1/pyreduce/masks/mask_uves_red_binned_2_2.fits.gz +0 -0
  89. pyreduce_astro-0.7/pyreduce/instruments/XSHOOTER/mask_nir.fits.gz → pyreduce_astro-0.7a1/pyreduce/masks/mask_xshooter_nir.fits.gz +0 -0
  90. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/pipeline.py +57 -273
  91. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/rectify.py +22 -22
  92. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/reduce.py +236 -713
  93. pyreduce_astro-0.7a1/pyreduce/settings/settings_AJ.json +19 -0
  94. pyreduce_astro-0.7a1/pyreduce/settings/settings_ANDES.json +89 -0
  95. pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_CRIRES_PLUS.json +18 -21
  96. pyreduce_astro-0.7/pyreduce/instruments/NEID/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_HARPN.json +18 -16
  97. pyreduce_astro-0.7/pyreduce/instruments/HARPS/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_HARPS.json +10 -12
  98. pyreduce_astro-0.7/pyreduce/instruments/JWST_MIRI/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_JWST_MIRI.json +10 -18
  99. pyreduce_astro-0.7/pyreduce/instruments/JWST_NIRISS/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_JWST_NIRISS.json +9 -17
  100. pyreduce_astro-0.7/pyreduce/instruments/LICK_APF/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_LICK_APF.json +20 -29
  101. pyreduce_astro-0.7/pyreduce/instruments/MCDONALD/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_MCDONALD.json +11 -22
  102. pyreduce_astro-0.7/pyreduce/instruments/METIS_IFU/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_METIS_IFU.json +17 -16
  103. pyreduce_astro-0.7a1/pyreduce/settings/settings_METIS_LSS.json +77 -0
  104. pyreduce_astro-0.7/pyreduce/instruments/MICADO/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_MICADO.json +18 -17
  105. pyreduce_astro-0.7a1/pyreduce/settings/settings_NEID.json +73 -0
  106. pyreduce_astro-0.7/pyreduce/instruments/NIRSPEC/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_NIRSPEC.json +9 -17
  107. pyreduce_astro-0.7/pyreduce/instruments/NTE/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_NTE.json +18 -18
  108. pyreduce_astro-0.7/pyreduce/instruments/UVES/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_UVES.json +15 -19
  109. pyreduce_astro-0.7/pyreduce/instruments/XSHOOTER/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_XSHOOTER.json +18 -18
  110. pyreduce_astro-0.7/pyreduce/instruments/defaults/settings.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_pyreduce.json +27 -27
  111. pyreduce_astro-0.7/pyreduce/instruments/defaults/schema.json → pyreduce_astro-0.7a1/pyreduce/settings/settings_schema.json +159 -81
  112. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/tools/combine.py +0 -1
  113. pyreduce_astro-0.7a1/pyreduce/trace.py +979 -0
  114. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/util.py +8 -53
  115. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/wavelength_calibration.py +2 -6
  116. pyreduce_astro-0.7/.gitattributes +0 -1
  117. pyreduce_astro-0.7/.pre-commit-config.yaml +0 -33
  118. pyreduce_astro-0.7/.python-version +0 -1
  119. pyreduce_astro-0.7/.readthedocs.yaml +0 -25
  120. pyreduce_astro-0.7/AGENTS.md +0 -1
  121. pyreduce_astro-0.7/ANDES_plan.md +0 -182
  122. pyreduce_astro-0.7/CHANGELOG.md +0 -252
  123. pyreduce_astro-0.7/CLAUDE.md +0 -356
  124. pyreduce_astro-0.7/WhatsNew.md +0 -78
  125. pyreduce_astro-0.7/examples/andes_yjh_example.py +0 -112
  126. pyreduce_astro-0.7/examples/crires_plus_example.py +0 -52
  127. pyreduce_astro-0.7/examples/custom_instrument_example.py +0 -80
  128. pyreduce_astro-0.7/examples/debug_single_swath.py +0 -233
  129. pyreduce_astro-0.7/examples/harpn_example.py +0 -48
  130. pyreduce_astro-0.7/examples/harps_example.py +0 -51
  131. pyreduce_astro-0.7/examples/harps_gridsearch.py +0 -114
  132. pyreduce_astro-0.7/examples/just_one_swath.py +0 -127
  133. pyreduce_astro-0.7/examples/jwst_miri_example.py +0 -46
  134. pyreduce_astro-0.7/examples/jwst_niriss_example.py +0 -46
  135. pyreduce_astro-0.7/examples/lick_apf_example.py +0 -46
  136. pyreduce_astro-0.7/examples/mcdonald_example.py +0 -57
  137. pyreduce_astro-0.7/examples/metis_ifu_example.py +0 -52
  138. pyreduce_astro-0.7/examples/metis_lss_example.py +0 -52
  139. pyreduce_astro-0.7/examples/micado_example.py +0 -72
  140. pyreduce_astro-0.7/examples/mosaic_nir.py +0 -96
  141. pyreduce_astro-0.7/examples/mosaic_preset-slitfunc.py +0 -141
  142. pyreduce_astro-0.7/examples/mosaic_vis.py +0 -92
  143. pyreduce_astro-0.7/examples/neid_example.py +0 -65
  144. pyreduce_astro-0.7/examples/nirspec_example.py +0 -50
  145. pyreduce_astro-0.7/examples/toes_example.py +0 -163
  146. pyreduce_astro-0.7/examples/uves_callfunc.py +0 -183
  147. pyreduce_astro-0.7/examples/uves_example.py +0 -50
  148. pyreduce_astro-0.7/examples/xshooter_example.py +0 -58
  149. pyreduce_astro-0.7/pyreduce/__main__.py +0 -513
  150. pyreduce_astro-0.7/pyreduce/clib/build_extract.py +0 -80
  151. pyreduce_astro-0.7/pyreduce/datasets.py +0 -190
  152. pyreduce_astro-0.7/pyreduce/instruments/ANDES_YJH/__init__.py +0 -14
  153. pyreduce_astro-0.7/pyreduce/instruments/ANDES_YJH/config.yaml +0 -122
  154. pyreduce_astro-0.7/pyreduce/instruments/ANDES_YJH/order_centers_h.yaml +0 -9
  155. pyreduce_astro-0.7/pyreduce/instruments/ANDES_YJH/order_centers_j.yaml +0 -21
  156. pyreduce_astro-0.7/pyreduce/instruments/ANDES_YJH/order_centers_y.yaml +0 -9
  157. pyreduce_astro-0.7/pyreduce/instruments/ANDES_YJH/settings.json +0 -24
  158. pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/__init__.py +0 -116
  159. pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/mask_det1.fits.gz +0 -0
  160. pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/mask_det2.fits.gz +0 -0
  161. pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/mask_det3.fits.gz +0 -0
  162. pyreduce_astro-0.7/pyreduce/instruments/HARPN/settings.json +0 -21
  163. pyreduce_astro-0.7/pyreduce/instruments/HARPN/wavecal_harpn_fibB_2D.npz +0 -0
  164. pyreduce_astro-0.7/pyreduce/instruments/HARPS/mask_blue.fits.gz +0 -0
  165. pyreduce_astro-0.7/pyreduce/instruments/HARPS/mask_red.fits.gz +0 -0
  166. pyreduce_astro-0.7/pyreduce/instruments/MCDONALD/mask.fits.gz +0 -0
  167. pyreduce_astro-0.7/pyreduce/instruments/METIS_LSS/settings.json +0 -4
  168. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/__init__.py +0 -38
  169. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/bundle_centers_nir.yaml +0 -92
  170. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/bundle_centers_vis1.yaml +0 -69
  171. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/bundle_centers_vis2.yaml +0 -72
  172. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/bundle_centers_vis3.yaml +0 -87
  173. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/bundle_centers_vis4.yaml +0 -87
  174. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/config.yaml +0 -61
  175. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/mask_nir.fits.gz +0 -0
  176. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/mosaic_fiber_positions.npz +0 -0
  177. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/settings.json +0 -25
  178. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/settings_VIS1.json +0 -22
  179. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/settings_VIS2.json +0 -4
  180. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/settings_VIS3.json +0 -4
  181. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/settings_VIS4.json +0 -4
  182. pyreduce_astro-0.7/pyreduce/instruments/MOSAIC/settings_nir.json +0 -21
  183. pyreduce_astro-0.7/pyreduce/instruments/NEID/__init__.py +0 -128
  184. pyreduce_astro-0.7/pyreduce/instruments/NEID/config.yaml +0 -60
  185. pyreduce_astro-0.7/pyreduce/instruments/NIRSPEC/mask_nirspec.fits.gz +0 -0
  186. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_blue.fits.gz +0 -0
  187. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_blue_binned_2_2.fits.gz +0 -0
  188. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_middle.fits.gz +0 -0
  189. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_middle_2x2_split.fits.gz +0 -0
  190. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_middle_binned_2_2.fits.gz +0 -0
  191. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_red.fits.gz +0 -0
  192. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_red_2x2.fits.gz +0 -0
  193. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_red_2x2_split.fits.gz +0 -0
  194. pyreduce_astro-0.7/pyreduce/instruments/UVES/mask_red_binned_2_2.fits.gz +0 -0
  195. pyreduce_astro-0.7/pyreduce/slit_curve.py +0 -671
  196. pyreduce_astro-0.7/pyreduce/trace.py +0 -1882
  197. pyreduce_astro-0.7/tools/argon.line +0 -133
  198. pyreduce_astro-0.7/tools/bpm_creator.py +0 -123
  199. pyreduce_astro-0.7/tools/create_wavelength_guess.py +0 -530
  200. pyreduce_astro-0.7/tools/download_files.py +0 -84
  201. pyreduce_astro-0.7/tools/ipy_startup.py +0 -19
  202. pyreduce_astro-0.7/tools/make_notebook.py +0 -47
  203. pyreduce_astro-0.7/tools/mosaic_vis_bundle_plot.py +0 -66
  204. pyreduce_astro-0.7/tools/neon.lin +0 -4180
  205. pyreduce_astro-0.7/tools/neon.line +0 -477
  206. pyreduce_astro-0.7/tools/plot_1d_vs_2d_extraction.py +0 -162
  207. pyreduce_astro-0.7/tools/plot_swath_debug.py +0 -64
  208. pyreduce_astro-0.7/tools/pymultispec.py +0 -267
  209. pyreduce_astro-0.7/tools/thar.npz +0 -0
  210. pyreduce_astro-0.7/tools/wavecal_creator.py +0 -28
  211. pyreduce_astro-0.7/tools/wavecal_creator_from_existing.py +0 -103
  212. pyreduce_astro-0.7/tools/xshooter_nir.json +0 -74
  213. pyreduce_astro-0.7/uv.lock +0 -2138
  214. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/LICENSE +0 -0
  215. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/hatch_build.py +0 -0
  216. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/__init__.py +0 -0
  217. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/clib/__init__.py +0 -0
  218. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/clib/slit_func_bd.h +0 -0
  219. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/clipnflip.py +0 -0
  220. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/echelle.py +0 -0
  221. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/instruments/__init__.py +0 -0
  222. /pyreduce_astro-0.7/pyreduce/instruments/defaults/config.yaml → /pyreduce_astro-0.7a1/pyreduce/instruments/common.yaml +0 -0
  223. {pyreduce_astro-0.7 → pyreduce_astro-0.7a1}/pyreduce/tools/__init__.py +0 -0
  224. /pyreduce_astro-0.7/pyreduce/instruments/MICADO/wavecal_HK_3arcsec_chip5.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/MICADO_HK_3arcsec_chip5.npz +0 -0
  225. {pyreduce_astro-0.7/pyreduce/instruments/defaults → pyreduce_astro-0.7a1/pyreduce/wavecal}/atlas/thar.fits +0 -0
  226. {pyreduce_astro-0.7/pyreduce/instruments/defaults → pyreduce_astro-0.7a1/pyreduce/wavecal}/atlas/thar_list.txt +0 -0
  227. {pyreduce_astro-0.7/pyreduce/instruments/defaults → pyreduce_astro-0.7a1/pyreduce/wavecal}/atlas/une.fits +0 -0
  228. /pyreduce_astro-0.7/tools/convert_wavecal.py → /pyreduce_astro-0.7a1/pyreduce/wavecal/convert.py +0 -0
  229. /pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/wavecal_J1228_det1.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/crires_plus_J1228_Open_det1.npz +0 -0
  230. /pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/wavecal_J1228_det2.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/crires_plus_J1228_Open_det2.npz +0 -0
  231. /pyreduce_astro-0.7/pyreduce/instruments/CRIRES_PLUS/wavecal_J1228_det3.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/crires_plus_J1228_Open_det3.npz +0 -0
  232. /pyreduce_astro-0.7/pyreduce/instruments/HARPN/wavecal_harpn_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/harpn_harpn_2D.npz +0 -0
  233. /pyreduce_astro-0.7/pyreduce/instruments/HARPS/wavecal_blue_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/harps_blue_2D.npz +0 -0
  234. /pyreduce_astro-0.7/pyreduce/instruments/HARPS/wavecal_blue_pol_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/harps_blue_pol_2D.npz +0 -0
  235. /pyreduce_astro-0.7/pyreduce/instruments/HARPS/wavecal_red_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/harps_red_2D.npz +0 -0
  236. /pyreduce_astro-0.7/pyreduce/instruments/HARPS/wavecal_red_pol_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/harps_red_pol_2D.npz +0 -0
  237. /pyreduce_astro-0.7/pyreduce/instruments/MCDONALD/wavecal.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/mcdonald.npz +0 -0
  238. /pyreduce_astro-0.7/pyreduce/instruments/METIS_LSS/wavecal_l_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/metis_lss_l_2D.npz +0 -0
  239. /pyreduce_astro-0.7/pyreduce/instruments/METIS_LSS/wavecal_m_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/metis_lss_m_2D.npz +0 -0
  240. /pyreduce_astro-0.7/pyreduce/instruments/NIRSPEC/wavecal_K2.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/nirspec_K2.npz +0 -0
  241. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_blue_360nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_blue_360nm_2D.npz +0 -0
  242. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_blue_390nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_blue_390nm_2D.npz +0 -0
  243. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_blue_437nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_blue_437nm_2D.npz +0 -0
  244. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_middle_2x2_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_middle_2x2_2D.npz +0 -0
  245. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_middle_565nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_middle_565nm_2D.npz +0 -0
  246. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_middle_580nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_middle_580nm_2D.npz +0 -0
  247. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_middle_600nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_middle_600nm_2D.npz +0 -0
  248. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_middle_665nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_middle_665nm_2D.npz +0 -0
  249. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_middle_860nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_middle_860nm_2D.npz +0 -0
  250. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_red_580nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_red_580nm_2D.npz +0 -0
  251. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_red_600nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_red_600nm_2D.npz +0 -0
  252. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_red_665nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_red_665nm_2D.npz +0 -0
  253. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_red_760nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_red_760nm_2D.npz +0 -0
  254. /pyreduce_astro-0.7/pyreduce/instruments/UVES/wavecal_red_860nm_2D.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/uves_red_860nm_2D.npz +0 -0
  255. /pyreduce_astro-0.7/pyreduce/instruments/XSHOOTER/wavecal_nir.npz → /pyreduce_astro-0.7a1/pyreduce/wavecal/xshooter_nir.npz +0 -0
@@ -20,7 +20,3 @@ docs/_build/
20
20
  .claude
21
21
  debug/
22
22
  idl/
23
- logs/
24
- *.ipynb
25
- tmp/*
26
- .obsidian/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyreduce-astro
3
- Version: 0.7
3
+ Version: 0.7a1
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
@@ -15,10 +15,12 @@ Classifier: Intended Audience :: Science/Research
15
15
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
16
16
  Classifier: Programming Language :: C
17
17
  Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
18
20
  Classifier: Programming Language :: Python :: 3.13
19
21
  Classifier: Programming Language :: Python :: 3.14
20
22
  Classifier: Topic :: Scientific/Engineering :: Astronomy
21
- Requires-Python: >=3.13
23
+ Requires-Python: >=3.11
22
24
  Requires-Dist: astropy>=5.3.0
23
25
  Requires-Dist: cffi>=1.17.1
24
26
  Requires-Dist: click>=8.1.0
@@ -37,15 +39,20 @@ Requires-Dist: scikit-image>=0.22.0
37
39
  Requires-Dist: scipy>=1.11.0
38
40
  Requires-Dist: spectres>=2.2.0
39
41
  Requires-Dist: tqdm>=4.66.0
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'
40
51
  Description-Content-Type: text/markdown
41
52
 
42
53
  [![CI](https://github.com/ivh/PyReduce/actions/workflows/python-publish.yml/badge.svg)](https://github.com/ivh/PyReduce/actions/workflows/python-publish.yml)
43
54
  [![Documentation Status](https://readthedocs.org/projects/pyreduce-astro/badge/?version=latest)](https://pyreduce-astro.readthedocs.io/en/latest/?badge=latest)
44
- [![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
45
-
46
- # What's new?
47
-
48
- Version 0.7 is a major overhaul with many improvements, please see [WhatsNew.md](WhatsNew.md) for the highlights. If the update breaks your existing setup, you are very welcome to file an issue, so we can assist you.
55
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
49
56
 
50
57
  # PyReduce
51
58
 
@@ -79,11 +86,11 @@ uv sync
79
86
  uv run reduce download UVES
80
87
 
81
88
  # Run reduction
82
- uv run reduce run UVES -t HD132205 --steps bias,flat,trace,science
89
+ uv run reduce run UVES HD132205 --steps bias,flat,orders,science
83
90
 
84
91
  # Or run individual steps
85
- uv run reduce bias UVES -t HD132205
86
- uv run reduce flat UVES -t HD132205
92
+ uv run reduce bias UVES HD132205
93
+ uv run reduce flat UVES HD132205
87
94
  ```
88
95
 
89
96
  Or use the Python API:
@@ -94,28 +101,14 @@ Pipeline.from_instrument(
94
101
  instrument="UVES",
95
102
  target="HD132205",
96
103
  night="2010-04-01",
97
- channel="middle",
104
+ arm="middle",
98
105
  ).run()
99
106
  ```
100
107
 
101
- ## Plotting
102
-
103
- Control plotting with environment variables:
104
-
105
- ```bash
106
- # Save plots to files (headless/CI)
107
- PYREDUCE_PLOT=1 PYREDUCE_PLOT_DIR=/tmp/plots PYREDUCE_PLOT_SHOW=off uv run reduce run ...
108
-
109
- # Show all plots at end (browser via webagg)
110
- MPLBACKEND=webagg PYREDUCE_PLOT=1 PYREDUCE_PLOT_SHOW=defer uv run reduce run ...
111
- ```
112
-
113
- See [How To](https://pyreduce-astro.readthedocs.io/en/latest/howto.html#plot-modes) for details.
114
-
115
108
  ## Documentation
116
109
 
117
110
  Full documentation at [ReadTheDocs](https://pyreduce-astro.readthedocs.io/).
118
111
 
119
112
  ## Output
120
113
 
121
- PyReduce creates `.fits` files (standard FITS with binary table extension). Headers include original keywords plus PyReduce-specific ones prefixed with `e_`.
114
+ PyReduce creates `.ech` files (standard FITS with binary table extension). Headers include original keywords plus PyReduce-specific ones prefixed with `e_`.
@@ -1,10 +1,6 @@
1
1
  [![CI](https://github.com/ivh/PyReduce/actions/workflows/python-publish.yml/badge.svg)](https://github.com/ivh/PyReduce/actions/workflows/python-publish.yml)
2
2
  [![Documentation Status](https://readthedocs.org/projects/pyreduce-astro/badge/?version=latest)](https://pyreduce-astro.readthedocs.io/en/latest/?badge=latest)
3
- [![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
4
-
5
- # What's new?
6
-
7
- Version 0.7 is a major overhaul with many improvements, please see [WhatsNew.md](WhatsNew.md) for the highlights. If the update breaks your existing setup, you are very welcome to file an issue, so we can assist you.
3
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
8
4
 
9
5
  # PyReduce
10
6
 
@@ -38,11 +34,11 @@ uv sync
38
34
  uv run reduce download UVES
39
35
 
40
36
  # Run reduction
41
- uv run reduce run UVES -t HD132205 --steps bias,flat,trace,science
37
+ uv run reduce run UVES HD132205 --steps bias,flat,orders,science
42
38
 
43
39
  # Or run individual steps
44
- uv run reduce bias UVES -t HD132205
45
- uv run reduce flat UVES -t HD132205
40
+ uv run reduce bias UVES HD132205
41
+ uv run reduce flat UVES HD132205
46
42
  ```
47
43
 
48
44
  Or use the Python API:
@@ -53,28 +49,14 @@ Pipeline.from_instrument(
53
49
  instrument="UVES",
54
50
  target="HD132205",
55
51
  night="2010-04-01",
56
- channel="middle",
52
+ arm="middle",
57
53
  ).run()
58
54
  ```
59
55
 
60
- ## Plotting
61
-
62
- Control plotting with environment variables:
63
-
64
- ```bash
65
- # Save plots to files (headless/CI)
66
- PYREDUCE_PLOT=1 PYREDUCE_PLOT_DIR=/tmp/plots PYREDUCE_PLOT_SHOW=off uv run reduce run ...
67
-
68
- # Show all plots at end (browser via webagg)
69
- MPLBACKEND=webagg PYREDUCE_PLOT=1 PYREDUCE_PLOT_SHOW=defer uv run reduce run ...
70
- ```
71
-
72
- See [How To](https://pyreduce-astro.readthedocs.io/en/latest/howto.html#plot-modes) for details.
73
-
74
56
  ## Documentation
75
57
 
76
58
  Full documentation at [ReadTheDocs](https://pyreduce-astro.readthedocs.io/).
77
59
 
78
60
  ## Output
79
61
 
80
- PyReduce creates `.fits` files (standard FITS with binary table extension). Headers include original keywords plus PyReduce-specific ones prefixed with `e_`.
62
+ PyReduce creates `.ech` files (standard FITS with binary table extension). Headers include original keywords plus PyReduce-specific ones prefixed with `e_`.
@@ -1,7 +1,11 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.25.0", "cffi>=1.17.1", "setuptools"]
3
+ build-backend = "hatchling.build"
4
+
1
5
  [project]
2
6
  name = "pyreduce-astro"
3
- version = "0.7"
4
- requires-python = ">=3.13"
7
+ version = "0.7a1"
8
+ requires-python = ">=3.11"
5
9
  description = "A data reduction package for echelle spectrographs"
6
10
  readme = "README.md"
7
11
  authors = [
@@ -19,6 +23,8 @@ classifiers = [
19
23
  "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
20
24
  "Programming Language :: C",
21
25
  "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
22
28
  "Programming Language :: Python :: 3.13",
23
29
  "Programming Language :: Python :: 3.14",
24
30
  "Topic :: Scientific/Engineering :: Astronomy",
@@ -42,25 +48,19 @@ dependencies = [
42
48
  "python-dateutil>=2.8.0",
43
49
  "scikit-image>=0.22.0",
44
50
  "tqdm>=4.66.0",
51
+ "wget>=3.2",
45
52
  "Pillow>=10.0.0",
46
53
  ]
47
54
 
48
- [dependency-groups]
55
+ [project.optional-dependencies]
49
56
  dev = [
50
57
  "ruff>=0.8.0",
51
58
  "pre-commit>=3.5.0",
52
59
  "pytest>=7.4.0",
53
60
  "pytest-cov>=4.1.0",
54
61
  "sphinx>=7.2.0",
55
- "ipython>=9.8.0",
56
- "myst-parser",
57
- "setuptools",
58
- ]
59
- ipynb = [
60
- "ipykernel>=7.1.0",
61
- "jupyter-client>=8.8.0",
62
- "jupytext>=1.18.1",
63
- "nbconvert>=7.16.6",
62
+ "myst-parser>=3.0.0",
63
+ "setuptools", # Required for CFFI compilation in tests (Python 3.12+)
64
64
  ]
65
65
 
66
66
  [project.urls]
@@ -71,19 +71,15 @@ Issues = "https://github.com/ivh/PyReduce/issues"
71
71
 
72
72
  [project.scripts]
73
73
  reduce = "pyreduce.__main__:main"
74
- reduce-build = "pyreduce.clib.build_extract:build"
75
- reduce-clean = "pyreduce.clib.build_extract:clean"
76
-
77
- [build-system]
78
- requires = ["hatchling>=1.25.0", "cffi>=1.17.1", "setuptools"]
79
- build-backend = "hatchling.build"
80
74
 
75
+ # Hatch build configuration
81
76
  [tool.hatch.build]
77
+ packages = ["pyreduce"]
82
78
  exclude = [
83
79
  "/.git",
84
80
  "/.github",
85
81
  "/docs",
86
- "/test",
82
+ "/tests",
87
83
  "*.pyc",
88
84
  "__pycache__",
89
85
  ]
@@ -177,13 +173,13 @@ markers = [
177
173
  ]
178
174
  filterwarnings = [
179
175
  "ignore:The following header keyword is invalid:astropy.utils.exceptions.AstropyUserWarning",
180
- "ignore::astropy.io.fits.verify.VerifyWarning",
176
+ "ignore:Invalid 'BLANK' keyword:astropy.io.fits.verify.VerifyWarning",
181
177
  ]
182
178
 
183
179
  # Coverage configuration
184
180
  [tool.coverage.run]
185
181
  source = ["pyreduce"]
186
- omit = ["*/test/*", "*/test_*.py"]
182
+ omit = ["*/tests/*", "*/test_*.py"]
187
183
 
188
184
  [tool.coverage.report]
189
185
  exclude_lines = [
@@ -197,9 +193,20 @@ exclude_lines = [
197
193
  "@(abc\\.)?abstractmethod",
198
194
  ]
199
195
 
196
+ # Development dependency groups
197
+ [dependency-groups]
198
+ dev = [
199
+ "ruff>=0.8.0",
200
+ "pre-commit>=3.5.0",
201
+ "pytest>=7.4.0",
202
+ "pytest-cov>=4.1.0",
203
+ "sphinx>=7.2.0",
204
+ "ipython>=9.8.0",
205
+ ]
206
+
200
207
  # cibuildwheel configuration for building platform-specific wheels
201
208
  [tool.cibuildwheel]
202
- build = "cp313-* cp314-*"
209
+ build = "cp311-* cp312-* cp313-* cp314-*"
203
210
  skip = "*-musllinux_* *-win32 *-manylinux_i686"
204
211
  test-command = "pytest {project}/test -m unit"
205
212
  test-requires = ["pytest"]
@@ -0,0 +1,206 @@
1
+ """
2
+ PyReduce command-line interface.
3
+
4
+ Usage:
5
+ uv run reduce --help
6
+ uv run reduce run UVES HD132205 --night 2010-04-01
7
+ uv run reduce run UVES HD132205 --steps bias,flat,orders
8
+ uv run reduce bias UVES HD132205
9
+ uv run reduce combine --output combined.fits *.final.fits
10
+ """
11
+
12
+ import click
13
+
14
+ from . import datasets
15
+ from .configuration import get_configuration_for_instrument
16
+ from .reduce import main as reduce_main
17
+ from .tools.combine import combine as tools_combine
18
+
19
+ ALL_STEPS = (
20
+ "bias",
21
+ "flat",
22
+ "orders",
23
+ "curvature",
24
+ "scatter",
25
+ "norm_flat",
26
+ "wavecal_master",
27
+ "wavecal_init",
28
+ "wavecal",
29
+ "freq_comb_master",
30
+ "freq_comb",
31
+ "science",
32
+ "continuum",
33
+ "finalize",
34
+ )
35
+
36
+
37
+ @click.group()
38
+ @click.version_option(package_name="pyreduce-astro")
39
+ def cli():
40
+ """PyReduce - Echelle spectrograph data reduction pipeline."""
41
+ pass
42
+
43
+
44
+ @cli.command()
45
+ @click.argument("instrument")
46
+ @click.argument("target")
47
+ @click.option("--night", "-n", default=None, help="Observation night (YYYY-MM-DD)")
48
+ @click.option("--arm", "-a", default=None, help="Instrument arm/detector")
49
+ @click.option(
50
+ "--steps",
51
+ "-s",
52
+ default=None,
53
+ help="Comma-separated steps to run (default: all)",
54
+ )
55
+ @click.option(
56
+ "--base-dir",
57
+ "-b",
58
+ default=None,
59
+ help="Base directory for data (default: $REDUCE_DATA or ~/REDUCE_DATA)",
60
+ )
61
+ @click.option(
62
+ "--input-dir", "-i", default="raw", help="Input directory relative to base"
63
+ )
64
+ @click.option(
65
+ "--output-dir", "-o", default="reduced", help="Output directory relative to base"
66
+ )
67
+ @click.option(
68
+ "--plot", "-p", default=0, help="Plot level (0=none, 1=save, 2=interactive)"
69
+ )
70
+ @click.option(
71
+ "--order-range",
72
+ default=None,
73
+ help="Order range to process (e.g., '1,21')",
74
+ )
75
+ def run(
76
+ instrument,
77
+ target,
78
+ night,
79
+ arm,
80
+ steps,
81
+ base_dir,
82
+ input_dir,
83
+ output_dir,
84
+ plot,
85
+ order_range,
86
+ ):
87
+ """Run the reduction pipeline.
88
+
89
+ INSTRUMENT: Name of the instrument (e.g., UVES, HARPS, XSHOOTER)
90
+ TARGET: Target star name or regex pattern
91
+ """
92
+ # Parse steps
93
+ if steps:
94
+ steps = tuple(s.strip() for s in steps.split(","))
95
+ else:
96
+ steps = "all"
97
+
98
+ # Parse order range
99
+ if order_range:
100
+ parts = order_range.split(",")
101
+ order_range = (int(parts[0]), int(parts[1]))
102
+
103
+ # Load configuration
104
+ config = get_configuration_for_instrument(instrument)
105
+
106
+ # Run reduction
107
+ reduce_main(
108
+ instrument=instrument,
109
+ target=target,
110
+ night=night,
111
+ arms=arm,
112
+ steps=steps,
113
+ base_dir=base_dir or "",
114
+ input_dir=input_dir,
115
+ output_dir=output_dir,
116
+ configuration=config,
117
+ order_range=order_range,
118
+ plot=plot,
119
+ )
120
+
121
+
122
+ @cli.command()
123
+ @click.argument("files", nargs=-1, required=True)
124
+ @click.option("--output", "-o", default="combined.fits", help="Output filename")
125
+ @click.option("--plot", "-p", default=None, type=int, help="Plot specific order")
126
+ def combine(files, output, plot):
127
+ """Combine multiple reduced spectra.
128
+
129
+ FILES: Input .final.fits files to combine
130
+ """
131
+ tools_combine(list(files), output, plot=plot)
132
+
133
+
134
+ @cli.command()
135
+ @click.argument("instrument")
136
+ def download(instrument):
137
+ """Download sample dataset for an instrument.
138
+
139
+ INSTRUMENT: Name of the instrument (e.g., UVES, HARPS)
140
+ """
141
+ instrument = instrument.upper()
142
+ dataset_func = getattr(datasets, instrument, None)
143
+ if dataset_func is None:
144
+ available = [
145
+ name
146
+ for name in dir(datasets)
147
+ if name.isupper() and not name.startswith("_")
148
+ ]
149
+ raise click.ClickException(
150
+ f"Unknown instrument '{instrument}'. Available: {', '.join(available)}"
151
+ )
152
+ path = dataset_func()
153
+ click.echo(f"Dataset downloaded to: {path}")
154
+
155
+
156
+ @cli.command("list-steps")
157
+ def list_steps():
158
+ """List all available reduction steps."""
159
+ click.echo("Available reduction steps:")
160
+ for step in ALL_STEPS:
161
+ click.echo(f" - {step}")
162
+
163
+
164
+ def make_step_command(step_name):
165
+ """Factory to create a command for a single step."""
166
+
167
+ @click.command(name=step_name)
168
+ @click.argument("instrument")
169
+ @click.argument("target")
170
+ @click.option("--night", "-n", default=None, help="Observation night")
171
+ @click.option("--arm", "-a", default=None, help="Instrument arm")
172
+ @click.option("--base-dir", "-b", default=None, help="Base directory")
173
+ @click.option("--input-dir", "-i", default="raw", help="Input directory")
174
+ @click.option("--output-dir", "-o", default="reduced", help="Output directory")
175
+ @click.option("--plot", "-p", default=0, help="Plot level")
176
+ def cmd(instrument, target, night, arm, base_dir, input_dir, output_dir, plot):
177
+ config = get_configuration_for_instrument(instrument)
178
+ reduce_main(
179
+ instrument=instrument,
180
+ target=target,
181
+ night=night,
182
+ arms=arm,
183
+ steps=(step_name,),
184
+ base_dir=base_dir or "",
185
+ input_dir=input_dir,
186
+ output_dir=output_dir,
187
+ configuration=config,
188
+ plot=plot,
189
+ )
190
+
191
+ cmd.__doc__ = f"Run the '{step_name}' step."
192
+ return cmd
193
+
194
+
195
+ # Register individual step commands
196
+ for _step in ALL_STEPS:
197
+ cli.add_command(make_step_command(_step))
198
+
199
+
200
+ def main():
201
+ """Entry point for the CLI."""
202
+ cli()
203
+
204
+
205
+ if __name__ == "__main__":
206
+ main()
@@ -155,7 +155,7 @@ def trace(instrument: str, files: tuple[str, ...], output: str, mode: str, plot:
155
155
  pipe = Pipeline(inst, output, mode=mode, plot=plot)
156
156
  if file_list:
157
157
  pipe = pipe.flat(file_list)
158
- pipe.trace(file_list).run()
158
+ pipe.trace_orders(file_list).run()
159
159
  click.echo(f"Order trace saved to {output}")
160
160
 
161
161
 
@@ -287,8 +287,8 @@ def run(config_file: str, steps: str, skip_existing: bool, plot: int):
287
287
  pipe = pipe.flat(_expand_globs(files["flat"]))
288
288
 
289
289
  if "trace" in config_steps:
290
- trace_files = files.get("trace") or files.get("flat")
291
- pipe = pipe.trace(_expand_globs(trace_files) if trace_files else None)
290
+ trace_files = files.get("orders") or files.get("flat")
291
+ pipe = pipe.trace_orders(_expand_globs(trace_files) if trace_files else None)
292
292
 
293
293
  if "scatter" in config_steps:
294
294
  pipe = pipe.scatter()
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env python3
2
+ """Builds the C library that contains the extraction algorithm
3
+
4
+ This module prepares and builds the C libary containing the curved
5
+ (and vertical) extraction algorithm using CFFI.
6
+ It also prepares the ffibuilder objects for setup.py,
7
+ so that the library is compiled on installation.
8
+
9
+
10
+ The user can also call the Module as a script to compile the
11
+ C libraries again.
12
+
13
+ Attributes
14
+ ----------
15
+ ffi_builder_vertical : FFI
16
+ CFFI Builder for the vertical extraction algorithm
17
+ ffi_builder_curved : FFI
18
+ CFFI Builder for the curved extraction algorithm
19
+ """
20
+
21
+ import logging
22
+ import os
23
+
24
+ from cffi import FFI
25
+
26
+ logger = logging.getLogger(__name__)
27
+
28
+
29
+ CWD = os.path.dirname(__file__)
30
+ CWD = os.path.abspath(CWD)
31
+ release_path = os.path.join(CWD, "Release")
32
+
33
+ print("Include dir: ", CWD)
34
+ print("Release dir: ", release_path)
35
+
36
+
37
+ ffibuilder_vertical = FFI()
38
+ with open(os.path.join(CWD, "slit_func_bd.h")) as f:
39
+ ffibuilder_vertical.cdef(f.read())
40
+ with open(os.path.join(CWD, "slit_func_bd.c")) as f:
41
+ ffibuilder_vertical.set_source(
42
+ "_slitfunc_bd",
43
+ f.read(),
44
+ include_dirs=[CWD, release_path],
45
+ depends=["slit_func_bd.h"],
46
+ )
47
+
48
+ ffibuilder_curved = FFI()
49
+ with open(os.path.join(CWD, "slit_func_2d_xi_zeta_bd.h")) as f:
50
+ ffibuilder_curved.cdef(f.read())
51
+ with open(os.path.join(CWD, "slit_func_2d_xi_zeta_bd.c")) as f:
52
+ ffibuilder_curved.set_source(
53
+ "_slitfunc_2d",
54
+ f.read(),
55
+ include_dirs=[CWD, release_path],
56
+ depends=["slit_func_2d_xi_zeta_bd.h"],
57
+ )
58
+
59
+
60
+ def build():
61
+ """Builds the C slitfunc library"""
62
+ logger.info("Building required C libraries, this might take a few seconds")
63
+
64
+ old_cwd = os.getcwd()
65
+ path = os.path.abspath(CWD)
66
+ os.chdir(path)
67
+
68
+ ffibuilder_vertical.compile(verbose=True, debug=False)
69
+ ffibuilder_curved.compile(verbose=True, debug=False)
70
+
71
+ os.chdir(old_cwd)
72
+
73
+
74
+ if __name__ == "__main__": # pragma: no cover
75
+ build()