summaryrefslogtreecommitdiffstats
path: root/funtools/doc/pod/funflush.pod
diff options
context:
space:
mode:
Diffstat (limited to 'funtools/doc/pod/funflush.pod')
-rw-r--r--funtools/doc/pod/funflush.pod107
1 files changed, 107 insertions, 0 deletions
diff --git a/funtools/doc/pod/funflush.pod b/funtools/doc/pod/funflush.pod
new file mode 100644
index 0000000..b525ad2
--- /dev/null
+++ b/funtools/doc/pod/funflush.pod
@@ -0,0 +1,107 @@
+=pod
+
+=head1 NAME
+
+
+
+B<FunFlush - flush data to output file>
+
+
+
+=head1 SYNOPSIS
+
+
+
+
+
+ #include <funtools.h>
+
+ void FunFlush(Fun fun, char *plist)
+
+
+
+
+
+=head1 DESCRIPTION
+
+
+
+
+The B<FunFlush> routine will flush data to a FITS output file. In
+particular, it can be called after all rows have been written (using
+the FunTableRowPut() routine)
+in order to add the null padding that is required to complete a FITS
+block. It also should be called after completely writing an image using
+FunImagePut() or after writing
+the final row of an image using
+FunTableRowPut().
+
+
+The B<plist> (i.e., parameter list) argument is a string
+containing one or more comma-delimited B<keyword=value>
+parameters. If the plist string contains the parameter
+"copy=remainder" and the file was opened with a reference file, which,
+in turn, was opened for extension copying (i.e. the input
+FunOpen() mode also was "c" or "C"),
+then FunFlush also will copy the remainder of the FITS extensions from
+the input reference file to the output file. This normally would be
+done only at the end of processing.
+
+
+Note that FunFlush() is called
+with "copy=remainder" in the mode string by FunClose(). This means
+that if you close the output file before the reference input file, it
+is not necessary to call
+FunFlush() explicitly, unless you
+are writing more than one extension. See the
+evmerge example code. However, it is safe to
+call FunFlush() more than once
+without fear of re-writing either the padding or the copied
+extensions.
+
+
+In addition, if FunFlush() is
+called on an output file with the plist set to "copy=reference" and if
+the file was opened with a reference file, the reference extension is
+written to the output file. This mechanism provides a simple way to
+copy input extensions to an output file without processing the former.
+For example, in the code fragment below, an input extension is set to
+be the reference file for a newly opened output extension. If that
+reference extension is not a binary table, it is written to the output
+file:
+
+ /* process each input extension in turn */
+ for(ext=0; ;ext++){
+ /* get new extension name */
+ sprintf(tbuf, "%s[%d]", argv[1], ext);
+ /* open input extension -- if we cannot open it, we are done */
+ if( !(ifun=FunOpen(tbuf, "r", NULL)) )
+ break;
+ /* make the new extension the reference handle for the output file */
+ FunInfoPut(ofun, FUN_IFUN, &ifun, 0);
+ /* if its not a binary table, just write it out */
+ if( !(s=FunParamGets(ifun, "XTENSION", 0, NULL, &got)) ||
+ strcmp(s, "BINTABLE")){
+ if( s ) free(s);
+ FunFlush(ofun, "copy=reference");
+ FunClose(ifun);
+ continue;
+ }
+ else{
+ /* process binary table */
+ ....
+ }
+ }
+
+
+
+
+
+=head1 SEE ALSO
+
+
+
+See funtools(n) for a list of Funtools help pages
+
+
+=cut