C+ C NAME: C smei_orb_min C PURPOSE: C Accumulate minimum orbital pattern C CATEGORY: C ucsd/camera/for/lib C CALLING SEQUENCE: subroutine smei_orb_min(nsec,nx,ny,frame,ip_min,ip_frac,orb_pattern,ped_val,dark_scale,cal_pattern) C INPUTS: C nsec integer number of seconds into orbit C nx integer horizontal frame size C ny integer vertical frame size C frame(*) real frame data (after massaging by href=smei_frm_clean=) C orb_pattern(*) real pattern to be updated. C Should be initialized to BadR4 by caller. C ped_val real pedestal value (from href=smei_frm_ped=) C dark_scale real scaling factor for calibration patttern C cal_pattern(*) real closed shutter calibration pattern C OUTPUTS: C orb_pattern(*) real updated orbital minimum pattern C INCLUDE: include 'smei_frm_layout.h' C RESTRICTIONS: C SEE ALSO: C PROCEDURE: C MODIFICATION HISTORY: C JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- integer nsec integer nx integer ny real frame(*) real orb_pattern(*) real ped_val real dark_scale real cal_pattern(*) integer smei_frm_mode ploc(i,j) = (j-1)*nx+i bad = BadR4() i = smei_frm_mode(nx,nbin) ileft = (SMEI__DRK_COL(1)-1)/nbin+1 iright = SMEI__DRK_COL(SMEI__DRK_NCOL)/nbin do j=1,ny do i=1,nx k = ploc(i,j) val = frame(k) if (val .ne. bad) then val = val-ped_val if (ileft .le. i .and. i .le. iright) val = val-dark_scale*cal_pattern(k) orb_pat = orb_pattern(ip_min+k) if (orb_pat .eq. bad) then orb_pat = val orb_pattern(ip_frac+k) = float(nsec) else orb_pat = min(orb_pat, val) if (orb_pat .eq. val) orb_pattern(ip_frac+k) = float(nsec) end if orb_pattern(ip_min+k) = orb_pat end if end do end do return end