IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2008, 11:47:19 AM (18 years ago)
Author:
Paul Price
Message:

Added verbose flags to scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/warp_overlap.pl

    r16020 r16308  
    3838my $ipprc = PS::IPP::Config->new(); # IPP configuration
    3939
    40 my ($warp_id, $camera, $dbname, $workdir, $no_update, $no_op);
     40my ($warp_id, $camera, $dbname, $workdir, $verbose, $no_update, $no_op);
    4141GetOptions(
    4242    'warp_id|i=s'       => \$warp_id, # Warp identifier
     
    4444    'dbname|d=s'        => \$dbname, # Database name
    4545    'workdir|w=s'       => \$workdir, # Working directory, for output files
     46    'verbose'           => \$verbose,   # Print to stdout
    4647    'no-update'         => \$no_update, # Don't update the database?
    4748    'no-op'             => \$no_op, # Don't do any operations
     
    7677    $command .= " -dbname $dbname" if defined $dbname;
    7778    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    78         run(command => $command, verbose => 1);
     79        run(command => $command, verbose => $verbose);
    7980    unless ($success) {
    8081        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    9596    my $command = "$ppConfigDump -camera $camera -dump-recipe PSWARP -";
    9697    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    97         run(command => $command, verbose => 1);
     98        run(command => $command, verbose => $verbose);
    9899    unless ($success) {
    99100        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    122123       
    123124        my $tess_dir = $ipprc->convert_filename_absolute( $$tessellations{$tess_id} ); # Catdir for DVO
    124         print STDERR "tessellation: $tess_id, $tess_dir\n";
    125125       
    126126        my %unique_skycells = (); # Identified skycells (all unique by virtue of hash property)
     
    153153                }
    154154                my @matchlist = get_overlaps($astromFile, $tess_dir, $astromAccept); # List of overlaps
    155                 if (! @matchlist) {
     155                if (! @matchlist and $verbose) {
    156156                    print "skipping $astromFile\n";
    157157                }           
     
    206206   
    207207    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    208         run(command => $command, verbose => 1);
     208        run(command => $command, verbose => $verbose);
    209209    unless ($success) {
    210210        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    236236    $command .= ' -accept-astrom' if $accept;
    237237    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    238         run(command => $command, verbose => 1);
     238        run(command => $command, verbose => $verbose);
    239239    if (!$success) {
    240240        print "missing astrometry for $filename\n";
     
    273273       
    274274        $entry = $filename . '\[' . $extname . '\]';
    275         print STDERR "entry: $entry, class: $class_id, extname: $extname, chiproot: $chipRoot\n";
     275        print STDERR "entry: $entry, class: $class_id, extname: $extname, chiproot: $chipRoot\n" if $verbose;
    276276    } else {
    277277        $entry = $filename;
    278         print STDERR "entry: $entry\n";
     278        print STDERR "entry: $entry\n" if $verbose;
    279279    }
    280280
    281281    my @skycells = &select_skycells($entry, @$matches); # Matching skycells
    282282    my $Nskycells = @skycells;
    283     printf STDERR "Nskycells: $Nskycells\n";
     283    printf STDERR "Nskycells: $Nskycells\n" if $verbose;
    284284    foreach my $skycell (@skycells) {
    285285        my %overlap = ();       # Overlap information for warptool
     
    291291        push @$overlaps, \%overlap;
    292292       
    293         printf STDERR "overlap: %s : %s , %s\n", $skycell, $imfile->{cam_id}, $imfile->{class_id};
     293        printf STDERR "overlap: %s : %s , %s\n", $skycell, $imfile->{cam_id}, $imfile->{class_id} if $verbose;
    294294       
    295295        $unique_skycells->{$skycell} = 1;
Note: See TracChangeset for help on using the changeset viewer.