IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32480


Ignore:
Timestamp:
Oct 4, 2011, 12:12:43 PM (15 years ago)
Author:
bills
Message:

use hash to detect duplicate exposures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/refstacktool

    r32080 r32480  
    103103my $n_exps = 0;
    104104my $exp_id_last = 0;
     105
     106my %exp_hash;
    105107while (my $exp = $stmt->fetchrow_hashref()) {
    106108    # avoid exposures processed multiple times
    107109    my $exp_id = $exp->{exp_id};
    108     next if $exp_id_last == $exp_id;
     110
     111    if ($exp_hash{$exp_id}) {
     112#        print "skipping duplicate for $exp_id\n";
     113        next;
     114    }
     115#    This doesn't work since we are ordered by fwhm_major
     116#    if ($exp_id_last == $exp_id) {
     117#        print "skipping duplicate for $exp_id\n";
     118#    }
    109119    $exp_id_last = $exp_id;
     120
     121    $exp_hash{$exp_id} = 1;
    110122
    111123    $n_exps++;
Note: See TracChangeset for help on using the changeset viewer.