phangs_isrf_pipeline.pro
11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
PRO phangs_isrf_pipeline
;Note: faire un chmod a+rwx * apres transfert sur alma1
;PHANGS ISRF pipeline
save_data_dir=!phangs_data_dir+'/ISRF/WORK/'
str='ls '+save_data_dir+'ngc0628_*SPIRE3.sav'
print,str
str='ls '+save_data_dir+'ngc0628_*images*.sav'
spawn,str
str='ls '+save_data_dir+'ngc0628_*seds_muse_pixels*.sav'
spawn,str
;==== make sky images
;produces _jwst_images.sav and _ref_header.sav
;/data/projects/phangs/phangs_drive/Archive/PHANGS_JWST/DR1/ngc0628/f1000w_psf_matched
phangs_make_jwst_images,source_name='ngc0628',/save,/show,/nostop
;produces _muse_filters_images.sav,_muse_data.sav, _muse_NH.sav
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop
;produces _astrosat_images.sav
phangs_make_astrosat_images,source_name='ngc0628',/save,/show,/nostop
;produces _herschel_images.sav
phangs_make_herschel_images,source_name='ngc0628',/save,/show,/nostop
;produces _HI_images.sav
phangs_make_hi_images,source_name='ngc0628',/save,/show,/nostop
;produces _CO_images.sav
phangs_make_co_images,source_name='ngc0628',/save,/show,/nostop
;produces _muse_data.sav,
phangs_make_muse_filters_data,source_name='ngc0628',/save,/show,/nostop
;==== extract SEDs on MUSE pixels
;produces _jwst_seds_muse_pixels.sav, _muse_seds_muse_pixels.sav', _astrosat_seds_muse_pixels.sav
;pointer for vid 40749, 41095, 41405, 41406, 41581 .... is not referenced in all_seds_indices
phangs_extract_seds,source_name='ngc0628'
;=== Compute ISRF prediction. This is done only at full resolution
;=== produce _isrf_min_prediction.sav, _isrf_min_prediction.fits (product)
make_phangs_ssps_isrf_prediction,source_name='ngc0628',/save
;==== Make isrf classes
;produces isrf_classes_one_ratio_on_*.fits, *_isrf_classes_map.fits, *_isrf_classes_voronoi.sav
make_phangs_isrf_classes,bidon,source_name='ngc0628',/save
;make_sed_phangs_tables,/test,/show_seds ;test of plugin dustem_plugin_phangs_class_isrf.pro
;Generally very long. Do it using nohup (see make_phangs_grid.pro)
make_sed_phangs_tables,grid_type=2,isrf_class=15
make_sed_phangs_tables,grid_type=2,isrf_class=0
;...
;=== Fit the SEDs with the ISRF Grids
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/from_restore
;============================================================================================================
;===== NGC0628 at SPIRE3 resolution
;============================================================================================================
;resolution_filter='SPIRE3'
;ngc0628_jwst_images_SPIRE3.sav, ngc0628_ref_header_SPIRE3.sav
phangs_make_jwst_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_CO_images_SPIRE3.sav
phangs_make_co_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_HI_images_SPIRE3.sav
phangs_make_hi_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_astrosat_data_SPIRE3.sav
phangs_make_astrosat_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_muse_filters_data_SPIRE3.sav, ngc0628_muse_images_SPIRE3.sav (not produced _muse_NH_SPIRE3.sav)
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_herschel_images_SPIRE3.sav
phangs_make_herschel_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
phangs_make_muse_filters_data,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
phangs_extract_seds,source_name='ngc0628',resolution_filter='SPIRE3'
;ngc0628_isrf_min_prediction_SPIRE3.sav
phangs_smooth_muse_isrf,'ngc0628',resolution_filter='SPIRE3',/save,/show,/nostop
make_phangs_isrf_classes,bidon,source_name='ngc0628',/save,resolution_filter='SPIRE3'
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='SPIRE3'
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='SPIRE3',/from_restore
;============================================================================================================
;===== NGC0628 at PACS3 resolution
;============================================================================================================
;resolution_filter='PACS3'
;ngc0628_jwst_images_PACS3.sav, ngc0628_ref_header_PACS3.sav
phangs_make_jwst_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_co_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_hi_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_astrosat_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_herschel_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_muse_filters_data,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_extract_seds,source_name='ngc0628',resolution_filter='PACS3'
phangs_smooth_muse_isrf,'ngc0628',resolution_filter='PACS3',/save,/show,/nostop
make_phangs_isrf_classes,bidon,source_name='ngc0628',/save,resolution_filter='PACS3'
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS3',/show_seds
;============================================================================================================
;===== NGC0628 at PACS2 resolution
;============================================================================================================
phangs_make_jwst_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS2'
phangs_make_co_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS2'
phangs_make_hi_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS2'
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS2'
phangs_make_astrosat_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS2'
phangs_make_herschel_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS2'
phangs_make_muse_filters_data,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS2'
phangs_extract_seds,source_name='ngc0628',resolution_filter='PACS2'
phangs_smooth_muse_isrf,'ngc0628',resolution_filter='PACS2',/save
make_phangs_isrf_classes,bidon,source_name='ngc0628',/save,resolution_filter='PACS2'
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS2',/subtract_star_light
;===== j'en suis la sur mon mac
make_sed_phangs_tables,grid_type=5,isrf_class=15,/test,/show_seds
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/from_restore,resolution_filter='PACS3'
plot_phangs_ssps_against_uv_fast,bidon
;==== Check the classes and do a plot
;==== produce ngc0682_isrf_classes_one_ratio.sav
;==== requires : ngc0628_astrosat_voronoi_prediction_fast.sav
check_phangs_ssps_isrf_prediction,/show_map
;fit_phangs_ngc0628_nir_continuum,/from_restore,/show_plots ;fit seds of some voronoi bins
;fit_phangs_ngc0628_nir_continuum,/from_restore,/brute_force
;fit_phangs_ngc0628_nir_continuum,/from_restore,/grid_brute_force
;=== Compute ISRF prediction. This is done only at full resolution
make_phangs_ssps_isrf_prediction,source_name='ngc0628',/save
check_phangs_ssps_isrf_prediction
;==== Make isrf classes
make_phangs_isrf_classes,bidon,source_name='ngc0628',/fits
;=== had to convert previous grids like this:
convert_all_grid_tables_from_v1_to_v2
;=== Fit the SEDs with the ISRF Grids
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/from_restore
;============================================================================================================
;===== NGC0628 at SPIRE3 resolution
;============================================================================================================
;resolution_filter='SPIRE3'
;ngc0628_jwst_images_SPIRE3.sav, ngc0628_ref_header_SPIRE3.sav
phangs_make_jwst_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_CO_images_SPIRE3.sav
phangs_make_co_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_HI_images_SPIRE3.sav
phangs_make_hi_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_astrosat_data_SPIRE3.sav
phangs_make_astrosat_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_muse_filters_data_SPIRE3.sav, ngc0628_muse_images_SPIRE3.sav (not produced _muse_NH_SPIRE3.sav)
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_herschel_images_SPIRE3.sav
phangs_make_herschel_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
phangs_make_muse_filters_data,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'
;ngc0628_jwst_seds_muse_pixels_SPIRE3.sav,ngc0628_seds_indices_SPIRE3.sav,ngc0628_muse_seds_muse_pixels_SPIRE3.sav
;ngc0628_astrosat_seds_muse_pixels_SPIRE3.sav,ngc0628_herschel_seds_muse_pixels_SPIRE3.sav,ngc0628_all_seds_muse_pixels_SPIRE3.sav
phangs_extract_seds,source_name='ngc0628',resolution_filter='SPIRE3',/reset_seds
;ngc0628_isrf_min_prediction_SPIRE3.sav
phangs_smooth_muse_isrf,'ngc0628',resolution_filter='SPIRE3',/save
;isrf_classes_one_ratio_on_ngc0628_SPIRE3.fits,ngc0628_isrf_classes_map_SPIRE3.fits,ngc0628_isrf_classes_voronoi_SPIRE3.sav
make_phangs_isrf_classes,bidon,source_name='ngc0628',/fits,resolution_filter='SPIRE3'
;J'en SUIS LA
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='SPIRE3'
;J'en SUIS LA
phangs_make_jwst_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_co_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_hi_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_astrosat_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_make_herschel_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
phangs_extract_seds,source_name='ngc0628',resolution_filter='PACS3'
;=== smooth MUSE isrfs to a given resolution
;phangs_smooth_muse_isrf,'ngc0628',resolution_filter='PACS3',/test
phangs_smooth_muse_isrf,'ngc0628',resolution_filter='PACS3',/save
;==== Make isrf classes
make_phangs_isrf_classes,bidon,source_name='ngc0628',/fits,resolution_filter='PACS3'
phangs_smooth_muse_isrf,'ngc0628',reso_filter='SPIRE1',/save
;=== NGC3351
;Note: faire un chmod a+rwx * apres transfert sur alma1
source_name='ngc3351'
;J'en SUIS LA
;produces _jwst_images.sav and _ref_header.sav
phangs_make_jwst_images,source_name='ngc3351',/save,/show,/nostop
;produces _muse_filters_data.sav,_muse_images.sav, _muse_NH.sav
phangs_make_muse_filters_images,source_name='ngc3351',/save,/show,/nostop
;produces _astrosat_data.sav
phangs_make_astrosat_images,source_name='ngc3351',/save,/show,/nostop
;produces _herschel_images.sav
phangs_make_herschel_images,source_name='ngc3351',/save,/show,/nostop
phangs_make_hi_images,source_name='ngc3351',/save,/show,/nostop
phangs_make_co_images,source_name='ngc3351',/save,/show,/nostop
phangs_extract_seds,source_name='ngc3351',/save
make_phangs_ssps_isrf_prediction,source_name='ngc3351',/save
make_phangs_isrf_classes,source_name='ngc3351',/fits
phangs_brute_force_fit_with_isrf_grid,source_name='ngc3351',/include_herschel,/normalize,/fit_G0
END