IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 9, 2013, 4:06:09 PM (13 years ago)
Author:
eugene
Message:

merge from trunk

Location:
branches/eam_branches/ipp-20130904/ippToPsps
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/ippToPsps

  • branches/eam_branches/ipp-20130904/ippToPsps/jython/dxlayer.py

    r35217 r36192  
    2525    '''
    2626    def deleteBatch(self, batchID):
     27        #HAF This is really lazy to do this way, but for the time, will check both dx layers and try the first, if no go try the second.
    2728
    2829        batch = Batch.getNameFromID(batchID)
     
    4647        p.stdout.close()
    4748
    48         if ret: self.logger.infoPair("Deleted batch from DXLayer", batch)
    49         else: self.logger.errorPair("Unable to delete batch from DXLayer", batch)
     49        if ret: self.logger.infoPair("Deleted batch from DXLayer 1", batch)
     50        else: self.logger.errorPair("Unable to delete batch from DXLayer 1" , batch)
     51
     52
     53       
     54
     55        tempFile = tempfile.NamedTemporaryFile(mode='w+b')
     56
     57        p = Popen("deleteFromDXLayer2.pl -b " + batch + " -f " + tempFile.name,
     58                shell=True,
     59                stdout=PIPE)
     60        p.wait()
     61       
     62        if p.returncode != 0:
     63           self.logger.debugPair("DXLayer webservice", "failed")
     64           return 0
     65        else:
     66           self.logger.debugPair("DXLayer webservice", "successful")
     67
     68        ret = self.decodeDXLayerResponse(tempFile.name)
     69
     70        tempFile.close()
     71        p.stdout.close()
     72
     73        if ret: self.logger.infoPair("Deleted batch from DXLayer 2", batch)
     74        else: self.logger.errorPair("Unable to delete batch from DXLayer 2" , batch)
     75
     76
     77
    5078
    5179        return ret
     80
    5281
    5382    '''
  • branches/eam_branches/ipp-20130904/ippToPsps/jython/ipptopspsdb.py

    r35994 r36192  
    3939               AND batch_type = '" + batchType + "' \
    4040               AND dvo_db = '" + self.skychunk.dvoLabel + "' \
     41               AND comment = '" + self.skychunk.name + "' \
     42               AND datastore_product = '" + self.skychunk.datastoreProduct + "' \
    4143               AND merged = 1 \
    4244               AND deleted_local = 0 \
     
    6567               AND batch_type = '" + batchType + "' \
    6668               AND dvo_db = '" + self.skychunk.dvoLabel + "' \
     69               AND comment = '" + self.skychunk.name + "' \
     70               AND datastore_product = '" + self.skychunk.datastoreProduct + "' \
    6771               AND purged = 1 \
    6872               AND deleted_local = 0 \
     
    9296               AND batch_type = '" + batchType + "' \
    9397               AND dvo_db = '" + self.skychunk.dvoLabel + "' \
     98               AND comment = '" + self.skychunk.name + "' \
     99               AND datastore_product = '" + self.skychunk.datastoreProduct + "' \
    94100               AND purged = 1 \
    95101               AND deleted_datastore = 0 \
     
    119125               AND batch_type = '" + batchType + "' \
    120126               AND dvo_db = '" + self.skychunk.dvoLabel + "' \
    121                AND (loaded_to_ODM = -1 OR merge_worthy = 1) \
     127               AND comment = '" + self.skychunk.name + "' \
     128               AND datastore_product = '" + self.skychunk.datastoreProduct + "' \
     129               AND (merge_worthy = 1) \
    122130               AND deleted_datastore = 0 AND block_delete_datastore = 0"
    123131
     
    144152               AND batch_type = '" + batchType + "' \
    145153               AND dvo_db = '" + self.skychunk.dvoLabel + "' \
    146                AND (loaded_to_ODM = -1 OR merge_worthy = 1) \
     154               AND (merge_worthy = 1) \
    147155               AND deleted_dxlayer = 0 and block_delete_dxlayer = 0"
    148156
  • branches/eam_branches/ipp-20130904/ippToPsps/jython/stackbatch.py

    r35780 r36192  
    645645        ,petRadiusErr=b.PETRO_RADIUS_ERR \
    646646        ,petFlux=POW(10.0, -0.4 * b.PETRO_MAG) /" + str(self.expTime) + " \
    647         ,petFluxErr=ABS(b.PETRO_MAG_ERR) * POW(10.0, (-0.4*b.PETRO_MAG)) / " + str(self.expTime) + " / 1.085736  \
     647        ,petFluxErr=-999  \
    648648        ,petR50=b.PETRO_RADIUS_50 \
    649649        ,petR50Err=b.PETRO_RADIUS_50_ERR \
     
    653653        WHERE a.ippDetectID=b.IPP_IDET"
    654654        self.scratchDb.execute(sql)
     655
     656        self.logger.infoPair("Adding", "petFluxErr for non nulls")
     657        sql = "UPDATE StackApFlx as a, SkyChip_xsrc AS b SET \
     658        petFluxErr=ABS(b.PETRO_MAG_ERR) * POW(10.0, (-0.4*b.PETRO_MAG)) / " + str(self.expTime) + " / 1.085736  \
     659        WHERE a.ippDetectID=b.IPP_IDET \
     660        AND (b.PETRO_MAG_ERR is not NULL AND b.PETRO_MAG is not NULL AND PETRO_MAG_ERR < 1000.0)"
     661        # added this because when the petromagerr is crazy large (10^29 it out of ranges the flux err calc)
     662        self.logger.infoPair("sql", sql)
     663        self.scratchDb.execute(sql)
     664
     665
    655666
    656667        self.logger.infoPair("adding"," PrimaryF to stackApFlx")
Note: See TracChangeset for help on using the changeset viewer.