function near_pc_fwhm, e, par return, par(0)*0.4117*sqrt(e) end ;+ ; ; NAME: ; NEAR_PC_RESP ; ; PURPOSE: ; This procedure computes the X-ray response of the NEAR P-I-N SI detector to a solar flux. ; Because it is designed to work with the generic SPEX ; CATEGORY: ; NEAR, SPEX ; ; CALLING SEQUENCE: ; NEAR_PC_RESP, EDGES_OUT=EDGES_OUT, EDGES_IN=EDGES_IN, $ ; AREA=AREA, DRM=DRM ; ; CALLS: ; RESP_CALC ; ; KEYWORDS: ; EDGES_OUT- Energy channel edges in keV. ; EDGES_IN - Photon input energies for DRM in keV. ; DRM - detector response, counts/sec/cm2/keV per photon/keV/cm2 ; ; OPTIONAL INPUTS: ; none ; ; OUTPUTS: ; none explicit, only through commons; ; ; OPTIONAL OUTPUTS: ; none ; ; COMMON BLOCKS: ; none ; ; SIDE EFFECTS: ; none ; ; RESTRICTIONS: ; none ; ; PROCEDURE: ; none ; ; MODIFICATION HISTORY: ; Version 1 ras, 17-may-1996 ; Version 2 ras, 15-aug-1996, added to common block, changed interpolation ; range ; Version 3 rds, 10-oct-1996, modified for NEAR Proportional ; Counter ; Version 4 RAS, 19-Nov-1996, modified for use with new resp_calc ; and explicit EOUT, includes call to PULSE_SPREAD for ; resolution broadening ;- PRO NEAR_PC_RESP, EDGES_OUT=ENEAR, EDGES_IN=EDGES, AREA=AREA, DRM=DRM, $ _extra=_extra common near_pc_resp, gain_mod, edges_out_sav, edges_in_sav, eloss_mat if n_elements(gain_mod) eq 0 then gain_mod= {gain, gain: 1.0, offset:0.0, fwhm: 0.5} if datatype( gain_mod ) eq 'STC' then begin tags = tag_names(gain_mod) w_fwhm = (where( tags eq 'FWHM', nfwhm))(0) w_gain = (where( tags eq 'GAIN', ngain))(0) w_offset = (where( tags eq 'OFFSET', noffset))(0) endif if datatype( eloss_mat ) eq 'STC' then begin tags = tag_names( eloss_mat) w_fwhm = (where( tags eq 'FWHM', mfwhm))(0) w_gain = (where( tags eq 'GAIN', mgain))(0) w_offset = (where( tags eq 'OFFSET', moffset))(0) endif common f_vth_com, use_vlth use_vlth = 1 detector='NPC' area= 25.0 ;cm2 if keyword_set(mfwhm) then fwhm_old = eloss_mat.fwhm else fwhm_old =0.5 if nfwhm eq 1 then fwhm = gain_mod.fwhm else fwhm = fwhm_old fwhm=0.840 func='near_pc_fwhm func_par=[fwhm,fltarr(3)] d = 4.3 nflux=300 elo = 1.001 ;keV ehi = 13.0 ;keV eout = findgen(221)*0.07 + 0.1 ;output pha for resp_calc, real pha later z=[4,12] gmcm=[.00254*1.847,.000847*1.738] ;print,gmcm ; 0.014074 if n_elements(eloss_mat) eq 0 or fwhm ne fwhm_old then begin resp_calc, detector,area,func,func_par,d,z,gmcm,nflux,elo,ehi, $;inputs eloss_mat1, pls_ht_mat, edges, smatrix_mat, eout=eout wmat1 = where( eloss_mat1 ne 0.0) emat1= eloss_mat1(wmat1) endif else edges = edges_in_sav edge_products, edges, edges_2=edges, wid=wedges, mean=emdges if keyword_set(mgain) then gain_old = eloss_mat.gain else gain_old=1.0 if ngain eq 1 then gain = gain_mod.gain else gain = gain_old if keyword_set(moffset) then offset_old = eloss_mat.offset else offset_old=0.0 if noffset eq 1 then offset = gain_mod.offset else offset = offset_old if n_elements(eloss_mat1) ge 1 then $ eloss_mat = {eloss_mat_pc, eloss_mat:eloss_mat1, $ fwhm: fwhm, gain: gain, offset:offset, eout:eout, wmat:wmat1, emat:emat1} else begin eloss_mat.fwhm = fwhm eloss_mat.gain = gain eloss_mat.offset = offset endelse gain_mod= {gain_pc, gain: gain, offset:offset, fwhm: fwhm} ;E=0.03918*keV/ch-.05485 keV ;pin calibration ;enear =(.0398/gain)*(findgen(257) - 0.5) - .0266 + offset > 1.001 ;enear =(.0394/gain)*(findgen(257) - 0.5) - .055 + offset > 1.001 ;enear =(0.039605/gain)*(findgen(257) - 0.5) - 0.0536511 + offset > 1.001 ;enear =(0.039605/gain)*(findgen(257) - 0.5) - 0.0536511 + offset > 0.1 enear =(0.0395394 /gain)*(findgen(257) - 0.5) - 0.0702844 + offset > 0.1 edge_products, enear, edges_2=enear, mean=emnear, wid=wnear edges_out_sav = enear input_psm = {ein: eout, eout: enear, func:func, func_par:func_par} pulse_spread, input_psm, pulse_shape, eloss_mat.eloss_mat, drm drm = f_div( drm, rebin(wnear, n_elements(emnear), nflux))/area checkvar, edges_in_sav, fltarr(2,nflux) if total( abs(edges_in_sav-edges) ) ne 0 then begin help,vlth( 1., 1., te6=findgen(200)*0.1+2., edges= edges) edges_in_sav = edges endif end