pyreduce-astro 0.6.0b2__py3-none-any.whl → 0.6.0b3__py3-none-any.whl

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/__init__.py CHANGED
@@ -60,6 +60,7 @@ def __getattr__(name):
60
60
  """Lazy load submodules on first access."""
61
61
  if name in ("configuration", "datasets", "reduce", "util"):
62
62
  import importlib
63
+
63
64
  module = importlib.import_module(f".{name}", __name__)
64
65
  globals()[name] = module
65
66
  return module
pyreduce/extract.py CHANGED
@@ -405,6 +405,8 @@ def fix_column_range(column_range, orders, extraction_width, nrow, ncol):
405
405
  -------
406
406
  column_range : array[nord, 2]
407
407
  updated column range
408
+ orders : array[nord, degree]
409
+ order tracing coefficients (may have rows removed if no valid pixels)
408
410
  """
409
411
 
410
412
  ix = np.arange(ncol)
@@ -426,7 +428,7 @@ def fix_column_range(column_range, orders, extraction_width, nrow, ncol):
426
428
 
427
429
  if len(points_in_image) == 0:
428
430
  # print(y_bot, y_top,nrow, ncol, points_in_image)
429
- logger.warn(
431
+ logger.warning(
430
432
  f"No pixels are completely within the extraction width for order {i}, removing it."
431
433
  )
432
434
  to_remove += [i]
@@ -452,9 +454,9 @@ def fix_column_range(column_range, orders, extraction_width, nrow, ncol):
452
454
  column_range[0] = column_range[1]
453
455
  column_range[-1] = column_range[-2]
454
456
 
455
- for i in to_remove:
456
- np.delete(column_range, i, axis=0)
457
- np.delete(orders, i, axis=0)
457
+ if to_remove:
458
+ column_range = np.delete(column_range, to_remove, axis=0)
459
+ orders = np.delete(orders, to_remove, axis=0)
458
460
 
459
461
  return column_range, orders
460
462
 
@@ -8,8 +8,10 @@
8
8
  "date_format": "fits",
9
9
  "id_mode": "ESO INS MODE",
10
10
  "id_band": "ESO INS WLEN ID",
11
+ "id_decker": "ESO INS OPTI8 ID",
11
12
  "id_lamp": "ESO INS1 LAMP? ID",
12
13
  "modes": ["SL", "IFU"],
14
+ "deckers": ["Open", "pos1", "pos2"],
13
15
  "bands": ["UBV", "RIZ", "YJH", "K"],
14
16
  "settings": ["B", "V", "R", "IZ", "Y", "J", "H", "K"],
15
17
  "chips": ["det1"],
@@ -45,8 +45,10 @@ class ANDES(Instrument):
45
45
  return modes
46
46
 
47
47
  def parse_mode(self, mode):
48
- pattern = r"([YJHKLM]\d{4})(_(Open|pos1|pos2))?_det(\d)"
48
+ pattern = r"([A-Z]+)(_(Open|pos1|pos2))?_det(\d)"
49
49
  match = re.match(pattern, mode, flags=re.IGNORECASE)
50
+ if not match:
51
+ raise ValueError(f"Invalid mode format: {mode}")
50
52
  band = match.group(1).upper()
51
53
  if match.group(3) is not None:
52
54
  decker = match.group(3).lower().capitalize()
pyreduce/reduce.py CHANGED
@@ -562,7 +562,7 @@ class Bias(Step):
562
562
  hdus.writeto(
563
563
  self.savefile,
564
564
  overwrite=True,
565
- output_verify="fix", # "silentfix+ignore",
565
+ output_verify="silentfix+ignore",
566
566
  )
567
567
  logger.info("Created master bias file: %s", self.savefile)
568
568
 
@@ -0,0 +1,89 @@
1
+ {
2
+ "__instrument__": "ANDES",
3
+ "instrument": {},
4
+ "bias": {
5
+ "degree": 1
6
+ },
7
+ "flat": {
8
+ "bias_scaling": "exposure_time"
9
+ },
10
+ "orders": {
11
+ "degree": 3,
12
+ "degree_before_merge": 1,
13
+ "filter_size": 100,
14
+ "min_cluster": 200000,
15
+ "border_width": 0,
16
+ "noise": 0,
17
+ "manual": false,
18
+ "auto_merge_threshold": 1,
19
+ "merge_min_threshold": 0.9,
20
+ "bias_scaling": "exposure_time"
21
+ },
22
+ "scatter": {
23
+ "extraction_width": 0.45,
24
+ "border_width": 50,
25
+ "bias_scaling": "exposure_time"
26
+ },
27
+ "norm_flat": {
28
+ "smooth_slitfunction": 2,
29
+ "smooth_spectrum": 0,
30
+ "extraction_width": 100,
31
+ "oversampling": 12,
32
+ "swath_width": 200,
33
+ "threshold": 1000
34
+ },
35
+ "wavecal_master": {
36
+ "extraction_method": "optimal",
37
+ "extraction_width": 100,
38
+ "oversampling": 5,
39
+ "swath_width": 2000,
40
+ "smooth_slitfunction": 1,
41
+ "smooth_spectrum": 1e-7,
42
+ "extraction_cutoff": 20,
43
+ "bias_scaling": "exposure_time"
44
+ },
45
+ "wavecal_init": {
46
+ "element": "UNe",
47
+ "medium": "vac",
48
+ "cutoff": 5,
49
+ "smoothing": 1
50
+ },
51
+ "wavecal": {
52
+ "threshold": 100,
53
+ "closing": 0,
54
+ "dimensionality": "2D",
55
+ "element": null,
56
+ "degree": [5,5],
57
+ "manual": false
58
+ },
59
+ "freq_comb_master": {
60
+ "extraction_width": 10,
61
+ "bias_scaling": "exposure_time"
62
+ },
63
+ "freq_comb": {
64
+ "threshold": 100,
65
+ "dimensionality": "2D",
66
+ "degree": [8, 8]
67
+ },
68
+ "curvature": {
69
+ "peak_threshold": 1,
70
+ "window_width": 15,
71
+ "extraction_width": 100,
72
+ "dimensionality": "2D",
73
+ "degree": [
74
+ 1,
75
+ 1
76
+ ],
77
+ "curv_degree": 1,
78
+ "peak_function": "lorentzian",
79
+ "bias_scaling": "exposure_time"
80
+ },
81
+ "science": {
82
+ "oversampling": 1,
83
+ "extraction_width": 10,
84
+ "swath_width": 300,
85
+ "smooth_slitfunction": 0.1,
86
+ "smooth_spectrum": 0,
87
+ "bias_scaling": "exposure_time"
88
+ }
89
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyreduce-astro
3
- Version: 0.6.0b2
3
+ Version: 0.6.0b3
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.readthedocs.io
@@ -41,6 +41,7 @@ Requires-Dist: pre-commit>=3.5.0; extra == 'dev'
41
41
  Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
42
42
  Requires-Dist: pytest>=7.4.0; extra == 'dev'
43
43
  Requires-Dist: ruff>=0.8.0; extra == 'dev'
44
+ Requires-Dist: setuptools; extra == 'dev'
44
45
  Requires-Dist: sphinx>=7.2.0; extra == 'dev'
45
46
  Description-Content-Type: text/markdown
46
47
 
@@ -1,4 +1,4 @@
1
- pyreduce/__init__.py,sha256=dA7KPdGmKFRPu5B-FOnslWTQLHVEkZlO0hySwWh_AGY,1729
1
+ pyreduce/__init__.py,sha256=MgaO38bC9mwKHkrcAu5cyRHyfSMbCbYKy635-GDZyyo,1730
2
2
  pyreduce/__main__.py,sha256=x59nq52i35-56M-4crL97XNnpCsMD6HwbWwUni4SXfI,3095
3
3
  pyreduce/clipnflip.py,sha256=yL_ESobmpVopzEG_jGXeXu63MKnQGSyEW1uAGl7inFE,5557
4
4
  pyreduce/combine_frames.py,sha256=xPG-k_Z5Bf7bL6Io3OuHHlsVVlb95wU-QKggXB7RpJo,29196
@@ -8,25 +8,25 @@ pyreduce/cwrappers.py,sha256=_LHLMxPvWDigkcgJIY-U1_NY021ElK9VyN6vrHYnPuw,13590
8
8
  pyreduce/datasets.py,sha256=RpP9kSGDlih0jvXvz6ab8Otad74IzmGW5Q44wwa3mPc,5105
9
9
  pyreduce/echelle.py,sha256=JgSex9nW3pl9h73qy8jcr0rE6FEK_O9oVjn8HfceHoo,12275
10
10
  pyreduce/estimate_background_scatter.py,sha256=QVY1kpqirdZQr_tKWhbVocX2LnvDkVj30iAz7hQRpy0,3871
11
- pyreduce/extract.py,sha256=K8e_XMRtw7CEQHDFZ-0vvqvNBTkB64yrhKlzx6Dy0uY,44883
11
+ pyreduce/extract.py,sha256=wDj3l-P8UCaM4KqM1yyQTRWqrB69Q8uQerU-0EIoVh8,45031
12
12
  pyreduce/extraction_width.py,sha256=71_wRtXJ5WaCR48WWemGS-FgDtrFCf1HGIPQskT3LI0,2308
13
13
  pyreduce/make_shear.py,sha256=hIiNKBkAgUiT29lO9xT5KA2PwCmE75J7ToeZYB8GFtw,20129
14
14
  pyreduce/rectify.py,sha256=2l8h8tU0dFD4uv5o4SlqrrIIxVj-RU2Q4aQj7yRNvkk,5025
15
- pyreduce/reduce.py,sha256=A8icegJtJyqAbM4Oj2_hQe1Gvmysz6V4sXQcESSM-vc,76294
15
+ pyreduce/reduce.py,sha256=smXUX89Ta9NnSFNR7EcUyDo8fckj3v6q0aDV2VfglQQ,76284
16
16
  pyreduce/trace_orders.py,sha256=DxSvWA2rMjxYhyxwtF1AFmKcUGarsZ0ic0Sq-gqMExg,20672
17
17
  pyreduce/util.py,sha256=xu41l56zMVjuP9129dU45L05UHGXph9DtpIdUyB7VYY,37188
18
18
  pyreduce/wavelength_calibration.py,sha256=GNHTOUoGjk5l0TJ7ggaPX5fxZLBPJxuXEjcV3sTJuRs,68564
19
19
  pyreduce/clib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- pyreduce/clib/_slitfunc_2d.cpython-313-darwin.so,sha256=DI56HNhl66l-r3_8X_O8tKORd_C3SRUGat_FqZh9IF8,69872
21
- pyreduce/clib/_slitfunc_bd.cpython-313-darwin.so,sha256=mJxoOp_7M9DguObQkClGAM-_iREQOH4BkDKHOrPseC8,52240
20
+ pyreduce/clib/_slitfunc_2d.cpython-313-darwin.so,sha256=Ea6I-KFM2rbdnNcu3Jaq3rPChevnoMcpy5rFLmL6D0k,69872
21
+ pyreduce/clib/_slitfunc_bd.cpython-313-darwin.so,sha256=jBann6sSRkp97jEMgx9ZFViaOIMA1NdmGdo4Mu8CAt4,52240
22
22
  pyreduce/clib/build_extract.py,sha256=Jf1nqWUIR_fnlnUrwpiWJd-sNP6Yq2WZPC5mKqCOUbY,1945
23
23
  pyreduce/clib/slit_func_2d_xi_zeta_bd.c,sha256=o_R_3hq0tX2ZdaCRxJjY2mXQf4RaYENcVKVn2OZR_Rk,51279
24
24
  pyreduce/clib/slit_func_2d_xi_zeta_bd.h,sha256=vQkOPIzNzOa32D-iW1_qoQDp4jtaKjSHUYCiDMIIcq4,1512
25
25
  pyreduce/clib/slit_func_bd.c,sha256=i_nLyO-5PDZdNZyJKUk3oR_tCYZqVsYKrvQmhwQBxTg,11466
26
26
  pyreduce/clib/slit_func_bd.h,sha256=Dx9dBmk4xYiqK44Ak5lxI9JJTkxagKdKa-rOItiTpCE,1326
27
27
  pyreduce/instruments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- pyreduce/instruments/andes.json,sha256=7qVfw54J3f95JGNkVF0NSWafST-Yp-OMWNgu3rqttgw,1826
29
- pyreduce/instruments/andes.py,sha256=J5G_-D659FHSrDiQf12Rn2gjddXZqCYtEHJDzYsvOr4,3363
28
+ pyreduce/instruments/andes.json,sha256=sk3pIuYYdty6r8_ihbTuJXpFAw2ZOLP5wUWLFESYBZs,1904
29
+ pyreduce/instruments/andes.py,sha256=0Z9lACgBPI8KT7bRE_m_daqQzzfl6GcZVud6_hZGClk,3439
30
30
  pyreduce/instruments/common.json,sha256=ypTnKwF5ZT629RUwJa4zXQuBH5DXk2asSGcttQHwzGM,1134
31
31
  pyreduce/instruments/common.py,sha256=IE7R67gWA2BFRzu_akdqkUpC6scvoK0A2_hEsOES3E4,22316
32
32
  pyreduce/instruments/crires_plus.json,sha256=6WBw8hOkYvvAftxrC31tKHFKd5gUsmOAhctfgh-b1cI,2137
@@ -94,6 +94,7 @@ pyreduce/masks/mask_uves_red_2x2.fits.gz,sha256=rE-DhRuGKshYFpmjYDO9H6_7JHOb4GGU
94
94
  pyreduce/masks/mask_uves_red_2x2_split.fits.gz,sha256=dJ7XlP_VHF_s6mlaG-vFc4o9mhlt29B6lLpkRb085jM,9959
95
95
  pyreduce/masks/mask_uves_red_binned_2_2.fits.gz,sha256=rKmu5FQx2H-h7PDRg36sQJd20kVfiz4igP-5nqy32tE,13277
96
96
  pyreduce/masks/mask_xshooter_nir.fits.gz,sha256=ZyG6yKkYLb3FnOWlmTvbKzjEhv2PctvBGyq2TkfuiF4,28155
97
+ pyreduce/settings/settings_ANDES.json,sha256=ej6Kx2fLFvGGiSoWzJvYsw15bcfnKLeGr4n6Cl7V9rE,2155
97
98
  pyreduce/settings/settings_CRIRES_PLUS.json,sha256=JEf1Ja5yv2boCuZx__XlNoBVSli-oKudRb4hix5Io00,2161
98
99
  pyreduce/settings/settings_HARPN.json,sha256=37Ya6unViL5Pocgih9FCRZ4VtlnQ-n-LScqzwMEHtds,1579
99
100
  pyreduce/settings/settings_HARPS.json,sha256=WcizGTYG5Tw5UQSuUB8MDbUPs909eDPtvCtefIWB7uI,1445
@@ -145,7 +146,7 @@ pyreduce/wavecal/xshooter_nir.npz,sha256=0Fu5wxWutc8072n8Hk2AZAWSlyT4WdhJuhh0OzU
145
146
  pyreduce/wavecal/atlas/thar.fits,sha256=nPPNStZ281iPUNsOXu3YJfHNlnHBd1CWMLwTuZL8vvo,1529218
146
147
  pyreduce/wavecal/atlas/thar_list.txt,sha256=saK3YW1slxlXGeulZDdILWf952XOWToJcUULVSHMe6k,63515
147
148
  pyreduce/wavecal/atlas/une.fits,sha256=egHlchdM4AN9MSksEI5MlHkmB3g1G1VhEdzhUG3XU8I,2949057
148
- pyreduce_astro-0.6.0b2.dist-info/METADATA,sha256=mmpbNGsvx1yf0JShQF3IWn4MoamokSrhrgLF-2SMhKQ,5267
149
- pyreduce_astro-0.6.0b2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
150
- pyreduce_astro-0.6.0b2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
151
- pyreduce_astro-0.6.0b2.dist-info/RECORD,,
149
+ pyreduce_astro-0.6.0b3.dist-info/METADATA,sha256=OuWiEn2E11TSmdlK-O9ART_g6DyYdsmqyA5dFm8DV1Y,5309
150
+ pyreduce_astro-0.6.0b3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
151
+ pyreduce_astro-0.6.0b3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
152
+ pyreduce_astro-0.6.0b3.dist-info/RECORD,,