From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/tbtables/fitsio/ftgics.f | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pkg/tbtables/fitsio/ftgics.f (limited to 'pkg/tbtables/fitsio/ftgics.f') diff --git a/pkg/tbtables/fitsio/ftgics.f b/pkg/tbtables/fitsio/ftgics.f new file mode 100644 index 00000000..fc41266e --- /dev/null +++ b/pkg/tbtables/fitsio/ftgics.f @@ -0,0 +1,47 @@ +C------------------------------------------------------------------------------ + subroutine ftgics(iunit,xrval,yrval,xrpix,yrpix,xinc,yinc,rot, + & type,status) + +C read the values of the celestial coordinate system keywords. +C These values may be used as input to the subroutines that +C calculate celestial coordinates. (FTXYPX, FTWLDP) + +C This routine assumes that the CHDU contains an image +C with the RA type coordinate running along the first axis +C and the DEC type coordinate running along the 2nd axis. + + double precision xrval,yrval,xrpix,yrpix,xinc,yinc,rot + integer iunit,status,tstat + character*(*) type + character comm*20,ctype*8 + + if (status .gt. 0)return + + call ftgkyd(iunit,'CRVAL1',xrval,comm,status) + call ftgkyd(iunit,'CRVAL2',yrval,comm,status) + + call ftgkyd(iunit,'CRPIX1',xrpix,comm,status) + call ftgkyd(iunit,'CRPIX2',yrpix,comm,status) + + call ftgkyd(iunit,'CDELT1',xinc,comm,status) + call ftgkyd(iunit,'CDELT2',yinc,comm,status) + + call ftgkys(iunit,'CTYPE1',ctype,comm,status) + + if (status .gt. 0)then + call ftpmsg('FTGICS could not find all the required'// + & 'celestial coordinate Keywords.') + status=505 + return + end if + + type=ctype(5:8) + + tstat=status + call ftgkyd(iunit,'CROTA2',rot,comm,status) + if (status .gt. 0)then +C CROTA2 is assumed to = 0 if keyword is not present + status=tstat + rot=0. + end if + end -- cgit