Blame view

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


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

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

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

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

e314ac19   Jean-Philippe Bernard   improved
32
33
;==== 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...
34
;pointer for vid 40749, 41095, 41405, 41406, 41581 .... is not referenced in all_seds_indices
e314ac19   Jean-Philippe Bernard   improved
35
phangs_extract_seds,source_name='ngc0628'
e314ac19   Jean-Philippe Bernard   improved
36

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

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

de766928   Jean-Philippe Bernard   improved
45
46
47
48
49
50
51
52
;===== j'en suis la sur mon mac

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

plot_phangs_ssps_against_uv_fast,bidon
e314ac19   Jean-Philippe Bernard   improved
53

ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
54
;==== Check the classes and do a plot
de766928   Jean-Philippe Bernard   improved
55
56
;==== produce ngc0682_isrf_classes_one_ratio.sav
;==== requires : ngc0628_astrosat_voronoi_prediction_fast.sav
ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
57
check_phangs_ssps_isrf_prediction,/show_map
e314ac19   Jean-Philippe Bernard   improved
58

de766928   Jean-Philippe Bernard   improved
59
60
61
;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
62

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

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

3b79f061   Jean-Philippe Bernard   improved
70
;make_sed_phangs_tables,/test,/show_seds   ;test of plugin dustem_plugin_phangs_class_isrf.pro
429a6075   Jean-Philippe Bernard   improved
71
72
73
;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
e314ac19   Jean-Philippe Bernard   improved
74
75
;...

ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
76
77
78
79
80
81


;=== 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
82
phangs_brute_force_fit_with_isrf_grid,source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save
2adbba75   Jean-Philippe Bernard   First commit
83

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

ee1fd9a9   Jean-Philippe Bernard   improved in the f...
86
87


9b0b6d7e   Jean-Philippe Bernard   finished implemen...
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
;============================================================================================================
;===== 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...
104
105
106

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

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
107
108
;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...
109
phangs_extract_seds,source_name='ngc0628',resolution_filter='SPIRE3',/reset_seds
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
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
;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...
139

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

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
142
143
144
145




82beee16   Jean-Philippe Bernard   improved
146
147
148
149
;=== NGC3351
;Note: faire un chmod a+rwx * apres transfert sur alma1

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

82beee16   Jean-Philippe Bernard   improved
152
;produces _jwst_images.sav and _ref_header.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
153
phangs_make_jwst_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
154
;produces _muse_filters_data.sav,_muse_images.sav, _muse_NH.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
155
phangs_make_muse_filters_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
156
;produces _astrosat_data.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
157
phangs_make_astrosat_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
158
;produces _herschel_images.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
159
160
161
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
162

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

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

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

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

2adbba75   Jean-Philippe Bernard   First commit
171
END