c c------------------------------------------------------------------ c subroutine maptrac(satut,satlat,satlon,iydsat,npts,chsize,chsat) c c Generate global cylindrical equidistant map with line showing sat track c containing npts data points c Assume proper set call has been made c Label uses chsize for character size c npts = number of points for x-axis (ut) c character*56 toplab character*(*) chsat dimension satut(npts),satlat(npts),satlon(npts),satmin(npts) data dut/.2/ ! delta ut(hrs) at which to label ut along orbit track c c Declarations for axes labeling: c parameter (nx=7,ny=7,mxlab=20) dimension xx(nx),yy(ny) dimension utlat(3),utlon(3),utfmlab(mxlab) data xx/-180.,-120.,-60.,0.,60.,120.,180./ data yy/-90.,-60.,-30.,0.,30.,60.,90./ character*8 utlab,utlabs(mxlab) character*16 labx,laby data laby/' LATITUDE (DEG) '/ data labx/' LONGITUDE (DEG)'/ data utlat/-45.,0.,45./, utlon/-90.,0.,90./ c c Save current set: call getset(pl,pr,pb,pt,wl,wr,wb,wt,lty) c c Set up ezmap: proj = 'CE ' plat = 0. plon = 0. call cpseti('MAP - mapping flag',1) rot = 0. call mappos(pl,pr,pb,pt) call mapsti('EL',0) call mapstc('OU','CO') call mapsti('DO',1) call maproj(proj,plat,plon,rot) call mapset('MA',0.,0.,0.,0.) call mapsti('G1',1) call mapsti('G2',2) call mapsti('VS',0) call mapint c c Draw sat track across projection: c (do not draw line when it wraps around from ~ -180 to +180) c c (mark beginning of orbit with 'B', and end with 'E') call maptrn(satlat(1),satlon(1),xpos,ypos) call plchmq(xpos,ypos,'B',.01,0.,-1.) offs = .01 xut = satut(1) c c Want to mark ut at some reasonable interval along the sat orbit c track. Since orbits are about 90 min, use a delta of 12 minutes. c Mkutlab returns labs(nlabs) and utlabs(nlabs) c subroutine mkutlab(utmin,ntms,idelmin,labs,utlabs,mxlabs,nlabs) c mindel = 12 idaysat0 = iydsat - iydsat/1000*1000 c note satut is always increasing do i=1,npts idaysat = idaysat0 + ifix(satut(i))/24 uth = satut(i)-ifix(satut(i))/24*24. satmin(i) = float(idaysat*1440) + uth*60. enddo call mkutlab(satmin,npts,mindel,utlabs,utfmlab,mxlab,nutlab) c write(6,"('maptrac after mkutlab: nutlab=',i2,' utlabs=', c + /(8(a8,' ')))") nutlab,(utlabs(i),i=1,nutlab) c write(6,"(' iydsat=',i5,' idaysat0=',i5,' idaysat=',i5)") c + iydsat,idaysat0,idaysat iutlab = 1 c do 100 i=2,npts call maptrn(satlat(i),satlon(i),xpos1,ypos1) if (xpos.ne.1.e12.and.ypos.ne.1.e12.and. + xpos1.ne.1.e12.and.ypos1.ne.1.e12.and. + abs(satlon(i)-satlon(i-1)).lt.300.) then c c Check for a ut label: c if (iutlab.le.nutlab) then idaysat = idaysat0 + ifix(satut(i))/24 fmlabmin = float(idaysat*1440) + utfmlab(iutlab)*60. if (fmlabmin.ge.satmin(i-1).and.fmlabmin.le.satmin(i)) then xutlab = xpos+((xpos1-xpos)*(fmlabmin-satmin(i-1)) / + (satmin(i)-satmin(i-1))) lutlab = lenstr(utlabs(iutlab)) c c Track is 'horizontal' on the map: c if (abs(xpos-xpos1).gt.abs(ypos-ypos1)) then if (satlat(i).lt.-60.) then call plchhq(xutlab,ypos1, + ' '//utlabs(iutlab)(1:lutlab),.01,90.,-1.) elseif (satlat(i).gt.60.) then call plchhq(xutlab,ypos1, + utlabs(iutlab)(1:lutlab)//' ',.01,90.,1.) else call plchhq(xutlab,ypos1, + ' '//utlabs(iutlab)(1:lutlab),.01,0.,-1.) endif c c Track is 'vertical' on the map: else if (satlon(i).gt.140.) then call plchhq(xutlab,ypos1, + utlabs(iutlab)(1:lutlab)//' ',.01,0.,1.) else call plchhq(xutlab,ypos1, + ' '//utlabs(iutlab)(1:lutlab),.01,0.,-1.) endif endif call plchmq(xutlab,ypos1,'x',.01,0.,0.) xut = satut(i) iutlab = iutlab+1 endif endif 200 continue c c Draw the sat track for current points: call line(xpos,ypos,xpos1,ypos1) endif xpos = xpos1 ypos = ypos1 100 continue c c Mark end of track: call plchmq(xpos,ypos,'E',.01,0.,1.) c c Label axes: call labrect(xx,nx,yy,ny,labx,laby,chsize) c c Add continental outlines: call maplot call set(pl,pr,pb,pt,wl,wr,wb,wt,lty) c c Add top label: call clearstr(toplab) write(toplab,"(a,' orbit track (npts = ', + i4,')')") chsat(1:lenstr(chsat)),npts c c (vl < 0 -> put left end of string at abs(vl)) c call wrlab(toplab(1:lenstr(toplab)),0.5*(pl+pr),pt+.02,.012) call cpseti('MAP - mapping flag',0) c return end