cccccc produces survey plots give ra,dec limits
cccc   f77 survey_plot.f -o survey_plot.e -L/star/lib putenv.c `pgplot_link`
cccc  f77 survey_plot2.f -o survey_plot2.e -L/star/lib putenv.c -lpng -l pgplot -l X11
      program survey_plot
      implicit none
      integer numArgs,ios,pixelwidth,pixelheight,i
      real boxL,boxR,boxT,boxB,xpt(4),ypt(4),x1,x2,y1,y2,xtick,
     >ytick,ri
      character argv*132,coveragefile*132,pointsFile*132,
     >plusFile*132,title*64,ph*6,pw*6,
     > str1*32,str2*32

ccc      call putenv('PGPLOT_GIF_WIDTH=640')
ccc      call putenv('PGPLOT_GIF_HEIGHT=480')
ccc      call putenv('PGPLOT_FOREGROUND=black')
ccc      call putenv('PGPLOT_BACKGROUND=white')
      numArgs=iargc();
      call getarg(1,argv)
      read(argv,'(a)') coveragefile
      call getarg(2,argv)
      read(argv,*) boxL
      call getarg(3,argv)
      read(argv,*) boxR
      call getarg(4,argv)
      read(argv,*) boxB
      call getarg(5,argv)
      read(argv,*) boxT
      call getarg(6,argv)
      read(argv,*) xtick
      call getarg(7,argv)
      read(argv,*) ytick
      call getarg(8,argv)
      read(argv,'(a)') title
      if (numArgs .gt. 8) then
      call getarg(9,argv)
      read(argv,'(a)') pointsFile
      end if
      pixelwidth=nint((boxR-boxL)*800./24.0)
      pixelwidth=800
      pixelheight=nint((boxT-boxB)*600./180.0)
      pixelheight=600
      if (numArgs .gt. 9) then
      call getarg(10,argv)
       read(argv,*,err=11) pixelwidth
 11    continue
      call getarg(11,argv)
       read(argv,*,err=22) pixelheight
      endif
 22    continue
      write (6,*) boxL,boxR,boxT,boxB

      write(ph,'(i6.6)') pixelheight
      write(pw,'(i6.6)') pixelwidth
      str1='PGPLOT_GIF_WIDTH='//pw
      str2='PGPLOT_GIF_HEIGHT='//ph
      write(6,*)pixelwidth,pixelheight,str1,str2
      call putenv(str1)
      call putenv(str2)
      call putenv('PGPLOT_FOREGROUND=black')
      call putenv('PGPLOT_BACKGROUND=white')
      CALL PGBEGIN(0,'/gif',1,1)
      CALL PGVPORT(0.0,1.0,0.0,1.0)
      CALL PGVSTD
      call pgscr(17,0.85,0.85,0.85)
      call pgscr(18,0.5,0.5,0.5)
      call pgslw(2)
      CALL PGSWIN (boxL,boxR,boxB,boxT)
      CALL PGBOX ('BCSTN', xtick, 5, 'BCNST', ytick, 5)
      CALL PGLAB('Right Ascension (hours)','Declination (degrees)'
     >,title)
 
      open (11,file=coveragefile,status='old')
      ios=0
      do while (ios .eq. 0)
      read (11,*,iostat=ios,err=20,end=20) x1,y1
       x1=x1/15.0

 
      call pgsci(17)
      call pgsfs(1)
      call pgslw(6)
      call pgpt1(x1,y1,-1)
  
      end do
 20   continue

 30   continue


      close (11)
      open (12,file=pointsFile,status='old',err=40)
      ios=0
      do while (ios .eq. 0)
      read (12,*,iostat=ios,err=35,end=35) x1,x2,y1,y2
      x1=x1/15.0
      x2=x2/15.0
cccc      write (6,*) x1,x2,y1,y2
      if (x1 .le. x2) then
      xpt(1)=x1
      ypt(1)=y1
      xpt(2)=x2
      ypt(2)=y1
      xpt(3)=x2
      ypt(3)=y2
      xpt(4)=x1
      ypt(4)=y2

      call pgsci(1)
      call pgsfs(1)
      call PGPOLY(4, XPT, YPT)
cc
cc      call pgsci(2)
cc      call pgsfs(2)
cc      call pgslw(5)
cc      call PGPOLY(4, XPT, YPT)
      end if
      end do
 35   continue
      rewind(12)
      ios=0
      do while (ios .eq. 0)
      read (12,*,iostat=ios, err=40,end=40) x1,x2,y1,y2
      x1=x1/15.0
      x2=x2/15.0
cccc      write (6,*) x1,x2,y1,y2
      if (x1 .le. x2) then
      xpt(1)=x1
      ypt(1)=y1
      xpt(2)=x2
      ypt(2)=y1
      xpt(3)=x2
      ypt(3)=y2
      xpt(4)=x1
      ypt(4)=y2
      call pgsci(2)
      call pgsfs(2)
      call PGPOLY(4, XPT, YPT)
      end if
      end do

 40   continue
      close(12)


      call pgsci(18)
      call pgslw(1)
      call pgsls(4)
      do ri=-90,90, ytick/2.0
      call pgmove(0.0,real(ri))
      call pgdraw(24.0,real(ri))
      enddo
      do ri=0,24, xtick
      call pgmove(real(ri),-90.0)
      call pgdraw(real(ri),90.0)
      enddo
       CALL PGEND

      stop
      end
