|
9 | 9 | from sunpy import log |
10 | 10 | from sunpy.util.decorators import deprecated |
11 | 11 |
|
| 12 | +from aiapy.psf.utils import filter_mesh_parameters |
12 | 13 | from aiapy.utils.decorators import validate_channel |
13 | 14 |
|
14 | 15 | try: |
|
18 | 19 | except ImportError: |
19 | 20 | HAS_CUPY = False |
20 | 21 |
|
21 | | -__all__ = ["_psf", "calculate_psf", "filter_mesh_parameters", "psf"] |
22 | | - |
23 | | - |
24 | | -def filter_mesh_parameters(*, use_preflightcore=False): |
25 | | - """ |
26 | | - Geometric parameters for meshes in AIA filters used to calculate the point |
27 | | - spread function. |
28 | | -
|
29 | | - Parameters |
30 | | - ---------- |
31 | | - use_preflightcore : `bool`, optional |
32 | | - If True, use the pre-flight values for the filter mesh parameters |
33 | | -
|
34 | | - Returns |
35 | | - ------- |
36 | | - meshinfo : `dict` |
37 | | - Dictionary with filter mesh information for each channel. Each channel |
38 | | - entry then contains another dictionary with the following keys |
39 | | - describing filter mesh properties of that channel |
40 | | - (see Table 2 of [1]_): |
41 | | -
|
42 | | - * ``angle_arm``: Angles of the four entrance filter arms |
43 | | - * ``error_angle_arm``: Error in angle of the four entrance filter arms |
44 | | - * ``spacing_e``: Distance between diffraction spikes from entrance filter |
45 | | - * ``spacing_fp``: Distance between diffraction spikes from focal plane filter |
46 | | - * ``mesh_pitch``: Pitch of the mesh |
47 | | - * ``mesh_width``: Width of the mesh |
48 | | - * ``width``: Width applied to the Gaussian such that *after* |
49 | | - convolution we have the proper width |
50 | | - (:math:`4/3` at :math:`1/e` of max) |
51 | | -
|
52 | | - References |
53 | | - ---------- |
54 | | - .. [1] `Grigis, P., Su, Y., Weber M., et al., 2012, |
55 | | - AIA PSF Characterization and Deconvolution |
56 | | - <https://sohoftp.nascom.nasa.gov/solarsoft/sdo/aia/idl/psf/DOC/psfreport.pdf>`_ |
57 | | -
|
58 | | - See Also |
59 | | - -------- |
60 | | - `calculate_psf` : Calculate the composite point spread function |
61 | | -
|
62 | | - Notes |
63 | | - ----- |
64 | | - These parameters were calculated from the following images and |
65 | | - reference background images. |
66 | | -
|
67 | | - 94: |
68 | | -
|
69 | | - * image: 'AIA20101016_191039_0094.fits' |
70 | | - * reference: 'AIA20101016_190903_0094.fits' |
71 | | -
|
72 | | - 131: |
73 | | -
|
74 | | - * image: 'AIA20101016_191035_0131.fits' |
75 | | - * reference: 'AIA20101016_190911_0131.fits' |
76 | | -
|
77 | | - 171: |
78 | | -
|
79 | | - * image: 'AIA20101016_191037_0171.fits' |
80 | | - * reference: 'AIA20101016_190901_0171.fits' |
81 | | -
|
82 | | - 193: |
83 | | -
|
84 | | - * image: 'AIA20101016_191056_0193.fits' |
85 | | - * reference: 'AIA20101016_190844_0193.fits' |
86 | | -
|
87 | | - 211: |
88 | | -
|
89 | | - * image: 'AIA20101016_191038_0211.fits' |
90 | | - * reference: 'AIA20101016_190902_0211.fits' |
91 | | -
|
92 | | - 304: |
93 | | -
|
94 | | - * image: 'AIA20101016_191021_0304.fits' |
95 | | - * reference: 'AIA20101016_190845_0304.fits' |
96 | | -
|
97 | | - 335: |
98 | | -
|
99 | | - * image: 'AIA20101016_191041_0335.fits' |
100 | | - * reference: 'AIA20101016_190905_0335.fits' |
101 | | - """ |
102 | | - return { |
103 | | - 94 * u.angstrom: { |
104 | | - "angle_arm": [49.81, 40.16, -40.28, -49.92] * u.deg, |
105 | | - "error_angle_arm": [0.02, 0.02, 0.02, 0.02] * u.deg, |
106 | | - "spacing_e": 8.99 * u.pixel, |
107 | | - "mesh_pitch": 363.0 * u.um, |
108 | | - "mesh_width": 34.0 * u.um, |
109 | | - "spacing_fp": 0.207 * u.pixel, |
110 | | - "width": (0.951 if use_preflightcore else 4.5) * u.pixel, |
111 | | - "CDELT": [0.600109, 0.600109] * u.arcsec, |
112 | | - }, |
113 | | - 131 * u.angstrom: { |
114 | | - "angle_arm": [50.27, 40.17, -39.70, -49.95] * u.deg, |
115 | | - "error_angle_arm": [0.02, 0.02, 0.02, 0.02] * u.deg, |
116 | | - "spacing_e": 12.37 * u.pixel, |
117 | | - "mesh_pitch": 363.0 * u.um, |
118 | | - "mesh_width": 34.0 * u.um, |
119 | | - "spacing_fp": 0.289 * u.pixel, |
120 | | - "width": (1.033 if use_preflightcore else 4.5) * u.pixel, |
121 | | - "CDELT": [0.600698, 0.600698] * u.arcsec, |
122 | | - }, |
123 | | - 171 * u.angstrom: { |
124 | | - "angle_arm": [49.81, 39.57, -40.13, -50.38] * u.deg, |
125 | | - "error_angle_arm": [0.02, 0.02, 0.02, 0.02] * u.deg, |
126 | | - "spacing_e": 16.26 * u.pixel, |
127 | | - "mesh_pitch": 363.0 * u.um, |
128 | | - "mesh_width": 34.0 * u.um, |
129 | | - "spacing_fp": 0.377 * u.pixel, |
130 | | - "width": (0.962 if use_preflightcore else 4.5) * u.pixel, |
131 | | - "CDELT": [0.599489, 0.599489] * u.arcsec, |
132 | | - }, |
133 | | - 193 * u.angstrom: { |
134 | | - "angle_arm": [49.82, 39.57, -40.12, -50.37] * u.deg, |
135 | | - "error_angle_arm": [0.02, 0.02, 0.03, 0.04] * u.deg, |
136 | | - "spacing_e": 18.39 * u.pixel, |
137 | | - "mesh_pitch": 363.0 * u.um, |
138 | | - "mesh_width": 34.0 * u.um, |
139 | | - "spacing_fp": 0.425 * u.pixel, |
140 | | - "width": (1.512 if use_preflightcore else 4.5) * u.pixel, |
141 | | - "CDELT": [0.600758, 0.600758] * u.arcsec, |
142 | | - }, |
143 | | - 211 * u.angstrom: { |
144 | | - "angle_arm": [49.78, 40.08, -40.34, -49.95] * u.deg, |
145 | | - "error_angle_arm": [0.02, 0.02, 0.02, 0.02] * u.deg, |
146 | | - "spacing_e": 19.97 * u.pixel, |
147 | | - "mesh_pitch": 363.0 * u.um, |
148 | | - "mesh_width": 34.0 * u.um, |
149 | | - "spacing_fp": 0.465 * u.pixel, |
150 | | - "width": (1.199 if use_preflightcore else 4.5) * u.pixel, |
151 | | - "CDELT": [0.600758, 0.600758] * u.arcsec, |
152 | | - }, |
153 | | - 304 * u.angstrom: { |
154 | | - "angle_arm": [49.76, 40.18, -40.14, -49.90] * u.degree, |
155 | | - "error_angle_arm": [0.02, 0.02, 0.02, 0.02] * u.deg, |
156 | | - "spacing_e": 28.87 * u.pixel, |
157 | | - "mesh_pitch": 363.0 * u.um, |
158 | | - "mesh_width": 34.0 * u.um, |
159 | | - "spacing_fp": 0.670 * u.pixel, |
160 | | - "width": (1.247 if use_preflightcore else 4.5) * u.pixel, |
161 | | - "CDELT": [0.600165, 0.600165] * u.arcsec, |
162 | | - }, |
163 | | - 335 * u.angstrom: { |
164 | | - "angle_arm": [50.40, 39.80, -39.64, -50.25] * u.degree, |
165 | | - "error_angle_arm": [0.02, 0.02, 0.02, 0.02] * u.deg, |
166 | | - "spacing_e": 31.83 * u.pixel, |
167 | | - "mesh_pitch": 363.0 * u.um, |
168 | | - "mesh_width": 34.0 * u.um, |
169 | | - "spacing_fp": 0.738 * u.pixel, |
170 | | - "width": (0.962 if use_preflightcore else 4.5) * u.pixel, |
171 | | - "CDELT": [0.600737, 0.600737] * u.arcsec, |
172 | | - }, |
173 | | - } |
| 22 | +__all__ = ["calculate_psf", "psf"] |
174 | 23 |
|
175 | 24 |
|
176 | 25 | @u.quantity_input |
@@ -335,7 +184,7 @@ def _psf(meshinfo, angles, diffraction_orders, *, focal_plane=False, use_gpu=Tru |
335 | 184 | return (1 - area_not_mesh) * psf / psf.sum() + area_not_mesh * psf_core / psf_core.sum() |
336 | 185 |
|
337 | 186 |
|
338 | | -@deprecated("1.0", alternative="calculate_psf") |
| 187 | +@deprecated("0.11.0", alternative="calculate_psf") |
339 | 188 | @u.quantity_input |
340 | 189 | def psf(channel: u.angstrom, *, use_preflightcore=False, diffraction_orders=None, use_gpu=True): |
341 | 190 | """ |
|
0 commit comments