msaexp 0.7.2__tar.gz → 0.7.4__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.
- {msaexp-0.7.2 → msaexp-0.7.4}/PKG-INFO +4 -1
- {msaexp-0.7.2 → msaexp-0.7.4}/README.rst +3 -0
- msaexp-0.7.4/msaexp/data/fwhm_data.py +116 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/drizzle.py +6 -3
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/pipeline.py +5 -2
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/slit_combine.py +295 -28
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/spectrum.py +444 -136
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/test_utils.py +15 -1
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/utils.py +75 -63
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/version.py +2 -2
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp.egg-info/PKG-INFO +4 -1
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp.egg-info/SOURCES.txt +1 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/.devcontainer/devcontainer.json +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/.github/workflows/publish-to-pypi.yml +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/.github/workflows/python-package.yml +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/.gitignore +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/.readthedocs.yml +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/CHANGES.rst +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/CITATION.cff +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/LICENSE +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/Makefile +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/conf.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/examples/ceers-z16-msaexp.ipynb +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/examples/drizzled-nirspec.ipynb +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/examples/process-rxj2129.ipynb +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/examples/process-smacs0723.ipynb +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/index.rst +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/make.bat +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/msaexp/Makefile +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/msaexp/api.rst +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/msaexp/install.rst +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/docs/requirements.txt +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/__init__.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/README.md +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/fix_units.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/jwst_nirspec_g140h_disp.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/jwst_nirspec_g140m_disp.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/jwst_nirspec_g235h_disp.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/jwst_nirspec_g235m_disp.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/jwst_nirspec_g395h_disp.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/jwst_nirspec_g395m_disp.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/jwst_nirspec_prism_disp.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/data/nirspec_msa_transforms.yaml +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/msa.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/resample.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/resample_numba.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/__init__.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/data/jw01345062001_03101_00001_nrs2_phot.138.1345_933.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/data/jw01345062001_03101_00002_nrs2_phot.138.1345_933.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/data/jw01345062001_03101_00003_nrs2_phot.138.1345_933.fits +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/test_drizzle.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/test_msa.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp/tests/test_spectra.py +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp.egg-info/dependency_links.txt +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp.egg-info/requires.txt +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/msaexp.egg-info/top_level.txt +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/pyproject.toml +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/setup.cfg +0 -0
- {msaexp-0.7.2 → msaexp-0.7.4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: msaexp
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
4
4
|
Summary: Manual extraction of JWST NIRSpec MSA spectra directly from the telescope exposures
|
|
5
5
|
Home-page: https://github.com/gbrammer/msaexp
|
|
6
6
|
Author: G. Brammer
|
|
@@ -84,3 +84,6 @@ Browsable table: https://s3.amazonaws.com/msaexp-nirspec/extractions/nirspec_gra
|
|
|
84
84
|
|
|
85
85
|
Full catalog: https://s3.amazonaws.com/msaexp-nirspec/extractions/nirspec_graded_v0.ecsv
|
|
86
86
|
|
|
87
|
+
Updated and additional extractions (2024-Feb): https://s3.amazonaws.com/msaexp-nirspec/extractions/nirspec_graded_v2.html
|
|
88
|
+
(Though see https://github.com/gbrammer/msaexp/pull/54)
|
|
89
|
+
|
|
@@ -49,3 +49,6 @@ Browsable table: https://s3.amazonaws.com/msaexp-nirspec/extractions/nirspec_gra
|
|
|
49
49
|
|
|
50
50
|
Full catalog: https://s3.amazonaws.com/msaexp-nirspec/extractions/nirspec_graded_v0.ecsv
|
|
51
51
|
|
|
52
|
+
Updated and additional extractions (2024-Feb): https://s3.amazonaws.com/msaexp-nirspec/extractions/nirspec_graded_v2.html
|
|
53
|
+
(Though see https://github.com/gbrammer/msaexp/pull/54)
|
|
54
|
+
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Original WebbPSF
|
|
2
|
+
# nspec = webbpsf.NIRSpec()
|
|
3
|
+
# nspec.image_mask = 'S200A1' # 0.2 arcsec slit
|
|
4
|
+
fwhm_data_orig = """# wave fwhm_pix
|
|
5
|
+
0.6 1.04
|
|
6
|
+
0.7 0.80
|
|
7
|
+
0.8 0.67
|
|
8
|
+
0.9 0.63
|
|
9
|
+
1.0 0.62
|
|
10
|
+
1.25 0.68
|
|
11
|
+
1.5 0.79
|
|
12
|
+
2.0 0.89
|
|
13
|
+
2.5 0.95
|
|
14
|
+
3.0 1.08
|
|
15
|
+
4.0 1.41
|
|
16
|
+
5.0 1.78
|
|
17
|
+
5.5 1.94"""
|
|
18
|
+
|
|
19
|
+
# nspec.image_mask = 'MSA all open'
|
|
20
|
+
fwhm_data_update = """# wave fwhm_pix
|
|
21
|
+
0.60 1.347
|
|
22
|
+
0.65 1.119
|
|
23
|
+
0.70 1.074
|
|
24
|
+
0.75 0.935
|
|
25
|
+
0.80 0.857
|
|
26
|
+
0.85 0.807
|
|
27
|
+
0.90 0.796
|
|
28
|
+
0.95 0.775
|
|
29
|
+
1.00 0.772
|
|
30
|
+
1.08 0.823
|
|
31
|
+
1.16 0.872
|
|
32
|
+
1.25 0.907
|
|
33
|
+
1.50 0.978
|
|
34
|
+
1.75 1.056
|
|
35
|
+
2.00 1.114
|
|
36
|
+
2.25 1.111
|
|
37
|
+
2.50 1.193
|
|
38
|
+
2.75 1.199
|
|
39
|
+
3.00 1.299
|
|
40
|
+
3.50 1.430
|
|
41
|
+
4.00 1.567
|
|
42
|
+
4.50 1.885
|
|
43
|
+
5.00 2.058
|
|
44
|
+
5.25 2.271
|
|
45
|
+
5.50 2.357"""
|
|
46
|
+
|
|
47
|
+
# measured from a star from CAL-1493
|
|
48
|
+
fwhm_data_2024 = """# wave fwhm_pix
|
|
49
|
+
0.55 1.127
|
|
50
|
+
0.58 1.127
|
|
51
|
+
0.60 1.093
|
|
52
|
+
0.63 1.075
|
|
53
|
+
0.67 1.066
|
|
54
|
+
0.71 1.063
|
|
55
|
+
0.77 1.063
|
|
56
|
+
0.83 1.067
|
|
57
|
+
0.90 1.072
|
|
58
|
+
0.99 1.079
|
|
59
|
+
1.09 1.088
|
|
60
|
+
1.21 1.097
|
|
61
|
+
1.34 1.108
|
|
62
|
+
1.47 1.118
|
|
63
|
+
1.61 1.129
|
|
64
|
+
1.75 1.140
|
|
65
|
+
1.88 1.150
|
|
66
|
+
2.01 1.160
|
|
67
|
+
2.13 1.169
|
|
68
|
+
2.25 1.178
|
|
69
|
+
2.37 1.187
|
|
70
|
+
2.48 1.196
|
|
71
|
+
2.58 1.204
|
|
72
|
+
2.68 1.213
|
|
73
|
+
2.78 1.223
|
|
74
|
+
2.88 1.233
|
|
75
|
+
2.97 1.244
|
|
76
|
+
3.06 1.256
|
|
77
|
+
3.15 1.268
|
|
78
|
+
3.24 1.281
|
|
79
|
+
3.32 1.294
|
|
80
|
+
3.40 1.308
|
|
81
|
+
3.48 1.322
|
|
82
|
+
3.56 1.336
|
|
83
|
+
3.63 1.350
|
|
84
|
+
3.71 1.365
|
|
85
|
+
3.78 1.380
|
|
86
|
+
3.85 1.395
|
|
87
|
+
3.92 1.411
|
|
88
|
+
3.99 1.427
|
|
89
|
+
4.06 1.444
|
|
90
|
+
4.13 1.463
|
|
91
|
+
4.19 1.482
|
|
92
|
+
4.26 1.503
|
|
93
|
+
4.32 1.524
|
|
94
|
+
4.38 1.546
|
|
95
|
+
4.44 1.569
|
|
96
|
+
4.51 1.592
|
|
97
|
+
4.56 1.614
|
|
98
|
+
4.62 1.635
|
|
99
|
+
4.68 1.656
|
|
100
|
+
4.74 1.676
|
|
101
|
+
4.80 1.694
|
|
102
|
+
4.85 1.713
|
|
103
|
+
4.91 1.731
|
|
104
|
+
4.96 1.752
|
|
105
|
+
5.02 1.774
|
|
106
|
+
5.07 1.799
|
|
107
|
+
5.12 1.826
|
|
108
|
+
5.17 1.851
|
|
109
|
+
5.22 1.866
|
|
110
|
+
5.28 1.859
|
|
111
|
+
5.33 1.859
|
|
112
|
+
5.38 1.859
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
# Set default
|
|
116
|
+
fwhm_data = fwhm_data_update
|
|
@@ -641,8 +641,11 @@ def drizzle_slitlets(id, wildcard='*phot', files=None, output=None, verbose=True
|
|
|
641
641
|
h['BUNIT'] = 'micron'
|
|
642
642
|
hdul.append(pyfits.ImageHDU(data=waves, header=h))
|
|
643
643
|
|
|
644
|
+
# output_key = f'{output}-{id}-{gr}'
|
|
645
|
+
output_key = f'{output}_{gr}_{id}' # match spec.fits
|
|
646
|
+
|
|
644
647
|
if output is not None:
|
|
645
|
-
hdul.writeto(f'{
|
|
648
|
+
hdul.writeto(f'{output_key}.d2d.fits', overwrite=True,
|
|
646
649
|
output_verify='fix')
|
|
647
650
|
|
|
648
651
|
if imshow_kws['vmax'] is None:
|
|
@@ -658,7 +661,7 @@ def drizzle_slitlets(id, wildcard='*phot', files=None, output=None, verbose=True
|
|
|
658
661
|
if (show_drizzled):
|
|
659
662
|
dfig = show_drizzled_product(hdul, imshow_kws=imshow_kws)
|
|
660
663
|
if output is not None:
|
|
661
|
-
dfig.savefig(f'{
|
|
664
|
+
dfig.savefig(f'{output_key}.d2d.png')
|
|
662
665
|
else:
|
|
663
666
|
dfig = None
|
|
664
667
|
|
|
@@ -667,7 +670,7 @@ def drizzle_slitlets(id, wildcard='*phot', files=None, output=None, verbose=True
|
|
|
667
670
|
imshow_kws=imshow_kws,
|
|
668
671
|
with_background=(show_slits > 1))
|
|
669
672
|
if output is not None:
|
|
670
|
-
sfig.savefig(f'{
|
|
673
|
+
sfig.savefig(f'{output_key}.slit2d.png')
|
|
671
674
|
else:
|
|
672
675
|
sfig = None
|
|
673
676
|
|
|
@@ -39,7 +39,7 @@ DETECTORS = ['nrs1','nrs2']
|
|
|
39
39
|
__all__ = ["query_program", "exposure_groups", "NirspecPipeline"]
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def query_program(prog=2767, download=True, detectors=DETECTORS, gratings=GRATINGS, filters=FILTERS, extensions=['s2d'], product='rate', extra_filters=[]):
|
|
42
|
+
def query_program(prog=2767, download=True, detectors=DETECTORS, gratings=GRATINGS, filters=FILTERS, extensions=['s2d'], product='rate', extra_filters=[], levels=['2','2a','2b']):
|
|
43
43
|
"""
|
|
44
44
|
Query and download MSA exposures for a given program from MAST
|
|
45
45
|
|
|
@@ -72,6 +72,9 @@ def query_program(prog=2767, download=True, detectors=DETECTORS, gratings=GRATIN
|
|
|
72
72
|
extra_filters : list
|
|
73
73
|
Additional query filters from, e.g., `mastquery.jwst.make_query_filter`
|
|
74
74
|
|
|
75
|
+
levels : list
|
|
76
|
+
List of ``productLevel`` entries to include in the query
|
|
77
|
+
|
|
75
78
|
Returns
|
|
76
79
|
-------
|
|
77
80
|
res : `~astropy.table.Table`
|
|
@@ -83,7 +86,7 @@ def query_program(prog=2767, download=True, detectors=DETECTORS, gratings=GRATIN
|
|
|
83
86
|
|
|
84
87
|
query = []
|
|
85
88
|
query += mastquery.jwst.make_query_filter('productLevel',
|
|
86
|
-
values=
|
|
89
|
+
values=levels)
|
|
87
90
|
query += mastquery.jwst.make_program_filter([prog])
|
|
88
91
|
|
|
89
92
|
if detectors is not None:
|