aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftuscm.f
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/tbtables/fitsio/ftuscm.f
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/fitsio/ftuscm.f')
-rw-r--r--pkg/tbtables/fitsio/ftuscm.f32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkg/tbtables/fitsio/ftuscm.f b/pkg/tbtables/fitsio/ftuscm.f
new file mode 100644
index 00000000..1d05cf49
--- /dev/null
+++ b/pkg/tbtables/fitsio/ftuscm.f
@@ -0,0 +1,32 @@
+C----------------------------------------------------------------------
+ subroutine ftuscm(input,np,scaled,scale,zero,output)
+
+C unscale the array of complex numbers, prior to writing to the FITS file
+
+C input d array of complex numbers (pairs of real/imaginay numbers)
+C np i total number of values to scale (no. of pairs times 2)
+C scaled l is the data scaled?
+C scale d scale factor
+C zero d offset
+C output d output array
+
+ integer np,i,j
+ logical scaled
+ double precision input(np),output(np)
+ double precision scale,zero
+
+ j=1
+ if (scaled)then
+ do 10 i=1,np/2
+ output(j)=(input(j)-zero)/scale
+ j=j+1
+C the imaginary part of the number is not offset!!
+ output(j)=input(j)/scale
+ j=j+1
+10 continue
+ else
+ do 20 i=1,np
+ output(i)=input(i)
+20 continue
+ end if
+ end