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/ftdtyp.f | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pkg/tbtables/fitsio/ftdtyp.f (limited to 'pkg/tbtables/fitsio/ftdtyp.f') diff --git a/pkg/tbtables/fitsio/ftdtyp.f b/pkg/tbtables/fitsio/ftdtyp.f new file mode 100644 index 00000000..c42410b3 --- /dev/null +++ b/pkg/tbtables/fitsio/ftdtyp.f @@ -0,0 +1,35 @@ +C---------------------------------------------------------------------- + subroutine ftdtyp(value,dtype,status) + +C determine datatype of a FITS value field +C This assumes value field conforms to FITS standards and may not +C detect all invalid formats. +C value c input value field from FITS header record only, +C (usually the value field is in columns 11-30 of record) +C The value string is left justified. +C dtype c output type (C,L,I,F) for Character string, Logical, +C Integer, Floating point, respectively +C +C written by Wm Pence, HEASARC/GSFC, February 1991 + + character*(*)value,dtype + integer status + + if (status .gt. 0)return + + dtype=' ' + + if (value(1:1) .eq. '''')then +C character string + dtype='C' + else if (value(1:1).eq.'T' .or. value(1:1).eq.'F')then +C logical + dtype='L' + else if (index(value,'.') .gt. 0)then +C floating point + dtype='F' + else +C assume it must be an integer, since it isn't anything else + dtype='I' + end if + end -- cgit