IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30277


Ignore:
Timestamp:
Jan 14, 2011, 2:16:52 PM (15 years ago)
Author:
watersc1
Message:

checkburntool bugs: StringSubstitute still is broken, vague SQL. register_imfile.pl detected daytime wrong.

Location:
trunk
Files:
3 edited

Legend:

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

    r30275 r30277  
    1010my $date = `date`;
    1111print "\n\n";
    12 print "Starting script $0 on $host at $date\n\n";
     12my $cmd_line = join ' ', @ARGV;
     13print "Starting script $0 $cmd_line on $host at $date\n\n";
    1314
    1415use vars qw( $VERSION );
     
    399400        $second =~ s/Z//;
    400401    }
    401     if (($hour >= $ss_hour)&&($minute >= $ss_minute)&&($second >= $ss_second)) {
    402         if (($hour <= $sr_hour)&&($minute <= $sr_minute)&&($second <= $sr_second)) {
    403             return(1);
     402#     print "this exposure: $hour $minute $second\n";
     403#     print "sunset:        $ss_hour $ss_minute $ss_second\n";
     404#     print "sunrise:       $sr_hour $sr_minute $sr_second\n";
     405#     printf "Hss: %d Mss: %d Sss: %d\n",($hour >= $ss_hour),($minute >= $ss_minute),($second >= $ss_second);
     406#     printf "Hsr: %d Msr: %d Ssr: %d\n",($hour <= $sr_hour),($minute <= $sr_minute),($second <= $sr_second);
     407
     408    if (($hour > $ss_hour)&&($hour <= 24)) {
     409        return(1); # After sunset by more than an hour, before midnight
     410    }
     411    elsif ($hour == $ss_hour) {
     412        if ($minute > $ss_minute) {
     413            return(1); # After sunset by more than a minute
    404414        }
    405     }
    406    
    407     return(0);
     415        elsif ($minute == $ss_minute) {
     416            if ($second >= $ss_second) {
     417                return(1); # After sunset by more than a second
     418            }
     419            else {
     420                return(0);
     421            }
     422        }
     423        else {
     424            return(0);
     425        }
     426    }
     427    elsif (($hour < $sr_hour)&&($hour >= 0)) {
     428        return(1); # Before sunrise by more than an hour, but after midnight
     429    }
     430    elsif ($hour == $sr_hour) {
     431        if ($minute < $sr_minute) {
     432            return(1); # Before sunrise by more than a minute
     433        }
     434        elsif ($minute == $sr_minute) {
     435            if ($second <= $sr_second) {
     436                return(1); # Before sunrise by more than a second
     437            }
     438            else {
     439                return(0);
     440            }
     441        }
     442        else {
     443            return(0);
     444        }
     445    }
     446    else {
     447        return(0); # We should never get here.
     448    }
    408449}
    409450
  • trunk/ippTools/share/regtool_checkburntoolimfile.sql

    r30240 r30277  
    11SELECT DISTINCT
    2        exp_name,
     2       summitExp.exp_name,
    33       rawImfile.uri,
    44       summitExp.dateobs AS registered,
     
    3131             AND summitExp.dateobs <= '@DATEOBS_END@'
    3232             AND summitImfile.class_id = '@CLASS_ID@'
    33              AND (exp_name <= '@EXP_NAME@')                                                                     
     33             AND (summitExp.exp_name <= '@EXP_NAME@')                                                                     
    3434ORDER BY summitExp.dateobs
  • trunk/ippTools/src/regtool.c

    r30240 r30277  
    9595            psAbort("invalid option (this should not happen)");
    9696    }
    97 
     97    psTrace("regtool",9,"Attempting to free config\n");
    9898    psFree(config);
    9999    pmConfigDone();
     
    204204
    205205  // convert regular class_id format to summitImfile.class_id format
     206  rep = psStringCopy(class_id);
     207  psFree(class_id);
     208  class_id = rep;
     209 
    206210  psStringSubstitute(&class_id,"ota","XY");
    207211 
     
    211215  psStringSubstitute(&query,dateobs_end,"@DATEOBS_END@");
    212216
    213   fprintf(stderr,"%s",query);
     217  // fprintf(stderr,"%s",query);
    214218
    215219  if (!p_psDBRunQuery(config->dbh, query)) {
     
    237241  if (!psArrayLength(output)) {
    238242    psTrace("regtool", PS_LOG_INFO, "no rows found");
    239     psFree(output);
    240243    return true;
    241244  }
Note: See TracChangeset for help on using the changeset viewer.