NAME

Astro::FITS::CFITSIO::Simple::PrintStatus - generate a progress status update

VERSION

version 0.20

DESCRIPTION

INTERNAL USE ONLY! No warranty, may change, etc.

Methods

new
$status = Astro::FITS::CFITSIO::Simple::PrintStatus->new( $what );

Create a new object. $what may be one of the following:

SCALAR

If this is non-zero, a progress indicator is written to STDERR. If Term::ProgressBar is available, that is used, else a simple percentile is output. If this is zero, returns undef.

GLOB

If it's a glob, it's assumed to be a filehandle glob, and output is written to that filehandle.

CODEREF

If it's a code reference, it is called with three arguments

rows read
total number of rows
OBJECT

If it's an object, and it has print() and flush() methods, it'll call those as appropriate.

start
$status->start( $nrows );

This preps the output and indicates the number of rows that will be written.

update
$status->update( $rows_read );

This will cause output to be generated. It returns the number of rows that will cause an actual change in the output. It is usually used as such:

$next_update = 0;
$ps->start();
for ( 0..$nmax )
{
  # do stuff

  $next_update = $ps->update( $_ )
    if $_ >= $next_update;
}
$ps->finish
  if $nmax >= $next_update;
finish
$status->finish;

This should be called after all of the rows have been written.

SUPPORT

Bugs

Please report any bugs or feature requests to bug-astro-fits-cfitsio-simple@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Astro-FITS-CFITSIO-Simple

Source

Source is available at

https://gitlab.com/djerius/astro-fits-cfitsio-simple

and may be cloned from

https://gitlab.com/djerius/astro-fits-cfitsio-simple.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHORS

  • Diab Jerius <djerius@cpan.org>

  • Pete Ratzlaff

COPYRIGHT AND LICENSE

This software is Copyright (c) 2008 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007