← Index
Performance Profile   « block view • line view • sub view »
For /wise/base/deliv/dev/bin/getfix
  Run on Thu May 20 15:30:03 2010
Reported on Thu May 20 16:25:20 2010

File/wise/base/static/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Astro/FITS/CFITSIO.pm
Statements Executed279
Total Time0.004005 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2120.004100.00410Astro::FITS::CFITSIO::bootstrap (xsub)
26310.000470.00061Astro::FITS::CFITSIO::AUTOLOAD
44410.000180.00018Astro::FITS::CFITSIO::__ANON__[:798]
27120.000140.00014Astro::FITS::CFITSIO::constant (xsub)
00000Astro::FITS::CFITSIO::BEGIN
00000Astro::FITS::CFITSIO::fits_read_header
00000fitsfilePtr::read_header

LineStmts.Exclusive
Time
Avg.Code
1package Astro::FITS::CFITSIO;
212.0e-62.0e-6$VERSION = '1.05';
3
434.4e-51.5e-5use strict;
# spent 11µs making 1 call to strict::import
534.4e-51.5e-5use Carp;
# spent 61µs making 1 call to Exporter::import
630.001260.00042use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
# spent 85µs making 1 call to vars::import
7
811.0e-61.0e-6require Exporter;
911.0e-61.0e-6require DynaLoader;
10100require AutoLoader;
11
1219.0e-69.0e-6@ISA = qw(Exporter DynaLoader);
13
1413.0e-63.0e-6my @__names_no_short = qw(
15 fits_get_compression_type
16 fits_set_compression_type
17 fits_get_noise_bits
18 fits_set_noise_bits
19 fits_get_tile_dim
20 fits_set_tile_dim
21 fits_hdr2str
22 fits_translate_keyword
23 fits_translate_keywords
24 fits_copy_cell2image
25 fits_copy_image2cell
26 );
27
28# perl -nle "next unless /^\s*#define\s+fits_/; (undef,\$l,\$s) = split ' '; print \"\$s => '\$l',\"" /usr/local/cfitsio/longnam.h
29
3010.000390.00039my %__names = (
31 ffiurl => 'fits_parse_input_url',
32 ffrtnm => 'fits_parse_rootname',
33 ffrwrg => 'fits_parse_range',
34 ffrwrgll => 'fits_parse_rangell',
35 ffourl => 'fits_parse_output_url',
36 ffexts => 'fits_parse_extspec',
37 ffextn => 'fits_parse_extnum',
38 ffbins => 'fits_parse_binspec',
39 ffbinr => 'fits_parse_binrange',
40 ffdopn => 'fits_open_data',
41 fftopn => 'fits_open_table',
42 ffiopn => 'fits_open_image',
43 ffomem => 'fits_open_memfile',
44 ffopen => 'fits_open_file',
45 ffdkopn => 'fits_open_diskfile',
46 ffreopen => 'fits_reopen_file',
47 ffinit => 'fits_create_file',
48 ffdkinit => 'fits_create_diskfile',
49 ffimem => 'fits_create_memfile',
50 fftplt => 'fits_create_template',
51 ffflus => 'fits_flush_file',
52 ffflsh => 'fits_flush_buffer',
53 ffclos => 'fits_close_file',
54 ffdelt => 'fits_delete_file',
55 ffexist => 'fits_file_exists',
56 ffflnm => 'fits_file_name',
57 ffflmd => 'fits_file_mode',
58 ffurlt => 'fits_url_type',
59 ffvers => 'fits_get_version',
60 ffupch => 'fits_uppercase',
61 ffgerr => 'fits_get_errstatus',
62 ffpmsg => 'fits_write_errmsg',
63 ffgmsg => 'fits_read_errmsg',
64 ffcmsg => 'fits_clear_errmsg',
65 ffrprt => 'fits_report_error',
66 ffpmrk => 'fits_write_errmark',
67 ffcmrk => 'fits_clear_errmark',
68 ffcmsg => 'fits_clear_errmsg',
69 ffcmps => 'fits_compare_str',
70 fftkey => 'fits_test_keyword',
71 fftrec => 'fits_test_record',
72 ffnchk => 'fits_null_check',
73 ffkeyn => 'fits_make_keyn',
74 ffnkey => 'fits_make_nkey',
75 ffgkcl => 'fits_get_keyclass',
76 ffdtyp => 'fits_get_keytype',
77 ffpsvc => 'fits_parse_value',
78 ffgknm => 'fits_get_keyname',
79 ffgthd => 'fits_parse_template',
80 ffasfm => 'fits_ascii_tform',
81 ffbnfm => 'fits_binary_tform',
82 ffbnfmll => 'fits_binary_tformll',
83 ffgabc => 'fits_get_tbcol',
84 ffgrsz => 'fits_get_rowsize',
85 ffgcdw => 'fits_get_col_display_width',
86 ffprec => 'fits_write_record',
87 ffpky => 'fits_write_key',
88 ffpunt => 'fits_write_key_unit',
89 ffpcom => 'fits_write_comment',
90 ffphis => 'fits_write_history',
91 ffpdat => 'fits_write_date',
92 ffgstm => 'fits_get_system_time',
93 ffgsdt => 'fits_get_system_date',
94 ffdt2s => 'fits_date2str',
95 fftm2s => 'fits_time2str',
96 ffs2dt => 'fits_str2date',
97 ffs2tm => 'fits_str2time',
98 ffpkls => 'fits_write_key_longstr',
99 ffplsw => 'fits_write_key_longwarn',
100 ffpkyu => 'fits_write_key_null',
101 ffpkys => 'fits_write_key_str',
102 ffpkyl => 'fits_write_key_log',
103 ffpkyj => 'fits_write_key_lng',
104 ffpkyf => 'fits_write_key_fixflt',
105 ffpkye => 'fits_write_key_flt',
106 ffpkyg => 'fits_write_key_fixdbl',
107 ffpkyd => 'fits_write_key_dbl',
108 ffpkfc => 'fits_write_key_fixcmp',
109 ffpkyc => 'fits_write_key_cmp',
110 ffpkfm => 'fits_write_key_fixdblcmp',
111 ffpkym => 'fits_write_key_dblcmp',
112 ffpkyt => 'fits_write_key_triple',
113 ffptdm => 'fits_write_tdim',
114 ffptdmll => 'fits_write_tdimll',
115 ffpkns => 'fits_write_keys_str',
116 ffpknl => 'fits_write_keys_log',
117 ffpknj => 'fits_write_keys_lng',
118 ffpknjj => 'fits_write_keys_lnglng',
119 ffpknf => 'fits_write_keys_fixflt',
120 ffpkne => 'fits_write_keys_flt',
121 ffpkng => 'fits_write_keys_fixdbl',
122 ffpknd => 'fits_write_keys_dbl',
123 ffcpky => 'fits_copy_key',
124 ffphps => 'fits_write_imghdr',
125 ffphpsll => 'fits_write_imghdrll',
126 ffphpr => 'fits_write_grphdr',
127 ffphprll => 'fits_write_grphdrll',
128 ffphtb => 'fits_write_atblhdr',
129 ffphbn => 'fits_write_btblhdr',
130 ffpktp => 'fits_write_key_template',
131 ffghsp => 'fits_get_hdrspace',
132 ffghps => 'fits_get_hdrpos',
133 ffmaky => 'fits_movabs_key',
134 ffmrky => 'fits_movrel_key',
135 ffgnxk => 'fits_find_nextkey',
136 ffgrec => 'fits_read_record',
137 ffgcrd => 'fits_read_card',
138 ffgunt => 'fits_read_key_unit',
139 ffgkyn => 'fits_read_keyn',
140 ffgky => 'fits_read_key',
141 ffgkey => 'fits_read_keyword',
142 ffgkys => 'fits_read_key_str',
143 ffgkyl => 'fits_read_key_log',
144 ffgkyj => 'fits_read_key_lng',
145 ffgkye => 'fits_read_key_flt',
146 ffgkyd => 'fits_read_key_dbl',
147 ffgkyc => 'fits_read_key_cmp',
148 ffgkym => 'fits_read_key_dblcmp',
149 ffgkyt => 'fits_read_key_triple',
150 ffgkls => 'fits_read_key_longstr',
151 ffgtdm => 'fits_read_tdim',
152 ffgtdmll => 'fits_read_tdimll',
153 ffdtdm => 'fits_decode_tdim',
154 ffdtdmll => 'fits_decode_tdimll',
155 ffgkns => 'fits_read_keys_str',
156 ffgknl => 'fits_read_keys_log',
157 ffgknj => 'fits_read_keys_lng',
158 ffgknjj => 'fits_read_keys_lnglng',
159 ffgkne => 'fits_read_keys_flt',
160 ffgknd => 'fits_read_keys_dbl',
161 ffghpr => 'fits_read_imghdr',
162 ffghprll => 'fits_read_imghdrll',
163 ffghtb => 'fits_read_atblhdr',
164 ffghtbll => 'fits_read_atblhdrll',
165 ffghbn => 'fits_read_btblhdr',
166 ffghbnll => 'fits_read_btblhdrll',
167 ffh2st => 'fits_header2str',
168 ffucrd => 'fits_update_card',
169 ffuky => 'fits_update_key',
170 ffukyu => 'fits_update_key_null',
171 ffukys => 'fits_update_key_str',
172 ffukls => 'fits_update_key_longstr',
173 ffukyl => 'fits_update_key_log',
174 ffukyj => 'fits_update_key_lng',
175 ffukyf => 'fits_update_key_fixflt',
176 ffukye => 'fits_update_key_flt',
177 ffukyg => 'fits_update_key_fixdbl',
178 ffukyd => 'fits_update_key_dbl',
179 ffukfc => 'fits_update_key_fixcmp',
180 ffukyc => 'fits_update_key_cmp',
181 ffukfm => 'fits_update_key_fixdblcmp',
182 ffukym => 'fits_update_key_dblcmp',
183 ffmrec => 'fits_modify_record',
184 ffmcrd => 'fits_modify_card',
185 ffmnam => 'fits_modify_name',
186 ffmcom => 'fits_modify_comment',
187 ffmkyu => 'fits_modify_key_null',
188 ffmkys => 'fits_modify_key_str',
189 ffmkls => 'fits_modify_key_longstr',
190 ffmkyl => 'fits_modify_key_log',
191 ffmkyj => 'fits_modify_key_lng',
192 ffmkyf => 'fits_modify_key_fixflt',
193 ffmkye => 'fits_modify_key_flt',
194 ffmkyg => 'fits_modify_key_fixdbl',
195 ffmkyd => 'fits_modify_key_dbl',
196 ffmkfc => 'fits_modify_key_fixcmp',
197 ffmkyc => 'fits_modify_key_cmp',
198 ffmkfm => 'fits_modify_key_fixdblcmp',
199 ffmkym => 'fits_modify_key_dblcmp',
200 ffikey => 'fits_insert_card',
201 ffirec => 'fits_insert_record',
202 ffikyu => 'fits_insert_key_null',
203 ffikys => 'fits_insert_key_str',
204 ffikls => 'fits_insert_key_longstr',
205 ffikyl => 'fits_insert_key_log',
206 ffikyj => 'fits_insert_key_lng',
207 ffikyf => 'fits_insert_key_fixflt',
208 ffikye => 'fits_insert_key_flt',
209 ffikyg => 'fits_insert_key_fixdbl',
210 ffikyd => 'fits_insert_key_dbl',
211 ffikfc => 'fits_insert_key_fixcmp',
212 ffikyc => 'fits_insert_key_cmp',
213 ffikfm => 'fits_insert_key_fixdblcmp',
214 ffikym => 'fits_insert_key_dblcmp',
215 ffdkey => 'fits_delete_key',
216 ffdrec => 'fits_delete_record',
217 ffghdn => 'fits_get_hdu_num',
218 ffghdt => 'fits_get_hdu_type',
219 ffghad => 'fits_get_hduaddr',
220 ffghadll => 'fits_get_hduaddrll',
221 ffghof => 'fits_get_hduoff',
222 ffgipr => 'fits_get_img_param',
223 ffgiprll => 'fits_get_img_paramll',
224 ffgidt => 'fits_get_img_type',
225 ffgiet => 'fits_get_img_equivtype',
226 ffgidm => 'fits_get_img_dim',
227 ffgisz => 'fits_get_img_size',
228 ffgiszll => 'fits_get_img_sizell',
229 ffmahd => 'fits_movabs_hdu',
230 ffmrhd => 'fits_movrel_hdu',
231 ffmnhd => 'fits_movnam_hdu',
232 ffthdu => 'fits_get_num_hdus',
233 ffcrim => 'fits_create_img',
234 ffcrimll => 'fits_create_imgll',
235 ffcrtb => 'fits_create_tbl',
236 ffcrhd => 'fits_create_hdu',
237 ffiimg => 'fits_insert_img',
238 ffiimgll => 'fits_insert_imgll',
239 ffitab => 'fits_insert_atbl',
240 ffibin => 'fits_insert_btbl',
241 ffrsim => 'fits_resize_img',
242 ffrsimll => 'fits_resize_imgll',
243 ffdhdu => 'fits_delete_hdu',
244 ffcpfl => 'fits_copy_file',
245 ffcopy => 'fits_copy_hdu',
246 ffcphd => 'fits_copy_header',
247 ffcpdt => 'fits_copy_data',
248 ffrdef => 'fits_set_hdustruc',
249 ffhdef => 'fits_set_hdrsize',
250 ffpthp => 'fits_write_theap',
251 ffesum => 'fits_encode_chksum',
252 ffdsum => 'fits_decode_chksum',
253 ffpcks => 'fits_write_chksum',
254 ffupck => 'fits_update_chksum',
255 ffvcks => 'fits_verify_chksum',
256 ffgcks => 'fits_get_chksum',
257 ffpscl => 'fits_set_bscale',
258 fftscl => 'fits_set_tscale',
259 ffpnul => 'fits_set_imgnull',
260 fftnul => 'fits_set_btblnull',
261 ffsnul => 'fits_set_atblnull',
262 ffgcno => 'fits_get_colnum',
263 ffgcnn => 'fits_get_colname',
264 ffgtcl => 'fits_get_coltype',
265 ffgtclll => 'fits_get_coltypell',
266 ffeqty => 'fits_get_eqcoltype',
267 ffeqtyll => 'fits_get_eqcoltypell',
268 ffgnrw => 'fits_get_num_rows',
269 ffgnrwll => 'fits_get_num_rowsll',
270 ffgncl => 'fits_get_num_cols',
271 ffgacl => 'fits_get_acolparms',
272 ffgbcl => 'fits_get_bcolparms',
273 ffgbclll => 'fits_get_bcolparmsll',
274 ffiter => 'fits_iterate_data',
275 ffggpb => 'fits_read_grppar_byt',
276 ffggpb => 'fits_read_grppar_sbyt',
277 ffggpui => 'fits_read_grppar_usht',
278 ffggpuj => 'fits_read_grppar_ulng',
279 ffggpi => 'fits_read_grppar_sht',
280 ffggpj => 'fits_read_grppar_lng',
281 ffggpjj => 'fits_read_grppar_lnglng',
282 ffggpk => 'fits_read_grppar_int',
283 ffggpuk => 'fits_read_grppar_uint',
284 ffggpe => 'fits_read_grppar_flt',
285 ffggpd => 'fits_read_grppar_dbl',
286 ffgpxv => 'fits_read_pix',
287 ffgpxvll => 'fits_read_pixll',
288 ffgpxf => 'fits_read_pixnull',
289 ffgpxfll => 'fits_read_pixnullll',
290 ffgpv => 'fits_read_img',
291 ffgpf => 'fits_read_imgnull',
292 ffgpvb => 'fits_read_img_byt',
293 ffgpvsb => 'fits_read_img_sbyt',
294 ffgpvui => 'fits_read_img_usht',
295 ffgpvuj => 'fits_read_img_ulng',
296 ffgpvi => 'fits_read_img_sht',
297 ffgpvj => 'fits_read_img_lng',
298 ffgpvjj => 'fits_read_img_lnglng',
299 ffgpvuk => 'fits_read_img_uint',
300 ffgpvk => 'fits_read_img_int',
301 ffgpve => 'fits_read_img_flt',
302 ffgpvd => 'fits_read_img_dbl',
303 ffgpfb => 'fits_read_imgnull_byt',
304 ffgpfsb => 'fits_read_imgnull_sbyt',
305 ffgpfui => 'fits_read_imgnull_usht',
306 ffgpfuj => 'fits_read_imgnull_ulng',
307 ffgpfi => 'fits_read_imgnull_sht',
308 ffgpfj => 'fits_read_imgnull_lng',
309 ffgpfjj => 'fits_read_imgnull_lnglng',
310 ffgpfuk => 'fits_read_imgnull_uint',
311 ffgpfk => 'fits_read_imgnull_int',
312 ffgpfe => 'fits_read_imgnull_flt',
313 ffgpfd => 'fits_read_imgnull_dbl',
314 ffg2db => 'fits_read_2d_byt',
315 ffg2dsb => 'fits_read_2d_sbyt',
316 ffg2dui => 'fits_read_2d_usht',
317 ffg2duj => 'fits_read_2d_ulng',
318 ffg2di => 'fits_read_2d_sht',
319 ffg2dj => 'fits_read_2d_lng',
320 ffg2djj => 'fits_read_2d_lnglng',
321 ffg2duk => 'fits_read_2d_uint',
322 ffg2dk => 'fits_read_2d_int',
323 ffg2de => 'fits_read_2d_flt',
324 ffg2dd => 'fits_read_2d_dbl',
325 ffg3db => 'fits_read_3d_byt',
326 ffg3dsb => 'fits_read_3d_sbyt',
327 ffg3dui => 'fits_read_3d_usht',
328 ffg3duj => 'fits_read_3d_ulng',
329 ffg3di => 'fits_read_3d_sht',
330 ffg3dj => 'fits_read_3d_lng',
331 ffg3dj => 'fits_read_3d_lnglng',
332 ffg3duk => 'fits_read_3d_uint',
333 ffg3dk => 'fits_read_3d_int',
334 ffg3de => 'fits_read_3d_flt',
335 ffg3dd => 'fits_read_3d_dbl',
336 ffgsv => 'fits_read_subset',
337 ffgsvb => 'fits_read_subset_byt',
338 ffgsvsb => 'fits_read_subset_sbyt',
339 ffgsvui => 'fits_read_subset_usht',
340 ffgsvuj => 'fits_read_subset_ulng',
341 ffgsvi => 'fits_read_subset_sht',
342 ffgsvj => 'fits_read_subset_lng',
343 ffgsvjj => 'fits_read_subset_lnglng',
344 ffgsvuk => 'fits_read_subset_uint',
345 ffgsvk => 'fits_read_subset_int',
346 ffgsve => 'fits_read_subset_flt',
347 ffgsvd => 'fits_read_subset_dbl',
348 ffgsfb => 'fits_read_subsetnull_byt',
349 ffgsfsb => 'fits_read_subsetnull_sbyt',
350 ffgsfui => 'fits_read_subsetnull_usht',
351 ffgsfuj => 'fits_read_subsetnull_ulng',
352 ffgsfi => 'fits_read_subsetnull_sht',
353 ffgsfj => 'fits_read_subsetnull_lng',
354 ffgsfjj => 'fits_read_subsetnull_lnglng',
355 ffgsfuk => 'fits_read_subsetnull_uint',
356 ffgsfk => 'fits_read_subsetnull_int',
357 ffgsfe => 'fits_read_subsetnull_flt',
358 ffgsfd => 'fits_read_subsetnull_dbl',
359 fits_comp_img => 'fits_compress_img',
360 fits_decomp_img => 'fits_decompress_img',
361 ffgcv => 'fits_read_col',
362 ffgcf => 'fits_read_colnull',
363 ffgcvs => 'fits_read_col_str',
364 ffgcvl => 'fits_read_col_log',
365 ffgcvb => 'fits_read_col_byt',
366 ffgcvsb => 'fits_read_col_sbyt',
367 ffgcvui => 'fits_read_col_usht',
368 ffgcvuj => 'fits_read_col_ulng',
369 ffgcvi => 'fits_read_col_sht',
370 ffgcvj => 'fits_read_col_lng',
371 ffgcvjj => 'fits_read_col_lnglng',
372 ffgcvuk => 'fits_read_col_uint',
373 ffgcvk => 'fits_read_col_int',
374 ffgcve => 'fits_read_col_flt',
375 ffgcvd => 'fits_read_col_dbl',
376 ffgcvc => 'fits_read_col_cmp',
377 ffgcvm => 'fits_read_col_dblcmp',
378 ffgcx => 'fits_read_col_bit',
379 ffgcxui => 'fits_read_col_bit_usht',
380 ffgcxuk => 'fits_read_col_bit_uint',
381 ffgcfs => 'fits_read_colnull_str',
382 ffgcfl => 'fits_read_colnull_log',
383 ffgcfb => 'fits_read_colnull_byt',
384 ffgcfsb => 'fits_read_colnull_sbyt',
385 ffgcfui => 'fits_read_colnull_usht',
386 ffgcfuj => 'fits_read_colnull_ulng',
387 ffgcfi => 'fits_read_colnull_sht',
388 ffgcfj => 'fits_read_colnull_lng',
389 ffgcfjj => 'fits_read_colnull_lnglng',
390 ffgcfuk => 'fits_read_colnull_uint',
391 ffgcfk => 'fits_read_colnull_int',
392 ffgcfe => 'fits_read_colnull_flt',
393 ffgcfd => 'fits_read_colnull_dbl',
394 ffgcfc => 'fits_read_colnull_cmp',
395 ffgcfm => 'fits_read_colnull_dblcmp',
396 ffgdes => 'fits_read_descript',
397 ffgdesll => 'fits_read_descriptll',
398 ffgdess => 'fits_read_descripts',
399 ffgdessll => 'fits_read_descriptsll',
400 ffgtbb => 'fits_read_tblbytes',
401 ffpgpb => 'fits_write_grppar_byt',
402 ffpgpsb => 'fits_write_grppar_sbyt',
403 ffpgpui => 'fits_write_grppar_usht',
404 ffpgpuj => 'fits_write_grppar_ulng',
405 ffpgpi => 'fits_write_grppar_sht',
406 ffpgpj => 'fits_write_grppar_lng',
407 ffpgpjj => 'fits_write_grppar_lngj',
408 ffpgpuk => 'fits_write_grppar_uint',
409 ffpgpk => 'fits_write_grppar_int',
410 ffpgpe => 'fits_write_grppar_flt',
411 ffpgpd => 'fits_write_grppar_dbl',
412 ffppx => 'fits_write_pix',
413 ffppxll => 'fits_write_pixll',
414 ffppxn => 'fits_write_pixnull',
415 ffppxnll => 'fits_write_pixnullll',
416 ffppr => 'fits_write_img',
417 ffpprb => 'fits_write_img_byt',
418 ffpprsb => 'fits_write_img_sbyt',
419 ffpprui => 'fits_write_img_usht',
420 ffppruj => 'fits_write_img_ulng',
421 ffppri => 'fits_write_img_sht',
422 ffpprj => 'fits_write_img_lng',
423 ffpprjj => 'fits_write_img_lnglng',
424 ffppruk => 'fits_write_img_uint',
425 ffpprk => 'fits_write_img_int',
426 ffppre => 'fits_write_img_flt',
427 ffpprd => 'fits_write_img_dbl',
428 ffppn => 'fits_write_imgnull',
429 ffppnb => 'fits_write_imgnull_byt',
430 ffppnsb => 'fits_write_imgnull_sbyt',
431 ffppnui => 'fits_write_imgnull_usht',
432 ffppnuj => 'fits_write_imgnull_ulng',
433 ffppni => 'fits_write_imgnull_sht',
434 ffppnj => 'fits_write_imgnull_lng',
435 ffppnjj => 'fits_write_imgnull_lnglng',
436 ffppnuk => 'fits_write_imgnull_uint',
437 ffppnk => 'fits_write_imgnull_int',
438 ffppne => 'fits_write_imgnull_flt',
439 ffppnd => 'fits_write_imgnull_dbl',
440 ffppru => 'fits_write_img_null',
441 ffpprn => 'fits_write_null_img',
442 ffp2db => 'fits_write_2d_byt',
443 ffp2dsb => 'fits_write_2d_sbyt',
444 ffp2dui => 'fits_write_2d_usht',
445 ffp2duj => 'fits_write_2d_ulng',
446 ffp2di => 'fits_write_2d_sht',
447 ffp2dj => 'fits_write_2d_lng',
448 ffp2djj => 'fits_write_2d_lnglng',
449 ffp2duk => 'fits_write_2d_uint',
450 ffp2dk => 'fits_write_2d_int',
451 ffp2de => 'fits_write_2d_flt',
452 ffp2dd => 'fits_write_2d_dbl',
453 ffp3db => 'fits_write_3d_byt',
454 ffp3dsb => 'fits_write_3d_sbyt',
455 ffp3dui => 'fits_write_3d_usht',
456 ffp3duj => 'fits_write_3d_ulng',
457 ffp3di => 'fits_write_3d_sht',
458 ffp3dj => 'fits_write_3d_lng',
459 ffp3djj => 'fits_write_3d_lnglng',
460 ffp3duk => 'fits_write_3d_uint',
461 ffp3dk => 'fits_write_3d_int',
462 ffp3de => 'fits_write_3d_flt',
463 ffp3dd => 'fits_write_3d_dbl',
464 ffpss => 'fits_write_subset',
465 ffpssb => 'fits_write_subset_byt',
466 ffpsssb => 'fits_write_subset_sbyt',
467 ffpssui => 'fits_write_subset_usht',
468 ffpssuj => 'fits_write_subset_ulng',
469 ffpssi => 'fits_write_subset_sht',
470 ffpssj => 'fits_write_subset_lng',
471 ffpssjj => 'fits_write_subset_lnglng',
472 ffpssuk => 'fits_write_subset_uint',
473 ffpssk => 'fits_write_subset_int',
474 ffpsse => 'fits_write_subset_flt',
475 ffpssd => 'fits_write_subset_dbl',
476 ffprwu => 'fits_write_nullrows',
477 ffpcl => 'fits_write_col',
478 ffpcls => 'fits_write_col_str',
479 ffpcll => 'fits_write_col_log',
480 ffpclb => 'fits_write_col_byt',
481 ffpclsb => 'fits_write_col_sbyt',
482 ffpclui => 'fits_write_col_usht',
483 ffpcluj => 'fits_write_col_ulng',
484 ffpcli => 'fits_write_col_sht',
485 ffpclj => 'fits_write_col_lng',
486 ffpcljj => 'fits_write_col_lnglng',
487 ffpcluk => 'fits_write_col_uint',
488 ffpclk => 'fits_write_col_int',
489 ffpcle => 'fits_write_col_flt',
490 ffpcld => 'fits_write_col_dbl',
491 ffpclc => 'fits_write_col_cmp',
492 ffpclm => 'fits_write_col_dblcmp',
493 ffpclu => 'fits_write_col_null',
494 ffpclx => 'fits_write_col_bit',
495 ffpcn => 'fits_write_colnull',
496 ffpcns => 'fits_write_colnull_str',
497 ffpcnl => 'fits_write_colnull_log',
498 ffpcnb => 'fits_write_colnull_byt',
499 ffpcnsb => 'fits_write_colnull_sbyt',
500 ffpcnui => 'fits_write_colnull_usht',
501 ffpcnuj => 'fits_write_colnull_ulng',
502 ffpcni => 'fits_write_colnull_sht',
503 ffpcnj => 'fits_write_colnull_lng',
504 ffpcnjj => 'fits_write_colnull_lnglng',
505 ffpcnuk => 'fits_write_colnull_uint',
506 ffpcnk => 'fits_write_colnull_int',
507 ffpcne => 'fits_write_colnull_flt',
508 ffpcnd => 'fits_write_colnull_dbl',
509 ffpdes => 'fits_write_descript',
510 ffcmph => 'fits_compress_heap',
511 fftheap => 'fits_test_heap',
512 ffptbb => 'fits_write_tblbytes',
513 ffirow => 'fits_insert_rows',
514 ffdrrg => 'fits_delete_rowrange',
515 ffdrow => 'fits_delete_rows',
516 ffdrws => 'fits_delete_rowlist',
517 ffdrwsll => 'fits_delete_rowlistll',
518 fficol => 'fits_insert_col',
519 fficls => 'fits_insert_cols',
520 ffdcol => 'fits_delete_col',
521 ffcpcl => 'fits_copy_col',
522 ffmvec => 'fits_modify_vector_len',
523 ffgics => 'fits_read_img_coord',
524 ffgtcs => 'fits_read_tbl_coord',
525 ffwldp => 'fits_pix_to_world',
526 ffxypx => 'fits_world_to_pix',
527 ffgiwcs => 'fits_get_image_wcs_keys',
528 ffgtwcs => 'fits_get_table_wcs_keys',
529 fffrow => 'fits_find_rows',
530 ffffrw => 'fits_find_first_row',
531 fffrwc => 'fits_find_rows_cmp',
532 ffsrow => 'fits_select_rows',
533 ffcrow => 'fits_calc_rows',
534 ffcalc => 'fits_calculator',
535 ffcalc_rng => 'fits_calculator_rng',
536 fftexp => 'fits_test_expr',
537 ffgtcr => 'fits_create_group',
538 ffgtis => 'fits_insert_group',
539 ffgtch => 'fits_change_group',
540 ffgtrm => 'fits_remove_group',
541 ffgtcp => 'fits_copy_group',
542 ffgtmg => 'fits_merge_groups',
543 ffmbyt => 'fits_seek',
544 ffgtcm => 'fits_compact_group',
545 ffgtvf => 'fits_verify_group',
546 ffgtop => 'fits_open_group',
547 ffgtam => 'fits_add_group_member',
548 ffgtnm => 'fits_get_num_members',
549 ffgmng => 'fits_get_num_groups',
550 ffgmop => 'fits_open_member',
551 ffgmcp => 'fits_copy_member',
552 ffgmtf => 'fits_transfer_member',
553 ffgmrm => 'fits_remove_member',
554 );
555
55610.000220.00022my @__shortnames = keys %__names;
55710.000150.00015my @__longnames = (values(%__names), @__names_no_short);
55815.6e-55.6e-5my @__constants = qw(
559 ANGLE_TOO_BIG
560 ANY_HDU
561 ARRAY_TOO_BIG
562 ASCII_TBL
563 BAD_ATABLE_FORMAT
564 BAD_BITPIX
565 BAD_BTABLE_FORMAT
566 BAD_C2D
567 BAD_C2F
568 BAD_C2I
569 BAD_COL_NUM
570 BAD_DATATYPE
571 BAD_DATA_FILL
572 BAD_DATE
573 BAD_DECIM
574 BAD_DIMEN
575 BAD_DOUBLEKEY
576 BAD_ELEM_NUM
577 BAD_F2C
578 BAD_FILEPTR
579 BAD_FLOATKEY
580 BAD_GCOUNT
581 BAD_GROUP_ID
582 BAD_HDU_NUM
583 BAD_HEADER_FILL
584 BAD_I2C
585 BAD_INTKEY
586 BAD_KEYCHAR
587 BAD_LOGICALKEY
588 BAD_NAXES
589 BAD_NAXIS
590 BAD_OPTION
591 BAD_ORDER
592 BAD_PCOUNT
593 BAD_PIX_NUM
594 BAD_ROW_NUM
595 BAD_ROW_WIDTH
596 BAD_SIMPLE
597 BAD_TBCOL
598 BAD_TDIM
599 BAD_TFIELDS
600 BAD_TFORM
601 BAD_TFORM_DTYPE
602 BAD_URL_PREFIX
603 BAD_WCS_PROJ
604 BAD_WCS_VAL
605 BINARY_TBL
606 BYTE_IMG
607 CASEINSEN
608 CASESEN
609 COL_NOT_FOUND
610 COL_NOT_UNIQUE
611 COL_TOO_WIDE
612 DOUBLENULLVALUE
613 DOUBLE_IMG
614 DRIVER_INIT_FAILED
615 END_JUNK
616 END_OF_FILE
617 FALSE
618 FILE_NOT_CLOSED
619 FILE_NOT_CREATED
620 FILE_NOT_OPENED
621 FLEN_CARD
622 FLEN_COMMENT
623 FLEN_ERRMSG
624 FLEN_FILENAME
625 FLEN_KEYWORD
626 FLEN_STATUS
627 FLEN_VALUE
628 FLOATNULLVALUE
629 FLOAT_IMG
630 GROUP_NOT_FOUND
631 GT_ID_ALL
632 GT_ID_ALL_URI
633 GT_ID_POS
634 GT_ID_POS_URI
635 GT_ID_REF
636 GT_ID_REF_URI
637 GZIP_1
638 HDU_ALREADY_MEMBER
639 HDU_ALREADY_TRACKED
640 HEADER_NOT_EMPTY
641 IDENTICAL_POINTERS
642 IMAGE_HDU
643 InputCol
644 InputOutputCol
645 KEY_NO_EXIST
646 KEY_OUT_BOUNDS
647 LONG_IMG
648 LONGLONG_IMG
649 MAXHDU
650 MEMBER_NOT_FOUND
651 MEMORY_ALLOCATION
652 NEG_AXIS
653 NEG_BYTES
654 NEG_FILE_POS
655 NEG_ROWS
656 NEG_WIDTH
657 NOT_ASCII_COL
658 NOT_ATABLE
659 NOT_BTABLE
660 NOT_GROUP_TABLE
661 NOT_IMAGE
662 NOT_LOGICAL_COL
663 NOT_POS_INT
664 NOT_TABLE
665 NOT_VARI_LEN
666 NO_BITPIX
667 NO_END
668 NO_GCOUNT
669 NO_MATCHING_DRIVER
670 NO_NAXES
671 NO_NAXIS
672 NO_NULL
673 NO_PCOUNT
674 NO_QUOTE
675 NO_SIMPLE
676 NO_TBCOL
677 NO_TFIELDS
678 NO_TFORM
679 NO_WCS_KEY
680 NO_XTENSION
681 NULL_INPUT_PTR
682 NUM_OVERFLOW
683 OPT_CMT_MBR
684 OPT_CMT_MBR_DEL
685 OPT_GCP_ALL
686 OPT_GCP_GPT
687 OPT_GCP_MBR
688 OPT_MCP_ADD
689 OPT_MCP_MOV
690 OPT_MCP_NADD
691 OPT_MCP_REPL
692 OPT_MRG_COPY
693 OPT_MRG_MOV
694 OPT_RM_ALL
695 OPT_RM_ENTRY
696 OPT_RM_GPT
697 OPT_RM_MBR
698 OVERFLOW_ERR
699 OutputCol
700 PARSE_BAD_COL
701 PARSE_BAD_OUTPUT
702 PARSE_BAD_TYPE
703 PARSE_LRG_VECTOR
704 PARSE_NO_OUTPUT
705 PARSE_SYNTAX_ERR
706 PLIO_1
707 READONLY
708 READONLY_FILE
709 READWRITE
710 READ_ERROR
711 RICE_1
712 SAME_FILE
713 SEEK_ERROR
714 SHORT_IMG
715 TBIT
716 TBYTE
717 TSBYTE
718 TCOMPLEX
719 TDBLCOMPLEX
720 TDOUBLE
721 TFLOAT
722 TINT
723 TLOGICAL
724 TLONG
725 TLONGLONG
726 TOO_MANY_DRIVERS
727 TOO_MANY_FILES
728 TOO_MANY_HDUS_TRACKED
729 TRUE
730 TSHORT
731 TSTRING
732 TUINT
733 TULONG
734 TUSHORT
735 ULONG_IMG
736 UNKNOWN_EXT
737 UNKNOWN_REC
738 URL_PARSE_ERROR
739 USE_MEM_BUFF
740 USHORT_IMG
741 VALIDSTRUC
742 VALUE_UNDEFINED
743 WCS_ERROR
744 WRITE_ERROR
745 ZERO_SCALE
746 TYP_STRUC_KEY
747 TYP_CMPRS_KEY
748 TYP_SCAL_KEY
749 TYP_NULL_KEY
750 TYP_DIM_KEY
751 TYP_RANG_KEY
752 TYP_UNIT_KEY
753 TYP_DISP_KEY
754 TYP_HDUID_KEY
755 TYP_CKSUM_KEY
756 TYP_WCS_KEY
757 TYP_REFSYS_KEY
758 TYP_COMM_KEY
759 TYP_CONT_KEY
760 TYP_USER_KEY
761 ); ### @__constants
762
76311.0e-61.0e-6@EXPORT = qw( );
764
76513.0e-63.0e-6%EXPORT_TAGS = (
766 'shortnames' => \@__shortnames,
767 'longnames' => \@__longnames,
768 'constants' => \@__constants,
769 );
770
77110.000310.00031@EXPORT_OK = (
772 'PerlyUnpacking',
773 @__shortnames,
774 @__longnames,
775 @__constants,
776 );
777
778
# spent 611µs (467+144) within Astro::FITS::CFITSIO::AUTOLOAD which was called 26 times, avg 24µs/call: # 14 times (222µs+59µs) at line 3295 of /wise/base/deliv/dev/lib/perl/FITSIO.pm, avg 20µs/call # 8 times (179µs+66µs) at line 2674 of /wise/base/deliv/dev/lib/perl/FITSIO.pm, avg 31µs/call # 4 times (66µs+19µs) at line 3464 of /wise/base/deliv/dev/lib/perl/FITSIO.pm, avg 21µs/call
sub AUTOLOAD {
77930.000630.00021 no strict;
# spent 11µs making 1 call to strict::unimport
780
781 # This AUTOLOAD is used to 'autoload' constants from the constant()
782 # XS function. If a constant is not found then control is passed
783 # to the AUTOLOAD in AutoLoader.
784
7851820.000502.8e-6 my $constname;
786 ($constname = $AUTOLOAD) =~ s/.*:://;
787 croak "& not defined" if $constname eq 'constant';
788 my $val = constant($constname, @_ ? $_[0] : 0);
# spent 144µs making 26 calls to Astro::FITS::CFITSIO::constant, avg 6µs/call
789 if ($! != 0) {
790 if ($! =~ /Invalid/) {
791 $AutoLoader::AUTOLOAD = $AUTOLOAD;
792 goto &AutoLoader::AUTOLOAD;
793 }
794 else {
795 croak "Your vendor has not defined Astro::FITS::CFITSIO macro $constname";
796 }
797 }
798708.2e-51.2e-6
# spent 183µs within Astro::FITS::CFITSIO::__ANON__[/wise/base/static/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Astro/FITS/CFITSIO.pm:798] which was called 44 times, avg 4µs/call: # 25 times (99µs+0) at line 3464 of /wise/base/deliv/dev/lib/perl/FITSIO.pm, avg 4µs/call # 12 times (52µs+0) at line 3328 of /wise/base/deliv/dev/lib/perl/FITSIO.pm, avg 4µs/call # 4 times (19µs+0) at line 3496 of /wise/base/deliv/dev/lib/perl/FITSIO.pm, avg 5µs/call # 3 times (13µs+0) at line 3343 of /wise/base/deliv/dev/lib/perl/FITSIO.pm, avg 4µs/call
*$AUTOLOAD = sub { $val };
799 #eval "sub $AUTOLOAD { $val }";
800 goto &$AUTOLOAD;
801}
802
80312.7e-52.7e-5bootstrap Astro::FITS::CFITSIO $VERSION;
# spent 8.30ms making 1 call to DynaLoader::bootstrap
804
805# Preloaded methods go here.
806
807# Compound routines -- useful routines that combine lower level
808# Astro::FITS::CFITSIO commands
809# This routine takes an argument (either a fitsfilePtr object
810# or a string containing a FITS file name) and returns the header
811# into a hash along with the exit status of the routine.
812# If it is called in a scalar context then only the hash reference
813# is returned
814
815# $hashref = fits_read_header("test.fits");
816# ($hashref, $status) = $fitsfile->read_header;
817
818# The comments are stored in a hash in $hashref->{COMMENTS}.
819
820sub fits_read_header {
821
822 croak 'Usage: fits_read_header(file|fitsfilePtr)'
823 unless @_;
824
825 my ($fitsfile, $status);
826 my ($n, $left, %header, $key, $value, $comment);
827
828 # Read the argument
829 my $file = shift;
830
831 my $obj_passed = 0; # were we passed a fitsfilePtr?
832
833 $status = 0;
834 if (UNIVERSAL::isa($file,'fitsfilePtr')) {
835 $fitsfile = $file;
836 $obj_passed = 1;
837 } else {
838 # Open the file.
839 fits_open_file($fitsfile, $file, READONLY(), $status);
840 }
841
842 # Now we have an open file -- check that status is good before
843 # proceeding
844 unless ($status) {
845
846 # Get the number of fits keywords in primary header
847 $fitsfile->get_hdrspace($n, $left, $status);
848
849 # Loop over the keys
850 for my $i (1..$n) {
851 last unless $status == 0;
852
853 $fitsfile->read_keyn($i, $key, $value, $comment, $status);
854
855 # Store the key/value in a hash
856 $header{$key} = $value;
857
858 # Store the comments.
859 if (! exists $header{COMMENTS}{$key}) {
860 $header{COMMENTS}{$key} = $comment;
861 }
862 # HISTORY keywords, for instance, can be numerous
863 else {
864 if (! ref $header{COMMENTS}{$key}) {
865 $header{COMMENTS}{$key} = [ $header{COMMENTS}{$key} ];
866 }
867 push @{$header{COMMENTS}{$key}}, $comment;
868 }
869
870 }
871
872 # Close the file if we opened it
873 $fitsfile->close_file($status) unless $obj_passed;
874 }
875
876 # Report an error - may not always want to write to STDERR...
877 fits_report_error(*STDERR, $status);
878
879
880 return (\%header, $status) if wantarray;
881 return \%header;
882
883}
884
885# This section provides perl aliases for the OO interface
886# This is a bit of a kluge since the actual command is in the
887# Astro::FITS::CFITSIO namespace. Did not open a new namespace with the package
888# command since AUTOSPLIT gets confused
889
890sub fitsfilePtr::read_header {
891 my $self = shift;
892 my ($href, $status) = Astro::FITS::CFITSIO::fits_read_header($self);
893 return ($href, $status) if wantarray;
894 return $href;
895}
896
897
898
899# Autoload methods go after =cut, and are processed by the autosplit program.
900
90110.000270.000271;
902
903__END__
904
905=head1 NAME
906
907Astro::FITS::CFITSIO - Perl extension for using the cfitsio library
908
909=head1 SYNOPSIS
910
911 use Astro::FITS::CFITSIO;
912 use Astro::FITS::CFITSIO qw( :longnames );
913 use Astro::FITS::CFITSIO qw( :shortnames );
914 use Astro::FITS::CFITSIO qw( :constants );
915
916=head1 DESCRIPTION
917
918Perl interface to William Pence's cfitsio subroutine library. For more
919information on cfitsio, see
920http://heasarc.gsfc.nasa.gov/fitsio.
921
922This module attempts to provide a wrapper for nearly every cfitsio routine,
923while retaining as much cfitsio behavior as possible. As such, one should
924be aware that it is still somewhat low-level, in the sense that handing an
925array which is not the correct size to a routine like C<fits_write_img()>
926may cause SIGSEGVs.
927
928My goal is to eventually use these routines to build a more Perl-like
929interface to many common tasks such as reading and writing of images and
930ASCII and binary tables.
931
932=head1 cfitsio API MAPPING
933
934Astro::FITS::CFITSIO allows one to use either the long or short name forms of the
935cfitsio routines. These work by using the exact same form of arguments
936as one would find in an equivalent C program.
937
938There is also an object-oriented API which uses the same function names
939as the long-name API, but with the leading "fits_" stripped. To get
940a Astro::FITS::CFITSIO "object" one would call C<open_file()>, C<create_file()> or
941C<create_template()>:
942
943 my $status = 0;
944 my $fptr = Astro::FITS::CFITSIO::open_file($filename,
945 Astro::FITS::CFITSIO::READONLY(),$status);
946
947 $fptr->read_key_str('NAXIS1',$naxis1,undef,$status);
948
949Note that the object-oriented forms of function names are only available for
950those cfitsio routines which accept a C<fitsfile*> data-type as the first
951argument.
952
953As an added benefit, whenever a filehandle goes out of scope, B<ffclos()>
954is automatically closed:
955
956 {
957 my $fptr = Astro::FITS::CFITSIO::open_file($filename,
958 Astro::FITS::CFITSIO::READWRITE(),$status);
959 [manipulate $fptr]
960
961 # neither of the following are needed
962 # ffclos($fptr,$status);
963 # $fptr->close_file($status);
964 }
965
966It there is an error, it will B<croak()>.
967
968
969=head1 NAME SPACE
970
971All cfitsio routines, with the exception of C<fits_iterate_data()> and
972C<fits_open_memfile()>, are available in both long and short name
973forms (e.g., C<fits_read_key> E<lt>=E<gt> C<ffgky>), as well as all
974constants defined in the F<fitsio.h> header file. This raises the
975possibility of your name space being invaded by nearly 1000 function
976and constant names.
977
978To deal with this situation, Astro::FITS::CFITSIO makes use of the Exporter
979package support for C<%EXPORT_TAGS>. You can import the long-named functions
980with
981
982 use Astro::FITS::CFITSIO qw( :longnames );
983
984and the short-named routines with
985
986 use Astro::FITS::CFITSIO qw( :shortnames );
987
988Constants are actually implemented as AUTOLOADed functions, so C<TSTRING>, for
989instance, would be accessed via C<Astro::FITS::CFITSIO::TSTRING()>. Alternatively
990you can
991
992 use Astro::FITS::CFITSIO qw( :constants );
993
994which would allow you to simply say C<TSTRING>.
995
996=head1 DATA STORAGE DETAILS
997
998=head2 Input Variables
999
1000If a routine expects an N-dimensional array as input, and you hand it a
1001reference to a scalar, then Astro::FITS::CFITSIO simply uses the data in the scalar
1002which the argument is referencing.
1003Otherwise it expects the argument to be a Perl array reference whose total
1004number of elements satisfies the input demands of the corresponding
1005C routine. Astro::FITS::CFITSIO then unpacks the array reference into a format that
1006the C routine can understand. If your input array does not hold enough
1007data for the C routine then a segfault is likely to occur.
1008
1009cfitsio functions which take an optional NULL pointer - indicating no output
1010in that place is desired - can instead be given an C<undef>. In other words,
1011the following C and Perl statements which read a keyword but ignore the
1012comment would be roughly equivalent:
1013
1014 fits_read_key_lng(fptr,key,&value,NULL,&status);
1015
1016 fits_read_key_lng($fptr,$key,$value,undef,$status);
1017
1018=head2 Output Variables
1019
1020Calling cfitsio routines which read data from FITS files causes the
1021output variable to be transformed into a Perl array of the appropriate
1022dimensions. The exception to this is if one wants the output to be in
1023the machine-native format (e.g., for use with PDL).
1024Then all output variables will become scalars containing the
1025appropriate data. The exception here is with routines which read
1026arrays of strings (e.g., C<fits_read_col_str()>). In this case the
1027output is again a Perl array reference.
1028
1029There are two ways to specify how data are retrieved. The behavior
1030can be specified either globally or on a per filehandle basis. The
1031global selection is done by calling the B<PerlyUnpacking> function.
1032This sets the behavior for I<all> file handles which do not
1033I<explicitly> choose not to follow it.
1034
1035 # turn ON unpacking into Perl arrays. This is the default
1036 PerlyUnpacking(1);
1037
1038 # turn OFF unpacking into Perl arrays, i.e. put in machine-native
1039 # format
1040 PerlyUnpacking(0);
1041
1042 # retrieve the current state:
1043 $state = PerlyUnpacking();
1044
1045To change the behavior for a particular file handle, use the
1046B<perlyunpacking> method. The default behavior for a file handle
1047is to track what is done with B<PerlyUnpacking()>
1048
1049 # track PerlyUnpacking(). This is the default
1050 $fptr->perlyunpacking(-1);
1051
1052 # turn ON unpacking into Perl arrays
1053 $fptr->perlyunpacking(1);
1054
1055 # turn OFF unpacking into Perl arrays
1056 $fptr->perlyunpacking(0);
1057
1058 # retrieve the current state:
1059 $state = $fptr->perlyunpacking;
1060
1061
1062=head1 EXAMPLES
1063
1064Take a look at F<testprog/testprog.pl> under the distribution directory. It
1065should
1066produce output identical to F<testprog.c> which comes with the cfitsio
1067library. Additionally, the
1068versions named F<testprog_longnames.pl>, F<testprog_OO.pl> and
1069F<testprog_pdl.pl> test the long-name and object-oriented APIs,
1070and machine-native unpacking with PDL.
1071
1072There is also an F<examples/> directory with scripts which do
1073the following:
1074
1075=over 4
1076
1077=item F<image_read.pl>
1078
1079reads a FITS primary image and displays it using PGPLOT
1080
1081=item F<image_read_pdl.pl>
1082
1083same as above, but uses machine-native unpacking with PDL
1084
1085=item F<bintable_read_pdl.pl>
1086
1087reads binary table column into PDL object, makes histogram and plots it
1088
1089=back
1090
1091=head1 CONSIDERATIONS
1092
1093=over 4
1094
1095=item Ensure your input arrays contain enough data
1096
1097The caller is responsible for ensuring that the input arrays given
1098to Astro::FITS::CFITSIO routines are large enough to satisfy the access demands
1099of said routines. For example, if you tell C<fits_write_col()> to write
1100a data column containing 100 elements, your Perl array should contain
1101at least 100 elements. Segfaults abound, so beware!
1102
1103=item maxdim semantics
1104
1105Some cfitsio routines take a parameter named something like 'C<maxdim>',
1106indicating that no more than that many elements should be placed into
1107the output data area. An example of this would be C<fits_read_tdim()>.
1108In these cases Astro::FITS::CFITSIO will automatically determine how much storage
1109space is needed for the full amount of output possible. As a result,
1110the arguments expected in Astro::FITS::CFITSIO are slightly different than
1111one would use in a C program, in that the 'C<maxdim>' argument
1112is unnecessary.
1113
1114Currently the routines
1115for which this is the case are C<fits_read_atblhdr()>, C<fits_read_btblhdr()>,
1116C<fits_read_imghdr()>, C<fits_decode_tdim()>, C<fits_read_tdim()>
1117C<fits_test_expr()>, C<fits_get_img_parm()> and C<fits_get_img_size()>.
1118
1119=item Output arrays remain as undisturbed as possible
1120
1121For routines like C<fits_read_col()>, Astro::FITS::CFITSIO unpacks the output into
1122a Perl array reference (unless C<PerlyUnpacking(0)> has been called, of
1123course). Prior to doing this, it ensures the scalar passed is a reference
1124to an array large enough to hold the data. If the argument is an
1125array reference which is too small, it expands the array pointed to
1126appropriately. B<But>, if the array is large enough already, the data
1127are just unpacked into the array. The upshot: If you call
1128C<fits_read_col()>, telling it to read 100 data elements, and the array
1129you are placing the data into already has 200 elements, then after
1130C<fits_read_col()> returns your array will still have 200 elements, only
1131the first 100 of which actually correspond to the data read by the routine.
1132
1133In more succinct language:
1134
1135 @output = (0..199);
1136 fits_read_col_lng($fptr,2,1,1,100,0,\@output,$anynul,$status);
1137
1138 # @output still has 200 elements, only first 100 are from FITS
1139 # file
1140
1141=back
1142
1143=head1 EXTRA COMMANDS
1144
1145Some extra commands that use sets of cfitsio routines are supplied to
1146simplify some standard tasks:
1147
1148=over 4
1149
1150=item fits_read_header(filename)
1151
1152This command reads in a primary fits header (unless one is using the extended
1153filename sytax to move to a different HDU on open) from the specified filename
1154and returns the header as a hash reference and a status (when called
1155in an array context) or simply a hash reference (when called in a scalar
1156context):
1157
1158 ($hash_ref, $status) = fits_read_header ($file);
1159 $hash_ref = fits_read_header($file);
1160
1161An object-oriented interface is also provided for reading headers from
1162FITS files that have already been opened. In this case, the header
1163read is from the current HDU.
1164
1165 $fitsfile = Astro::FITS::CFITSIO::open_file($file);
1166 $hash_ref = $fitsfile->read_header;
1167 ($hash_ref, $status) = $fitsfile->read_header;
1168
1169=item sizeof_datatype(datatype)
1170
1171Returns the size of the given Astro::FITS::CFITSIO datatype constant (e.g., C<Astro::FITS::CFITSIO::TSHORT()>).
1172
1173=back
1174
1175=head1 BUGS
1176
1177FIXME
1178
1179=head1 AUTHOR
1180
1181Pete Ratzlaff <pratzlaff@cfa.harvard.edu>, with a great deal of code taken
1182from Karl Glazebrook's PGPLOT module.
1183
1184Contributors include:
1185
1186=over 4
1187
1188=item Tim Jenness <t.jenness@jach.hawaii.edu>
1189
1190convenience routines
1191
1192=item Tim Conrow <tim@ipac.caltech.edu>
1193
1194function implementations, bug fixes
1195
1196=back
1197
1198=cut
# spent 4.10ms within Astro::FITS::CFITSIO::bootstrap which was called # once (4.10ms+0) by DynaLoader::bootstrap at line 226 of /opt/wise/lib/perl5/5.10.0/x86_64-linux-thread-multi/DynaLoader.pm
sub Astro::FITS::CFITSIO::bootstrap; # xsub
# spent 144µs within Astro::FITS::CFITSIO::constant which was called 26 times, avg 6µs/call: # 26 times (144µs+0) by Astro::FITS::CFITSIO::AUTOLOAD at line 788 of /wise/base/static/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Astro/FITS/CFITSIO.pm, avg 6µs/call
sub Astro::FITS::CFITSIO::constant; # xsub