;+ ; NAME: ; smei_hdr_c3maskupload ; PURPOSE: ; Best effort at determining upload times for C3 "bad-pixel" masks ; CATEGORY: ; camera/idl/hdr ; CALLING SEQUENCE: FUNCTION smei_hdr_c3maskupload, trange, time=time, name=name, status=status ; INPUTS: ; trange array[2]; time structure or valid time string ; start and end time ; OUTPUTS: ; result scalar; type: integer ; number of uploads in specified time period ; OPTIONAL OUTPUT PARAMETERS: ; time array[result]; type: time structure ; upload times ; name array[result]; type: string ; name of "bad-pixel" mask ; status array[result]; type: byte ; 0: upload failed ; 1: upload succesfull ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; IsType, TimeSet, TimeGet, TimeUnit, destroyvar ; PROCEDURE: ; Information mostly from SMEI logs, plus some additional ; information scattered around in the code, primarily ; the Fortran routine href=smei_frm_c3mask_active=.f ; MODIFICATION HISTORY: ; JUN-2010, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- uploads = [ $ [ '2006_012_150000' , '2005_342_000000' , '1' ], $ ; Not sure [ '2006_256_132000' , '2006_???_000000' , '0' ], $ [ '2006_256_160000' , '2006_???_000000' , '0' ], $ [ '2006_257_200000' , '2006_215_000000' , '1' ], $ [ '2006_334_120000' , '2006_334_000000' , '1' ], $ ; Looks really wrong ; No evidence in log this ever happened [ '2007_099_150000' , '2007_083_000000' , '1' ], $ [ '2007_253_210000' , '2007_237_000000' , '1' ], $ [ '2008_039_165500' , '2008_023_000000' , '0' ], $ ; In the middle of FF "on"??? ; Mask check failed on 041_014500 ; FF "off" on 042_173700 [ '2008_049_160000' , '2008_023_000000' , '1' ], $ ; In the middle of FF "on"??? [ '2008_242_143000' , '2008_226_000000' , '1' ], $ [ '2009_044_130000' , '2009_014_000000' , '0' ], $ ; Failed [ '2009_052_140000' , '2009_014_000000' , '1' ], $ [ '2009_278_150000' , '2009_260_000000' , '1' ], $ [ '2010_113_150000' , '2010_098_000000' , '1' ], $ [ '2010_276_150000' , '2010_259_000000' , '1' ], $ [ '2011_055_132000' , '2011_038_000000' , '1' ]$ ] CASE 1 OF IsType(trange,/string): tt = TimeSet(trange) ELSE : tt = trange ENDCASE tt = TimeGet(/_ydoy,tt,upto=TimeUnit(/sec)) nn = where( tt[0] LT uploads[0,*] AND uploads[0,*] LT tt[1], count ) IF count GT 0 THEN BEGIN time = TimeSet( uploads[0,nn] ) name = uploads[1,nn] status = byte(fix(uploads[2,nn])) ENDIF ELSE BEGIN destroyvar, time, name, status ENDELSE RETURN, count & END