qfits/qfits/html/structqfitsdumper.html

231 lines
8.1 KiB
HTML

<html>
<head>
<meta name="keywords" content="eso, FITS format, C library">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<title>qfits 5.1.1</title>
</head>
<body text="#000000" bgcolor="#ffffff">
<!-- Generated by Doxygen 1.4.1 -->
<h1>qfitsdumper Struct Reference</h1>qfits dumper control object
<a href="#_details">More...</a>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqfitsdumper.html#o0">filename</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqfitsdumper.html#o1">npix</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqfitsdumper.html#o2">ptype</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqfitsdumper.html#o3">ibuf</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqfitsdumper.html#o4">fbuf</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqfitsdumper.html#o5">dbuf</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqfitsdumper.html#o6">out_ptype</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
qfits dumper control object
<p>
This structure offers various control parameters to dump a pixel buffer to a FITS file. The buffer will be dumped as requested to the requested file in append mode. Of course, the requested file must be writeable for the operation to succeed.<p>
The following example demonstrates how to save a linear ramp sized 100x100 to a FITS file with BITPIX=16. Notice that this code only dumps the pixel buffer, no header information is provided in this case.<p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> i, j ;
<span class="keywordtype">int</span> * ibuf ;
<a class="code" href="structqfitsdumper.html">qfitsdumper</a> qd ;
<span class="comment">// Fill a buffer with 100x100 int pixels</span>
ibuf = malloc(100 * 100 * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
<span class="keywordflow">for</span> (j=0 ; j&lt;100 ; j++) {
<span class="keywordflow">for</span> (i=0 ; i&lt;100 ; i++) {
ibuf[i+j*100] = i+j ;
}
}
qd.<a class="code" href="structqfitsdumper.html#o0">filename</a> = <span class="stringliteral">"out.fits"</span> ; <span class="comment">// Output file name</span>
qd.<a class="code" href="structqfitsdumper.html#o1">npix</a> = 100 * 100 ; <span class="comment">// Number of pixels</span>
qd.<a class="code" href="structqfitsdumper.html#o2">ptype</a> = PTYPE_INT ; <span class="comment">// Input buffer type</span>
qd.<a class="code" href="structqfitsdumper.html#o3">ibuf</a> = ibuf ; <span class="comment">// Set buffer pointer</span>
qd.<a class="code" href="structqfitsdumper.html#o6">out_ptype</a> = BPP_16_SIGNED ; <span class="comment">// Save with BITPIX=16</span>
<span class="comment">// Dump buffer to file (error checking omitted for clarity)</span>
<a class="code" href="qfits_8h.html#a78">qfits_pixdump</a>(&amp;qd);
free(ibuf);
</pre></div><p>
If the provided output file name is "STDOUT" (all capitals), the function will dump the pixels to the stdout steam (usually the console, could have been re-directed).
<p>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="o5" doxytag="qfitsdumper::dbuf"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">double* <a class="el" href="structqfitsdumper.html#o5">qfitsdumper::dbuf</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Pointer to input double pixel buffer </td>
</tr>
</table>
<a class="anchor" name="o4" doxytag="qfitsdumper::fbuf"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">float* <a class="el" href="structqfitsdumper.html#o4">qfitsdumper::fbuf</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Pointer to input float pixel buffer </td>
</tr>
</table>
<a class="anchor" name="o0" doxytag="qfitsdumper::filename"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">char* <a class="el" href="structqfitsdumper.html#o0">qfitsdumper::filename</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Name of the file to dump to, "STDOUT" to dump to stdout </td>
</tr>
</table>
<a class="anchor" name="o3" doxytag="qfitsdumper::ibuf"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int* <a class="el" href="structqfitsdumper.html#o3">qfitsdumper::ibuf</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Pointer to input integer pixel buffer </td>
</tr>
</table>
<a class="anchor" name="o1" doxytag="qfitsdumper::npix"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int <a class="el" href="structqfitsdumper.html#o1">qfitsdumper::npix</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of pixels in the buffer to dump </td>
</tr>
</table>
<a class="anchor" name="o6" doxytag="qfitsdumper::out_ptype"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int <a class="el" href="structqfitsdumper.html#o6">qfitsdumper::out_ptype</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Requested BITPIX in output FITS file </td>
</tr>
</table>
<a class="anchor" name="o2" doxytag="qfitsdumper::ptype"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int <a class="el" href="structqfitsdumper.html#o2">qfitsdumper::ptype</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Buffer type: PTYPE_FLOAT, PTYPE_INT or PTYPE_DOUBLE </td>
</tr>
</table>
<hr>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="qfits_8h.html">qfits.h</a></ul>
</body>
</html>