Blame view

LabTools/IRAP/JPB/phangs_isrf_pipeline.pro 11.8 KB
2adbba75   Jean-Philippe Bernard   First commit
1
2
PRO phangs_isrf_pipeline

eb7ea183   Jean-Philippe Bernard   included stellar ...
3
;Note: faire un chmod a+rwx * apres transfert sur alma1
2adbba75   Jean-Philippe Bernard   First commit
4
5

;PHANGS ISRF pipeline
9b37a060   Jean-Philippe Bernard   improved for smoo...
6
7
save_data_dir=!phangs_data_dir+'/ISRF/WORK/'
str='ls '+save_data_dir+'ngc0628_*SPIRE3.sav'
f8a541d6   Jean-Philippe Bernard   updated to new fi...
8
9
print,str

8c4defa5   Jean-Philippe Bernard   improved
10
11
str='ls '+save_data_dir+'ngc0628_*images*.sav'
spawn,str
f8a541d6   Jean-Philippe Bernard   updated to new fi...
12
str='ls '+save_data_dir+'ngc0628_*seds_muse_pixels*.sav'
8c4defa5   Jean-Philippe Bernard   improved
13
spawn,str
2adbba75   Jean-Philippe Bernard   First commit
14

e314ac19   Jean-Philippe Bernard   improved
15
;==== make sky images
6fd06be5   Jean-Philippe Bernard   improved
16
;produces _jwst_images.sav and _ref_header.sav
f8a541d6   Jean-Philippe Bernard   updated to new fi...
17
;/data/projects/phangs/phangs_drive/Archive/PHANGS_JWST/DR1/ngc0628/f1000w_psf_matched
e314ac19   Jean-Philippe Bernard   improved
18
phangs_make_jwst_images,source_name='ngc0628',/save,/show,/nostop
9b37a060   Jean-Philippe Bernard   improved for smoo...
19
;produces _muse_filters_images.sav,_muse_data.sav, _muse_NH.sav
e314ac19   Jean-Philippe Bernard   improved
20
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop
9b37a060   Jean-Philippe Bernard   improved for smoo...
21
;produces _astrosat_images.sav
e314ac19   Jean-Philippe Bernard   improved
22
phangs_make_astrosat_images,source_name='ngc0628',/save,/show,/nostop
6fd06be5   Jean-Philippe Bernard   improved
23
24
;produces _herschel_images.sav
phangs_make_herschel_images,source_name='ngc0628',/save,/show,/nostop
8c4defa5   Jean-Philippe Bernard   improved
25
;produces _HI_images.sav
14ae4f23   Jean-Philippe Bernard   improved
26
phangs_make_hi_images,source_name='ngc0628',/save,/show,/nostop
8c4defa5   Jean-Philippe Bernard   improved
27
;produces _CO_images.sav
6fd06be5   Jean-Philippe Bernard   improved
28
phangs_make_co_images,source_name='ngc0628',/save,/show,/nostop
e314ac19   Jean-Philippe Bernard   improved
29

9b37a060   Jean-Philippe Bernard   improved for smoo...
30
31
;produces _muse_data.sav,
phangs_make_muse_filters_data,source_name='ngc0628',/save,/show,/nostop
3e3d714b   Jean-Philippe Bernard   removed hardcoded...
32

e314ac19   Jean-Philippe Bernard   improved
33
34
;==== extract SEDs on MUSE pixels
;produces _jwst_seds_muse_pixels.sav, _muse_seds_muse_pixels.sav', _astrosat_seds_muse_pixels.sav
9b37a060   Jean-Philippe Bernard   improved for smoo...
35
;pointer for vid 40749, 41095, 41405, 41406, 41581 .... is not referenced in all_seds_indices
e314ac19   Jean-Philippe Bernard   improved
36
phangs_extract_seds,source_name='ngc0628'
e314ac19   Jean-Philippe Bernard   improved
37

6c2927ee   Jean-Philippe Bernard   improved
38
;=== Compute ISRF prediction. This is done only at full resolution
de766928   Jean-Philippe Bernard   improved
39
;=== produce _isrf_min_prediction.sav, _isrf_min_prediction.fits (product)
6c2927ee   Jean-Philippe Bernard   improved
40
41
make_phangs_ssps_isrf_prediction,source_name='ngc0628',/save

de766928   Jean-Philippe Bernard   improved
42
43
44
;==== 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
e314ac19   Jean-Philippe Bernard   improved
45

c4ea1c02   Jean-Philippe Bernard   improved
46
47
48
49
50
;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
;...
de766928   Jean-Philippe Bernard   improved
51
52
53
54
55
56

;=== 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

c4ea1c02   Jean-Philippe Bernard   improved
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

;============================================================================================================
;===== 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'

8cfdf0b6   Jean-Philippe Bernard   improved
80
;ngc0628_isrf_min_prediction_SPIRE3.sav
eb7ea183   Jean-Philippe Bernard   included stellar ...
81
phangs_smooth_muse_isrf,'ngc0628',resolution_filter='SPIRE3',/save,/show,/nostop
c4ea1c02   Jean-Philippe Bernard   improved
82

c4ea1c02   Jean-Philippe Bernard   improved
83
84
make_phangs_isrf_classes,bidon,source_name='ngc0628',/save,resolution_filter='SPIRE3'

8cfdf0b6   Jean-Philippe Bernard   improved
85
86
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='SPIRE3'

c7d22c08   Jean-Philippe Bernard   improved
87
88
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='SPIRE3',/from_restore

966e3740   Jean-Philippe Bernard   improved
89
90
91
92
93
94
95

;============================================================================================================
;===== 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'
c7d22c08   Jean-Philippe Bernard   improved
96
97
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'
966e3740   Jean-Philippe Bernard   improved
98
phangs_make_muse_filters_images,source_name='ngc0628',/save,/show,/nostop,resolution_filter='PACS3'
c7d22c08   Jean-Philippe Bernard   improved
99
100
101
102
103
104
105
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'

eb7ea183   Jean-Philippe Bernard   included stellar ...
106
phangs_smooth_muse_isrf,'ngc0628',resolution_filter='PACS3',/save,/show,/nostop
c7d22c08   Jean-Philippe Bernard   improved
107
108
109
110

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
966e3740   Jean-Philippe Bernard   improved
111

524e900a   Jean-Philippe Bernard   fixed smoothing I...
112
113
114
115
116
117
118
119
120
121
;============================================================================================================
;===== 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'
c4ea1c02   Jean-Philippe Bernard   improved
122

524e900a   Jean-Philippe Bernard   fixed smoothing I...
123
124
125
126
127
128
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'
eb7ea183   Jean-Philippe Bernard   included stellar ...
129
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS2',/subtract_star_light
524e900a   Jean-Philippe Bernard   fixed smoothing I...
130
131

;===== j'en suis la sur mon mac
c4ea1c02   Jean-Philippe Bernard   improved
132

c190c44c   Jean-Philippe Bernard   improved
133
make_sed_phangs_tables,grid_type=4,isrf_class=15,/test
c4ea1c02   Jean-Philippe Bernard   improved
134
135


eb7ea183   Jean-Philippe Bernard   included stellar ...
136
137
138
139
140
141






524e900a   Jean-Philippe Bernard   fixed smoothing I...
142
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/from_restore,resolution_filter='PACS3'
c4ea1c02   Jean-Philippe Bernard   improved
143

dc862aaf   Jean-Philippe Bernard   improved
144
145


de766928   Jean-Philippe Bernard   improved
146
plot_phangs_ssps_against_uv_fast,bidon
e314ac19   Jean-Philippe Bernard   improved
147

ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
148
;==== Check the classes and do a plot
de766928   Jean-Philippe Bernard   improved
149
150
;==== produce ngc0682_isrf_classes_one_ratio.sav
;==== requires : ngc0628_astrosat_voronoi_prediction_fast.sav
ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
151
check_phangs_ssps_isrf_prediction,/show_map
e314ac19   Jean-Philippe Bernard   improved
152

de766928   Jean-Philippe Bernard   improved
153
154
155
;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
3b79f061   Jean-Philippe Bernard   improved
156

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
157
;=== Compute ISRF prediction. This is done only at full resolution
2adbba75   Jean-Philippe Bernard   First commit
158
make_phangs_ssps_isrf_prediction,source_name='ngc0628',/save
3b79f061   Jean-Philippe Bernard   improved
159
160
check_phangs_ssps_isrf_prediction

ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
161
;==== Make isrf classes
e2fb44a5   Jean-Philippe Bernard   improved
162
make_phangs_isrf_classes,bidon,source_name='ngc0628',/fits
ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
163

e314ac19   Jean-Philippe Bernard   improved
164

ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
165
166
167
168
169
170


;=== had to convert previous grids like this:
convert_all_grid_tables_from_v1_to_v2

;=== Fit the SEDs with the ISRF Grids
442151d0   Jean-Philippe Bernard   improved
171
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save
2adbba75   Jean-Philippe Bernard   First commit
172

442151d0   Jean-Philippe Bernard   improved
173
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/from_restore
82beee16   Jean-Philippe Bernard   improved
174

ee1fd9a9   Jean-Philippe Bernard   improved in the f...
175
176


9b0b6d7e   Jean-Philippe Bernard   finished implemen...
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
;============================================================================================================
;===== 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'
9b37a060   Jean-Philippe Bernard   improved for smoo...
193
194
195

phangs_make_muse_filters_data,source_name='ngc0628',/save,/show,/nostop,resolution_filter='SPIRE3'

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
196
197
;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
9b37a060   Jean-Philippe Bernard   improved for smoo...
198
phangs_extract_seds,source_name='ngc0628',resolution_filter='SPIRE3',/reset_seds
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
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
;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'

ee1fd9a9   Jean-Philippe Bernard   improved in the f...
228

ee1fd9a9   Jean-Philippe Bernard   improved in the f...
229
phangs_smooth_muse_isrf,'ngc0628',reso_filter='SPIRE1',/save
33d0e4eb   Jean-Philippe Bernard   improved
230

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
231
232
233
234




82beee16   Jean-Philippe Bernard   improved
235
236
237
238
;=== NGC3351
;Note: faire un chmod a+rwx * apres transfert sur alma1

source_name='ngc3351'
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
239
240
;J'en SUIS LA

82beee16   Jean-Philippe Bernard   improved
241
;produces _jwst_images.sav and _ref_header.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
242
phangs_make_jwst_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
243
;produces _muse_filters_data.sav,_muse_images.sav, _muse_NH.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
244
phangs_make_muse_filters_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
245
;produces _astrosat_data.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
246
phangs_make_astrosat_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
247
;produces _herschel_images.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
248
249
250
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
82beee16   Jean-Philippe Bernard   improved
251

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
252
phangs_extract_seds,source_name='ngc3351',/save
82beee16   Jean-Philippe Bernard   improved
253

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
254
make_phangs_ssps_isrf_prediction,source_name='ngc3351',/save
82beee16   Jean-Philippe Bernard   improved
255

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
256
make_phangs_isrf_classes,source_name='ngc3351',/fits
82beee16   Jean-Philippe Bernard   improved
257

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
258
phangs_brute_force_fit_with_isrf_grid,source_name='ngc3351',/include_herschel,/normalize,/fit_G0
f522d335   Jean-Philippe Bernard   improved
259

2adbba75   Jean-Philippe Bernard   First commit
260
END