IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33949


Ignore:
Timestamp:
May 29, 2012, 5:08:07 PM (14 years ago)
Author:
eugene
Message:

merging changes from trunk

Location:
branches/eam_branches/ipp-20120405
Files:
69 edited
12 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120405/Nebulous-Server/bin/neb-admin

    r33414 r33949  
    625625#   OFFSET $offset
    626626# ");
    627     my $query = $dbh->prepare(
    628         "
    629 SELECT Z.so_id,ext_id,Z.ins_id,Z.uri,substr(Z.uri,-10,5) AS class_id,Z.vol_id,vol_name,vol_host,
    630        instance.vol_id AS  second_vol_id,volume.name AS second_name,volume.host AS second_host FROM (
    631   SELECT S.so_id,ext_id,ins_id,uri,substr(uri,-10,5) AS class_id,vol_id,name AS vol_name,host AS vol_host,MAXins_id FROM (
    632     select * FROM (
    633       select MAX(ins_id) AS MAXins_id, MIN(ins_id) AS MINins_id, so_id,ext_id FROM storage_object
    634         JOIN storage_object_xattr USING(so_id)
    635         RIGHT JOIN instance USING(so_id)
    636          WHERE name = 'user.copies'
    637          AND value >= 2
    638          AND ext_id LIKE '%ota%fits'
    639          AND so_id >= $so_id_start
    640          AND so_id <  $so_id_end
    641          GROUP BY so_id
    642       ) AS V
    643       WHERE MAXins_id != MINins_id
    644     ) AS S
    645     JOIN instance ON (S.MINins_id = instance.ins_id AND S.so_id = instance.so_id)
    646     JOIN volume USING(vol_id) WHERE volume.available = 1
    647     AND volume.name AS $requested_source
    648   ) AS Z
    649 JOIN instance ON (MAXins_id = instance.ins_id AND Z.so_id = instance.so_id)
    650 JOIN volume ON(instance.vol_id = volume.vol_id) WHERE volume.available = 1
    651 LIMIT $limit
    652 OFFSET $offset
    653 ");
     627   
     628    print STDERR "This query is broken so I have disabled it to get the MHPCC->ATRC shuffle going.\n";
     629    exit 0;
     630    my $query;
     631#     my $query = $dbh->prepare(
     632#       "
     633# SELECT Z.so_id,ext_id,Z.ins_id,Z.uri,substr(Z.uri,-10,5) AS class_id,Z.vol_id,vol_name,vol_host,
     634#        instance.vol_id AS  second_vol_id,volume.name AS second_name,volume.host AS second_host FROM (
     635#   SELECT S.so_id,ext_id,ins_id,uri,substr(uri,-10,5) AS class_id,vol_id,name AS vol_name,host AS vol_host,MAXins_id FROM (
     636#     select * FROM (
     637#       select MAX(ins_id) AS MAXins_id, MIN(ins_id) AS MINins_id, so_id,ext_id FROM storage_object
     638#         JOIN storage_object_xattr USING(so_id)
     639#         RIGHT JOIN instance USING(so_id)
     640#          WHERE name = 'user.copies'
     641#          AND value >= 2
     642#          AND ext_id LIKE '%ota%fits'
     643#          AND so_id >= $so_id_start
     644#          AND so_id <  $so_id_end
     645#          GROUP BY so_id
     646#       ) AS V
     647#       WHERE MAXins_id != MINins_id
     648#     ) AS S
     649#     JOIN instance ON (S.MINins_id = instance.ins_id AND S.so_id = instance.so_id)
     650#     JOIN volume USING(vol_id) WHERE volume.available = 1
     651#     AND volume.name AS $requested_source
     652#   ) AS Z
     653# JOIN instance ON (MAXins_id = instance.ins_id AND Z.so_id = instance.so_id)
     654# JOIN volume ON(instance.vol_id = volume.vol_id) WHERE volume.available = 1
     655# LIMIT $limit
     656# OFFSET $offset
     657# ");
    654658
    655659    $query->execute();
  • branches/eam_branches/ipp-20120405/Nebulous-Server/lib/Nebulous/Server/SQL.pm

    r31410 r33949  
    750750###
    751751
     752CREATE TABLE lost_instances (
     753    id BIGINT NOT NULL AUTO_INCREMENT,
     754    ins_id BIGINT NOT NULL DEFAULT -1,
     755    so_id BIGINT NOT NULL DEFAULT -1,
     756    vol_id INT NOT NULL DEFAULT -1,
     757    uri CHAR(255) NOT NULL DEFAULT 'undefined',
     758    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
     759    mtime TIMESTAMP,
     760    PRIMARY KEY(id),
     761    KEY(so_id),
     762    KEY(vol_id),
     763    KEY(uri(40))
     764) ENGINE=innodb DEFAULT CHARSET=latin1;
     765
     766###
     767
    752768CREATE TABLE log (
    753769    timestamp TIMESTAMP,
  • branches/eam_branches/ipp-20120405/ippMonitor

  • branches/eam_branches/ipp-20120405/ippMonitor/Makefile.in

    r32782 r33949  
    4747$(DESTWWW)/ipp.dvodb.dat \
    4848$(DESTWWW)/ipp.dvodb.php \
     49$(DESTWWW)/ipp.czar.dat \
     50$(DESTWWW)/ipp.czar.php \
    4951$(DESTWWW)/phptest.php \
    5052$(DESTWWW)/site.php \
     
    222224$(DESTWWW)/minidvodbCopy.php \
    223225$(DESTWWW)/minidvodbProcessed.php \
     226$(DESTWWW)/mergedvodbRun.php \
     227$(DESTWWW)/mergedvodbCopy.php \
     228$(DESTWWW)/mergedvodbProcessed.php \
     229$(DESTWWW)/dvodbStatus.php \
     230$(DESTWWW)/dvodbFaulted.php \
    224231$(DESTWWW)/addRunRun.php \
    225232$(DESTWWW)/addRunProcessed.php \
     233$(DESTWWW)/addRunSummary.php \
    226234$(DESTWWW)/lapSequenceSummary.php \
    227235$(DESTWWW)/lapRuns.php \
  • branches/eam_branches/ipp-20120405/ippMonitor/czartool/czarpoll.pl

    r32775 r33949  
    3838
    3939my @stages = (
    40         "burntool",
    4140        "chip",
    4241        "cam",
     
    4443        "warp",
    4544        "stack",
     45        "staticsky",
    4646        "diff",
    47         "magic",
    48         "magicDS",
    4947        "dist",
    50         "pub");
     48        "pub",
     49        "chipbackground");
    5150
    5251my @ippToPspsStages = (
  • branches/eam_branches/ipp-20120405/ippMonitor/czartool/czartool.pl

    r32093 r33949  
    3232my @publishingLabels = undef;
    3333
    34 my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub");
     34my @stages = ("chip", "cam", "fake", "warp", "stack", "staticsky", "diff", "dist", "pub", "chipbackground");
    3535promptPoll();
    3636
     
    155155
    156156    chomp($label);
    157 
    158     printf("\n+----------------------------------------------------------------------------------------------------------------------------------------------+\n");
    159     printf("|                                                         %32s                                                     |\n", $label);
    160     printf("+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
    161     printf("|   state    |    chip    |    cam     |    fake    |    warp    |   stack    |    diff    |   magic    |  destreak  |    dist    |   publish  |\n");
    162     printf("+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     157    my $stage;
     158
     159    printf("\n|  %32s  \n", $label);
     160    printf("+------------+");
     161    foreach $stage (@stages) {
     162        print "--------------+"
     163    }
     164    printf("\n");
     165    printf("|   state    |");
     166    foreach $stage (@stages) {
     167
     168        printf("%14s|", $stage)
     169    }
     170    printf("\n");
     171    printf("+------------+");
     172    foreach $stage (@stages) {
     173        print "--------------+"
     174    }
     175    printf("\n");
    163176
    164177    my $state;
    165     my $stage;
    166178    my $i=0;
    167179    foreach $state (@states) {
     
    172184        foreach $stage (@stages) {
    173185
    174             printf("| %10s ", getStateAndFaultsString($label, $state, $stage));
     186            printf("|%14s", getStateAndFaultsString($label, $state, $stage));
    175187        }
    176188
     
    179191    }
    180192
    181     printf("+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     193    printf("+------------+");
     194    foreach $stage (@stages) {
     195        print "--------------+"
     196    }
     197    printf("\n");
    182198
    183199}
     
    191207    my ($state) = @_;
    192208#print time, $/;
    193     printf("\n+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n");
    194     printf("|                                                                                         %10s (any faults are shown in parentheses)                                                                 |\n", $state);
    195     printf("+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+\n");
    196     printf("| no  |              label               | distributing? |  publishing?  |    chip    |    cam     |    fake    |    warp    |   stack    |    diff    |   magic    |  destreak  |    dist    |   publish  |\n");
    197     printf("+-----+----------------------------------+---------------+---------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     209    my $stage;
     210
     211    printf("|\n");
     212    printf("+-----+----------------------------------+---------------+---------------+");
     213    foreach $stage (@stages) {
     214        print "--------------+"
     215    }
     216    printf("\n");
     217    printf("| no  |              label               | distributing? |  publishing?  |");
    198218
    199219    my $stdsLabel;
     
    202222    my $distributing;
    203223    my $publishing;
    204     my $stage;
    205224    my $i=1;
     225    foreach $stage (@stages) {
     226
     227        printf("%14s|", $stage)
     228    }
     229    printf("\n");
     230    printf("+-----+----------------------------------+---------------+---------------+");
     231    foreach $stage (@stages) {
     232        print "--------------+"
     233    }
     234    printf("\n");
     235
    206236    foreach $stdsLabel (@stdscienceLabels) {
    207237
     
    225255        foreach $stage (@stages) {
    226256
    227             printf("| %10s ", getStateAndFaultsString($stdsLabel, $state, $stage));
     257            printf("|%14s", getStateAndFaultsString($stdsLabel, $state, $stage));
    228258        }
    229259
     
    232262    }
    233263
    234     printf("+-----+----------------------------------+---------------+---------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     264    printf("+-----+----------------------------------+---------------+---------------+");
     265    foreach $stage (@stages) {
     266        print "--------------+"
     267    }
     268    printf("\n");
    235269
    236270}
  • branches/eam_branches/ipp-20120405/ippMonitor/czartool/czartool/CzarDb.pm

    r32797 r33949  
    99
    1010my @stages = (
    11         "burntool",
    1211        "chip",
    1312        "cam",
     
    1615        "stack",
    1716        "diff",
    18         "magic",
    19         "magicDS",
    2017        "dist",
    21         "pub"); # TODO put elsewhere
     18        "pub",
     19        "chipbackground"); # TODO put elsewhere
    2220
    2321my @ippToPspsStages = (
  • branches/eam_branches/ipp-20120405/ippMonitor/czartool/czartool/DayMetrics.pm

    r32093 r33949  
    4040    $self->{begin} =  "$yesterday " . $self->{config}->getMetricsStartTime();
    4141    $self->{end} = $self->{czarDb}->addInterval($self->{begin}, "1 DAY");
    42     $self->{burntoolEnd} = $self->{czarDb}->addInterval($self->{begin}, "12 HOUR");
     42    $self->{chipEnd} = $self->{czarDb}->addInterval($self->{begin}, "12 HOUR");
    4343
    4444    # create path, dir and html file
     
    6767    my $htmlFile = $self->{htmlFile};
    6868
    69     # summit and burntool exposures
     69    # summit and chip exposures
    7070    my $summitExposures = $self->{gpc1Db}->countScienceExposuresFromLastNight($self->{day});
    71     my $burntoolMetrics = new czartool::StageMetrics("burntool", "all_stdscience_labels", $self->{begin}, $self->{burntoolEnd});
    72     $self->{czarDb}->runAnalysis($burntoolMetrics);
     71    my $chipMetrics = new czartool::StageMetrics("chip", "all_stdscience_labels", $self->{begin}, $self->{chipEnd});
     72    $self->{czarDb}->runAnalysis($chipMetrics);
    7373
    7474    my $previousDay = $self->{czarDb}->subtractInterval($self->{day}, "1 DAY");
     
    7878    print $htmlFile "<a href=\"../$previousDay/index.html\"> \< previous day</a> | <a href=\"../index.html\">all</a> | <a href=\"../$nextDay/index.html\">next day \></a><br>\n";
    7979    print $htmlFile "Measured from $self->{begin} to $self->{end} HST<br>\n";
    80     printf ( $htmlFile "%d exposures taken on summit last night, %d through burntool today</h5>\n",
    81             $summitExposures, $burntoolMetrics->getProcessed() ? $burntoolMetrics->getProcessed() : 0 );
     80    printf ( $htmlFile "%d exposures taken on summit last night, %d through chip today</h5>\n",
     81            $summitExposures, $chipMetrics->getProcessed() ? $chipMetrics->getProcessed() : 0 );
    8282    print $htmlFile "</head>\n";
    8383    print $htmlFile "<body>\n";
     
    9898    my %labelTables;
    9999
    100     my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
     100    my @stages = (
     101            "chip",
     102            "cam",
     103            "fake",
     104            "warp",
     105            "stack",
     106            "staticsky",
     107            "diff",
     108            "dist",
     109            "chipbackground");
    101110
    102111
     
    126135        foreach my $stage ( @stages ){
    127136
    128             my $stageMetrics = new czartool::StageMetrics($stage, $label, $self->{begin}, ($stage eq "burntool") ? $self->{burntoolEnd} : $self->{end});
     137            my $stageMetrics = new czartool::StageMetrics($stage, $label, $self->{begin}, ($stage eq "chip") ? $self->{chipEnd} : $self->{end});
    129138            if (!$self->{czarDb}->runAnalysis($stageMetrics)) {next;}
    130139
     
    253262    print $htmlFile "  <tr>\n";
    254263    print $htmlFile "    <th>Survey</th>\n";
    255     print $htmlFile "    <th>Started burntool</th>\n";
     264    print $htmlFile "    <th>Started chip</th>\n";
    256265    print $htmlFile "    <th>Finished distribution</th>\n";
    257266    print $htmlFile "    <th>Time taken</th>\n";
     
    260269    # OSS survey
    261270    my ($started, $finished, $timeTaken) = undef;
    262     $self->{czarDb}->getDayTimings("OSS.nightlyscience", "burntool", "diff", $self->{begin}, \$started, \$finished, \$timeTaken);
     271    $self->{czarDb}->getDayTimings("OSS.nightlyscience", "chip", "diff", $self->{begin}, \$started, \$finished, \$timeTaken);
    263272    $self->printSurveyDetails("OSS", $started, $finished, $timeTaken);
    264273
     
    285294    foreach $mdf (@mdfs) {
    286295
    287         if ($self->{czarDb}->getDayTimings($mdf, "burntool", "dist", $self->{begin}, \$started, \$finished, \$timeTaken)) {
     296        if ($self->{czarDb}->getDayTimings($mdf, "chip", "dist", $self->{begin}, \$started, \$finished, \$timeTaken)) {
    288297
    289298            if ($started && $self->{czarDb}->isBefore($started, $earliest)) {$earliest = $started; $haveStart = 1;}
     
    299308    $self->printSurveyDetails("MDF", $earliest, $latest, $timeTaken);
    300309
    301     $self->{czarDb}->getDayTimings("all_stdscience_labels", "burntool", "dist", $self->{begin}, \$started, \$finished, \$timeTaken);
     310    $self->{czarDb}->getDayTimings("all_stdscience_labels", "chip", "dist", $self->{begin}, \$started, \$finished, \$timeTaken);
    302311    $self->printSurveyDetails("All", $started, $finished, $timeTaken);
    303312
  • branches/eam_branches/ipp-20120405/ippMonitor/czartool/czartool/Gpc1Db.pm

    r32567 r33949  
    2424    elsif ($stage eq "warp") {${$joinTable}="warpSkyfile";}
    2525    elsif ($stage eq "stack") {${$joinTable}="stackSumSkyfile";}
     26    elsif ($stage eq "staticsky") {${$id} = "sky_id"; ${$joinTable}="staticskyResult";}
    2627    elsif ($stage eq "diff") {${$joinTable}="diffSkyfile";}
    2728    elsif ($stage eq "magic") {${$joinTable}="magicNodeResult";}
     
    2930    elsif ($stage eq "dist") {${$joinTable}="distComponent";}
    3031    elsif ($stage eq "pub") {${$joinTable}="publishDone";}
     32    elsif ($stage eq "chipbackground") {${$id}="chip_bg_id"; ${$joinTable}="chipBackgroundImfile";}
    3133    else {
    3234
     
    5153    elsif ($stage eq "warp" ) {return "warpRun";}
    5254    elsif ($stage eq "stack" ) {return "stackRun";}
     55    elsif ($stage eq "staticsky" ) {return "staticskyRun";}
    5356    elsif ($stage eq "diff" ) {return "diffRun";}
    5457    elsif ($stage eq "magic" ) {return "magicRun";}
     
    5659    elsif ($stage eq "dist" ) {return "distRun";}
    5760    elsif ($stage eq "pub" ) {return "publishRun";}
     61    elsif ($stage eq "chipbackground" ) {return "chipBackgroundRun";}
    5862
    5963    return "ERROR";
  • branches/eam_branches/ipp-20120405/ippMonitor/czartool/czartool/Plotter.pm

    r32763 r33949  
    1111
    1212my @allStages = (
    13         "burntool",
    1413        "chip",
    1514        "cam",
     
    1716        "warp",
    1817        "stack",
     18        "staticsky",
    1919        "diff",
    20         "magic",
    21         "magicDS",
    2220        "dist",
    23         "pub");
     21        "pub",
     22        "chipbackground");
    2423
    2524my @allIppToPspsStages = (
  • branches/eam_branches/ipp-20120405/ippMonitor/czartool/roboczar.pl

    r32098 r33949  
    2121my $czarDb = $config->getCzarDbInstance();
    2222
    23 my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); # TODO get from Pantasks
     23my @stages = (
     24        "chip",
     25        "cam",
     26        "fake",
     27        "warp",
     28        "stack",
     29        "staticsky",
     30        "diff",
     31        "dist",
     32        "chipbackground"); # TODO get from Pantasks
    2433
    2534my @interestedServers = $config->getRoboczarInterestedServers();
  • branches/eam_branches/ipp-20120405/ippMonitor/def/addRunRun.d

    r31320 r33949  
    99
    1010#     field                   size  format  name         show    link to                  extras
    11 FIELD distinct(addRun.add_id),        5, %d,     add ID
     11FIELD addRun.add_id,       5, %d,     addID
    1212FIELD addRun.stage,        5, %s,     stage
    13 FIELD addRun.stage_id,          5, %d,     stage ID
    14 FIELD addRun.add_id,        5, %d,     add ID
     13FIELD addRun.stage_id,     5, %d,     stageID
     14FIELD addRun.stage_extra1, 5, %d,     stageExtra1
     15#FIELD addRun.add_id,       5, %d,     addID
    1516FIELD addRun.state,        5, %s,     state
    16 FIELD addRun.workdir,        5, %s,     workdir
    17 FIELD addRun.reduction,        5, %s,     reduction
     17FIELD addRun.workdir,      5, %s,     workdir
     18FIELD addRun.reduction,    5, %s,     reduction
    1819FIELD addRun.label,        5, %s,     label
    19 FIELD addRun.data_group,        5, %s,     data_group
     20FIELD addRun.data_group,   5, %s,     data_group
    2021FIELD addRun.dvodb,        5, %s,     dvodb
    21 FIELD addRun.note,        5, %s,     note
    22 FIELD addRun.image_only,        5, %d,   image_only
    23 FIELD addRun.minidvodb,        5, %d,     minidvodb
    24 FIELD addRun.minidvodb_group,        5, %s,     minidvodb_group
    25 FIELD addRun.minidvodb_name,        5, %s,     minidvodb_name
    26 
    27 
     22FIELD addRun.note,         5, %s,     note
     23FIELD addRun.image_only,   5, %d,   image_only
     24FIELD addRun.minidvodb,    5, %d,     minidvodb
     25FIELD addRun.minidvodb_group, 5, %s,     minidvodb_group
     26FIELD addRun.minidvodb_name,  5, %s,     minidvodb_name
  • branches/eam_branches/ipp-20120405/ippMonitor/def/exposureStatus.d

    r29404 r33949  
    22TITLE Exposures Status
    33FILE exposureStatus.php
    4 MENU ipp.imfiles.dat
     4MENU ipp.czar.dat
    55
    66WHERE object != 'ENGINEERING'
  • branches/eam_branches/ipp-20120405/ippMonitor/def/gpc1MysqlProcessList.d

    r29481 r33949  
    22TITLE GPC 1 MySql Process List
    33FILE gpc1MysqlProcessList.php
    4 MENU ipp.imfiles.dat
     4MENU ipp.czar.dat
    55
    66FIELD ID,   5,  %d, Process ID
  • branches/eam_branches/ipp-20120405/ippMonitor/def/maskStats.d

    r28451 r33949  
    22TITLE Mask Stats
    33FILE  maskStats.php
    4 MENU  ipp.imfiles.dat
     4MENU  ipp.czar.dat
    55
    66WHERE rawExp.exp_id = chipRun.exp_id
  • branches/eam_branches/ipp-20120405/ippMonitor/def/minidvodbProcessed.d

    r30453 r33949  
    99
    1010#     field                   size  format  name         show    link to                  extras
    11 FIELD distinct(minidvodbRun.minidvodb_id),        5, %d,     Minidvodb ID
    12 
     11FIELD minidvodbRun.minidvodb_id,        5, %d,     Minidvodb ID
    1312FIELD minidvodbRun.minidvodb_name,          5, %s,     minidvodb_name
    1413FIELD minidvodbRun.minidvodb_group,       5, %s,     minidvodb_group
    15 FIELD minidvodbProcessed.merge_order,        5, %d,     Merge Order
    1614FIELD minidvodbProcessed.dtime_resort,        5, %d,     resort time
    1715FIELD minidvodbProcessed.dtime_relphot,        5, %d,     relphot time
    18 FIELD minidvodbProcessed.dtime_merge,        5, %d,     dvomerge time
    19 FIELD minidvodbProcessed.mergedvodb_path,          25, %s,     mergedvodb_path
     16FIELD minidvodbProcessed.dtime_script,        5, %d,     script time
    2017FIELD state,          5, %s,    State
    2118FIELD minidvodbProcessed.fault,        5, %d,     Fault
  • branches/eam_branches/ipp-20120405/ippMonitor/def/minidvodbRun.d

    r30453 r33949  
    99
    1010#     field                   size  format  name         show    link to                  extras
    11 FIELD distinct(minidvodbRun.minidvodb_id),        5, %d,     Minidvodb ID
     11FIELD minidvodbRun.minidvodb_id,        5, %d,     Minidvodb ID
    1212FIELD minidvodbRun.minidvodb_name,          5, %s,     minidvodb_name
    1313FIELD minidvodbRun.minidvodb_group,       5, %s,     minidvodb_group
    1414FIELD minidvodbRun.minidvodb_path,    25, %s,     minidvodb_path
    15 FIELD minidvodbRun.mergedvodb_path,          25, %s,     mergedvodb_path
     15#FIELD minidvodbRun.mergedvodb_path,          25, %s,     mergedvodb_path
    1616FIELD state,          5, %s,    State
    1717FIELD creation_date,        5, %T,     epoch
  • branches/eam_branches/ipp-20120405/ippMonitor/def/mopsStatus.d

    r32278 r33949  
    22TITLE MOPS Status
    33FILE mopsStatus.php
    4 MENU ipp.imfiles.dat
     4MENU ipp.czar.dat
    55#WHERE rawExp.obs_mode!='ENGINEERING'
    66
  • branches/eam_branches/ipp-20120405/ippMonitor/def/warpProcessedSkyfiles_Images.d

    r32369 r33949  
    11TABLE  rawExp JOIN chipRun USING(exp_id) JOIN camRun USING(chip_id) JOIN fakeRun USING(cam_id) JOIN warpRun USING(fake_id) JOIN warpSkyfile USING(warp_id)
    22TITLE Warp Processed Skyfiles
    3 FILE  warpProcessedSkyfiles.php
     3FILE  warpProcessedSkyfiles_Images.php
    44MENU  ipp.science.dat
    55
  • branches/eam_branches/ipp-20120405/ippMonitor/raw/czartool_ipptopsps.php

    r33441 r33949  
    2323
    2424if ($ID['menu']) {$myMenu = $ID['menu'];}
    25 else {$myMenu = "ipp.imfiles.dat";}
     25else {$myMenu = "ipp.czar.dat";}
    2626
    2727menu($myMenu, 'Czartool on '.$lastUpdateTime, 'ipp.css', $ID['link'], $ID['proj']);
     
    7878
    7979$debug = 0;
    80 $table = "<table bgcolor=\"#FFFFFF\" width=\"700\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     80$table = "<table bgcolor=\"#FFFFFF\" width=\"900\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
    8181
    8282
  • branches/eam_branches/ipp-20120405/ippMonitor/raw/czartool_labels.php

    r33063 r33949  
    2323
    2424if ($ID['menu']) {$myMenu = $ID['menu'];}
    25 else {$myMenu = "ipp.imfiles.dat";}
     25else {$myMenu = "ipp.czar.dat";}
    2626
    2727menu($myMenu, 'Czartool on '.$lastUpdateTime, 'ipp.css', $ID['link'], $ID['proj']);
    2828
    2929$stages=array(
    30         "burntool",
    3130        "chip",
    3231        "cam",
     
    3433        "warp",
    3534        "stack",
     35        "staticsky",
    3636        "diff",
    37         "magic",
    38         "magicDS",
    3937        "dist",
    40         "pub");
     38        "pub",
     39        "chipbackground");
    4140
    4241$servers=array(
     
    9291
    9392$debug = 0;
    94 $table = "<table bgcolor=\"#FFFFFF\" width=\"700\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     93$table = "<table bgcolor=\"#FFFFFF\" width=\"900\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
    9594
    9695$labels = getLabels($czardb, $selectedMode);
     
    441440        $anyFaults = false;
    442441
    443         $link = $defaultlink;
    444         getStateAndFaults($db, $thisLabel, $selectedState, "burntool", $str, $anyFaults);
    445         createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    446 
    447442        $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel . "&chipRun.state=".$searchState;
    448443        getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults);
     
    465460        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    466461
     462        $link = $defaultlink;
     463        getStateAndFaults($db, $thisLabel, $selectedState, "staticsky", $str, $anyFaults);
     464        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
     465
    467466        $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState;
    468467        getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults);
     
    470469
    471470        $link = $defaultlink;
    472         getStateAndFaults($db, $thisLabel, $selectedState, "magic", $str, $anyFaults);
    473         createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    474 
    475         $link = $defaultlink;
    476         getStateAndFaults($db, $thisLabel, $selectedState, "magicDS", $str, $anyFaults);
    477         createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    478 
    479         $link = $defaultlink;
    480471        getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults);
    481472        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
     
    485476        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$publishing) ? "gray" : null);
    486477
     478        $link = $defaultlink;
     479        getStateAndFaults($db, $thisLabel, $selectedState, "chipbackground", $str, $anyFaults);
     480        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
     481
    487482        echo "</tr>\n";
    488483    }
     
    492487    createFormattedTableCell(($selectedLabel != "all"), $link, "All labels", 0, null);
    493488
    494     createFormattedTableCell(0, null, "Reverting?", 0, "$columnHeaderColor");
    495 
    496489    foreach ($stages as &$stage) {
    497490
    498         if ($stage == "burntool") continue;
    499491        $reverting = getRevertStatus($db, $stage);
    500         #$link =
    501         #    "czartool_labels.php?pass=".$pass
    502         #    ."&proj=".$proj
    503         #    ."&mode=" .$selectedMode
    504         #    ."&label=".$selectedLabel
    505         #    ."&stage=".$selectedStage
    506         #    ."&plottype=".$plotType
    507         #    ."&revertstage=".$stage
    508         #    ."&revertmode=";
    509 #
    510         #if(!$reverting) {$label =  "Start";$link = $link . "on";}
    511         #if($reverting) {$label = "Stop";$link = $link . "off";}
    512         if(!$reverting) {$label =  "no";}
    513         if($reverting) {$label = "yes";}
     492        if(!$reverting) {$label =  "";}
     493        if($reverting) {$label = "reverting";}
    514494        unset($reverting);
    515         #createFormattedTableCell(1, $link, $label, 0, "$columnHeaderColor");
    516495        createFormattedTableCell(0, null, $label, 0, "$columnHeaderColor");
    517         #echo "<td><a href=\"$link\"><font color=\"blue\">$label</font></td>";
    518 
    519496    }
    520497
  • branches/eam_branches/ipp-20120405/ippMonitor/raw/ipp.dvodb.dat

    r30453 r33949  
    99             
    1010menulink  | menuselect   | link    | minidvodbRun              | minidvodbRun.php
    11 menulink  | menuselect   | link    | minidvodbProcessed         | minidvodbProcessed.php           
     11menulink  | menuselect   | link    | minidvodbProcessed         | minidvodbProcessed.php   
    1212menulink  | menuselect   | link    | minidvodbCopy               | minidvodbCopy.php           
    1313
     14menutop   | menutop      | plain   | &nbsp;   |
     15
     16menulink  | menuselect   | link    | mergedvodbRun              | mergedvodbRun.php
     17menulink  | menuselect   | link    | mergedvodbProcessed         | mergedvodbProcessed.php   
     18menulink  | menuselect   | link    | mergedvodbCopy               | mergedvodbCopy.php           
     19
     20menutop   | menutop      | plain   | &nbsp;   |
     21
     22menulink  | menuselect   | link    | dvodbStatus               | dvodbStatus.php
     23menulink  | menuselect   | link    | dvodbFaulted               | dvodbFaulted.php           
     24menulink  | menuselect   | link    | addRun Summary        | addRunSummary.php           
  • branches/eam_branches/ipp-20120405/ippMonitor/raw/ipp.menu.dat

    r31816 r33949  
    2727menutop   | menutop      | link    | Calibration                  | ipp.cal.php
    2828menutop   | menutop      | link    | Plots                        | ipp.plots.php
     29menutop   | menutop      | link    | Czar                         | ipp.czar.php
    2930menutop   | menutop      | link    | Admin and Debug              | ipp.imfiles.php
  • branches/eam_branches/ipp-20120405/ippMonitor/raw/ipp.science.dat

    r28688 r33949  
    3838menulink  | menuselect   | link    | Warp Skyfile Inputs          | warpStageSkyfileInputs.php
    3939menulink  | menuselect   | link    | Warp Processed Skyfiles      | warpProcessedSkyfiles.php
     40#menulink  | menuselect   | link    | Warp Processed Skyfiles w/ Images     | warpProcessedSkyfiles_images.php
    4041menulink  | menuselect   | link    | Warp Failed Skyfiles         | warpFailedSkyfiles.php
    4142
  • branches/eam_branches/ipp-20120405/ippMonitor/raw/nightSummary.php

    r33004 r33949  
    5252  $myMenu = $ID['menu'];
    5353} else {
    54   $myMenu = "ipp.imfiles.dat";
     54  $myMenu = "ipp.czar.dat";
    5555}
    5656
  • branches/eam_branches/ipp-20120405/ippScripts/scripts/destreak_restore_camera.pl

    • Property svn:mergeinfo set to (toggle deleted branches)
      /tags/ipp-20120404/ippScripts/scripts/destreak_restore_camera.plmergedeligible
      /trunk/ippScripts/scripts/destreak_restore_camera.plmergedeligible
      /branches/czw_branch/20101203/ippScripts/scripts/destreak_restore_camera.pl29907-30631
      /branches/eam_branches/ipp-20101103/ippScripts/scripts/destreak_restore_camera.pl29657-29920
      /branches/eam_branches/ipp-20101205/ippScripts/scripts/destreak_restore_camera.pl29959-30585
      /branches/eam_branches/ipp-20110213/ippScripts/scripts/destreak_restore_camera.pl30628-31149
      /branches/eam_branches/ipp-20110404/ippScripts/scripts/destreak_restore_camera.pl31166-31444
      /branches/eam_branches/ipp-20110505/ippScripts/scripts/destreak_restore_camera.pl31458-31658
      /branches/eam_branches/ipp-20110710/ippScripts/scripts/destreak_restore_camera.pl31852-32345
      /branches/eam_branches/ipp-20110906/ippScripts/scripts/destreak_restore_camera.pl32363-32631
      /branches/eam_branches/ipp-20111110/ippScripts/scripts/destreak_restore_camera.pl32645-32694
      /branches/haf_add201112/ippScripts/scripts/destreak_restore_camera.pl32980-33029
    r33618 r33949  
    422422                # looks like a censored one
    423423                if (scalar @{$file{bad_instances}}) {
    424                     my $bad = ${$file{bad_instances}}->[0];
     424                    my $bad = ${$file{bad_instances}}[0];
    425425                    $file{censored} = ($bad =~ /SR_/);
    426426                    print "no good instances found setting censored based on $bad\n";
  • branches/eam_branches/ipp-20120405/ippScripts/scripts/ipp_apply_burntool_single.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120405/ippScripts/scripts/magic_destreak.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120405/ippScripts/scripts/nightly_science.pl

    r33371 r33949  
    15391539            $cmd .= " -simple  -set_label $label -exp_id $input_exp_id -template_exp_id $template_exp_id ";
    15401540#               $cmd .= " -pretend ";
     1541            if (defined($reduction)) {
     1542                $cmd .= " -set_reduction $reduction ";
     1543            }
     1544
    15411545            if (defined($pretend)) {
    15421546                $cmd .= ' -pretend ';
     
    16701674            $cmd .= "-set_workdir $workdir  -set_dist_group $dist_group  -set_data_group $new_data_group ";
    16711675            $cmd .= " -simple  -set_label $label -exp_id $input_exp_id -template_exp_id $template_exp_id ";
     1676            if (defined($reduction)) {
     1677                $cmd .= " -set_reduction $reduction ";
     1678            }
     1679
    16721680#               $cmd .= " -pretend ";
    16731681            if (defined($pretend)) {
     
    17241732    $check_cmd .= " -pretend -simple  -rerun -set_label $label -filter $filter ";
    17251733    $check_cmd .= " -dateobs_begin ${lunation_start}T00:00:00 -dateobs_end ${lunation_end}T23:59:59 -distance 1.5 ";
     1734    if (defined($reduction)) {
     1735        $check_cmd .= " -set_reduction $reduction ";
     1736    }
    17261737
    17271738    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    17451756            $cmd .= " -simple  -rerun -set_label $label -filter $filter ";
    17461757            $cmd .= " -dateobs_begin ${lunation_start}T00:00:00 -dateobs_end ${lunation_end}T23:59:59 -distance 1.5 ";
     1758            if (defined($reduction)) {
     1759                $cmd .= " -set_reduction $reduction ";
     1760            }
    17471761
    17481762            if (defined($pretend)) {
  • branches/eam_branches/ipp-20120405/ippScripts/scripts/staticsky.pl

    r33690 r33949  
    144144            my $path_base = $file->{path_base};
    145145            print "input: $path_base\n";
     146            my $stack_id = $file->{stack_id};
    146147
    147148            my $imageCnv  = $ipprc->filename("PPSTACK.OUTPUT",          $path_base ); # Image name
     
    172173            &my_die("Couldn't find input: $sources",   $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$sources");
    173174
     175            print $listFile "  STACK_ID      S64  " . $stack_id  . "\n";
    174176            print $listFile "  RAW:IMAGE     STR  " . $imageRaw  . "\n";
    175177            print $listFile "  RAW:MASK      STR  " . $maskRaw   . "\n";
  • branches/eam_branches/ipp-20120405/ippTasks/pstamp.pro

    r33671 r33949  
    1313$pstampFin_DB = 0
    1414$pstampRev_DB = 0
     15$pstampRevReq_DB = 0
    1516$pstampDep_DB = 0
    1617$pstampRevDep_DB = 0
     
    117118
    118119macro pstamp.revert.on
     120    task pstamp.request.revert
     121        active true
     122    end
    119123    task pstamp.job.revert
    120124        active true
     
    128132end
    129133macro pstamp.revert.off
     134    task pstamp.request.revert
     135        active false
     136    end
    130137    task pstamp.job.revert
    131138        active false
     
    662669end
    663670
     671task pstamp.request.revert
     672    host        local
     673
     674    periods     -poll $LOADPOLL
     675    periods     -exec 1200
     676    periods     -timeout 20
     677    npending    1
     678
     679    task.exec
     680        stdout NULL
     681        stderr $LOGSUBDIR/pstamp.request.revert.log
     682        $run = pstamptool -revertreq
     683        if ($DB:n == 0)
     684            option DEFAULT
     685        else
     686            $run = $run $PS_DBSERVER -dbname $DB:$pstampRevReq_DB
     687            $pstampRevReq_DB ++
     688            if ($pstampRevReq_DB >= $DB:n) set pstampRevReq_DB = 0
     689        end
     690        add_poll_args run
     691        add_poll_labels run
     692        command $run
     693    end
     694
     695    task.exit $EXIT_SUCCESS
     696        # nothing to do
     697    end
     698
     699    task.exit   default
     700        showcommand failure
     701    end
     702
     703    task.exit   crash
     704        showcommand crash
     705    end
     706
     707    task.exit   timeout
     708        showcommand timeout
     709    end
     710end
    664711task pstamp.job.revert
    665712    host        local
  • branches/eam_branches/ipp-20120405/ippTools/share/Makefile.am

    r33525 r33949  
    450450        vptool_pendingrun.sql \
    451451        vptool_processedcell.sql \
    452         vptool_revertrun.sql
     452        vptool_revertrun.sql \
     453        sctool_list.sql
    453454
  • branches/eam_branches/ipp-20120405/ippTools/share/camtool_find_pendingimfile.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120405/ippTools/share/chiptool_pendingimfile.sql

    r27926 r33949  
    66    rawImfile.magicked as raw_magicked,
    77    (rawImfile.user_1 is not NULL and rawImfile.user_1 > 0.5) as deburned,
     8    rawImfile.burntool_state as burntool_state,
     9    rawImfile.video_cells as video_cells,
    810    rawExp.exp_tag,
    911    rawExp.exp_name,
  • branches/eam_branches/ipp-20120405/ippTools/share/chiptool_setimfiletoupdate.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120405/ippTools/share/pstamptool_revertreq_deletejobs.sql

    r25199 r33949  
    33FROM pstampJob
    44    JOIN pstampRequest USING(req_id)
    5 WHERE pstampRequest.state = 'new'
     5WHERE pstampRequest.state = 'new'
     6    AND pstampRequest.fault > 0
  • branches/eam_branches/ipp-20120405/ippTools/share/pxadmin_create_tables.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120405/ippTools/share/staticskytool_definebyquery_inputs.sql

    r31689 r33949  
    66  FROM stackRun
    77  JOIN stackSumSkyfile USING(stack_id)
     8  JOIN skycell USING(tess_id, skycell_id)
    89  WHERE stackRun.state = 'full'
    910      AND stackSumSkyfile.fault = 0
  • branches/eam_branches/ipp-20120405/ippTools/share/staticskytool_definebyquery_select.sql

    r31687 r33949  
    1010  FROM stackRun
    1111  JOIN stackSumSkyfile USING(stack_id)
     12  JOIN skycell using(tess_id, skycell_id)
    1213  WHERE stackRun.state = 'full'
    1314      AND stackSumSkyfile.fault = 0
     
    2930    JOIN stackRun USING(stack_id)
    3031    JOIN stackSumSkyfile USING(stack_id)
     32    JOIN skycell USING(tess_id, skycell_id)
    3133    WHERE 1
    3234    -- restrict by selected filters, stackSumSkyfile.good_frac, stackRun.skycell_id, stackRun.label
  • branches/eam_branches/ipp-20120405/ippTools/share/staticskytool_result.sql

    r33384 r33949  
    66    stackRun.tess_id,
    77    stackRun.skycell_id,
    8     count(stackRun.filter) AS num_filters
     8    count(stackRun.filter) AS num_filters,
     9    skycell.glong,
     10    skycell.glat
    911FROM staticskyRun
    1012JOIN staticskyResult USING(sky_id)
    1113JOIN staticskyInput USING(sky_id)
    12 JOIN stackRun using(stack_id)
     14JOIN stackRun USING(stack_id)
     15LEFT JOIN skycell USING(tess_id, skycell_id)
  • branches/eam_branches/ipp-20120405/ippTools/share/warptool_towarped.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120405/ippTools/src

  • branches/eam_branches/ipp-20120405/ippTools/src/addtool.c

    r33705 r33949  
    14171417  psString query = NULL;
    14181418  psStringAppend(&query, bare_query, minidvodb_group);
    1419   psStringAppend(&query, where_string);
     1419  psStringAppend(&query," %s ", where_string);
    14201420
    14211421
  • branches/eam_branches/ipp-20120405/ippTools/src/magictool.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120405/ippTools/src/pstamptoolConfig.c

    r33337 r33949  
    125125    psMetadataAddStr(revertreqArgs, PS_LIST_TAIL, "-state", 0,      "state to revert", NULL);
    126126    psMetadataAddStr(revertreqArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by pstampRequest label (LIKE comparision)", NULL);
     127    // this argument is supplied by pantasks so we accept it but don't use it
     128    psMetadataAddU64(revertreqArgs, PS_LIST_TAIL, "-limit", 0,      "not used", 0);
    127129
    128130    // -pendingcleanup
  • branches/eam_branches/ipp-20120405/ippTools/src/pxspace.c

    r25770 r33949  
    5656    psMetadataAddF64(md, PS_LIST_TAIL, "-decl", 0,             "DEC value for radius search (degrees)", false);
    5757}
     58
     59void pxskycellAddArguments(psMetadata *md)
     60{
     61    psMetadataAddF32(md,  PS_LIST_TAIL, "-ra_min",            0, "search by right ascension (degrees)", NAN);
     62    psMetadataAddF32(md,  PS_LIST_TAIL, "-dec_min",           0, "search by declination (degrees)", NAN);
     63    psMetadataAddF32(md,  PS_LIST_TAIL, "-ra_max",            0, "search by right ascension (degrees)", NAN);
     64    psMetadataAddF32(md,  PS_LIST_TAIL, "-dec_max",           0, "search by declination (degrees)", NAN);
     65    psMetadataAddF32(md,  PS_LIST_TAIL, "-glong_min",         0, "search by galactic longitude (degrees)", NAN);
     66    psMetadataAddF32(md,  PS_LIST_TAIL, "-glat_min",          0, "search by galactic latitude (degrees)", NAN);
     67    psMetadataAddF32(md,  PS_LIST_TAIL, "-glong_max",         0, "search by galactic longitude (degrees)", NAN);
     68    psMetadataAddF32(md,  PS_LIST_TAIL, "-glat_max",          0, "search by galactic latitude (degrees)", NAN);
     69}
     70
     71bool pxskycellAddWhere(pxConfig *config, psMetadata *where)
     72{
     73    PXOPT_COPY_F32(config->args, where, "-ra_min", "skycell.radeg", ">=");
     74    PXOPT_COPY_F32(config->args, where, "-dec_min", "skycell.decdeg", ">=");
     75    PXOPT_COPY_F32(config->args, where, "-ra_max", "skycell.radeg", "<");
     76    PXOPT_COPY_F32(config->args, where, "-dec_max", "skycell.decdeg", "<");
     77    PXOPT_COPY_F32(config->args, where, "-glong_min", "skycell.glong", ">=");
     78    PXOPT_COPY_F32(config->args, where, "-glat_min", "skycell.glat", ">=");
     79    PXOPT_COPY_F32(config->args, where, "-glong_max", "skycell.glong", "<");
     80    PXOPT_COPY_F32(config->args, where, "-glat_max", "skycell.glat", "<");
     81    return true;
     82}
  • branches/eam_branches/ipp-20120405/ippTools/src/pxspace.h

    r25770 r33949  
    11/*
    2  * pxmagic.h
     2 * pxspace.h
    33 *
    44 * Copyright (C) 2009  IfA
     
    2424extern void pxspaceAddArguments(psMetadata *md);
    2525
     26extern bool pxskycellAddWhere(pxConfig *config, psMetadata *where);
     27extern void pxskycellAddArguments(psMetadata *md);
     28
    2629#endif // PXSPACE_H
  • branches/eam_branches/ipp-20120405/ippTools/src/sctool.c

    r33720 r33949  
    3131#include "pxdata.h"
    3232#include "pxchip.h"
     33#include "pxspace.h"
    3334
    3435#include "sctool.h"
    3536
    3637static bool defineskycellsMode(pxConfig *config);
     38static bool listMode(pxConfig *config);
    3739
    3840# define MODECASE(caseName, func) \
     
    5355
    5456    switch (config->mode) {
    55         MODECASE(SCTOOL_MODE_DEFINESKYCELLS,         defineskycellsMode);
     57        MODECASE(SCTOOL_MODE_DEFINESKYCELLS,    defineskycellsMode);
     58        MODECASE(SCTOOL_MODE_LIST,              listMode);
    5659        default:
    5760            psAbort("invalid option (this should not happen)");
     
    131134    return true;
    132135}
     136static bool listMode(pxConfig *config)
     137{
     138    PS_ASSERT_PTR_NON_NULL(config, NULL);
     139
     140    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     141    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     142    psMetadata *where = psMetadataAlloc();
     143
     144    PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell.skycell_id", "LIKE");
     145    PXOPT_COPY_STR(config->args, where, "-tess_id", "skycell.tess_id", "LIKE");
     146    pxskycellAddWhere(config, where);
     147
     148    psString query = pxDataGet("sctool_list.sql");
     149    if (!query) {
     150        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     151        return false;
     152    }
     153
     154    if (!psListLength(where->list)) {
     155        psError(PXTOOLS_ERR_CONFIG, false, "search paramters are required\n");
     156        psFree(where);
     157        return false;
     158    }
     159    psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     160    psStringAppend(&query, " WHERE %s", whereClause);
     161    psFree(whereClause);
     162
     163    if (limit) {
     164        psString limitString = psDBGenerateLimitSQL(limit);
     165        psStringAppend(&query, " %s", limitString);
     166        psFree(limitString);
     167    }
     168
     169    if (!p_psDBRunQuery(config->dbh, query)) {
     170        psError(PS_ERR_UNKNOWN, false, "database error");
     171        psFree(query);
     172        return false;
     173    }
     174    psFree(query);
     175
     176    psArray *output = p_psDBFetchResult(config->dbh);
     177    if (!output) {
     178        psError(PS_ERR_UNKNOWN, false, "database error");
     179        return false;
     180    }
     181
     182    if (!psArrayLength(output)) {
     183        psTrace("sctool", PS_LOG_INFO, "no rows found");
     184        psFree(output);
     185        return true;
     186    }
     187
     188    if (!ippdbPrintMetadatas(stdout, output, "skycell", !simple)) {
     189        psError(PS_ERR_UNKNOWN, false, "failed to print array");
     190        psFree(output);
     191        return false;
     192    }
     193
     194    psFree(output);
     195
     196
     197    return true;
     198}
  • branches/eam_branches/ipp-20120405/ippTools/src/sctool.h

    r33720 r33949  
    2626    SCTOOL_MODE_NONE      = 0x0,
    2727    SCTOOL_MODE_DEFINESKYCELLS,
     28    SCTOOL_MODE_LIST,
    2829} sctoolMode;
    2930
  • branches/eam_branches/ipp-20120405/ippTools/src/stacktool.c

    r31957 r33949  
    232232    PXOPT_COPY_F32(config->args,  where, "-select_fwhm_minor_min",     "camProcessedExp.fwhm_minor", ">=");
    233233    PXOPT_COPY_F32(config->args,  where, "-select_fwhm_minor_max",     "camProcessedExp.fwhm_minor", "<=");
     234    PXOPT_COPY_F32(config->args,  where, "-select_elong_max",          "(camProcessedExp.fwhm_major / camProcessedExp.fwhm_minor)", "<=");
     235    PXOPT_COPY_F32(config->args,  where, "-select_iq_elong_max",       "(camProcessedExp.iq_fwhm_major / camProcessedExp.iq_fwhm_minor)", "<=");
    234236    PXOPT_COPY_F32(config->args,  where, "-select_iq_m2_max",          "camProcessedExp.iq_m2", "<=");
    235237    PXOPT_COPY_F32(config->args,  where, "-select_iq_m2_min",          "camProcessedExp.iq_m2", ">=");
     
    239241    PXOPT_COPY_F32(config->args,  where, "-select_zpt_obs_min",        "camProcessedExp.zpt_obs", ">=");
    240242    PXOPT_COPY_F32(config->args,  where, "-select_zpt_obs_max",        "camProcessedExp.zpt_obs", "<=");
     243    PXOPT_COPY_F32(config->args,  where, "-select_bg_max",             "camProcessedExp.bg", "<=");
     244    PXOPT_COPY_F32(config->args,  where, "-select_bg_stdev_max",       "camProcessedExp.bg_stdev", "<=");
    241245    PXOPT_COPY_F32(config->args,  where, "-select_astrom",             "sqrt(POWER(camProcessedExp.sigma_ra, 2) + POWER(camProcessedExp.sigma_dec, 2))", "<=");
    242246
  • branches/eam_branches/ipp-20120405/ippTools/src/stacktoolConfig.c

    r31792 r33949  
    8282    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_fwhm_minor_min", 0, "define min fwhm (minor axis)", NAN);
    8383    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_fwhm_minor_max", 0, "define max fwhm (minor axis)", NAN);
     84    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_elong_max", 0, "define max elongation from fwhm ", NAN);
     85    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_iq_elong_max", 0, "define max elongation from iq_fwhm ", NAN);
    8486    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_iq_m2_min", 0, "define min iq_m2", NAN);
    8587    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_iq_m2_max", 0, "define max iq_m2", NAN);
     
    9092    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_zpt_obs_min", 0, "define min zero point", NAN);
    9193    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_zpt_obs_max", 0, "define max zero point", NAN);
     94    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_bg_max", 0, "define max background", NAN);
     95    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_bg_stdev_max", 0, "define max background stdev", NAN);   
    9296    psMetadataAddF64(definebyqueryArgs, PS_LIST_TAIL, "-select_astrom", 0, "define max astrometry rms", NAN);
    9397    psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-warp_id", PS_META_DUPLICATE_OK, "include this warp ID (multiple OK)", 0);
  • branches/eam_branches/ipp-20120405/ippTools/src/staticskytool.c

    r33385 r33949  
    2929
    3030#include "pxtools.h"
     31#include "pxspace.h"
    3132#include "staticskytool.h"
    3233
     
    131132    pxAddLabelSearchArgs(config, whereMD, "-select_data_group",    "stackRun.data_group",       "LIKE");
    132133    pxAddLabelSearchArgs(config, whereMD, "-select_filter",        "stackRun.filter",           "LIKE");
     134    PXOPT_COPY_F32(config->args, whereMD, "-select_glat_min",      "skycell.glat",              ">=");
     135    PXOPT_COPY_F32(config->args, whereMD, "-select_glat_max",      "skycell.glat",              "<=");
    133136
    134137    // find the number of requested filters:
     
    390393
    391394    psMetadata *where = psMetadataAlloc();
    392     PXOPT_COPY_S64(config->args, where, "-sky_id",  "sky_id",   "==");
    393     PXOPT_COPY_STR(config->args, where, "-label",   "label",    "==");
    394     PXOPT_COPY_STR(config->args, where, "-state",   "state",    "==");
     395    PXOPT_COPY_S64(config->args, where, "-sky_id",      "sky_id",   "==");
     396    PXOPT_COPY_STR(config->args, where, "-label",       "staticskyRun.label",    "==");
     397    PXOPT_COPY_STR(config->args, where, "-state",       "staticskyRun.state",    "==");
     398    PXOPT_COPY_STR(config->args, where, "-tess_id",     "stackRun.tess_id",    "==");
     399    PXOPT_COPY_STR(config->args, where, "-skycell_id",  "stackRun.skycell_id",    "==");
     400    if (!pxskycellAddWhere(config, where)) {
     401        psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments");
     402        return false;
     403    }
    395404    if (!psListLength(where->list)) {
    396405        psFree(where);
     
    399408    }
    400409
    401     psString query = psStringCopy("UPDATE staticskyRun");
     410    psString query = psStringCopy("UPDATE staticskyRun JOIN staticskyInput USING(sky_id) JOIN stackRun using(stack_id) JOIN skycell USING(tess_id, skycell_id)");
    402411
    403412    // pxUpdateRun gets parameters from config->args and updates
     
    638647    PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "LIKE");
    639648    PXOPT_COPY_S16(config->args, where, "-fault",      "staticskyResult.fault", "==");
     649    pxskycellAddWhere(config, where);
    640650    PXOPT_LOOKUP_S32(num_filters, config->args, "-num_filters", false, false);
    641651
  • branches/eam_branches/ipp-20120405/ippTools/src/staticskytoolConfig.c

    r33385 r33949  
    5555    psMetadataAddStr(definebyqueryArgs,  PS_LIST_TAIL, "-select_data_group", PS_META_DUPLICATE_OK, "search by stackRun data_group (LIKE comparison, multiple OK)", NULL);
    5656    psMetadataAddStr(definebyqueryArgs,  PS_LIST_TAIL, "-select_filter", PS_META_DUPLICATE_OK, "search by filter (LIKE comparison, multiple OK)", NULL);
     57    psMetadataAddF32(definebyqueryArgs,  PS_LIST_TAIL, "-select_glat_min", 0, "define min galactic latitude", NAN);
     58    psMetadataAddF32(definebyqueryArgs,  PS_LIST_TAIL, "-select_glat_max", 0, "define max galactic latitude", NAN);
    5759    psMetadataAddStr(definebyqueryArgs,  PS_LIST_TAIL, "-set_workdir", 0, "define workdir (required)", NULL);
    5860    psMetadataAddStr(definebyqueryArgs,  PS_LIST_TAIL, "-set_label", 0, "define label (required)", NULL);
     
    7375    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL);
    7476    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label", 0, "search by label", 0);
     77    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tess_id", NULL);
     78    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-skycell_id", 0, "search by skycell_id", NULL);
     79    pxskycellAddArguments(updaterunArgs);
    7580    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_label", 0, "define new value for label", NULL);
    7681    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state", 0, "define new state", NULL);
     
    113118    psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-data_group", 0, "search by data_group (LIKE comparison)", NULL);
    114119    psMetadataAddS16(resultArgs, PS_LIST_TAIL, "-num_filters", 0, "search by number of filters in the inputs (>=)", 0);
     120    pxskycellAddArguments(resultArgs);
    115121    psMetadataAddS16(resultArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0);
    116122    psMetadataAddU64(resultArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0);
  • branches/eam_branches/ipp-20120405/ppImage/src

  • branches/eam_branches/ipp-20120405/ppImage/src/ppImage.h

    r33590 r33949  
    5757    bool addNoise;                      // Add noise to degrade MD image to 3pi
    5858
     59  bool hasVideo;                      // Determine if this OTA has a video cell
     60  bool useVideoDark;                  // Should we use a video dark if we can?
     61  bool useVideoMask;                  // Should we use a video mask if we can?
     62 
    5963    // output files requested
    6064    bool BaseFITS;
  • branches/eam_branches/ipp-20120405/ppImage/src/ppImageDetrendReadout.c

    r33590 r33949  
    3535      }
    3636    }
    37 
     37    // Check to see if we're in a chip that contains video
     38    bool hasVideo = false;
     39    {
     40      if (psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE")) {
     41        psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask);
     42        char *Vptr = strchr(psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE"),'V');
     43        if (Vptr) {
     44          hasVideo = true;
     45          psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask);
     46        }
     47      }
     48    }
     49
     50   
    3851    // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine.
    3952    if (options->doMaskBuild) {
     
    4457    // apply the externally supplied mask to the input->mask pixels
    4558    if (options->doMask) {
    46         pmReadout *mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK");
    47         pmMaskBadPixels(input, mask, options->maskValue);
     59      pmReadout *mask;
     60      if ((options->useVideoMask)&&(hasVideo)) {
     61        mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEOMASK");
     62      }
     63      else {
     64        mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK");
     65      }
     66      pmMaskBadPixels(input, mask, options->maskValue);
    4867    }
    4968    if (options->doMaskBurntool) {
     
    8099        psMetadata *recipe = psMetadataLookupPtr (&mdok, config->recipes, RECIPE_NAME);
    81100        assert(mdok && recipe);
    82         if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) {
     101
     102        if ((options->useVideoDark)&&(hasVideo)) {
     103          if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) {
     104            oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEODARK");
     105          } else {
     106            dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.VIDEODARK");
     107          }
     108        }
     109        else {
     110          if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) {
    83111            oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.DARK");
    84         } else {
     112          } else {
    85113            dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.DARK");
    86         }
     114          }
     115        }
    87116    }
    88117
  • branches/eam_branches/ipp-20120405/ppImage/src/ppImageOptions.c

    r33590 r33949  
    4545    options->doMaskStats     = false;   // Calculate mask fractions
    4646    options->addNoise        = false;  //Degrade an MD image to a 3pi image
    47 
     47    options->hasVideo        = false;   // Determine if this OTA has a video cell
     48    options->useVideoDark    = false;   // Use video dark if we can?
     49    options->useVideoMask    = false;   // Use video mask if we can?
    4850    // output files requested
    4951    options->BaseFITS        = false;   // create output image
     
    362364    options->fringeKeep = psMetadataLookupF32(NULL, recipe, "FRINGE.KEEP");
    363365
     366    // Video cell options
     367    if (psMetadataLookup(recipe, "USE.VIDEO.DARK")) {
     368      options->useVideoDark = psMetadataLookupBool(NULL,recipe,"USE.VIDEO.DARK");
     369    }
     370    if (psMetadataLookup(recipe, "USE.VIDEO.MASK")) {
     371      options->useVideoMask = psMetadataLookupBool(NULL,recipe,"USE.VIDEO.MASK");
     372    }
     373
    364374    // Pattern correction
    365375    if (psMetadataLookup(format, "PATTERN.ROW.ORDER")) {
     
    418428      options->patternContinuityEdgeWidth = psMetadataLookupS32(NULL, recipe, "PATTERN.CONTINUITY.WIDTH");
    419429    }
    420    
     430
    421431
    422432    // Remnance options
  • branches/eam_branches/ipp-20120405/ppImage/src/ppImageParseCamera.c

    r29833 r33949  
    2222    ppImageOptions *options = ppImageOptionsParse(config);
    2323
     24    // parse the header to extract out whether this OTA has video cells.
     25    // CZW: 2012-05-01 I'm somewhat ashamed of what needs to be done to get to the header. There has to be a simpler way, right?
     26/*     pmFPAview *view = pmFPAviewAlloc(0);// View for level of interest */
     27/*     pmChip *chip;                       // Chip from FPA */
     28/*     while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) { */
     29/*       if (!chip->process || !chip->file_exists) { */
     30/*      continue; */
     31/*       } */
     32/* /\*       if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { *\/ */
     33/* /\*  continue; *\/ */
     34/* /\*       } *\/ */
     35/*       psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */
     36/*       if (psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE")) { */
     37/*      psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */
     38/*      char *Vptr = strchr(psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE"),'V'); */
     39/*      if (Vptr) { */
     40/*        options->hasVideo = true; */
     41/*        psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */
     42/*      } */
     43/*       } */
     44/*     } */
     45/*     pmFPAviewReset(view); */
     46/*     psFree(view); */
     47   
    2448    // the following are defined from the argument list, if given,
    2549    // otherwise they revert to the config information
     
    4266    }
    4367    if (options->doDark) {
    44         if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK",
    45                                PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) {
     68      // Always load the regular Dark
     69      if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK",
     70                             PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) {
     71        psError(PS_ERR_IO, false, "Can't find a dark image source");
     72        psFree(options);
     73        return NULL;
     74      }
     75      // Sometimes load the video dark if we need it.
     76      if (options->useVideoDark) {
     77        if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEODARK", "DARK",
     78                               PM_FPA_FILE_DARK, PM_DETREND_TYPE_VIDEODARK)) {
    4679            psError(PS_ERR_IO, false, "Can't find a dark image source");
    4780            psFree(options);
    4881            return NULL;
    4982        }
     83      }
    5084    }
    5185    if (options->doMask) {
    52         if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK",
    53                                PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) {
     86      // Always load the regular mask
     87      if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK",
     88                             PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) {
     89        psError(PS_ERR_IO, false, "Can't find a mask image source");
     90        psFree(options);
     91        return NULL;
     92      }
     93
     94      if (options->useVideoMask) {
     95        if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEOMASK", "MASK",
     96                               PM_FPA_FILE_MASK, PM_DETREND_TYPE_VIDEOMASK)) {
    5497            psError(PS_ERR_IO, false, "Can't find a mask image source");
    5598            psFree(options);
    5699            return NULL;
    57100        }
     101      }
    58102    }
    59103    if (options->doShutter) {
  • branches/eam_branches/ipp-20120405/ppMerge/src/ppMergeCamera.c

    r33666 r33949  
    224224            format = (HDU)->format; \
    225225        } else if (format != (HDU)->format) { \
    226             psError(PS_ERR_UNKNOWN, true, "Camera format %d doesn't match: %p vs %p", \
    227                     i, format, (HDU)->format); \
     226          psError(PS_ERR_UNKNOWN, true, "Camera format %d doesn't match: %p vs %p on %s %s", \
     227                  i, format, (HDU)->format, (HDU)->extname, psMetadataLookupStr(NULL,(HDU)->header,"FILENAME")); \
    228228            psFree(phuView); \
    229229            return false; \
     
    232232    } \
    233233}
     234    // CZW: 2012-04-10 Version of above to allow different camera formats to be processed together.
     235/* #define CHECK_LEVEL(HDU, CHIP, CELL) { \ */
     236/*     if (HDU) { \ */
     237/*         if (!phuView) { \ */
     238/*             phuView = pmFPAviewAlloc(0); \ */
     239/*             phuView->chip = CHIP; \ */
     240/*             phuView->cell = CELL; \ */
     241/*         } else if ((phuView->chip != (CHIP)) && (phuView->cell != (CELL))) { \ */
     242/*             psError(PS_ERR_UNKNOWN, true, "Differing PHU for input %d", i); \ */
     243/*             psFree(phuView); \ */
     244/*             return false; \ */
     245/*         } \ */
     246/*         if (!format) { \ */
     247/*             format = (HDU)->format; \ */
     248/*         } else if (format != (HDU)->format) { \ */
     249/*         } \ */
     250/*         continue; \ */
     251/*     } \ */
     252/* } */
    234253
    235254    psMetadata *format = NULL;          ///< Camera format
  • branches/eam_branches/ipp-20120405/psastro/src/psastroLoadCrosstalk.c

    r26826 r33949  
    5353  pmFPAview *viewMask = pmFPAviewAlloc (0);
    5454
    55   float zeropt, exptime, MAX_MAG;
     55  float zeropt, exptime, MAX_MAG, SPIKE_MAX_MAG;
    5656
    5757  psLogMsg ("psastro", PS_LOG_INFO, "determine crosstalk positions");
     
    105105  MAX_MAG += MagOffset;
    106106
     107  // Get the spike maximum, as well
     108  SPIKE_MAX_MAG = psMetadataLookupF32(&status, recipe, "REFSTAR_MASK_BLEED_MAG_MAX");
     109  SPIKE_MAX_MAG += MagOffset;
     110 
    107111  psTrace("psastro.crosstalk",2,"%f %f %f %f\n",zeropt,exptime,MAX_MAG,MagOffset);
    108112
     
    259263
    260264            pmAstromObj *crosstalk = pmAstromObjAlloc();
    261 
     265           
    262266            crosstalk->Mag = ref->Mag - MagOffset;
    263267            crosstalk->chip->x = x_t_chip;
     
    274278            }
    275279            psArrayAdd(crosstalks,100,crosstalk);
    276 
     280           
    277281            psFree(targetChipName);
    278282            psFree(targetCellName);
    279283            psFree(crosstalk);
     284
     285            // Determine if we need to add a spike mask.
     286/*          psWarning("BLAH: %g %g %g\n",ref->Mag,MagOffset,SPIKE_MAX_MAG); */
     287            if (ref->Mag < SPIKE_MAX_MAG) {
     288              if ((X == 2)&&(! ((U == 3)||(U == 5)||(U == 6)))) {
     289                psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y);
     290                continue;
     291              }
     292              if ((X == 3)&&(! ((U == 3)))) {
     293                psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y);
     294                continue;
     295              }
     296              if ((X == 4)&&(! ((U == 3)))) {
     297                psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y);
     298                continue;
     299              }
     300              if ((X == 5)&&(! ((U == 3)||(U == 5)||(U == 6)))) {
     301                psTrace ("psastro.crosstalk",2,"Cell (%d%d) on chip (%d%d) not a known crosstalk source.",U,V,X,Y);
     302                continue;
     303              }
     304             
     305              Xt = X;
     306              Yt = Y;
     307              Vt = V;
     308             
     309              for (Ut = 0; Ut < 8; Ut++) {
     310
     311                psString targetChipName = NULL;
     312                psStringAppend(&targetChipName,"XY%d%d",Xt,Yt);
     313                psString targetCellName = NULL;
     314                psStringAppend(&targetCellName,"xy%d%d",Ut,Vt);
     315               
     316                psTrace ("psastro.crosstalk",2,"CTsource @ OTA%d%dxy%d%d@%f,%f CTtarget OTA%d%dxy%d%d@%f,%f [%s %s]",
     317                         X,Y,U,V,x_cell,y_cell,Xt,Yt,Ut,Vt,x_t_cell,y_t_cell,
     318                         targetChipName,targetCellName);
     319/*              psWarning ("CT bleed ct @ OTA%d%dxy%d%d@%f,%f CTtarget OTA%d%dxy%d%d@%f,%f [%s %s]", */
     320/*                       X,Y,U,V,x_cell,y_cell,Xt,Yt,Ut,Vt,x_t_cell,y_t_cell, */
     321/*                       targetChipName,targetCellName); */
     322               
     323                pmCell *CTtargetCell = getCellByName (CTsourceChip,targetCellName);
     324                if (!CTtargetCell) continue;
     325               
     326                pmChipCoordsForCell(&x_t_chip,&y_t_chip,CTtargetCell,x_t_cell,y_t_cell);
     327
     328                psTrace ("psastro.crosstalk",2,"CTsource @ OTA%d%dxy%d%d@%f,%f CTtarget OTA%d%dxy%d%d@%f,%f ChipLoc: (%f,%f)",
     329                         X,Y,U,V,x_cell,y_cell,Xt,Yt,Ut,Vt,x_t_cell,y_t_cell,x_t_chip,y_t_chip);
     330               
     331                // Hunt down the readout for the target, and save the chip position and magnitude of source star.
     332                pmChip *targetChip = getChipByName(fpa,targetChipName);
     333                if (!targetChip) continue;
     334                if (!targetChip->cells) continue;
     335                if (!targetChip->cells->n) continue;
     336               
     337                pmCell *targetCell = targetChip->cells->data[0];
     338                if (!targetCell) continue;
     339                if (!targetCell->readouts) continue;
     340                if (!targetCell->readouts->n) continue;
     341                pmReadout *targetReadout = targetCell->readouts->data[0];
     342                if (!targetReadout) continue;
     343               
     344                pmAstromObj *crosstalk = pmAstromObjAlloc();
     345               
     346                crosstalk->Mag = ref->Mag;
     347                crosstalk->chip->x = x_t_chip;
     348                crosstalk->chip->y = y_t_chip;
     349               
     350                psArray *crosstalks = psMetadataLookupPtr (&status, targetReadout->analysis, "PSASTRO.CROSSTALKS.SPIKES");
     351                if (crosstalks == NULL) {
     352                  crosstalks = psArrayAllocEmpty(100);
     353                  if (!psMetadataAdd(targetReadout->analysis,PS_LIST_TAIL,"PSASTRO.CROSSTALKS.SPIKES", PS_DATA_ARRAY, "crosstalk locations", crosstalks)) {
     354                    psError(PSASTRO_ERR_CONFIG, false, "failure to add crosstalks to readout");
     355                    goto escape;
     356                  }
     357                  psFree(crosstalks);
     358                }
     359                psArrayAdd(crosstalks,100,crosstalk);
     360               
     361                psFree(targetChipName);
     362                psFree(targetCellName);
     363                psFree(crosstalk);
     364              }
     365            } // End satspike crosstalks
     366
     367           
    280368          } // refstars
    281369        } // readout
  • branches/eam_branches/ipp-20120405/psastro/src/psastroLoadGhosts.c

    r26259 r33949  
    128128                for (int i = 0; i < refstars->n; i++) {
    129129                    pmAstromObj *ref = refstars->data[i];
     130                    psTrace("psastro.ghost",5,"Begin ghost %d/%ld: MAX_MAG: %g; ref_mag: %g @ (%.10g,%.10g)",i,refstars->n,MAX_MAG,ref->Mag,ref->sky->r * 180 / M_PI,ref->sky->d * 180.0 / M_PI);
    130131                    if (ref->Mag > MAX_MAG) continue;
    131132
     
    163164                    pmChip *ghostChip = psastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, -ghost->srcFP->x, -ghost->srcFP->y);
    164165                    // fprintf (stderr, "raw chip position: %f, %f ", ghost->chip->x, ghost->chip->y);
    165 
     166/*                  float ref_chip_x = ghost->chip->x; */
     167/*                  float ref_chip_y = ghost->chip->y; */
    166168                    ghostChip = psastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y);
    167169                    // fprintf (stderr, "-> model chip position: %f, %f\n", ghost->chip->x, ghost->chip->y);
    168170
     171                    if (ghostChip) {
     172                      psTrace("psastro.ghost",5,"   in ghost: %d/%ld: ref: (%f,%f) or (%s) ghost: (%f,%f) or (%f,%f,%s) %f inner: (%f,%f,%f) outer: (%f,%f,%f)",
     173                              i,refstars->n,
     174                              ref->FP->x,ref->FP->y,
     175                              psMetadataLookupStr(NULL,chip->concepts,"CHIP.NAME"),
     176                              ghost->FP->x,ghost->FP->y,
     177                              ghost->chip->x,ghost->chip->y,psMetadataLookupStr(NULL,ghostChip->concepts,"CHIP.NAME"),
     178                              rSrc,
     179                              ghost->inner.major,ghost->inner.minor,ghost->inner.theta,
     180                              ghost->outer.major,ghost->outer.minor,ghost->outer.theta);
     181/*                    psWarning("   GHOST_DATA: %d/%ld: ref: (%f,%f) or (%f,%f,%s) ghost: (%f,%f) or (%f,%f,%s) %f inner: (%f,%f,%f) outer: (%f,%f,%f)", */
     182/*                            i,refstars->n, */
     183/*                            ref->FP->x,ref->FP->y, */
     184/*                            ref_chip_x,ref_chip_y,psMetadataLookupStr(NULL,chip->concepts,"CHIP.NAME"), */
     185/*                            ghost->FP->x,ghost->FP->y, */
     186/*                            ghost->chip->x,ghost->chip->y,psMetadataLookupStr(NULL,ghostChip->concepts,"CHIP.NAME"), */
     187/*                            rSrc, */
     188/*                            ghost->inner.major,ghost->inner.minor,ghost->inner.theta, */
     189/*                            ghost->outer.major,ghost->outer.minor,ghost->outer.theta); */
     190                    }
     191                    else {
     192                      psTrace("psastro.ghost",5,"   in ghost: %d/%ld: ref: (%f,%f) ghost: (%f,%f) or (%f,%f,%s) inner: (%f,%f,%f) outer: (%f,%f,%f)",
     193                              i,refstars->n,
     194                              ref->FP->x,ref->FP->y,
     195                              ghost->FP->x,ghost->FP->y,
     196                              ghost->chip->x,ghost->chip->y,"NONE",
     197                              ghost->inner.major,ghost->inner.minor,ghost->inner.theta,
     198                              ghost->outer.major,ghost->outer.minor,ghost->outer.theta);
     199                    }                 
     200                     
     201
     202                           
    169203                    if (!ghostChip) goto skip;
    170204                    if (!ghostChip->cells) goto skip;
    171205                    if (!ghostChip->cells->n) goto skip;
     206
     207                   
    172208                    pmCell *ghostCell = ghostChip->cells->data[0];
    173209                    if (!ghostCell) goto skip;
     
    190226
    191227                skip:
     228                   
    192229                    psFree (ghost);
    193230                }
  • branches/eam_branches/ipp-20120405/psastro/src/psastroMaskUpdates.c

    r30873 r33949  
    406406                    // XXX for now, assume cell binning is 1x1 relative to chip
    407407                    psastroMaskCircle (readoutMask->mask, crosstalkMaskValue, ref->chip->x, ref->chip->y, radius, radius);
     408                  }
     409                }
     410                // Crosstalk Bleeds
     411                psArray *bleedcrosstalks = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.CROSSTALKS.SPIKES");
     412                if (bleedcrosstalks) {
     413                  for (int i = 0; i < bleedcrosstalks->n; i++) {
     414                    pmAstromObj *ref = bleedcrosstalks->data[i];
     415                    float width = REFSTAR_MASK_BLEED_MAG_SLOPE * (REFSTAR_MASK_BLEED_MAG_MAX - ref->Mag);
     416                    psTrace("psastro.crosstalk",2,"Masking spike on Chip %s @ (%f,%f) Magnitude: %f Radius %f\n",
     417                            psMetadataLookupStr(&status,readout->parent->parent->concepts,"CHIP.NAME"),
     418                            ref->chip->x,ref->chip->y,ref->Mag,width);
     419                    // XXX for now, assume cell binning is 1x1 relative to chip
     420                    pmCell *refCell = pmCellInChip(refChip,ref->chip->x,ref->chip->y);
     421                    if (refCell) {
     422                      float xCell = 0.0;
     423                      float yCell = 0.0;
     424                      pmCellCoordsForChip (&xCell, &yCell, refCell, ref->chip->x, ref->chip->y);
     425                      int ySize = psMetadataLookupS32(NULL,refCell->concepts,"CELL.YSIZE");
     426/*                    psWarning("Masking CTspike on Chip %s @ (%f,%f) Magnitude: %f (%f %f) Radius %f Z: %d %d %d %d\n", */
     427/*                              psMetadataLookupStr(&status,readout->parent->parent->concepts,"CHIP.NAME"), */
     428/*                              ref->chip->x,ref->chip->y,ref->Mag,REFSTAR_MASK_BLEED_MAG_SLOPE,REFSTAR_MASK_BLEED_MAG_MAX,width, */
     429/*                              (int) (ref->chip->x - 0.5 * width),   (int) (ref->chip->y - yCell), */
     430/*                              (int) (ref->chip->x+0.5 * width + 1), (int) (ref->chip->y + (ySize - yCell))); */
     431                      psastroMaskRectangle (readoutMask->mask, crosstalkMaskValue,
     432                                            (int) (ref->chip->x - 0.5 * width),   (int) (ref->chip->y - yCell),
     433                                            (int) (ref->chip->x+0.5 * width + 1), (int) (ref->chip->y + (ySize - yCell)));
     434                    }
    408435                  }
    409436                }
  • branches/eam_branches/ipp-20120405/psastro/src/psastroMaskUtils.c

    r24045 r33949  
    135135        // XXX optimize this
    136136        float A = 1.0;
    137         float B = shape.sxy*y*PS_SQR(shape.sx);
     137        float B = 2.0 * shape.sxy*y*PS_SQR(shape.sx);
    138138        float C = PS_SQR(y*shape.sx/shape.sy) - PS_SQR(shape.sx);
    139139
  • branches/eam_branches/ipp-20120405/tools/czarcal

    r33317 r33949  
    2424mark
    2525serge
    26 roy
    2726chris
    2827gene
  • branches/eam_branches/ipp-20120405/tools/dlapstacks

    r33575 r33949  
    215215        } else {
    216216            # otherwise use a temporary directory
     217            $outdir = $tempdir;
    217218            print "deasined files will be saved to $outdir\n" if $save_temps;
    218             $outdir = $tempdir;
    219219        }
    220220    }
  • branches/eam_branches/ipp-20120405/tools/repair_bad_instance

    r33197 r33949  
    123123        return 0;
    124124    }
     125    if (! ($nextend =~ /\d+/)) {
     126        print "failed to find NEXTEND for $file. command returned $nextend\n";
     127        return 0;
     128    }
    125129    print "\t$file: $nextend extensions\n";
     130
    126131
    127132    $command = 'fhead -x ' . ($nextend - 1) . " $file | grep EXTNAME | awk '{print \$3}'";
  • branches/eam_branches/ipp-20120405/tools/runbgchip.pl

    r33068 r33949  
    9797exit 0 if $pretend;
    9898
    99 exit system $command;
     99my $rc = system $command;
     100my $status = $rc >> 8;
     101if ($rc) {
     102    print "command returned $rc $status\n";
     103}
     104exit $status;
    100105
    101106
  • branches/eam_branches/ipp-20120405/tools/runchipimfile.pl

    r33067 r33949  
    110110exit 0 if $pretend;
    111111
    112 exit system $command;
     112my $rc = system $command;
     113my $status = $rc >> 8;
     114if ($rc) {
     115    print STDERR "command failed with $rc $status\n";
     116    $status = 1 unless $status;
     117} else {
     118    print "Successfully rebuilt chip $chip_id $class_id\n";
     119}
     120exit $status;
    113121
    114122
  • branches/eam_branches/ipp-20120405/tools/runwarpskycell.pl

    r31942 r33949  
    105105exit 0 if $pretend;
    106106
    107 exit system $command;
     107my $rc =  system $command;
     108exit $rc >> 8;
    108109
    109110
Note: See TracChangeset for help on using the changeset viewer.