Commit 8faf358d7a8076f70542394763aaed0c3c5b0438

Authored by Jean-Philippe Bernard
1 parent b0ee8672
Exists in master

improved

LabTools/IRAP/JPB/phangs_brute_force_fit_with_isrf_grid.pro
... ... @@ -2,7 +2,6 @@ PRO phangs_brute_force_fit_with_isrf_grid,source_name=source_name $
2 2 ,model=model $
3 3 ,normalize=normalize $
4 4 ,from_restore=from_restore $
5   - ,from_small_restore=from_small_restore $
6 5 ,save=save $
7 6 ,force_mathis=force_mathis $
8 7 ,fit_G0=fit_G0 $
... ... @@ -132,7 +131,6 @@ IF keyword_set(do_postscripts) THEN BEGIN
132 131 ENDIF
133 132  
134 133 IF keyword_set(from_restore) THEN GOTO,from_restore
135   -IF keyword_set(from_small_restore) THEN GOTO,from_small_restore
136 134  
137 135 dustem_init,show_plots=show_plots
138 136  
... ... @@ -840,26 +838,15 @@ FOR isrf_class=class_min,class_max DO BEGIN ;isrf_class runs from 1
840 838 ENDFOR
841 839  
842 840 stats_st=st
843   -;save,GOs,Ypahs,Yvsgs,file=dir+source_name+'DBP90_JWST_G0_YPAH_YVSG.fits'
844 841 IF keyword_set(save) THEN BEGIN
845 842 dustem_grid_saved=!dustem_grid
846   - file_save=data_dir+use_source_name+use_model+'_JWST_G0_YPAH_YVSG_on-voronoi_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
  843 + file_save=data_dir+use_source_name+use_model+'_logn_JWST_G0_YPAH_YVSG_on-voronoi_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
847 844 save,all_filters,use_fit_filters,dustem_grid_saved,stellar_normalizations,stats_st,EBVs,F0s,F0s_predicted,G0s,G0s_predicted, $
848 845 Ygrain1,Ygrain2,Ygrain3,facts,chi2s,rchi2s,dF0s,dYgrain1,dYgrain2,dYgrain3, $
849 846 F0_hit,Ygrain1_hit,Ygrain2_hit,Ygrain3_hit,NH_values,best_fit_seds,observed_seds,file=file_save
850 847 message,'Wrote '+file_save,/continue
851 848 ENDIF
852 849  
853   -from_small_restore:
854   -
855   -IF keyword_set(from_small_restore) THEN BEGIN
856   - ;dustem_grid_saved=!dustem_grid
857   - file_save=data_dir+use_source_name+use_model+'_JWST_G0_YPAH_YVSG_on-voronoi_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
858   - restore,file_save,/verb
859   - file_save=data_dir+use_source_name+use_model+'_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
860   - restore,file_save,/verb
861   -ENDIF
862   -
863 850 ;stop
864 851 ;=== make maps of parameters
865 852 EBV_map=fltarr(sxpar(href,'NAXIS1'),sxpar(href,'NAXIS2'))+la_undef()
... ... @@ -931,8 +918,6 @@ FOR vid=0LL,Nvor-1 DO BEGIN
931 918 ENDIF
932 919 ENDFOR
933 920  
934   -;stats_st=st
935   -;;save,GOs,Ypahs,Yvsgs,file=dir+source_name+'DBP90_JWST_G0_YPAH_YVSG.fits'
936 921 IF keyword_set(save) THEN BEGIN
937 922 ; dustem_grid_saved=!dustem_grid
938 923 ; file_save=data_dir+use_source_name+use_model+'_JWST_G0_YPAH_YVSG_on-voronoi_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
... ... @@ -940,7 +925,7 @@ IF keyword_set(save) THEN BEGIN
940 925 ; Ygrain1,Ygrain2,Ygrain3,facts,chi2s,rchi2s,dF0s,dYgrain1,dYgrain2,dYgrain3, $
941 926 ; F0_hit,Ygrain1_hit,Ygrain2_hit,Ygrain3_hit,Yvsg_hit,NH_values,best_fit_seds,observed_seds,file=file_save
942 927 ; message,'Wrote '+file_save,/continue
943   - file_save=data_dir+use_source_name+use_model+'_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
  928 + file_save=data_dir+use_source_name+use_model+'_logn_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
944 929 save,NHCO,NHI,NHmap,norm_stars_map,EBV_map,F0_map,G0_map,F0_predicted_map,G0_predicted_map,Yg1_map,Yg2_map,Yg3_map,fact_map,chi2_map,rchi2_map,dF0_map,dYg1_map,dYg2_map,dYg3_map,F0_hit_map,Yg1_hit_map,Yg2_hit_map,Yg3_hit_map,NH_values_map,residual_maps,residual_maps_perc,file=file_save
945 930 message,'Wrote '+file_save,/continue
946 931 ENDIF
... ... @@ -961,7 +946,7 @@ ENDELSE
961 946  
962 947 ;stop
963 948  
964   -file=data_dir+use_source_name+use_model+'_JWST_G0_YPAH_YVSG_on-voronoi_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
  949 +file=data_dir+use_source_name+use_model+'_logn_JWST_G0_YPAH_YVSG_on-voronoi_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
965 950 st_info=file_info(file)
966 951 IF st_info.exists NE 1 THEN BEGIN
967 952 message,'Could not find '+file,/continue
... ... @@ -982,7 +967,7 @@ restore,file,/verb
982 967 ; % RESTORE: Restored variable: F0_HIT.
983 968 ; % RESTORE: Restored variable: YPAH_HIT.
984 969 ; % RESTORE: Restored variable: YVSG_HIT.
985   -file=data_dir+use_source_name+use_model+'_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
  970 +file=data_dir+use_source_name+use_model+'_logn_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
986 971 st_info=file_info(file)
987 972 IF st_info.exists NE 1 THEN BEGIN
988 973 message,'Could not find '+file,/continue
... ... @@ -1366,7 +1351,7 @@ IF keyword_set(do_postscripts) THEN BEGIN
1366 1351 postscript=ps_file,orientation='portrait'
1367 1352 message,'Wrote '+ps_file,/continue
1368 1353 ENDIF
1369   -stop
  1354 +;stop
1370 1355  
1371 1356 window,win,xsize=800,ysize=900 & win=win+1
1372 1357 imrange=1.+[-0.5,+0.5]
... ...
LabTools/IRAP/JPB/phangs_isrf_pipeline.pro
... ... @@ -120,41 +120,47 @@ make_phangs_isrf_classes,bidon,source_name='ngc0628',/save,resolution_filter='PA
120 120  
121 121 ;===test new tables
122 122 dustem_init
123   -;table_name_root='_orig_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
  123 +
  124 +;Test
124 125 table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
125 126 class_min_max=[15,20]
126 127 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,/fit_G0,resolution_filter='PACS3' $
127 128 ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max,/save
128 129  
129   -
130   -;table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  130 +;ISRF classes
131 131 table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
132 132 class_min_max=0
  133 +show_sed=0
133 134 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS3' $
134   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max
  135 + ,/subtract_star_light,show_sed=show_sed,/nostop,table_name_root=table_name_root,class_min_max=class_min_max
135 136  
136   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  137 +;idem from restore and do postscripts
  138 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
137 139 class_min_max=0
  140 +postscripts_dir=!phangs_data_dir+'/ISRF/WORK/PS/ngc0628_PACS3/'
138 141 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS3' $
139   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max,/from_restore,/do_postscripts
140   -
141   -phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS3',/show_seds,/subtract_star_light,/nostop
  142 + ,/subtract_star_light,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
  143 + ,/from_restore,/do_postscripts,postscripts_dir=postscripts_dir
142 144  
143   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  145 +;Mathis ISRF
  146 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
144 147 class_min_max=0
  148 +show_sed=0
145 149 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS3' $
146   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max,/force_mathis
  150 + ,/subtract_star_light,show_sed=show_sed,/nostop,table_name_root=table_name_root,class_min_max=class_min_max,/force_mathis
147 151  
148   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  152 +;idem from restore and do postscripts
  153 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
149 154 class_min_max=0
  155 +postscripts_dir=!phangs_data_dir+'/ISRF/WORK/PS/ngc0628_PACS3_Mathis/'
150 156 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,/fit_G0,/save,resolution_filter='PACS3' $
151   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max,/from_restore,/do_postscripts,/force_mathis
152   -
  157 + ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
  158 + ,/from_restore,/do_postscripts,/force_mathis,postscripts_dir=postscripts_dir
153 159  
154 160 ;This is option A1 (using default value):
155 161 ;This is when not trying to fit G0, ie, assuming same average relation between predicted F0 and F0
156 162 ;This therefore has discrete values of F0 set by the grid values
157   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  163 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
158 164 class_min_max=0
159 165 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=0,set_yvsg=0,/save,resolution_filter='PACS3' $
160 166 ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max
... ... @@ -163,7 +169,7 @@ phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/includ
163 169 ;This is option A1 (using map at lower resolution):
164 170 ;This is when not trying to fit G0, ie, assuming same average relation between predicted F0 and F0
165 171 ;This therefore has discrete values of F0 set by the grid values
166   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  172 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
167 173 class_min_max=0
168 174 data_dir=!phangs_data_dir+'/ISRF/WORK/'
169 175 source_name='ngc0628'
... ... @@ -187,19 +193,19 @@ phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/includ
187 193  
188 194 ;This is option A1M:
189 195 ;This is when not trying to fit G0 and using Mathis field
190   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  196 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
191 197 class_min_max=0
192 198 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=0,set_yvsg=0,/save,resolution_filter='PACS3' $
193 199 ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max,/force_mathis
194 200  
195 201 ;This is option B1: ie, assuming standard Ysg
196   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  202 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
197 203 class_min_max=0
198 204 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=1,set_yvsg=1,/save,resolution_filter='PACS3' $
199 205 ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max
200 206  
201 207 ;This is option B1, using low res Ysg, and Nearest marginalization method (This works)
202   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  208 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
203 209 class_min_max=0
204 210 data_dir=!phangs_data_dir+'/ISRF/WORK/'
205 211 source_name='ngc0628'
... ... @@ -209,23 +215,33 @@ mathis_str=''
209 215 reso_str='_PACS3'
210 216 fit_G0_str=''
211 217 set_yvsg_str=''
212   -file_save=data_dir+source_name+model+'_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
  218 +file_save=data_dir+source_name+model+'_logn_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
213 219 restore,file_save,/verb
214 220 restore,data_dir+source_name+'_ref_header'+reso_str+'.sav',/verb
215 221 nostop=0
216 222 marginalize_method='NEAREST'
  223 +show_sed=0
217 224 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=1,set_yvsg=1,/save,resolution_filter='PACS3' $
218   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
  225 + ,/subtract_star_light,show_sed=show_sed,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
219 226 ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method
220 227  
221   -;This is option B1, using low res Ysg, and RELLIKELYHOOD marginalization method (This does not work well)
222   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  228 +;same as above from_restore, doing postscript files
  229 +postscripts_dir=!phangs_data_dir+'/ISRF/WORK/PS/ngc0628_PACS3_B1_NEAREST'
  230 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
  231 +phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=1,set_yvsg=1,resolution_filter='PACS3' $
  232 + ,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
  233 + ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method,/from_restore,/do_postscripts,postscripts_dir=postscripts_dir
  234 +
  235 +
  236 +
  237 +;This is option B1, using low res Ysg, and NEAREST marginalization method and Mathis field
  238 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
223 239 class_min_max=0
224 240 data_dir=!phangs_data_dir+'/ISRF/WORK/'
225 241 source_name='ngc0628'
226 242 model='DL07'
227 243 norm_str='_normalized'
228   -mathis_str=''
  244 +mathis_str='_MATHIS'
229 245 reso_str='_PACS3'
230 246 fit_G0_str=''
231 247 set_yvsg_str=''
... ... @@ -234,12 +250,22 @@ restore,file_save,/verb
234 250 restore,data_dir+source_name+'_ref_header'+reso_str+'.sav',/verb
235 251 nostop=0
236 252 marginalize_method='NEAREST'
  253 +show_sed=0
237 254 phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=1,set_yvsg=1,/save,resolution_filter='PACS3' $
238   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
  255 + ,/subtract_star_light,show_sed=show_sed,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
239 256 ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method
240 257  
  258 +;same as above, from_restore, doing postscript files
  259 +postscripts_dir=!phangs_data_dir+'/ISRF/WORK/PS/ngc0628_PACS3_B1M_NEAREST'
  260 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
  261 +phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=1,set_yvsg=1,resolution_filter='PACS3' $
  262 + ,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
  263 + ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method $
  264 + ,/from_restore,/do_postscripts,postscripts_dir=postscripts_dir
  265 +
  266 +
241 267 ;This is option B1, using low res Ysg, and PREDICTOR marginalization method (This does should in principle work)
242   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  268 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
243 269 class_min_max=0
244 270 data_dir=!phangs_data_dir+'/ISRF/WORK/'
245 271 source_name='ngc0628'
... ... @@ -258,12 +284,6 @@ phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/includ
258 284 ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
259 285 ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method
260 286  
261   -;This is option B1M: ie, assuming standard Ysg, and Mathis field
262   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
263   -class_min_max=0
264   -phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=1,set_yvsg=1,/save,resolution_filter='PACS3' $
265   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max,/force_mathis
266   -
267 287 ;============================================================================================================
268 288 ;===== NGC0628 at PACS2 resolution
269 289 ;============================================================================================================
... ... @@ -520,7 +540,8 @@ phangs_smooth_muse_isrf,'ngc0628',resolution_value=1./60.^2,/save,/nostop
520 540 make_phangs_isrf_classes,bidon,source_name='ngc0628',/save,resolution_value=1./60.^2
521 541  
522 542 ;ngc0628_1arcsec_B1_NEAREST (1arcsec_B1_NEAREST)
523   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  543 +;table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  544 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis' ;rem: They also have YPAH0 added ....
524 545 class_min_max=0
525 546 data_dir=!phangs_data_dir+'/ISRF/WORK/'
526 547 source_name='ngc0628'
... ... @@ -540,36 +561,21 @@ phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/includ
540 561 ,/subtract_star_light,show_sed=show_sed,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
541 562 ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method,/silent
542 563  
543   -;ngc0628_1arcsec_B1_NEAREST (1arcsec_B1_NEAREST)
544   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
545   -class_min_max=0
546   -data_dir=!phangs_data_dir+'/ISRF/WORK/'
547   -source_name='ngc0628'
548   -model='DL07'
549   -norm_str='_normalized'
550   -mathis_str=''
551   -reso_str='_PACS3'
552   -fit_G0_str=''
553   -set_yvsg_str=''
554   -file_save=data_dir+source_name+model+'_JWST_G0_YPAH_YVSG_maps_with-ISRFclasses'+norm_str+mathis_str+reso_str+fit_G0_str+set_yvsg_str+'.sav'
555   -restore,file_save,/verb
556   -restore,data_dir+source_name+'_ref_header'+reso_str+'.sav',/verb
557   -nostop=0
558   -marginalize_method='NEAREST'
  564 +;same as above, doing postscripts
  565 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
559 566 postscripts_dir=!phangs_data_dir+'/ISRF/WORK/PS/ngc0628_1arcsec_B1_NEAREST'
560   -phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/include_herschel,/normalize,fit_G0=1,set_yvsg=1,/save,resolution_value=1./60.^2 $
561   - ,/subtract_star_light,/show,/nostop,table_name_root=table_name_root,class_min_max=class_min_max $
562   - ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method $
  567 +phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/normalize,fit_G0=1,set_yvsg=1,resolution_value=1./60.^2 $
  568 + ,/nostop,table_name_root=table_name_root $
563 569 ,/from_restore,/do_postscripts,postscripts_dir=postscripts_dir
564 570  
565 571 ;ngc0628_1arcsec_B1M_NEAREST (1arcsec_B1M_NEAREST)
566   -table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
  572 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
567 573 class_min_max=0
568 574 data_dir=!phangs_data_dir+'/ISRF/WORK/'
569 575 source_name='ngc0628'
570 576 model='DL07'
571 577 norm_str='_normalized'
572   -mathis_str=''
  578 +mathis_str='_MATHIS'
573 579 reso_str='_PACS3'
574 580 fit_G0_str=''
575 581 set_yvsg_str=''
... ... @@ -586,6 +592,16 @@ phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/includ
586 592 ,yvsg_option='MAP',yvsg_fits_map=Yg3_map,yvsg_fits_header=href,marginalize_method=marginalize_method,force_mathis=force_mathis $
587 593 ,silent=silent
588 594  
  595 +;same as above, doing postscripts
  596 +table_name_root='_logn_MuseISRF_JWST_adaptedG0_Ypah1added_Yvsgadded_4Phangs_noionis'
  597 +postscripts_dir=!phangs_data_dir+'/ISRF/WORK/PS/ngc0628_1arcsec_B1M_NEAREST'
  598 +force_mathis=1
  599 +phangs_brute_force_fit_with_isrf_grid,model='DL07',source_name='ngc0628',/normalize,fit_G0=1,set_yvsg=1,resolution_value=1./60.^2 $
  600 + ,/nostop,table_name_root=table_name_root $
  601 + ,/from_restore,/do_postscripts,postscripts_dir=postscripts_dir,force_mathis=force_mathis
  602 +
  603 +;J'en suis la
  604 +
589 605 ;ngc0628_1arcsec_B1M_NEAREST (1arcsec_B1M_NEAREST)
590 606 table_name_root='_MuseISRF_JWST_adaptedG0_Ypah1added_Ypah2added_adaptedYvsgadded_4Phangs_noionis'
591 607 class_min_max=0
... ... @@ -778,12 +794,12 @@ phangs_smooth_muse_isrf,'ngc0628',reso_filter='SPIRE1',/save
778 794 ;Note: faire un chmod a+rwx * apres transfert sur alma1
779 795  
780 796 source_name='ngc3351'
781   -;J'en SUIS LA
782 797  
783 798 ;produces _jwst_images.sav and _ref_header.sav
784 799 phangs_make_jwst_images,source_name='ngc3351',/save,/show,/nostop
785 800 ;produces _muse_filters_data.sav,_muse_images.sav, _muse_NH.sav
786 801 phangs_make_muse_filters_images,source_name='ngc3351',/save,/show,/nostop
  802 +;J'en SUIS LA
787 803 ;produces _astrosat_data.sav
788 804 phangs_make_astrosat_images,source_name='ngc3351',/save,/show,/nostop
789 805 ;produces _herschel_images.sav
... ... @@ -799,4 +815,17 @@ make_phangs_isrf_classes,source_name='ngc3351',/fits
799 815  
800 816 phangs_brute_force_fit_with_isrf_grid,source_name='ngc3351',/include_herschel,/normalize,/fit_G0
801 817  
  818 +;=== NGC3351 @ PAC3
  819 +;produces _jwst_images.sav and _ref_header.sav
  820 +phangs_make_jwst_images,source_name='ngc3351',/save,/show,/nostop,resolution_filter='PACS3'
  821 +;produces _muse_filters_data.sav,_muse_images.sav, _muse_NH.sav
  822 +phangs_make_muse_filters_images,source_name='ngc3351',/save,/show,/nostop,resolution_filter='PACS3'
  823 +;J'en SUIS LA
  824 +;produces _astrosat_data.sav
  825 +phangs_make_astrosat_images,source_name='ngc3351',/save,/show,/nostop
  826 +;produces _herschel_images.sav
  827 +phangs_make_herschel_images,source_name='ngc3351',/save,/show,/nostop
  828 +phangs_make_hi_images,source_name='ngc3351',/save,/show,/nostop
  829 +phangs_make_co_images,source_name='ngc3351',/save,/show,/nostop
  830 +
802 831 END
... ...
LabTools/IRAP/JPB/phangs_make_astrosat_images.pro
... ... @@ -109,6 +109,7 @@ FOR i=0L,Nastrosat_filter-1 DO BEGIN
109 109 IF st_info.exists NE 1 THEN BEGIN
110 110 message,'Could not find file '+file,/continue
111 111 stop
  112 + goto,next_filter
112 113 ENDIF
113 114 d=mrdfits(file,0,h)
114 115 steradians=(sxpar(h,'CDELT2')/!radeg)^2 ;pixel in sr
... ... @@ -139,6 +140,7 @@ FOR i=0L,Nastrosat_filter-1 DO BEGIN
139 140 image_cont20,d,href,/square,imrange=imrange,image_color_table='jpbloadct',axis_color_table=1,/silent,tit=tit,off_bar_pos=obp
140 141 astrosat_images[*,*,0,i]=d
141 142 IF not keyword_set(nostop) THEN stop
  143 + next_filter:
142 144 ENDFOR
143 145  
144 146 ;Invent variances (will have to do better)
... ...
LabTools/IRAP/JPB/phangs_make_jwst_images.pro
... ... @@ -56,10 +56,14 @@ dustem_init
56 56 obp=[1.1,0,1.15,1]
57 57 win=0L
58 58  
  59 +;use_DR='DR1'
  60 +use_DR='DR1p1'
  61 +
59 62 ;data_dir='/Volumes/PILOT_FLIGHT1/PHANGS-JWST/DR1/'
60 63 ;data_dir=!phangs_data_dir+'/phangs_drive/PHANGS-JWST/DR1/'
61 64 ;/data/projects/phangs/phangs_drive/Archive/PHANGS_JWST/DR1/ngc0628/f1000w_psf_matched
62   -data_dir=!phangs_data_dir+'/phangs_drive/Archive/PHANGS_JWST/DR1/'+use_source_name+'/f300m_psf_matched/'
  65 +;data_dir=!phangs_data_dir+'/phangs_drive/Archive/PHANGS_JWST/'+use_DR+'/'+use_source_name+'/f300m_psf_matched/'
  66 +data_dir=!phangs_data_dir+'/phangs_drive/Archive/PHANGS_JWST/'+use_DR+'/'+use_source_name+'/f200w_psf_matched/'
63 67 save_data_dir=!phangs_data_dir+'/ISRF/WORK/'
64 68  
65 69 ;========== get JWST reference header
... ... @@ -120,7 +124,8 @@ IF not keyword_set(nostop) THEN stop
120 124  
121 125 ;========== Make JWST images
122 126 FOR i=0L,Nfilters-1 DO BEGIN
123   - data_dir=!phangs_data_dir+'/phangs_drive/Archive/PHANGS_JWST/DR1/'+use_source_name+'/'+strlowcase(filters_names2[i])+'_psf_matched/'
  127 + ;data_dir=!phangs_data_dir+'/phangs_drive/Archive/PHANGS_JWST/'+use_DR+'/'+use_source_name+'/'+strlowcase(filters_names2[i])+'_psf_matched/'
  128 + data_dir=!phangs_data_dir+'/phangs_drive/Archive/PHANGS_JWST/'+use_DR+'/'+use_source_name+'/f200w_psf_matched/'
124 129 file=data_dir+use_source_name+'_'+strlowcase(instrus[i])+'_lv3_'+strlowcase(filters_names2[i])+'_i2d_anchor_atgauss1.fits'
125 130 st_info=file_info(file)
126 131 IF st_info.exists NE 1 THEN BEGIN
... ...