C+ C NAME: C smei_frm_c3fudge C PURPOSE: C Set dark current fudge ratio for camera 3, mode 1 C CALLING SEQUENCE: function smei_frm_c3fudge(tt,c3mask) C INPUTS: C tt integer(2) SMEI frame time C c3mask integer 0/1: onboard flatfield off/on C INCLUDE: include 'smei_frm_layout.h' C CALLS: C Time2YMD, Time2Delta, Time2Day, Time2DHMS, Say C cTime2Str, cFlt2Str, smei_frm_c3mask_active C PROCEDURE: C c3mask=0: C The dark current fudge ratio is a function of time, and C is determined from a fit to a function C f(t) = 1-exp(-(t-b)/a) C where t is the number of days since 2003/04/15 0 UT C The fit is done by the IDL procedure smei_frm_darkratio.pro C C c3mask=1: C The fudge factor depends on which "bad-pixel" mask is active. C The actual fudge factor is returned by smei_frm_c3mask_active C RESTRICTIONS: C The origin t0 (currently 2003/04/15 0 UT) MUST match the C origin in the IDL procedure!!. C MODIFICATION HISTORY: C JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C Extracted from href=smei_frm_ratio= C- integer tt(2) integer c3mask character cSay*11 /'frm_c3fudge'/ character cTime2Str*80 character cFlt2Str *14 integer Time2Str integer smei_frm_c3mask_active integer t0(4) /2003,04,15,0/ real a / 1330.28/ real b /-1879.37/ integer uu(2) integer hms(4) character ctime*(SMEI__UT_FORMAT_LEN) character cmask*(SMEI__UT_FORMAT_LEN) if (c3mask .eq. 0) then call Time2YMD (1,uu,t0(1),t0(2),t0(3))! Time Origin call Time2Delta(tt,uu,uu) ! Difference with time origin call Time2Day (0,uu,dd) ! Difference in days smei_frm_c3fudge = 1.0-exp((b-dd)/a) else i = Time2Str(SMEI__UT_FORMAT,tt,ctime) i = smei_frm_c3mask_active(0,ctime,c3mask,cmask,smei_frm_c3fudge) if (i .eq. 0) call Say(cSay,'E',ctime,'no mask; expected "bad-pixel" mask') end if call Time2DHMS(tt,hms) ! At the beginning of each hour if (hms(2)*60+hms(3) .lt. 4) & call Say(cSay,'I',cTime2Str('SMEI',tt), & 'fudge ratio is '//cFlt2Str(smei_frm_c3fudge,5)) return end