;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& pro etc_rc,rmag,wcen=wcen,res=res,snr=snr,time=time ; ress=[370,400,750,1000,1350,1500,2100,2950] ;available R dw=[17.2,16.4,8.6,6.5,4.8,4.3,3.1,2.2] qe=[.13,.18,.15,.17,.15,.15,.13,.12] if n_elements(rmag) eq 0 then rmag=10 if n_elements(wcen) eq 0 then wcen=6700. if n_elements(res) eq 0 then res=2100 ii=fix(xindex(ress,res)+0.5) ; gain=0.96 & rn=6.5 ; f0=2.25e-9 area=75.^2*!pi hcl=6.62*2.99792E-9/wcen ; cps=area*f0/hcl*dw(ii)/3.*qe(ii)*2.512^(-rmag) ; print,' Count rate = ',cps,' counts per second ; if keyword_set(time) then begin time=time>1. cts=cps*time*gain noise=sqrt(cts)+rn sn=cts/noise print,' S/N= ',sn,' in ',time,' sec' endif if keyword_set(snr) then begin snr=snr>3. t=snr*snr/cps/gain print,' Approximately ',t,' sec needed to obtain SN=',snr endif ; if keyword_set(stp) then stop,'ETC_RC>>>' return end