IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32366


Ignore:
Timestamp:
Sep 7, 2011, 9:42:54 AM (15 years ago)
Author:
Serge CHASTEL
Message:

Fixed display for new tessellation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/warpProcessedExp_Images.php

    r28718 r32366  
    7777
    7878if ($restricted == 0) {
    79   if ("none" != "none") {
    80     $WHERE = "$WHERE none";
    81   }
     79   $WHERE = "WHERE 0=1";
    8280}
    8381
    8482// get the result table count
    8583if (basic == "basic") {
    86   $sql = "SELECT count(*) FROM fakeRun,camRun,chipRun,rawExp,warpRun LEFT JOIN warpSummary ON warpSummary.warp_id = warpRun.warp_id $WHERE";
     84  $sql = "SELECT count(*) FROM rawExp JOIN chipRun USING(exp_id) JOIN camRun USING (chip_id) JOIN fakeRun USING(cam_id) JOIN warpRun USING(fake_id) LEFT JOIN warpSummary ON warpSummary.warp_id = warpRun.warp_id $WHERE";
    8785}
    8886
     
    111109// query the database
    112110if (basic == "basic") {
    113   $sql = "SELECT rawExp.exp_name,rawExp.exp_id,chipRun.chip_id,camRun.cam_id,fakeRun.fake_id,warpRun.warp_id,warpRun.state,warpRun.label,warpRun.data_group,warpRun.dist_group,rawExp.telescope,rawExp.camera,rawExp.dateobs,rawExp.ra,rawExp.decl,rawExp.object,rawExp.filter,rawExp.exp_time,rawExp.airmass,rawExp.bg,rawExp.bg_stdev,rawExp.comment,ifnull(warpSummary.path_base,'noimage'),ifnull(warpSummary.projection_cell,'noimage') FROM fakeRun,camRun,chipRun,rawExp,warpRun LEFT JOIN warpSummary ON warpSummary.warp_id = warpRun.warp_id $WHERE LIMIT $dTABLE OFFSET $rowStart";
     111  $sql = "SELECT rawExp.exp_name,rawExp.exp_id,chipRun.chip_id,camRun.cam_id,fakeRun.fake_id,warpRun.warp_id,warpRun.state,warpRun.label,warpRun.data_group,warpRun.dist_group,rawExp.telescope,rawExp.camera,rawExp.dateobs,rawExp.ra,rawExp.decl,rawExp.object,rawExp.filter,rawExp.exp_time,rawExp.airmass,rawExp.bg,rawExp.bg_stdev,rawExp.comment,ifnull(warpSummary.path_base,'noimage'),ifnull(warpSummary.projection_cell,'noimage'),warpRun.tess_id FROM rawExp JOIN chipRun USING(exp_id) JOIN camRun USING (chip_id) JOIN fakeRun USING(cam_id) JOIN warpRun USING(fake_id) LEFT JOIN warpSummary ON warpSummary.warp_id = warpRun.warp_id $WHERE LIMIT $dTABLE OFFSET $rowStart";
    114112}
    115113
     
    175173$buttonLink = button_restrict_string ('warpSummary.path_base', $buttonLink);
    176174$buttonLink = button_restrict_string ('warpSummary.projection_cell', $buttonLink);
     175$buttonLink = button_restrict_string ('warpRun.tess_id', $buttonLink);
    177176navigate_buttons ($rowStart, $rowLast, $dTABLE,
    178177                  $rowTotal, $buttonLink, $ID, 'warpProcessedExp_Images.php');
     
    210209write_header_cell ("list", "stdev    ");
    211210write_header_cell ("list", "Comment");
     211write_header_cell ("list", "TessId");
    212212echo "</tr>\n";
    213213echo "<tr><td></td>\n";
     
    236236write_sort_cell ("list", "rawExp.bg_stdev", $buttonLink, $ID, 'warpProcessedExp_Images.php');
    237237write_sort_cell ("list", "rawExp.comment", $buttonLink, $ID, 'warpProcessedExp_Images.php');
     238write_sort_cell ("list", "warpRun.tess_id", $buttonLink, $ID, 'warpProcessedExp_Images.php');
    238239echo "</tr>\n";
    239240// echo "</tr>\n";
     
    268269write_query_row ('rawExp.bg_stdev', 5, 'min');
    269270write_query_row ('rawExp.comment', 65, 'string');
     271write_query_row ('warpRun.tess_id', 65, 'string');
    270272echo "</tr><tr><td>&le;</td>\n";
    271273echo "<td> &nbsp; </td>\n";
     
    292294write_query_row ('rawExp.bg_stdev', 5, 'max');
    293295echo "<td> &nbsp; </td>\n";
     296echo "<td> &nbsp; </td>\n";
    294297echo "</tr>\n";
    295298// echo "</tr>\n";
     
    312315  //Identify current warpId
    313316  $warpId = $row[5];
    314 /*   echo "<tr><td>Number of elements in warpIdCollection: ".count($warpIdCollection)."</td></tr>\n"; */
    315 /*   echo "<tr><td>(warpId=$warpId)</td></tr>\n"; */
     317  $tessId = $row[24];
     318  /* echo "<tr><td>Number of elements in warpIdCollection: ".count($warpIdCollection)."</td></tr>\n"; */
     319  /* echo "<tr><td>(warpId=$warpId)</td></tr>\n"; */
    316320
    317321  if (!isSet($warpIdCollection[$warpId])) {
    318 /*    echo "<tr><td>$warpId not in warpIdCollection</td></tr>"; */
     322    /* echo "<tr><td>$warpId not in warpIdCollection</td></tr>"; */
    319323    $warpIdCollection[$warpId] = array();
    320324    $skyCellValue = preg_replace("|skycell[.]|","",$row[23]);
    321325    $warpIdCollection[$warpId]["12"] = $skyCellValue;
    322 /*    echo "<tr><td>Skycell is [$skyCellValue]</td></tr>"; */
     326    /* echo "<tr><td>Skycell is [$skyCellValue]</td></tr>"; */
    323327
    324328    echo "<tr>\n";
     
    344348    echo "<td class=\"$class\">\n";
    345349    echo "<table border=\"1\"><tr>\n";
    346 /*    echo "  <td class=\"ul3x2\" id=\"$warpId.00\">$noImageValue</td>\n"; */
     350    /* echo "  <td class=\"ul3x2\" id=\"$warpId.00\">$noImageValue</td>\n"; */
    347351    echo "  <td class=\"ul3x2\" id=\"$warpId.00\"></td>\n";
    348352    echo "  <td class=\"uc3x2\" id=\"$warpId.01\">$noImageValue</td>\n";
    349353    echo "  <td class=\"ur3x2\" id=\"$warpId.02\">$noImageValue</td>\n";
    350354    echo "</tr><tr>\n";
    351 /*    echo "  <td class=\"ll3x2\" id=\"$warpId.10\">$noImageValue</td>\n"; */
     355    /* echo "  <td class=\"ll3x2\" id=\"$warpId.10\">$noImageValue</td>\n"; */
    352356    echo "  <td class=\"ll3x2\" id=\"$warpId.10\"></td>\n";
    353357    echo "  <td class=\"lc3x2\" id=\"$warpId.11\">$noImageValue</td>\n";
     
    364368    echo "<td class=\"$class\">\n";
    365369    echo "<table border=\"1\"><tr>\n";
    366 /*    echo "  <td class=\"ul3x2\" id=\"t$warpId.00\">No image</td>\n"; */
     370    /* echo "  <td class=\"ul3x2\" id=\"t$warpId.00\">No image</td>\n"; */
    367371    echo "  <td class=\"ul3x2\" id=\"t$warpId.00\"></td>\n";
    368372    echo "  <td class=\"uc3x2\" id=\"t$warpId.01\">No image</td>\n";
    369373    echo "  <td class=\"ur3x2\" id=\"t$warpId.02\">No image</td>\n";
    370374    echo "</tr><tr>\n";
    371 /*    echo "  <td class=\"ll3x2\" id=\"t$warpId.10\">No image</td>\n"; */
     375    /* echo "  <td class=\"ll3x2\" id=\"t$warpId.10\">No image</td>\n"; */
    372376    echo "  <td class=\"ll3x2\" id=\"t$warpId.10\"></td>\n";
    373377    echo "  <td class=\"lc3x2\" id=\"t$warpId.11\">No image</td>\n";
     
    376380    echo "</td>\n";
    377381
    378     $cellContent = "<a href=\\\"$link\\\"> <img src=\\\"getimage.php?name=$row[22].$row[23]&rule=PPSKYCELL.JPEG2&camera=$row[11]&class_id=NONE\\\"> </a>";
    379     echo "<script type=\"text/javascript\">changeCell(\"$warpId.12\", \"$cellContent\");</script>";
    380     $imageNameValue = ($row[23]=="noimage" ?
    381                        "No image" : $row[23]);
    382     echo "<script type=\"text/javascript\">changeCell(\"t$warpId.12\", \"$imageNameValue\");</script>";
     382    if ($tessId != "RINGS.V3") {
     383      $cellContent = "<a href=\\\"$link\\\"> <img src=\\\"getimage.php?name=$row[22].$row[23]&rule=PPSKYCELL.JPEG2&camera=$row[11]&class_id=NONE\\\"> </a>";
     384      echo "<script type=\"text/javascript\">changeCell(\"$warpId.12\", \"$cellContent\");</script>";
     385      $imageNameValue = ($row[23]=="noimage" ?
     386                         "No image" : $row[23]);
     387      echo "<script type=\"text/javascript\">changeCell(\"t$warpId.12\", \"$imageNameValue\");</script>";
     388    } else {
     389      //The cell to update is the upper right one for new tessellation
     390      $cellContent = "<a href=\\\"$link\\\"> <img src=\\\"getimage.php?name=$row[22].$row[23]&rule=PPSKYCELL.JPEG2&camera=$row[11]&class_id=NONE\\\"> </a>";
     391      echo "<script type=\"text/javascript\">changeCell(\"$warpId.02\", \"$cellContent\");</script>";
     392      $imageNameValue = ($row[23]=="noimage" ?
     393                         "No image" : $row[23]);
     394      echo "<script type=\"text/javascript\">changeCell(\"t$warpId.02\", \"$imageNameValue\");</script>";
     395    }
    383396
    384397    //resume with "regular" columns
     
    399412    write_table_cell ($class, '%.2f', "", $row[20]);
    400413    write_table_cell ($class, '%s', "", $row[21]);
     414    write_table_cell ($class, '%s', "", $row[24]);
    401415    echo "</tr>\n";
    402416
     
    415429    $cellContent = "<a href=\\\"$link\\\"> <img src=\\\"getimage.php?name=$row[22].$row[23]&rule=PPSKYCELL.JPEG2&camera=$row[11]&class_id=NONE\\\"> </a>";
    416430
    417     if ($skyCellValue == $lrValue + 1) {
    418       $warpIdCollection[$warpId]["11"] = $skyCellValue;
    419       echo "<script type=\"text/javascript\">changeCell(\"$warpId.11\", \"$cellContent\");</script>";
    420       echo "<script type=\"text/javascript\">changeCell(\"t$warpId.11\", \"$row[23]\");</script>";
    421     } else {
    422       if ($skyCellValue == $lrValue + 2) {
    423         $warpIdCollection[$warpId]["10"] = $skyCellValue;
    424         echo "<script type=\"text/javascript\">changeCell(\"$warpId.10\", \"$cellContent\");</script>";
    425         echo "<script type=\"text/javascript\">changeCell(\"t$warpId.10\", \"$row[23]\");</script>";
     431    if ($tessId != "RINGS.V3") {
     432      if ($skyCellValue == $lrValue + 1) {
     433        $warpIdCollection[$warpId]["11"] = $skyCellValue;
     434        echo "<script type=\"text/javascript\">changeCell(\"$warpId.11\", \"$cellContent\");</script>";
     435        echo "<script type=\"text/javascript\">changeCell(\"t$warpId.11\", \"$row[23]\");</script>";
    426436      } else {
    427         if (!isSet($warpIdCollection[$warpId]["02"])) {
    428           /*    echo "<tr><td>Update UpperRight</td></tr>"; */
    429           $warpIdCollection[$warpId]["02"] = $skyCellValue;
    430           echo "<script type=\"text/javascript\">changeCell(\"$warpId.02\", \"$cellContent\");</script>";
    431           echo "<script type=\"text/javascript\">changeCell(\"t$warpId.02\", \"$row[23]\");</script>";
    432         } else {
    433           $urValue = $warpIdCollection[$warpId]["02"];
    434           if ($urValue + 1 == $skyCellValue) {
    435             echo "<script type=\"text/javascript\">changeCell(\"$warpId.01\", \"$cellContent\");</script>";
    436             echo "<script type=\"text/javascript\">changeCell(\"t$warpId.01\", \"$row[23]\");</script>";
     437        if ($skyCellValue == $lrValue + 2) {
     438          $warpIdCollection[$warpId]["10"] = $skyCellValue;
     439          echo "<script type=\"text/javascript\">changeCell(\"$warpId.10\", \"$cellContent\");</script>";
     440          echo "<script type=\"text/javascript\">changeCell(\"t$warpId.10\", \"$row[23]\");</script>";
     441        } else {
     442          if (!isSet($warpIdCollection[$warpId]["02"])) {
     443            /* echo "<tr><td>Update UpperRight</td></tr>"; */
     444            $warpIdCollection[$warpId]["02"] = $skyCellValue;
     445            echo "<script type=\"text/javascript\">changeCell(\"$warpId.02\", \"$cellContent\");</script>";
     446            echo "<script type=\"text/javascript\">changeCell(\"t$warpId.02\", \"$row[23]\");</script>";
    437447          } else {
    438             if ($urValue + 2 == $skyCellValue) {
    439               echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"$cellContent\");</script>";
    440               echo "<script type=\"text/javascript\">changeCell(\"t$warpId.00\", \"$row[23]\");</script>";
     448            $urValue = $warpIdCollection[$warpId]["02"];
     449            if ($urValue + 1 == $skyCellValue) {
     450              echo "<script type=\"text/javascript\">changeCell(\"$warpId.01\", \"$cellContent\");</script>";
     451              echo "<script type=\"text/javascript\">changeCell(\"t$warpId.01\", \"$row[23]\");</script>";
    441452            } else {
    442               $expected = $urValue + 1;
    443               $actual = $skyCellValue;
    444               echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"Problem in UpperLeft corner: expected $expected but was $actual\");</script>";
    445               echo "<tr><td>Problem in Upper part!</td></tr>";
    446             }
    447           }
     453              if ($urValue + 2 == $skyCellValue) {
     454                echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"$cellContent\");</script>";
     455                echo "<script type=\"text/javascript\">changeCell(\"t$warpId.00\", \"$row[23]\");</script>";
     456              } else {
     457                $expected = $urValue + 1;
     458                $actual = $skyCellValue;
     459                echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"Problem in UpperLeft corner: expected $expected but was $actual\");</script>";
     460                echo "<tr><td>Problem in Upper part!</td></tr>";
     461              }
     462            }
     463          }
    448464        }
     465      }
     466    } else { /* New tessellation */
     467
     468      /* echo "<p>$lrValue -  $skyCellValue</p>"; */
     469
     470      if ($skyCellValue == $lrValue + 1) {
     471        $warpIdCollection[$warpId]["11"] = $skyCellValue;
     472        echo "<script type=\"text/javascript\">changeCell(\"$warpId.01\", \"$cellContent\");</script>";
     473        echo "<script type=\"text/javascript\">changeCell(\"t$warpId.01\", \"$row[23]\");</script>";
     474      } else {
     475        if ($skyCellValue == $lrValue + 2) {
     476          $warpIdCollection[$warpId]["10"] = $skyCellValue;
     477          echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"$cellContent\");</script>";
     478          echo "<script type=\"text/javascript\">changeCell(\"t$warpId.00\", \"$row[23]\");</script>";
     479        } else {
     480          if (!isSet($warpIdCollection[$warpId]["02"])) {
     481            /* echo "<tr><td>Update UpperRight</td></tr>"; */
     482            $warpIdCollection[$warpId]["02"] = $skyCellValue;
     483            echo "<script type=\"text/javascript\">changeCell(\"$warpId.12\", \"$cellContent\");</script>";
     484            echo "<script type=\"text/javascript\">changeCell(\"t$warpId.12\", \"$row[23]\");</script>";
     485          } else {
     486            $urValue = $warpIdCollection[$warpId]["02"];
     487            if ($urValue + 1 == $skyCellValue) {
     488              echo "<script type=\"text/javascript\">changeCell(\"$warpId.11\", \"$cellContent\");</script>";
     489              echo "<script type=\"text/javascript\">changeCell(\"t$warpId.11\", \"$row[23]\");</script>";
     490            } else {
     491              if ($urValue + 2 == $skyCellValue) {
     492                echo "<script type=\"text/javascript\">changeCell(\"$warpId.10\", \"$cellContent\");</script>";
     493                echo "<script type=\"text/javascript\">changeCell(\"t$warpId.10\", \"$row[23]\");</script>";
     494              } else {
     495                $expected = $urValue + 1;
     496                $actual = $skyCellValue;
     497                echo "<script type=\"text/javascript\">changeCell(\"$warpId.00\", \"Problem in UpperLeft corner: expected $expected but was $actual\");</script>";
     498                echo "<tr><td>Problem in Upper part!</td></tr>";
     499              }
     500            }
     501          }
     502        }
     503
    449504      }
    450505    }
Note: See TracChangeset for help on using the changeset viewer.