Changeset 41178 for trunk/ippMonitor/raw/czartool_labels.php
- Timestamp:
- Nov 27, 2019, 12:27:00 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/raw/czartool_labels.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/raw/czartool_labels.php
r41135 r41178 626 626 echo "</tr>"; 627 627 } 628 629 630 #----------------------------------------- 631 #list bad quality cam exposures 632 if ($badcamflag != 0) { 633 634 // set up another table 635 global $table; 636 echo $table; 637 echo "<tr>"; 638 createTableTitle("Bad quality camRun exposures", 6); 639 echo "<tr>"; 640 createTableColumnHeader("exp_name"); 641 createTableColumnHeader("cam_id"); 642 createTableColumnHeader("quality"); 643 createTableColumnHeader("sigma_ra"); 644 createTableColumnHeader("sigma_dec"); 645 createTableColumnHeader("comment"); 646 647 #query the bad cam exposures 648 $query = "SELECT exp_name,cam_id, camProcessedExp.quality, camProcessedExp.sigma_ra, camProcessedExp.sigma_dec, comment"; 649 $query .= " FROM rawExp"; 650 $query .= " JOIN chipRun USING (exp_id)"; 651 $query .= " JOIN camRun USING (chip_id)"; 652 $query .= " JOIN camProcessedExp USING (cam_id)"; 653 $query .= " WHERE dateobs LIKE '$date%'"; 654 $query .= " AND exp_id > $refExpID[0]"; 655 $query .= " AND exp_type = 'OBJECT'"; 656 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 657 $query .= " AND (camProcessedExp.quality > 0 OR camProcessedExp.sigma_ra > 5 OR camProcessedExp.sigma_dec > 5)"; 658 $query .= " ORDER BY comment"; 659 660 $qry1 = $projectdb->query($query); 661 while ($qry1->fetchInto($row)) { 662 663 echo "<tr>"; 664 665 echo "<td>$row[0]</td>"; 666 echo "<td>$row[1]</td>"; 667 echo "<td>$row[2]</td>"; 668 echo "<td>$row[3]</td>"; 669 echo "<td>$row[4]</td>"; 670 echo "<td>$row[5]</td>"; 671 672 echo "</tr>"; 673 } 674 } 675 676 #----------------------------------------- 677 #list bad quality warp exposures 678 if ($badwarpflag != 0) { 679 680 // set up another table 681 global $table; 682 echo $table; 683 echo "<tr>"; 684 createTableTitle("Bad quality warpRun exposures", 3); 685 echo "<tr>"; 686 createTableColumnHeader("exp_name"); 687 createTableColumnHeader("warp_id"); 688 createTableColumnHeader("comment"); 689 690 #query the bad warps 691 $query = "SELECT exp_name,warp_id,count(warpSkyfile.quality) AS Nwarpskycell,count(if(warpSkyfile.quality > 0,1,NULL)) AS Nwarpskycellbad, comment"; 692 $query .= " FROM rawExp LEFT JOIN chipRun USING (exp_id) LEFT JOIN camRun USING (chip_id) LEFT JOIN fakeRun USING (cam_id) LEFT JOIN warpRun USING (fake_id) JOIN warpSkyfile USING (warp_id)"; 693 $query .= " WHERE dateobs like '$date%' AND exp_id > $refExpID[0]"; 694 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 695 $query .= " GROUP BY exp_name ORDER BY comment"; 696 697 $qry1 = $projectdb->query($query); 698 while ($qry1->fetchInto($row)) { 699 700 echo "<tr>"; 701 702 echo "<td>$row[0]</td>"; 703 echo "<td>$row[1]</td>"; 704 echo "<td>$row[2]</td>"; 705 706 echo "</tr>"; 707 } 708 } 709 710 #----------------------------------------- 711 #list bad quality diff exposures 712 if ($baddiffflag != 0) { 713 // set up another table 714 global $table; 715 echo $table; 716 echo "<tr>"; 717 createTableTitle("Bad diffRun exposures", 7); 718 echo "<tr>"; 719 createTableColumnHeader("exp_name"); 720 createTableColumnHeader("diff_id"); 721 createTableColumnHeader("warp1"); 722 createTableColumnHeader("stack1"); 723 createTableColumnHeader("warp2"); 724 createTableColumnHeader("stack2"); 725 createTableColumnHeader("comment"); 726 727 #query the bad diffs 728 $query = " SELECT diff_id,warp1,stack1,warp2,stack2,exp_name,comment FROM "; 729 $query .= " diffInputSkyfile JOIN warpRun ON (warp1=warp_id OR warp2=warp_id) JOIN fakeRun USING (fake_id) JOIN camRun USING (cam_id) JOIN camProcessedExp USING (cam_id) JOIN chipRun USING (chip_id) JOIN rawExp USING (exp_id)"; 730 $query .= " WHERE rawExp.dateobs LIKE '$date%' AND exp_id > $refExpID[0] AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 731 $query .= " GROUP By diff_id"; 732 $qry1 = $projectdb->query($query); 733 734 while ($qry1->fetchInto($row)) { 735 #distinguish between WW and WS diffs based on stack2 736 if ($row[4] == 0) { 737 #find the total number of skycell and the number of skycell with a bad quality flag as well as the full publish state 738 $query3 = " SELECT count(diffSkyfile.quality) AS Ndiff,count(if(diffSkyfile.quality > 0,1,NULL)) AS Ndiffbad,count(if(publishRun.state LIKE 'full',1,NULL)) AS Npub FROM "; 739 $query3 .= " diffRun JOIN diffSkyfile USING (diff_id) LEFT JOIN publishRun ON (diffRun.diff_id = stage_id)"; 740 $query3 .= " WHERE diff_id='$row[0]' GROUP BY diffRun.diff_id"; 741 $qry3 = $projectdb->query($query3); 742 743 while ($qry3->fetchInto($row3)) { 744 #if all skycells have bad quality, this is a bad diff. If all the skycells are in a full state in publishRun, it is fully published 745 if ($row3[1]==$row3[0]) { 746 echo "<tr>"; 747 748 echo "<td>$row[5]</td>"; 749 echo "<td>$row[0]</td>"; 750 echo "<td>$row[1]</td>"; 751 echo "<td>$row[2]</td>"; 752 echo "<td>$row[3]</td>"; 753 echo "<td>$row[4]</td>"; 754 echo "<td>$row[6]</td>"; 755 756 echo "</tr>"; 757 } 758 } 759 } 760 761 if ($row[4] > 0) { 762 #find the total number of skycell and the number of skycell with a bad quality flag as well as the full publish state 763 $query3 = " SELECT count(diffSkyfile.quality) AS Ndiff,count(if(diffSkyfile.quality > 0,1,NULL)) AS Ndiffbad,count(if(publishRun.state LIKE 'full',1,NULL)) AS Npub FROM "; 764 $query3 .= " diffRun JOIN diffSkyfile USING (diff_id) LEFT JOIN publishRun ON (diffRun.diff_id = stage_id)"; 765 $query3 .= " WHERE diff_id='$row[0]' GROUP BY diffRun.diff_id"; 766 $qry3 = $projectdb->query($query3); 767 768 while ($qry3->fetchInto($row3)) { 769 #if all skycells have bad quality, this is a bad diff. If all the skycells are in a full state in publishRun, it is fully published 770 if ($row3[1]==$row3[0]) { 771 echo "<tr>"; 772 773 echo "<td>$row[5]</td>"; 774 echo "<td>$row[0]</td>"; 775 echo "<td>$row[1]</td>"; 776 echo "<td>$row[2]</td>"; 777 echo "<td>$row[3]</td>"; 778 echo "<td>$row[4]</td>"; 779 echo "<td>$row[6]</td>"; 780 781 echo "</tr>"; 782 } 783 } 784 } 785 } 786 } 787 788 #----------------------------------------- 789 #check for overridden exposures 790 $query = "SELECT COUNT(comment), comment"; 791 $query .= " FROM rawExp"; 792 $query .= " JOIN chipRun USING (exp_id)"; 793 $query .= " JOIN camRun USING (chip_id)"; 794 $query .= " WHERE dateobs LIKE '$date%'"; 795 $query .= " AND exp_id > $refExpID[0]"; 796 $query .= " AND exp_type = 'OBJECT'"; 797 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 798 $query .= " GROUP BY comment"; 799 800 $qry1 = $projectdb->query($query); 801 $doHeader = 1; 802 803 while ($qry1->fetchInto($row)) { 804 if ($row[0] > 1) { 805 $query = "SELECT exp_name,dateobs, comment"; 806 $query .= " FROM rawExp"; 807 $query .= " JOIN chipRun USING (exp_id)"; 808 $query .= " JOIN camRun USING (chip_id)"; 809 $query .= " WHERE dateobs LIKE '$date%' AND comment LIKE '$row[1]'"; 810 $query .= " AND exp_id > $refExpID[0]"; 811 $query .= " AND exp_type = 'OBJECT'"; 812 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 813 $query .= " ORDER BY dateobs DESC"; 814 $qry2 = $projectdb->query($query); 815 816 $doskip = 0; 817 while ($qry2->fetchInto($row2)) { 818 if ($doskip) { 819 if ($doHeader) { 820 // set up another table 821 global $table; 822 echo $table; 823 echo "<tr>"; 824 createTableTitle("Overridden exposures", 3); 825 echo "<tr>"; 826 createTableColumnHeader("exp_name"); 827 createTableColumnHeader("dateobs"); 828 createTableColumnHeader("comment"); 829 $doHeader = 0; 830 } 831 echo "<tr>"; 832 833 echo "<td>$row2[0]</td>"; 834 echo "<td>$row2[1]</td>"; 835 echo "<td>$row2[2]</td>"; 836 837 echo "</tr>"; 838 } 839 $doskip = 1; 840 } 841 } 842 } 843 if (!$doHeader) { print "\n"; } 628 844 629 845
Note:
See TracChangeset
for help on using the changeset viewer.
