Blame view

LabTools/IRAP/JPB/phangs_isrf_pipeline.pro 6.46 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'
f145894a   Jean-Philippe Bernard   improved
36
;===== j'en suis la sur mon mac
e314ac19   Jean-Philippe Bernard   improved
37
38
39
40
41
42


;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

ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
43
44
;==== Check the classes and do a plot
check_phangs_ssps_isrf_prediction,/show_map
e314ac19   Jean-Philippe Bernard   improved
45

3b79f061   Jean-Philippe Bernard   improved
46
47
plot_phangs_ssps_against_uv_fast

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

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

3b79f061   Jean-Philippe Bernard   improved
55
;make_sed_phangs_tables,/test,/show_seds   ;test of plugin dustem_plugin_phangs_class_isrf.pro
429a6075   Jean-Philippe Bernard   improved
56
57
58
;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
59
60
;...

ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
61
62
63
64
65
66


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

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

ee1fd9a9   Jean-Philippe Bernard   improved in the f...
71
72


9b0b6d7e   Jean-Philippe Bernard   finished implemen...
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
;============================================================================================================
;===== 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...
89
90
91

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

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
92
93
;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...
94
phangs_extract_seds,source_name='ngc0628',resolution_filter='SPIRE3',/reset_seds
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
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
;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...
124

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

9b0b6d7e   Jean-Philippe Bernard   finished implemen...
127
128
129
130




82beee16   Jean-Philippe Bernard   improved
131
132
133
134
;=== NGC3351
;Note: faire un chmod a+rwx * apres transfert sur alma1

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

82beee16   Jean-Philippe Bernard   improved
137
;produces _jwst_images.sav and _ref_header.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
138
phangs_make_jwst_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
139
;produces _muse_filters_data.sav,_muse_images.sav, _muse_NH.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
140
phangs_make_muse_filters_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
141
;produces _astrosat_data.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
142
phangs_make_astrosat_images,source_name='ngc3351',/save,/show,/nostop
82beee16   Jean-Philippe Bernard   improved
143
;produces _herschel_images.sav
9b0b6d7e   Jean-Philippe Bernard   finished implemen...
144
145
146
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
147

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

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

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

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

2adbba75   Jean-Philippe Bernard   First commit
156
END