Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temperature response for Si detectors #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

athrayspanchap
Copy link
Contributor

No description provided.

@athrayspanchap
Copy link
Contributor Author

Hi @LinErinG created a pull request with @DanRyanIrish's direction!

@somusset
Copy link
Contributor

In foxsi2_count_spectrum.pro, line 74:

eff_fudge = (1-0.05)

Can you explain what this is with a comment? I also am not sure if this line is important because I did not find eff_fudge called later in the file, but I might be wrong because I looked very quickly.

@athrayspanchap
Copy link
Contributor Author

You are right Sophie. This is not important. I think I was trying to introduce some fudge factor, later dropped that idea. May be I can comment that line out with a note.

@somusset
Copy link
Contributor

somusset commented Apr 3, 2019

Hi Athiray,
Yes I think you should comment this since it is not currently use
Also, I think when the temperature response is calculated, the save file should not be in spec but in the calibration data folder, since in spec we have only procedures, not data files. I would do something like this:
data_dir = 'calibration_data/'
save,logte,dem_resp_overarea_ppixel,filename='$FOXSIPKG' + '/' + data_dir +'foxsi_Si_temperature_response.sav'

Can you implement these changes?

@athrayspanchap
Copy link
Contributor Author

athrayspanchap commented Apr 3, 2019 via email

al_legend, ['4.5 keV','5.5 keV','6.5 keV','7.5 keV','8.5 keV','9.5 keV'], $
textcol=[2,3,4,5,6,7], thick=6, charsi=1.2, box=0, /bottom, /right

save,logte,dem_resp_overarea_ppixel,filename='foxsi_Si_temperature_response.sav'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here the temperature response is save in the current folder, would it make more sense to save it in the calibration folder of the FOXSI distribution?


; fold flux with FOXSI response
eff_fudge = (1-0.05)
counts = flux*area.eff_area_cm2 ; now the units are counts per second per keV

; Smear to account for imperfect energy resolution (~0.5 keV).
if keyword_set(smear) then begin
i=where( emid gt 3. and emid lt 30. )
nbins = 0.5 / average(ewid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a keyword for the energy resolution? Then this function could be used for CdTe also.

;finding counts at mid ponit of each E bin using interpol
counts_smear_coarse = interpol(counts_smear, emid, emid_smear_coarse) ; units still in counts / sec / keV
counts_smear_coarse = counts_smear_coarse*time ; Now units are counts / keV
y_err_smear_raw = sqrt(counts_smear_coarse) ; units also in counts / keV
Copy link
Contributor

@jtvievering jtvievering Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think y_err_smear_raw should be:
y_err_smear_raw = sqrt(counts_smear_coarse/binsize)

Otherwise the units don't work out. This also applies to y_err_avg_smear_raw, y_err_raw, and y_err_avg_raw.

(emid le e1_coarse[avg_ct]))]) ; units still in counts / sec / keV
counts_avg_coarse = counts_avg_coarse*time ; Now units are counts / keV
y_err_avg_raw = sqrt(counts_avg_coarse)
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you include this option in the code (averagects but no smear), you should also include a way to save this information in "result".

;The following function computes expected AVERAGE foxsi2 counts in 1 keV energy bands
;including smear in detector (0.5 keV fwhm)
f=foxsi2_count_spectrum( em,te[i_te],time=1.,binsize=1.,module=i_det,offaxis=0,/smear,/averagects)
dem_resp[i_det, *, i_te ] = f.counts[4:9] ;counts/s/(10^49cm-3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the units for "counts" from foxsi2_count_spectrum counts/keV?



;Plot FOXSI temperature response for Si Detector 6

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for more general use, we could set a keyword for detector number so that the response for any detector could be plotted?

Changed the path of output temperature response file to store inside calibration_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants