;+ ; NAME: ; smei_sky_cleanedge_sample ; PURPOSE: ; (for internal use by smei_sky_cleanedge_fov) ; Accumulates bins from hires skymaps along strip of ; sky close to edge of fov. ; CATEGORY: ; camera/idl/toolbox ; CALLING SEQUENCE: PRO smei_sky_cleanedge_sample , $ lo_fovx , lo_time , $ ; Lores direction cosine angle and time maps hi_sky , $ ; Hires sky map lo_edge , hi_edge , $ ; Inner and outer edge of strip used to make sample brightness left_time , left_sky , $ right_time , right_sky , $ mode = mode ; INPUTS: ; lo_fovx array[720,360]; type: float ; lo_time array[720,360]; type: float ; 2D lores skymaps: time and fovx angle ; hi_sky array[3600,1200] or array[800,800] ; 2D hires skymap to be corrected ; ; lo_edge scalar; inner edge of strip along edge fov ; (lo_edge=29 degrees) ; hi_edge scalar: outer edge of strip along edge fov ; (hi_edge=30 degrees) ; OUTPUTS: ; left_time array[n]; type: float ; times (as seconds since start of orbit) ; for sky bins along left edge of fov. ; left_sky array[n]; type: float ; sky brightness for sky bins along left ; edge of fov. ; right_time array[n]; type: float ; sky brightness for sky bins along right ; edge of fov. ; right_sky array[n]; type: float ; sky brightness for sky bins along right ; edge of fov ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; boost, cvsmei ; RESTRICTIONS: ; The units of the angles (degrees are radians) must be the ; same for lo_fovx, lo_edge and hi_edge ; PROCEDURE: ; Collects sky bins inside 1-degree strip along "left edge" ; (negative direction cosine angles) and "right edge" (positive ; direction cosine angles) of fov, and stores times in ; left_time and right_sky, and sky brightnesses in ; right_time and right_sky. ; ; Bin times and brightnesses are tagged to the end of the ; *_time and *_sky arrays, i.e. these arrays need to be ; destroyed by the calling procedure prior to accumulating ; sky bins for the three hires maps (equatorial, north pole ; and south pole). ; MODIFICATION HISTORY: ; APR-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- pos = cvsmei(from_map='MAP', from_mode=mode, /to_map, to_mode='lores',/silent) pos = round(pos) ; Nearest lowres grid point xpos = reform(pos[0,*]) ; Horizontal index into lores map ypos = reform(pos[1,*]) ; Vertical index into lowres map fovx = lo_fovx[xpos,ypos] ; Direction cosine angle for all bins in hires sky map ; Left edge: negative direction cosine angles edge = where(-hi_edge LT fovx AND fovx LT -lo_edge) IF edge[0] NE -1 THEN BEGIN boost, left_time, lo_time[xpos[edge],ypos[edge]] boost, left_sky , hi_sky[edge] ENDIF ; Right edge: positive direction cosine angles edge = where(lo_edge LT fovx AND fovx LT hi_edge) IF edge[0] NE -1 THEN BEGIN boost, right_time, lo_time[xpos[edge],ypos[edge]] boost, right_sky , hi_sky[edge] ENDIF RETURN & END