-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_ns_maps_hc.pro
245 lines (217 loc) · 8.34 KB
/
plot_ns_maps_hc.pro
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
pro plot_ns_maps_hc,obs_id=obs_id,maindir=maindir,nsdir=nsdir
; Plot the individual maps and also a combined one
;
; Work in progress version - only a the most recent observations
;
; Options
; obs_id - Which NuSTAR observations (default =1)
; maindir - Main directory of where the NuSTAR data is kept (default for IGH system but only need if no *.dat files)
; nsdir - Specific directory where this NuSTAR obs is kepts (default for IGH system but only need if no *.dat files)
;
; 30-Aug-2016 IGH - Created
; 18-Nov-2016 IGH - Includes more data (from HEASARC) and changes location of output files
; 22-Mar-2017 IGH - Added in Mar 2017 data
; 25-Sep-2017 IGH - Updated with Aug 2017 data
; 26-Sep-2017 IGH - Updated with Sep 2017 data
; 18-Oct-2017 IGH - Updated with Oct 2017 data
; 03-Jun-2018 IGH - Updated wtih May 2018 data
; 10-Sep-2018 IGH - Updated with Sep 2018 data
; 29-Sep-2018 IGH - Updated with Sep 2018 data, QS 28th
; Removed auto scaling to 1e-4 and 1e-1
; 30-Sep-2018 IGH - Increased gaussian sr for Sep 2018 QS data
; 06-Feb-2019 IGH - Updated for heasarc version of Jan data
; 20-Apr-2019 IGH - Updated with Apr 2019 data
; Made sure sr=2 by default (uses bigger value for QS obs)
; 10-May-2019 IGH - Updated with Apr 2019 QS data
; 16-Jul-2019 IGH - Added in Jul 2019 QS data
; 14-Feb-2020 IGH - Added in Jan 2020 data
; 11-Mar-2020 IGH - Updated for Feb 2020
; 02-Jul-2020 IGH - Updated for Jun 2020 data
; 05-Oct-2020 IGH - Updated for Oct 2020, tweak plotting for QS FD mosaic (via qsmos flag)
; 22-Feb-2021 IGH - Added in Jan 2021 data
; 26-May-2021 IGH - Added in Apr/May 2021 data
; 26-Jul-2021 IGH - Added in 20 Jul 2021 data
; 15-Aug-2021 IGH - Added in 30 Jul 2021 data
; 30-Jan-2022 IGH - Added in Nov 2021 data
; 28-Mar-2022 IGH - Added in Feb 2022 data
; 16-Jun-2022 IGH - Added in Jun 2022 data
; 03-Oct-2022 IGH - Added in Sep 2022 data
; 02-Jan-2023 IGH - Added in Dec 2022 data
; 28-Mar-2023 IGH - Added in Mar 2023 data
; 30-Jan-2024 IGH - Added in Dec 2023 data
; 15-May-2024 IGH - Added in Mar 2024 data
; 12-Jul-2024 IGH - Added in Jun 2024 data
; 05-Aug-2024 IGH - Added in Jul 2024 data
; 06-Jan-2025 IGH - Added in Dec 2024 data
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clearplot
if (n_elements(obs_id) ne 1) then obs_id=37
dobs=['20140910','20141101','20141211',$
'20150429','20150901',$
'20160219','20160422','20160726',$
'20170321','20170821','20170911','20171010',$
'20180529','20180907','20180928',$
'20190112','20190412','20190425','20190702',$
'20200129','20200221','20200606','20200912',$
'20210108','20210429','20210720','20210730','20211117',$
'20220224','20220603','20220906','20221209',$
'20230318','20231228',$
'20240330','20240630','20240716','20241224']
obsname=dobs[obs_id]
if (n_elements(maindir) ne 1) then maindir='~/data/heasarc_nustar/';'~/data/ns_data/'
if (obsname eq '20180529') then nsdir='obs13' else nsdir='ns_'+obsname
if (obsname eq '20180907') then nsdir='obs14/quicklook' ;else nsdir='ns_'+obsname
if (obsname eq '20180928') then nsdir='obs15/quicklook' ;else nsdir='ns_'+obsname
if (obsname eq '20190112') then begin
nsdir='ns_20190112';'obs16/quicklook'
maindir='~/data/heasarc_nustar/'
endif
if (obsname eq '20190412') then nsdir='obs17' ;else nsdir='ns_'+obsname
if (obsname eq '20200606') then begin
nsdir='ns_20200606'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20200912') then begin
nsdir='ns_20200912'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20210108') then begin
nsdir='ns_20210108'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20210429') then begin
nsdir='ns_20210429'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20210720') then begin
nsdir='ns_20210720'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20210730') then begin
nsdir='ns_20210730'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20211117') then begin
nsdir='ns_20211117'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20220224') then begin
nsdir='ns_20220224'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20220603') then begin
nsdir='ns_20220603'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20220906') then begin
nsdir='ns_20220906'
endif
if (obsname eq '20221209') then begin
nsdir='ns_20221209'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20230318') then begin
nsdir='ns_20230318'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20231228') then begin
nsdir='ns_20231228'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20240330') then begin
nsdir='ns_20240330'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20240630') then begin
nsdir='ns_20240630'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20240716') then begin
nsdir='ns_20240716'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
if (obsname eq '20241224') then begin
nsdir='ns_20241224'
maindir='/Volumes/Samsung_T5/data/heasarc_nustar/'
endif
; control color scaling on final maps by obsid
if (obs_id eq 8 or obs_id eq 13 or obs_id eq 12 or obs_id eq 11 or $
obs_id eq 10 or obs_id eq 19 or obs_id eq 23 or obs_id eq 24 or obs_id eq 27 or obs_id eq 28) then begin
dnl=1e-4
dmx=1e1
endif else begin
dnl=1e-3
dmx=1e1
endelse
; For the QS Mosaic data
if (obs_id eq 14 or obs_id eq 15 or obs_id eq 17 or obs_id eq 18 or $
obs_id eq 20 or obs_id eq 22) then begin
dnl=1e-5
dmx=1e-2
endif
if (obs_id eq 26) then begin
dnl=1e-4
dmx=1e0
endif
;--------------------------------------------
ffa=file_search(maindir+nsdir,'*FPM*.fits')
nf=n_elements(ffa)
sr=2
if (obs_id eq 14) then sr=8
if (obs_id eq 15) then sr=8
@post_outset
!p.multi=0
loadct,74,/silent
reverse_ct
tvlct,r,g,b,/get
r[0]=0
g[0]=0
b[0]=0
r[1]=255
g[1]=255
b[1]=255
tvlct,r,g,b
plim=1500
xr=[-1,1]*plim
yr=[-1,1]*plim
for i=0, nf-1 do begin
; Load in the map
fits2map,ffa[i],mm
; need to setup things a bit differently for the QS combined mosaics
; just manually identify they and send to a different plotting option
fitsname=(strsplit(ffa[i],'/',/extract))[-1]
; Extra filter to change binning and scale for the proper QS full disk mosaics
qsmos=0
if (obs_id eq 20 and (fitsname eq 'maps_ns_20200221_1002_FPMA.fits' or fitsname eq 'maps_ns_20200221_1002_FPMB.fits' or $
fitsname eq 'maps_ns_20200221_1001_FPMA.fits' or fitsname eq 'maps_ns_20200221_1001_FPMB.fits' )) then qsmos=1
if (obs_id eq 22 and (fitsname eq 'maps_ns_20200912_1001_FPMA.fits' or fitsname eq 'maps_ns_20200912_1001_FPMB.fits')) then qsmos=1
if (qsmos eq 1) then begin
newx=n_elements(mm.data[*,0])/16.
newy=n_elements(mm.data[0,*])/16.
dnl=1e-5
dmx=1e-2
mms=rebin_map(mm,newx,newy)
endif else begin
mms=mm
mms.data=gauss_smooth(mms.data,sr)
endelse
idbp=where(mms.data eq 0,nidbp)
if (nidbp gt 0) then mms.data[idbp]=1e-12
; modify the scaling on the fly?
; if (mean(mms.data) lt 1e-2) then dnl=1e-4 else dnl=1e-3
ftemp=strsplit(ffa[i],'/',/extract)
ftemp=ftemp[n_elements(ftemp)-1]
fname=(strsplit(ftemp,'.',/extract))[0]
set_plot,'ps'
device, /encapsulated, /color, / isolatin1,/inches, $
bits=8, xsize=4.5, ysize=4.5,file='maps/maps_'+obsname+'/'+fname+'.eps'
plot_map,mms,/log,dmin=dnl,dmax=dmx,position=[0.17,0.13,0.87,0.83],$
title=mms.id,grid_sp=30,xrange=xr,yrange=yr,$
gcolor=0,bot=1,chars=0.8,xtitle='x [arcsec]',ytitle='y [arcsec]'
plot_map_cb_igh,alog10([dnl,dmx]),position=[0.15,0.96,0.85,0.98],color=0,chars=0.8,$
cb_title='NuSTAR [log!D10!N count s!U-1!N]',bottom=1,format='(f4.1)'
if (obs_id eq 14 or obs_id eq 15) then xyouts,100,100,'gsr'+string(sr,format='(i1)'),/device,chars=0.5
device,/close
set_plot, mydevice
endfor
end