#! /usr/bin/env perl

# $Id: detDump 146 2007-03-07 03:02:13Z yamada $

#use lib '/home/yamada/prj/panstarrs/mops/src';

use warnings;
use strict;
use Getopt::Long;
use Pod::Usage;

use PS::MOPS::DET::table;

my $help;

GetOptions(
    help => \$help,
) or pod2usage(2);                      # opts parse error
pod2usage(-verbose => 3) if $help;      # user asked for help

if ( $#ARGV != 0 ) {
	pod2usage(2);
	exit(1)
}
my $filename = $ARGV[0];

my $p = new PS::MOPS::DET::table;

$p->openfile($filename);
$p->printkeys;
while (my @data = $p->readrecord()) {
	for my $datum (@data) {
		print $datum, ' ';
	}
	print "\n";
}
$p->closefile();

__END__

=head1 NAME

detDump - Take a detections FITS file, and print its contents.

=head1 SYNOPSIS

detDump FILENAME

=head1 ARGUMENTS

=over 4

=item FILENAME

Input filename (FITS).

=back

=head1 DESCRIPTION

Just a simple test program for reading a FITS file.

=head1 ENVIRONMENT VARIABLES

=head1 TO DO

=head1 BUGS

=cut
