C+ C NAME: C smei_get_starmask C PURPOSE: C Read in star masks for indexing. C CALLING SEQUENCE subroutine smei_get_starmask(bNoStarMask,n_eq, n_pl, mask) C INPUTS: C bNoStarMask logical .FALSE.: use star mask (read from C file $SMEIDB/starmask.fts.gz) C .TRUE : set mask to zero everywhere C n_eq integer number of bins in hires equatorial map C n_pl integer number of bins in hires polar maps C OUTPUTS: C mask(n_eq+2*n_pl) C integer mask values: C 0: indicates skybin away from bright star C 1: indicates skybin close to bright star. C INCLUDE: include 'filparts.h' include 'dirspec.h' include 'ftspar.h' C CALLS: C iFilePath, Say, FTNOPN, say_fts, iGetLun, iFreeLun, ArrI4Zero C PROCEDURE C If bNoStarMask=.TRUE. then the entire array is filled with zeroes. C This effectively suppresses the correction for 'star-nibbling' C near bright stars. C MODIFCATION HISTORY: C JUN-2011, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C Added bNoStarMask to enable switching off the 'bright-star' C mask used to addres 'star-nibbling'. C- logical bNoStarMask integer n_eq integer n_pl integer mask(*) character cSay*12 /'get_starmask'/ character cSeverity /'E'/ character cFile*(FIL__LENGTH) logical anyf integer nAxes(2) if (bNoStarMask) then call Say(cSay,'I','nostarmask','all mask values set to zero') call ArrI4Zero(n_eq+2*n_pl,mask) ! Equatorial, plus two polar maps else i = iFilePath(cEnvi(:iEnvi)//'SMEIDB',0,' ','starmask.fts.gz',cFile) iU = iGetLun(cFile) istat = 0 call Say(cSay,'I','#'//cFile,'is star mask file') call FTNOPN(iU, cFile, FTS__READONLY, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTGISZ(iU, 2, nAxes, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) n = nAxes(1)*nAxes(2) if (n .ne. n_eq) call Say(cSay,'E','n_eq','wrong array size') anyf = .FALSE. call FTGPVJ(iU, 1, 1, n, 0.0, mask, anyf, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTMAHD(iU, 2, ihdutype, istat) call FTGISZ(iU, 2, nAxes, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) n = nAxes(1)*nAxes(2) if (n .ne. n_pl) call Say(cSay,'E','n_pl','wrong array size') anyf = .FALSE. call FTGPVJ(iU, 1, 1, n, 0.0, mask(n_eq+1), anyf, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTMAHD(iU, 3, ihdutype, istat) call FTGISZ(iU, 2, nAxes, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) n = nAxes(1)*nAxes(2) if (n .ne. n_pl) call Say(cSay,'E','n_pl','wrong array size') anyf = .FALSE. call FTGPVJ(iU, 1, 1, n, 0.0, mask(n_eq+n_pl+1), anyf, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTCLOS(iU, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) iU = iFreeLun(iU) end if return end