;+ ; NAME: ; smei_frm_mask ; PURPOSE: ; Check whether camera 3 mask is active at specified time ; CATEGORY: ; camera/idl/frm ; CALLING SEQUENCE: FUNCTION smei_frm_mask, tframe, mask=mask ; INPUTS: ; tframe character*(*) SMEI frame time in format YYYY_DOY_hhmmss ; OUTPUTS: ; smei_frm_mask_active ; logical .TRUE. : bad pixel mask in use for specified time ; .FALSE.: no bad pixel mask in use for specified time ; cmask character*(*) mask time in format YYYY_DOY ; This is used in the construction of the file ; name for the mask. ; PROCEDURE: ; A bad pixel mask is in effect during time periods hardcoded in this routine. ; If the specified frame time tframe is inside one of these time periods then ; the appropriate mask is returned. If not inside any one of the time periods ; then a mask containing only the value 1 is returned. ; MODIFICATION HISTORY: ; MAR-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- ; Start time End time Mask name tmask = [ $ ['2006_033_000000','2006_033_235959', '2005_342'] , $ ; Test period ['2006_053_234500','2006_124_235959', '2005_342'] , $ ; Ends when DHU-B comes online ['2006_261_195846','2006_333_235959', '2006_215'] , $ ['2006_334_000000','2050_000_000000', '2006_334'] ] CASE 1 OF IsTime(tframe): tt = TimeSet(tframe,format='YYYY_DOY_hhmmss') ELSE : tt = tframe ENDCASE ; Loop over the time periods where a "bad pixel" mask was in effect. n = (size(tmask,/dim))[1] name = '' SyncArgs, tframe, name, active FOR i=0,n-1 DO BEGIN j = where( tmask[0,i] LE tt AND tt LE tmask[1,i] ) IF j[0] NE -1 THEN name[j] = tmask[2,i] ENDFOR IF arg_present(mask) THEN BEGIN CASE n_elements(name) NE 1 OF 0: message, 'specify single time only to retrieve mask array' 1: BEGIN f = filepath(root=getenv('SMEIDB'),subdir='c3mask','ff_mask_'+name+'.txt') IF txt_read(f,n) THEN mask = byte(n)-48B END ENDCASE ENDIF RETURN, name & END