Changeset 42578
- Timestamp:
- Jan 9, 2024, 4:11:25 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-ops-20220906/ippScripts/scripts/nightly_science.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/nightly_science.pl merged: 42577
r42423 r42578 1564 1564 my $warps = $db->selectall_arrayref( $input_sth ); 1565 1565 1566 #consider which exposures should be used to be used to make warps (bad states and too high FWHM are not be allowed) 1566 1567 # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra. 1567 1568 my %comment_hash = (); 1569 foreach my $this_warp (@{ $warps }) { 1570 my $this_comment = ${ $this_warp }[3]; 1571 my $this_exp_id = ${ $this_warp }[0]; 1572 my $this_quality = ${ $this_warp }[5]; 1573 my $this_state = ${ $this_warp }[4]; 1574 my $this_fwhm = ${ $this_warp }[6]; 1575 1576 if ( ($this_quality != 0) || ($this_state eq 'drop') || ($this_fwhm > $maxFWHM)) { 1577 print STDERR "diff_queue: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality or state $this_state or FWHM $this_fwhm\n"; 1578 } 1579 else { 1580 $comment_hash{$this_comment} = $this_exp_id; 1581 } 1582 } 1583 1584 # Exclude any warps that are not stored in the comment_hash (overrides) and check their status. 1585 my @keep_warps = (); 1568 1586 my $Nbad = 0; 1569 1587 foreach my $this_warp (@{ $warps }) { … … 1571 1589 my $this_exp_id = ${ $this_warp }[0]; 1572 1590 my $this_quality = ${ $this_warp }[5]; 1573 my $this_state = ${ $this_warp }[4];1574 1591 my $this_warp_id = ${ $this_warp }[1]; 1575 my $this_fwhm = ${ $this_warp }[6];1576 1592 my $chip_state = ${ $this_warp }[7]; 1577 1593 my $cam_state = ${ $this_warp }[8]; 1578 1579 #find exposures for this object that have not been fully processed 1580 if (($this_warp_id eq 'NULL') && (($this_quality == 0) || ($this_quality eq 'NULL')) ) { 1581 print STDERR "diff_queue: exposure with exp_id $this_exp_id for $this_object has warp_id $this_warp_id and quality $this_quality and is therefore not fully processed\n"; 1582 $Nbad += 1; 1583 } 1584 if (($chip_state ne 'full') || ($cam_state ne 'full') ) { 1585 print STDERR "diff_queue: exposure with exp_id $this_exp_id for $this_object has chip state $chip_state and cam state $cam_state and is therefore not fully processed\n"; 1586 $Nbad += 1; 1587 } 1588 1589 if (($this_quality != 0) || ($this_state eq 'drop') || ($this_fwhm > $maxFWHM)) { 1590 print STDERR "diff_queue: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality or state $this_state or FWHM $this_fwhm\n"; 1594 if ((exists($comment_hash{$this_comment}))&& 1595 ($comment_hash{$this_comment} == $this_exp_id)) { 1596 push @keep_warps, $this_warp; 1597 1598 #do not continue if you encounter exposures that finished cam stage but have not yet continued to warp (i.e. stuck in between stages) 1599 if (($this_warp_id eq 'NULL') && (($this_quality == 0) || ($this_quality eq 'NULL')) ) { 1600 print STDERR "diff_queue: exposure with exp_id $this_exp_id for $this_object has warp_id $this_warp_id and quality $this_quality and is therefore not fully processed\n"; 1601 $Nbad += 1; 1602 } 1603 #do not continue if you encounter exposures that have not been fully processed or have bad quality 1604 if (($chip_state ne 'full') || ($cam_state ne 'full') || ($this_quality != 0) ) { 1605 print STDERR "diff_queue: exposure with exp_id $this_exp_id for $this_object has chip state $chip_state and cam state $cam_state and quality $this_quality and is therefore not fully processed\n"; 1606 $Nbad += 1; 1607 } 1591 1608 } 1592 1609 else { 1593 $comment_hash{$this_comment} = $this_exp_id; 1594 } 1595 } 1610 print STDERR "diff_queue: excluding $this_exp_id for $this_object due to not being an accepted comment string $this_comment\n"; 1611 } 1612 } 1613 @{ $warps } = @keep_warps; 1596 1614 1597 1615 #kick object out of diff consideration if it has exposures not fully processed … … 1600 1618 next; 1601 1619 } 1602 1603 # Exclude any warps that are not stored in the comment_hash.1604 my @keep_warps = ();1605 foreach my $this_warp (@{ $warps }) {1606 my $this_comment = ${ $this_warp }[3];1607 my $this_exp_id = ${ $this_warp }[0];1608 if ((exists($comment_hash{$this_comment}))&&1609 ($comment_hash{$this_comment} == $this_exp_id)) {1610 push @keep_warps, $this_warp;1611 }1612 else {1613 print STDERR "diff_queue: excluding $this_exp_id for $this_object due to not being an accepted comment string $this_comment\n";1614 }1615 }1616 @{ $warps } = @keep_warps;1617 1620 1618 1621 # Exclude the last entry if we do not have an even number of warps. … … 1779 1782 my $warpsBQ = $db->selectall_arrayref( $input_sth );; 1780 1783 1784 #consider which exposures should be used to be used to make warps (bad states and too high FWHM are not be allowed) 1785 # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra. 1786 my %comment_hash = (); 1787 my %comment_hash_good = (); 1788 foreach my $this_warp (@{ $warps }) { 1789 my $this_comment = ${ $this_warp }[3]; 1790 my $this_exp_id = ${ $this_warp }[0]; 1791 my $this_quality = ${ $this_warp }[5]; 1792 my $this_state = ${ $this_warp }[4]; 1793 my $this_fwhm = ${ $this_warp }[6]; 1794 1795 if (($this_quality != 0) || ($this_state eq 'drop') || ($this_fwhm > $maxFWHM)) { 1796 print STDERR "desp_diff_singles: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality or state $this_state or FWHM $this_fwhm\n"; 1797 } 1798 else { 1799 $comment_hash_good{$this_comment} = $this_exp_id; 1800 } 1801 1802 #also save the entries which are ok, but not best quality 1803 if (($this_quality == 0) && ($this_state ne 'drop') ) { 1804 $comment_hash{$this_comment} = $this_exp_id; 1805 } 1806 1807 } 1808 1781 1809 # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra. 1782 1810 my %comment_hash = (); … … 1788 1816 my $this_quality = ${ $this_warp }[5]; 1789 1817 my $this_state = ${ $this_warp }[4]; 1790 my $this_warp_id = ${ $this_warp }[1];1791 1818 my $this_fwhm = ${ $this_warp }[6]; 1792 my $chip_state = ${ $this_warp }[7];1793 my $cam_state = ${ $this_warp }[8];1794 1795 #find exposures for this object that have not been fully processed1796 if (($this_warp_id eq 'NULL') && (($this_quality == 0) || ($this_quality eq 'NULL')) ) {1797 print STDERR "desp_diff_singles: exposure with exp_id $this_exp_id for $this_object has warp_id $this_warp_id and quality $this_quality and is therefore not fully processed\n";1798 $Nbad += 1;1799 }1800 if (($chip_state ne 'full') || ($cam_state ne 'full') ) {1801 print STDERR "desp_diff_singles: exposure with exp_id $this_exp_id for $this_object has chip state $chip_state and cam state $cam_state and is therefore not fully processed\n";1802 $Nbad += 1;1803 }1804 1819 1805 1820 if (($this_quality != 0) || ($this_state eq 'drop') || ($this_fwhm > $maxFWHM)) { … … 1816 1831 } 1817 1832 1833 # Exclude any warps that are not stored in the comment_hash (overrides) and check their status. 1834 my @keep_warps = (); 1835 my $Nbad = 0; 1836 foreach my $this_warp (@{ $warps }) { 1837 my $this_comment = ${ $this_warp }[3]; 1838 my $this_exp_id = ${ $this_warp }[0]; 1839 my $this_quality = ${ $this_warp }[5]; 1840 my $this_warp_id = ${ $this_warp }[1]; 1841 my $chip_state = ${ $this_warp }[7]; 1842 my $cam_state = ${ $this_warp }[8]; 1843 if ((exists($comment_hash_good{$this_comment}))&& 1844 ($comment_hash_good{$this_comment} == $this_exp_id)) { 1845 push @keep_warps, $this_warp; 1846 my $this_date = ${ $this_warp }[2]; 1847 my $chunk_name = ${ $this_warp }[6]; 1848 1849 #do not continue if you encounter exposures that finished cam stage but have not yet continued to warp (i.e. stuck in between stages) 1850 if (($this_warp_id eq 'NULL') && (($this_quality == 0) || ($this_quality eq 'NULL')) ) { 1851 print STDERR "desp_diff_singles: exposure with exp_id $this_exp_id for $this_object has warp_id $this_warp_id and quality $this_quality and is therefore not fully processed\n"; 1852 $Nbad += 1; 1853 } 1854 #do not continue if you encounter exposures that have not been fully processed or have bad quality 1855 if (($chip_state ne 'full') || ($cam_state ne 'full') || ($this_quality != 0) ) { 1856 print STDERR "desp_diff_singles: exposure with exp_id $this_exp_id for $this_object has chip state $chip_state and cam state $cam_state and quality $this_quality and is therefore not fully processed\n"; 1857 $Nbad += 1; 1858 } 1859 } 1860 else { 1861 print STDERR "desp_diff_singles: excluding $this_exp_id for $this_object due to not being an accepted comment string $this_comment\n"; 1862 } 1863 } 1864 @{ $warps } = @keep_warps; 1865 my $nwarps = ($#{ $warps } + 1); 1866 1818 1867 #kick object out of diff consideration if it has exposures not fully processed 1819 1868 if ($Nbad > 0) { … … 1821 1870 next; 1822 1871 } 1823 1824 # Exclude any warps that are not stored in the comment_hash_good.1825 my @keep_warps = ();1826 foreach my $this_warp (@{ $warps }) {1827 my $this_comment = ${ $this_warp }[3];1828 my $this_exp_id = ${ $this_warp }[0];1829 if ((exists($comment_hash_good{$this_comment}))&&1830 ($comment_hash_good{$this_comment} == $this_exp_id)) {1831 push @keep_warps, $this_warp;1832 $this_date = ${ $this_warp }[2];1833 $chunk_name = ${ $this_warp }[6];1834 }1835 else {1836 print STDERR "desp_diff_singles: excluding $this_exp_id for $this_object due to being rejected $this_comment\n";1837 }1838 }1839 @{ $warps } = @keep_warps;1840 my $nwarps = ($#{ $warps } + 1);1841 1872 1842 1873 #find the time of the most recent exposure in that chunk … … 2173 2204 my $warpsBQ = $db->selectall_arrayref( $input_sth );; 2174 2205 2206 2207 2208 2209 2210 2211 2212 2175 2213 # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra. 2176 2214 my %comment_hash = (); … … 2182 2220 my $this_quality = ${ $this_warp }[5]; 2183 2221 my $this_state = ${ $this_warp }[4]; 2184 my $this_warp_id = ${ $this_warp }[1]; 2185 my $this_fwhm = ${ $this_warp }[6]; 2186 my $chip_state = ${ $this_warp }[7]; 2187 my $cam_state = ${ $this_warp }[8]; 2188 2189 #find exposures for this object that have not been fully processed 2190 if (($this_warp_id eq 'NULL') && (($this_quality == 0) || ($this_quality eq 'NULL')) ) { 2191 print STDERR "desp_diff_queue: exposure with exp_id $this_exp_id for $this_object has warp_id $this_warp_id and quality $this_quality and is therefore not fully processed\n"; 2192 $Nbad += 1; 2193 } 2194 if (($chip_state ne 'full') || ($cam_state ne 'full') ) { 2195 print STDERR "desp_diff_queue: exposure with exp_id $this_exp_id for $this_object has chip state $chip_state and cam state $cam_state and is therefore not fully processed\n"; 2196 $Nbad += 1; 2197 } 2222 my $this_fwhm = ${ $this_warp }[6]; 2198 2223 2199 2224 if (($this_quality != 0) || ($this_state eq 'drop') || ($this_fwhm > $maxFWHM)) { … … 2210 2235 } 2211 2236 2212 #kick object out of diff consideration if it has exposures not fully processed 2213 if ($Nbad > 0) { 2214 print STDERR "desp_diff_queue: excluding $this_object from making diffs due to not being fully processed to warp stage\n"; 2215 next; 2216 } 2217 2218 # Exclude any warps that are not stored in the comment_hash_good. 2237 # Exclude any warps that are not stored in the comment_hash (overrides) and check their status. 2219 2238 my @keep_warps = (); 2239 my $Nbad = 0; 2220 2240 foreach my $this_warp (@{ $warps }) { 2221 2241 my $this_comment = ${ $this_warp }[3]; 2222 2242 my $this_exp_id = ${ $this_warp }[0]; 2243 my $this_quality = ${ $this_warp }[5]; 2244 my $this_warp_id = ${ $this_warp }[1]; 2245 my $chip_state = ${ $this_warp }[7]; 2246 my $cam_state = ${ $this_warp }[8]; 2223 2247 if ((exists($comment_hash_good{$this_comment}))&& 2224 2248 ($comment_hash_good{$this_comment} == $this_exp_id)) { … … 2226 2250 my $this_date = ${ $this_warp }[2]; 2227 2251 my $chunk_name = ${ $this_warp }[6]; 2252 2253 #do not continue if you encounter exposures that finished cam stage but have not yet continued to warp (i.e. stuck in between stages) 2254 if (($this_warp_id eq 'NULL') && (($this_quality == 0) || ($this_quality eq 'NULL')) ) { 2255 print STDERR "desp_diff_queue: exposure with exp_id $this_exp_id for $this_object has warp_id $this_warp_id and quality $this_quality and is therefore not fully processed\n"; 2256 $Nbad += 1; 2257 } 2258 #do not continue if you encounter exposures that have not been fully processed or have bad quality 2259 if (($chip_state ne 'full') || ($cam_state ne 'full') || ($this_quality != 0) ) { 2260 print STDERR "desp_diff_queue: exposure with exp_id $this_exp_id for $this_object has chip state $chip_state and cam state $cam_state and quality $this_quality and is therefore not fully processed\n"; 2261 $Nbad += 1; 2262 } 2228 2263 } 2229 2264 else { 2230 print STDERR "desp_diff_queue: excluding $this_exp_id for $this_object due to being rejected$this_comment\n";2265 print STDERR "desp_diff_queue: excluding $this_exp_id for $this_object due to not being an accepted comment string $this_comment\n"; 2231 2266 } 2232 2267 } 2233 2268 @{ $warps } = @keep_warps; 2234 2269 my $nwarps = ($#{ $warps } + 1); 2270 2271 #kick object out of diff consideration if it has exposures not fully processed 2272 if ($Nbad > 0) { 2273 print STDERR "desp_diff_queue: excluding $this_object from making diffs due to not being fully processed to warp stage\n"; 2274 next; 2275 } 2235 2276 2236 2277 ################################ - Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.
