aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbfwsi.x
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tbtables/tbfwsi.x')
-rw-r--r--pkg/tbtables/tbfwsi.x33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/tbtables/tbfwsi.x b/pkg/tbtables/tbfwsi.x
new file mode 100644
index 00000000..985eb27c
--- /dev/null
+++ b/pkg/tbtables/tbfwsi.x
@@ -0,0 +1,33 @@
+include <tbset.h>
+include "tbtables.h"
+
+# tbfwsi -- write size info
+# If the current HDU is a table, this routine writes the number of rows and
+# the number of columns as FITS keywords NAXIS2 and TFIELDS respectively.
+#
+# Phil Hodge, 6-Jul-1995 Subroutine created
+# Phil Hodge, 2-Feb-1996 Check that current HDU is a table.
+# Phil Hodge, 7-Jun-1999 Use TB_SUBTYPE instead of TB_HDUTYPE.
+
+procedure tbfwsi (tp)
+
+pointer tp # i: pointer to table descriptor
+#--
+int status # zero is OK
+errchk tbferr
+
+begin
+ status = 0
+
+ if (TB_SUBTYPE(tp) == TBL_SUBTYPE_BINTABLE ||
+ TB_SUBTYPE(tp) == TBL_SUBTYPE_ASCII) {
+
+ call fsmkyj (TB_FILE(tp), "NAXIS2", TB_NROWS(tp), "", status)
+ if (status != 0)
+ call tbferr (status)
+
+ call fsmkyj (TB_FILE(tp), "TFIELDS", TB_NCOLS(tp), "", status)
+ if (status != 0)
+ call tbferr (status)
+ }
+end