IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42577 for trunk/ippScripts


Ignore:
Timestamp:
Jan 9, 2024, 4:06:06 PM (3 years ago)
Author:
tdeboer
Message:

ngihtly_science update for IPP-2088

File:
1 edited

Legend:

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

    r42421 r42577  
    15641564        my $warps = $db->selectall_arrayref( $input_sth );
    15651565
     1566        #consider which exposures should be used to be used to make warps (bad states and too high FWHM are not be allowed)
    15661567        # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra.
    15671568        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 = ();
    15681586        my $Nbad = 0;
    15691587        foreach my $this_warp (@{ $warps }) {
     
    15711589            my $this_exp_id  = ${ $this_warp }[0];
    15721590            my $this_quality = ${ $this_warp }[5];
    1573             my $this_state   = ${ $this_warp }[4];
    15741591            my $this_warp_id  = ${ $this_warp }[1];
    1575             my $this_fwhm   = ${ $this_warp }[6];
    15761592            my $chip_state   = ${ $this_warp }[7];
    15771593            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                }
    15911608            }
    15921609            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;
    15961614
    15971615        #kick object out of diff consideration if it has exposures not fully processed
     
    16001618            next;
    16011619        }
    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;
    16171620
    16181621        # Exclude the last entry if we do not have an even number of warps.
     
    17791782            my $warpsBQ = $db->selectall_arrayref( $input_sth );;
    17801783
     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
    17811809            # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra.
    17821810            my %comment_hash = ();
     
    17881816                my $this_quality = ${ $this_warp }[5];
    17891817                my $this_state   = ${ $this_warp }[4];
    1790                 my $this_warp_id  = ${ $this_warp }[1];
    17911818                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 processed
    1796                 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                 }
    18041819
    18051820                if (($this_quality != 0) || ($this_state eq 'drop') || ($this_fwhm > $maxFWHM)) {
     
    18161831            }
    18171832
     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
    18181867            #kick object out of diff consideration if it has exposures not fully processed
    18191868            if ($Nbad > 0) {
     
    18211870                next;
    18221871            }
    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);
    18411872           
    18421873            #find the time of the most recent exposure in that chunk
     
    21732204            my $warpsBQ = $db->selectall_arrayref( $input_sth );;
    21742205
     2206
     2207
     2208
     2209
     2210
     2211
     2212
    21752213            # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra.
    21762214            my %comment_hash = ();
     
    21822220                my $this_quality = ${ $this_warp }[5];
    21832221                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];
    21982223
    21992224                if (($this_quality != 0) || ($this_state eq 'drop') || ($this_fwhm > $maxFWHM)) {
     
    22102235            }
    22112236
    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.
    22192238            my @keep_warps = ();
     2239            my $Nbad = 0;
    22202240            foreach my $this_warp (@{ $warps }) {
    22212241                my $this_comment = ${ $this_warp }[3];
    22222242                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];
    22232247                if ((exists($comment_hash_good{$this_comment}))&&
    22242248                    ($comment_hash_good{$this_comment} == $this_exp_id)) {
     
    22262250                    my $this_date  = ${ $this_warp }[2];
    22272251                    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                    }
    22282263                }
    22292264                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";
    22312266                }
    22322267            }
    22332268            @{ $warps } = @keep_warps;
    22342269            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            }
    22352276
    22362277            ################################
Note: See TracChangeset for help on using the changeset viewer.