• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • edu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • extragear
  • edu
  • kstars
  • kstars
  • fitsviewer
fpack.h
Go to the documentation of this file.
1 /* used by FPACK and FUNPACK
2  * R. Seaman, NOAO
3  * W. Pence, NASA/GSFC
4  */
5 
6 #pragma once
7 
8 #include <string.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 
12 /* not needed any more */
13 /* #include <unistd.h> */
14 /* #include <sys/stat.h> */
15 /* #include <sys/types.h> */
16 
17 #define FPACK_VERSION "1.7.0 (Dec 2013)"
18 /*
19 VERSION History
20 
21 1.7.0 (Dec 2013)
22  - extensive changes to the binary table compression method. All types
23  of binary table columns, including variable length array columns are
24  now supported. The command line table compression flag has been changed
25  to "-table" instead of "-BETAtable", and a new "-tableonly" flag has
26  been introduced to only compress the binary tables in the input files(s)
27  and not the image HDUs.
28 1.6.1 (Mar 2013)
29  - numerous changes to the BETAtable compression method used to compress
30  binary tables
31  - added support for compression 'steering' keywords that specify the
32  desired compression parameters that should be used when compressing
33  that particular HDU, thus overriding the fpack command line parameter
34  values.
35 
36 1.6.0 (June 2012)
37  - Fixed behavior of the "rename" function on Windows platforms so that
38  it will clobber/delete an existing file before renaming a file to
39  that name (the rename command behaves differently on POSIX and non-POSIX
40  environments).
41 
42 1.6.0 (February 2011)
43  - Added full support for compressing and uncompressing FITS binary tables
44  using a newly proposed format convention. This is intended only for
45  further feasibility studies, and is not recommended for use with publicly
46  distributed FITS files.
47  - Use the minimum of the MAD 2nd, 3rd, and 5th order values as a more
48  conservative estimate of the noise when quantizing floating point images.
49  - Enhanced the tile compression routines so that a tile that contains all
50  NaN pixel values will be compressed.
51  - When uncompressing an image that was originally in a FITS primary array,
52  funpack will also append any new keywords that were written into the
53  primary array of the compressed FITS file after the file was compressed.
54  - Added support for the GZIP_2 algorithm, which shuffles the bytes in the
55  pixel values prior to compressing them with gzip.
56 1.5.1 (December 2010) Added prototype, mainly hidden, support for compressing
57  binary tables.
58 1.5.0 (August 2010) Added the -i2f option to lossy compress integer images.
59 1.4.0 (Jan 2010) Reduced the default value for the q floating point image
60  quantization parameter from 16 to 4. This results in about 50% better
61  compression (from about 4.6x to 6.4) with no lost of significant information
62  (with the new subtractive dithering enhancement). Replaced the code for
63  generating temporary filenames to make the code more portable (to Windows).
64  Replaced calls to the unix 'access' and 'stat' functions with more portable
65  code. When unpacking a file, write it first to a temporary file, then
66  rename it when finished, so that other tasks cannot try to read the file
67  before it is complete.
68 1.3.0 (Oct 2009) added randomization to the dithering pattern so that
69  the same pattern is not used for every image; also added an option
70  for losslessly compressing floating point images with GZIP for test
71  purposes (not recommended for general use). Also added support for
72  reading the input FITS file from the stdin file streams.
73 1.2.0 (Sept 2009) added subtractive dithering feature (in CFITSIO) when
74  quantizing floating point images; When packing an IRAF .imh + .pix image,
75  the file name is changed to FILE.fits.fz, and if the original file is
76  deleted, then both the .imh and .pix files are deleted.
77 1.1.4 (May 2009) added -E option to funpack to unpack a list of HDUs
78 1.1.3 (March 2009) minor modifications to the content and format of the -T report
79 1.1.2 (September 2008)
80 */
81 
82 #define FP_INIT_MAGIC 42
83 #define FPACK 0
84 #define FUNPACK 1
85 
86 /* changed from 16 in Jan. 2010 */
87 #define DEF_QLEVEL 4.
88 
89 #define DEF_HCOMP_SCALE 0.
90 #define DEF_HCOMP_SMOOTH 0
91 #define DEF_RESCALE_NOISE 0
92 
93 #define SZ_STR 513
94 #define SZ_CARD 81
95 
96 
97 typedef struct
98 {
99  int comptype;
100  float quantize_level;
101  int no_dither;
102  int dither_offset;
103  int dither_method;
104  float scale;
105  float rescale_noise;
106  int smooth;
107  int int_to_float;
108  float n3ratio;
109  float n3min;
110  long ntile[MAX_COMPRESS_DIM];
111 
112  int to_stdout;
113  int listonly;
114  int clobber;
115  int delete_input;
116  int do_not_prompt;
117  int do_checksums;
118  int do_gzip_file;
119  int do_images;
120  int do_tables;
121  int test_all;
122  int verbose;
123 
124  char prefix[SZ_STR];
125  char extname[SZ_STR];
126  int delete_suffix;
127  char outfile[SZ_STR];
128  int firstfile;
129 
130  int initialized;
131  int preflight_checked;
132 } fpstate;
133 
134 typedef struct
135 {
136  int n_nulls;
137  double minval;
138  double maxval;
139  double mean;
140  double sigma;
141  double noise1;
142  double noise2;
143  double noise3;
144  double noise5;
145 } imgstats;
146 
147 #ifdef __cplusplus
148 extern "C" {
149 #endif
150 
151 int fp_get_param (int argc, char *argv[], fpstate *fpptr);
152 void abort_fpack(int sig);
153 void fp_abort_output (fitsfile *infptr, fitsfile *outfptr, int stat);
154 int fp_usage (void);
155 int fp_help (void);
156 int fp_hint (void);
157 int fp_init (fpstate *fpptr);
158 int fp_list (int argc, char *argv[], fpstate fpvar);
159 int fp_info (char *infits);
160 int fp_info_hdu (fitsfile *infptr);
161 int fp_preflight (int argc, char *argv[], int unpack, fpstate *fpptr);
162 int fp_loop (int argc, char *argv[], int unpack, char *output_filename, fpstate fpvar);
163 int fp_pack (char *infits, char *outfits, fpstate fpvar, int *islossless);
164 int fp_unpack (char *infits, char *outfits, fpstate fpvar);
165 int fp_test (char *infits, char *outfits, char *outfits2, fpstate fpvar);
166 int fp_pack_hdu (fitsfile *infptr, fitsfile *outfptr, fpstate fpvar,
167  int *islossless, int *status);
168 int fp_unpack_hdu (fitsfile *infptr, fitsfile *outfptr, fpstate fpvar, int *status);
169 int fits_read_image_speed (fitsfile *infptr, float *whole_elapse,
170  float *whole_cpu, float *row_elapse, float *row_cpu, int *status);
171 int fp_test_hdu (fitsfile *infptr, fitsfile *outfptr, fitsfile *outfptr2,
172  fpstate fpvar, int *status);
173 int fp_test_table (fitsfile *infptr, fitsfile *outfptr, fitsfile *outfptr2,
174  fpstate fpvar, int *status);
175 int marktime(int *status);
176 int gettime(float *elapse, float *elapscpu, int *status);
177 int fits_read_image_speed (fitsfile *infptr, float *whole_elapse,
178  float *whole_cpu, float *row_elapse, float *row_cpu, int *status);
179 
180 int fp_i2stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status);
181 int fp_i4stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status);
182 int fp_r4stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status);
183 int fp_i2rescale(fitsfile *infptr, int naxis, long *naxes, double rescale,
184  fitsfile *outfptr, int *status);
185 int fp_i4rescale(fitsfile *infptr, int naxis, long *naxes, double rescale,
186  fitsfile *outfptr, int *status);
187 
188 #define fp_msg(msg) _fp_msg((const char *)msg)
189 int _fp_msg (const char *msg);
190 int fp_version (void);
191 int fp_noop (void);
192 
193 int fu_get_param (int argc, char *argv[], fpstate *fpptr);
194 int fu_usage (void);
195 int fu_hint (void);
196 int fu_help (void);
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
fu_usage
int fu_usage(void)
marktime
int marktime(int *status)
fp_pack_hdu
int fp_pack_hdu(fitsfile *infptr, fitsfile *outfptr, fpstate fpvar, int *islossless, int *status)
fp_noop
int fp_noop(void)
imgstats
Definition: fpack.h:134
fpstate::do_tables
int do_tables
Definition: fpack.h:120
imgstats::sigma
double sigma
Definition: fpack.h:140
fpstate::do_gzip_file
int do_gzip_file
Definition: fpack.h:118
fpstate::firstfile
int firstfile
Definition: fpack.h:128
fp_usage
int fp_usage(void)
fp_preflight
int fp_preflight(int argc, char *argv[], int unpack, fpstate *fpptr)
fpstate::initialized
int initialized
Definition: fpack.h:130
fu_get_param
int fu_get_param(int argc, char *argv[], fpstate *fpptr)
fp_get_param
int fp_get_param(int argc, char *argv[], fpstate *fpptr)
imgstats::n_nulls
int n_nulls
Definition: fpack.h:136
fp_test_hdu
int fp_test_hdu(fitsfile *infptr, fitsfile *outfptr, fitsfile *outfptr2, fpstate fpvar, int *status)
fpstate::int_to_float
int int_to_float
Definition: fpack.h:107
fpstate::quantize_level
float quantize_level
Definition: fpack.h:100
fpstate::preflight_checked
int preflight_checked
Definition: fpack.h:131
fpstate::verbose
int verbose
Definition: fpack.h:122
fpstate::smooth
int smooth
Definition: fpack.h:106
imgstats::maxval
double maxval
Definition: fpack.h:138
fp_init
int fp_init(fpstate *fpptr)
fpstate::delete_input
int delete_input
Definition: fpack.h:115
fp_i2stat
int fp_i2stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status)
fpstate::do_images
int do_images
Definition: fpack.h:119
fpstate::do_not_prompt
int do_not_prompt
Definition: fpack.h:116
fu_help
int fu_help(void)
imgstats::noise2
double noise2
Definition: fpack.h:142
fp_pack
int fp_pack(char *infits, char *outfits, fpstate fpvar, int *islossless)
imgstats::noise5
double noise5
Definition: fpack.h:144
fp_i2rescale
int fp_i2rescale(fitsfile *infptr, int naxis, long *naxes, double rescale, fitsfile *outfptr, int *status)
fp_hint
int fp_hint(void)
fpstate::delete_suffix
int delete_suffix
Definition: fpack.h:126
fp_unpack
int fp_unpack(char *infits, char *outfits, fpstate fpvar)
fpstate::to_stdout
int to_stdout
Definition: fpack.h:112
abort_fpack
void abort_fpack(int sig)
fpstate::n3min
float n3min
Definition: fpack.h:109
imgstats::mean
double mean
Definition: fpack.h:139
fp_i4rescale
int fp_i4rescale(fitsfile *infptr, int naxis, long *naxes, double rescale, fitsfile *outfptr, int *status)
fpstate::dither_method
int dither_method
Definition: fpack.h:103
fp_list
int fp_list(int argc, char *argv[], fpstate fpvar)
fp_i4stat
int fp_i4stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status)
fu_hint
int fu_hint(void)
fp_version
int fp_version(void)
fpstate::clobber
int clobber
Definition: fpack.h:114
fp_info_hdu
int fp_info_hdu(fitsfile *infptr)
imgstats::noise1
double noise1
Definition: fpack.h:141
fpstate::scale
float scale
Definition: fpack.h:104
fp_help
int fp_help(void)
gettime
int gettime(float *elapse, float *elapscpu, int *status)
fpstate::listonly
int listonly
Definition: fpack.h:113
fpstate::rescale_noise
float rescale_noise
Definition: fpack.h:105
imgstats::minval
double minval
Definition: fpack.h:137
fp_loop
int fp_loop(int argc, char *argv[], int unpack, char *output_filename, fpstate fpvar)
fpstate::do_checksums
int do_checksums
Definition: fpack.h:117
fpstate::n3ratio
float n3ratio
Definition: fpack.h:108
fp_r4stat
int fp_r4stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status)
SZ_STR
#define SZ_STR
Definition: fpack.h:93
fp_unpack_hdu
int fp_unpack_hdu(fitsfile *infptr, fitsfile *outfptr, fpstate fpvar, int *status)
imgstats::noise3
double noise3
Definition: fpack.h:143
fp_info
int fp_info(char *infits)
fpstate::dither_offset
int dither_offset
Definition: fpack.h:102
fp_abort_output
void fp_abort_output(fitsfile *infptr, fitsfile *outfptr, int stat)
fpstate::no_dither
int no_dither
Definition: fpack.h:101
fpstate::comptype
int comptype
Definition: fpack.h:99
fits_read_image_speed
int fits_read_image_speed(fitsfile *infptr, float *whole_elapse, float *whole_cpu, float *row_elapse, float *row_cpu, int *status)
fp_test_table
int fp_test_table(fitsfile *infptr, fitsfile *outfptr, fitsfile *outfptr2, fpstate fpvar, int *status)
fpstate
Definition: fpack.h:97
fp_test
int fp_test(char *infits, char *outfits, char *outfits2, fpstate fpvar)
fpstate::test_all
int test_all
Definition: fpack.h:121
_fp_msg
int _fp_msg(const char *msg)
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Fri Dec 13 2019 02:57:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

edu API Reference

Skip menu "edu API Reference"
  •     core
  • kstars

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal