C+ C NAME: C smei_sky_iread C PURPOSE: C Read one of the real*4 arrays in an orbital sky map C CATEGORY: C ucsd/camera/for/lib C CALLING SEQUENCE: subroutine smei_sky_iread(cFile, mode, nx, ny, skymap, cx, cy, dd, ctype) C INPUTS: C cFile*(*) character fully qualified Fits file name C mode integer selects Fits extension C = 0: (used by smei_sky_read) C = 1: (used by smei_sky_read) C = 2: (used by smei_sky_read) C = 3: C = 4: C = 5: C = 6: (used by smei_sky_read) C = 7: (used by smei_sky_read) C = 8: (used by smei_sky_read) C = 9: (used by smei_sky_read) C =10: (used by smei_sky_read) C =11: (used by smei_sky_read) C =12: Bad pixel map C C The equatorial map is 3600x1200; the polar maps 1600x1600. C all others are 720x360 arrays. C OUTPUTS: C nx,ny integer dimensions of sky map C If there is an open error (usually because the file does not C exist) then nx=0 and ny=0 is returned. C skymap(nx,ny) integer sky map C cx,cy,dd double precision C constants relating array index to RA and dec. C For north polar map: C i=cx+dd*RA*cos(90-decl); j=cy+dd*RA*sin(90-decl) C For south polar map: C i=cx+dd*RA*cos(90+decl); j=cy+dd*RA*sin(90+decl) C For all other (equatorial) maps: C i=cx+dd*RA; j=cy+dd*decl C ctype character*(*) string describing data C INCLUDE: include 'smei_frm_layout.h' include 'filparts.h' include 'ftspar.h' C CALLS: C iGetLun, iFreeLun, say_fts, Say, FTGKYS C FTNOPN, FTMAHD, FTGISZ, FTGPVE, FTGKYD, FTCLOS, FTGPVJ C SEE ALSO: C smei_htm_fts C PROCEDURE: C MODIFICATION HISTORY: C FEB-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- character cFile*(*) integer mode integer nx integer ny integer skymap(*) double precision cx double precision cy double precision dd character ctype*(*) character cSay*13 /'smei_sky_read'/ character cSeverity /'E'/ character cStr*(FIL__LENGTH) logical anyf integer nAxes(2) iU = iGetLun(cFile) istat = 0 call FTNOPN(iU, cFile, FTS__READONLY, istat) if (istat .ne. 0) then iU = iFreeLun(iU) call Say(cSay,'W',cFile,'not found') nx = 0 ny = 0 !istat = 0 !call say_fts(cSay,cSeverity,istat) end if ! Advance to the requested map if (mode .ne. 0) call FTMAHD(iU, mode+1, ihdutype, istat) !call FTCLOS(iU, istat) !if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) !I = 0 !I = I+Str2Str(cFile , cStr(I+1:)) !I = I+Str2Str('+' , cStr(I+1:)) !I = I+Int2Str(mode , cStr(I+1:)) !call FTNOPN(iU, cStr, FTN__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) nx = nAxes(1) ny = nAxes(2) anyf = .FALSE. call FTGPVJ(iU, 1, 1, nx*ny, 0.0, skymap, anyf, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) ! Replace zero by bad values !call ArrR4Copy(SMEI__FRM_NPIX,pattern,pat_mode_0) !call ArrR4Mask(SMEI__FRM_NPIX,pattern,BadR4(),0.0,0.0,0.0,1.0,pat_mode_0) !call FTGKYD(iU, 'CXLO', cx, cStr, istat) !if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) !call FTGKYD(iU, 'CYLO', cy, cStr, istat) !if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) !call FTGKYD(iU, 'D_LO', dd, cStr, istat) !if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTGKYS(iU, 'MAP' , cType, cStr, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) ! Close fts file call FTCLOS(iU, istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) iU = iFreeLun(iU) return end