-
Notifications
You must be signed in to change notification settings - Fork 0
/
foxsi4_resp_diag.pro
132 lines (117 loc) · 6.61 KB
/
foxsi4_resp_diag.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
Function foxsi4_resp_diag, pos = pos, energy_arr = energy_arr, att_wheel = att_wheel, plot = plot
; Purpose:
; Calculate FOXSI-4 instrument response (1D diagonol elements) as a function of energy for each telescope (Units: cm^2)
;
; Note:
; Include response from optics, blaneting material, attenuators, and detectors.
; Position 0: MSFC high-resolution optics + CMOS
; Position 1: Nagoya high-resolution optics + CMOS
; Position 2: 10-shell optics + CdTe
; Position 3: MSFC high-resolution optics + pixelated attenuator + CdTe
; Position 4: Nagoya high-resolution optics + CdTe
; Position 5: 10-shell optics + pixelated attenuator + CdTe
; Position 6: MSFC high-resolution optics + Timepix
; Detector energy resolution not considered here (considered in foxsi4_resp_2d.pro and foxsi4_ct_spec.pro).
;
; Keywords:
; pos: position number (must be from 0 to 6)
; energy_arr: 1d energy array in keV (default is [1.00,1.01,1.02,...,41.00])
; att_wheel: set this to 1 to insert the attenutor wheel (only have effects on CdTe strip detectors)
; plot: set this to 1 to plot total effective area vs energy
;
; Outputs:
; Data structure that consists of energy array (keV) and effective area (cm2)
;
; Examples:
; resp = foxsi4_resp_diag(pos = 2, energy_arr = findgen(100)*0.2+1, plot = 1)
; resp = foxsi4_resp_diag(pos = 4, att_wheel = 1, plot = 1)
; resp = foxsi4_resp_diag(pos = 6, plot = 1)
;
; History:
; Oct 2023, created by Y. Zhang
Default, energy_arr, findgen(4000)*0.01+1
Default, att_wheel, 0
Default, plot, 0
; thickness of the uniform Al attenuator attached to the detector (only needed for Position 2 and 4)
al_thickness = [0,0,380,0,113,0,0]
; thicknesses of the Al attenuator on the insertable wheel (only needed for CdTe strip detectors)
al_att_wheel = [0,0,390,140,185,335,0]
If total(pos eq findgen(7)) ne 1 then begin
print, "Error: position must be an integer between 0 and 6"
return,0
Endif
;-------------------------------------------------------------------------------------
; Position 0: MSFC high-resolution optics + CMOS
If pos eq 0 then begin
optics = foxsi4_optics_effarea(energy_arr = energy_arr, msfc_hi_res = 1) ; optics effective area
colli_trans = 0.4 ; optics collimator
; optics filter: 5um polymide C22H10N2O5 + 150 nm Al
optf_poly = get_material_transmission('material_data/polymide_att_len.txt', 5., energy_arr = energy_arr)
optf_al = get_material_transmission('material_data/al_att_len.txt', 0.15, energy_arr = energy_arr)
optf_trans = optf_poly.transmission * optf_al.transmission
optics.eff_area_cm2 = optics.eff_area_cm2 * colli_trans * optf_trans
blanketing= foxsi4_blanketing(energy_arr = energy_arr) ; blanketing transmission
al_um = 0
atten = foxsi4_attenuator(energy_arr = energy_arr, al_um = al_um, pixelated_att = 0) ; attenuator transmission
detector = foxsi4_deteff(energy_arr = energy_arr, cmos = 1) ; detector efficiency
Endif
; Position 1: Nagoya high-resolution optics + CMOS
If pos eq 1 then begin
optics = foxsi4_optics_effarea(energy_arr = energy_arr, nagoya_sxr = 1) ; optics effective area
blanketing= foxsi4_blanketing(energy_arr = energy_arr) ; blanketing transmission
al_um = al_thickness[pos]
atten = foxsi4_attenuator(energy_arr = energy_arr, al_um = al_um, pixelated_att = 0) ; attenuator transmission
detector = foxsi4_deteff(energy_arr = energy_arr, cmos = 1) ; detector efficiency
Endif
; Position 2: 10-shell optics + blanketing + uniform Al attenuator + CdTe
If pos eq 2 then begin
optics = foxsi4_optics_effarea(energy_arr = energy_arr, heritage = 1) ; optics effective area
blanketing= foxsi4_blanketing(energy_arr = energy_arr) ; blanketing transmission
al_um = al_thickness[pos]
If att_wheel eq 1 then al_um = al_um + al_att_wheel[pos]
atten = foxsi4_attenuator(energy_arr = energy_arr, al_um = al_um, pixelated_att = 0) ; attenuator transmission
detector = foxsi4_deteff(energy_arr = energy_arr, cdte = 1) ; detector efficiency
Endif
; Position 3: MSFC high-resolution optics + blanketing + pixelated attenuator + CdTe
If pos eq 3 then begin
optics = foxsi4_optics_effarea(energy_arr = energy_arr, msfc_hi_res = 1) ; optics effective area
blanketing= foxsi4_blanketing(energy_arr = energy_arr) ; blanketing transmission
al_um = al_thickness[pos]
If att_wheel eq 1 then al_um = al_um + al_att_wheel[pos]
atten = foxsi4_attenuator(energy_arr = energy_arr, al_um = al_um, pixelated_att = 1) ; attenuator transmission
detector = foxsi4_deteff(energy_arr = energy_arr, cdte = 1) ; detector efficiency
Endif
; Position 4: Nagoya optics + blanketing + uniform Al attenuator + CdTe
If pos eq 4 then begin
optics = foxsi4_optics_effarea(energy_arr = energy_arr, nagoya_hxr = 1) ; optics effective area
blanketing= foxsi4_blanketing(energy_arr = energy_arr) ; blanketing transmission
al_um = al_thickness[pos]
If att_wheel eq 1 then al_um = al_um + al_att_wheel[pos]
atten = foxsi4_attenuator(energy_arr = energy_arr, al_um = al_um, pixelated_att = 0) ; attenuator transmission
detector = foxsi4_deteff(energy_arr = energy_arr, cdte = 1) ; detector efficiency
Endif
; Position 5: 10-shell optics + blanketing + pixelated attenuator + CdTe
If pos eq 5 then begin
optics = foxsi4_optics_effarea(energy_arr = energy_arr, heritage = 1) ; optics effective area
blanketing= foxsi4_blanketing(energy_arr = energy_arr) ; blanketing transmission
al_um = al_thickness[pos]
If att_wheel eq 1 then al_um = al_um + al_att_wheel[pos]
atten = foxsi4_attenuator(energy_arr = energy_arr, al_um = al_um, pixelated_att = 1) ; attenuator transmission
detector = foxsi4_deteff(energy_arr = energy_arr, cdte = 1) ; detector efficiency
Endif
; Position 6: MSFC high-resolution optics + blanketing + Timepix
If pos eq 6 then begin
optics = foxsi4_optics_effarea(energy_arr = energy_arr, msfc_hi_res = 1) ; optics effective area
blanketing= foxsi4_blanketing(energy_arr = energy_arr) ; blanketing transmission
al_um = al_thickness[pos]
If att_wheel eq 1 then al_um = al_um + al_att_wheel[pos]
atten = foxsi4_attenuator(energy_arr = energy_arr, al_um = al_um, pixelated_att = 0) ; attenuator transmission
detector = foxsi4_deteff(energy_arr = energy_arr, timepix = 1) ; detector efficiency
Endif
; Final effective area
effarea = optics.eff_area_cm2 * blanketing.transmission * atten.transmission * detector.efficiency
If keyword_set(plot) then plot, energy_arr, effarea, xtitle = 'Energy (keV)', ytitle = 'Effective area (cm2)', $
charsize = 1.4, xr = [4,40], yr = [0.01,5], /xlog, /ylog, /xst, /yst
resp = create_struct("energy_keV", energy_arr, "eff_area_cm2", effarea)
return, resp
End