IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33948


Ignore:
Timestamp:
May 29, 2012, 5:07:20 PM (14 years ago)
Author:
eugene
Message:

merging changes from trunk

Location:
branches/eam_branches/ipp-20120405
Files:
6 deleted
60 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120405/ippToPsps/config/ippToPspsDbSchema.sql

    r33593 r33948  
    4545  `purged` tinyint(4) NOT NULL default '0',
    4646  PRIMARY KEY  (`batch_id`)
    47 ) ENGINE=InnoDB AUTO_INCREMENT=326479 DEFAULT CHARSET=latin1;
     47) ENGINE=InnoDB AUTO_INCREMENT=328286 DEFAULT CHARSET=latin1;
    4848SET character_set_client = @saved_cs_client;
    4949
     
    6565  KEY `fk_config` (`config`),
    6666  CONSTRAINT `fk_config` FOREIGN KEY (`config`) REFERENCES `config` (`name`) ON DELETE CASCADE
    67 ) ENGINE=InnoDB AUTO_INCREMENT=25457 DEFAULT CHARSET=latin1;
     67) ENGINE=InnoDB AUTO_INCREMENT=44588 DEFAULT CHARSET=latin1;
    6868SET character_set_client = @saved_cs_client;
    6969
     
    8787  PRIMARY KEY  (`id`),
    8888  UNIQUE KEY `unique_key` (`host`,`pid`)
    89 ) ENGINE=InnoDB AUTO_INCREMENT=961 DEFAULT CHARSET=latin1;
     89) ENGINE=InnoDB AUTO_INCREMENT=1227 DEFAULT CHARSET=latin1;
    9090SET character_set_client = @saved_cs_client;
    9191
     
    110110  `max_dec` double default '90',
    111111  `box_size` double default '4',
    112   `base_path` varchar(1000) default NULL,
     112  `base_path` varchar(1000) default '/data/ipp005.0/ipptopsps/',
    113113  `data_release` smallint(6) default '0',
    114114  `delete_local` tinyint(1) default '0',
     
    120120  `queue_P2` tinyint(1) default '1',
    121121  `queue_ST` tinyint(1) default '0',
     122  `queue_OB` tinyint(1) default '0',
     123  `active` tinyint(1) default '1',
    122124  UNIQUE KEY `name` (`name`)
    123125) ENGINE=InnoDB DEFAULT CHARSET=latin1;
     
    141143
    142144--
     145-- Table structure for table `object`
     146--
     147
     148DROP TABLE IF EXISTS `object`;
     149SET @saved_cs_client     = @@character_set_client;
     150SET character_set_client = utf8;
     151CREATE TABLE `object` (
     152  `batch_id` bigint(20) unsigned NOT NULL,
     153  `region` varchar(50) default NULL,
     154  KEY `batch_id` (`batch_id`),
     155  CONSTRAINT `object_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`)
     156) ENGINE=InnoDB DEFAULT CHARSET=latin1;
     157SET character_set_client = @saved_cs_client;
     158
     159--
    143160-- Table structure for table `pending`
    144161--
     
    151168  `batch_type` varchar(10) default NULL,
    152169  `stage_id` bigint(20) default NULL,
    153   `ra_bore` float default NULL,
    154   `dec_bore` float default NULL,
    155170  UNIQUE KEY `a_key` (`box_id`,`stage_id`,`batch_type`),
     171  UNIQUE KEY `stage_id_key` (`stage_id`),
    156172  CONSTRAINT `box_key` FOREIGN KEY (`box_id`) REFERENCES `box` (`id`) ON DELETE CASCADE
    157173) ENGINE=InnoDB DEFAULT CHARSET=latin1;
     
    199215/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    200216
    201 -- Dump completed on 2012-03-22  7:59:34
     217-- Dump completed on 2012-04-10  6:00:59
  • branches/eam_branches/ipp-20120405/ippToPsps/config/settings.xml

    r33594 r33948  
    55
    66  <!-- path for storing logs -->
    7   <logPath>/data/ipp005.0/rhenders</logPath>
     7  <logPath>/data/ipp005.0/ipptopsps</logPath>
    88
    99  <!-- local scratch Db section -->
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/batch.py

    r33672 r33948  
    3939                 useFullTables):
    4040
    41         self.everythingOK = False
    4241        self.readHeader = False
    4342        self.config = config
     
    6665            if not self.header:
    6766                logger.errorPair("Could not read FITS for id", "%d" % id)
    68                 return
     67                raise
    6968
    7069        self.scratchDb.setUseFullTables(self.useFullTables)
     
    115114        self.logger.infoPair("Output path", self.localOutPath)
    116115
    117         self.everythingOK = True
    118116   
    119117    '''
     
    510508    def run(self):
    511509
    512         if not self.everythingOK:
    513             self.logger.errorPair("Aborting this batch", "could not initialize")
    514             self.ippToPspsDb.updateProcessed(self.batchID, -1)
    515             return
    516 
    517510        if not self.createEmptyPspsTables():
    518511            self.logger.errorPair("Aborting this batch", "could not create empty PSPS tables")
    519512            self.ippToPspsDb.updateProcessed(self.batchID, -1)
    520             return
     513            raise
    521514
    522515        if not self.importIppTables():
    523516            self.logger.errorPair("Aborting this batch", "could not import IPP tables")
    524517            self.ippToPspsDb.updateProcessed(self.batchID, -1)
    525             return
     518            raise
    526519
    527520        if not self.populatePspsTables():
    528521            self.logger.errorPair("Aborting this batch", "unable to populate PSPS tables")
    529522            self.ippToPspsDb.updateProcessed(self.batchID, -1)
    530             return
     523            raise
    531524
    532525        if not self.exportPspsTablesToFits():
    533526            self.logger.errorPair("Aborting this batch", "unable to export tables to FITS file")
    534527            self.ippToPspsDb.updateProcessed(self.batchID, -1)
    535             return
     528            raise
    536529   
    537530        if self.writeBatchManifest():
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/cleanup.py

    r33708 r33948  
    77import sys
    88import time
     9import traceback
    910import logging.config
    1011
     
    4142            self.logger.infoPair("Config", self.config.name)
    4243            self.config.printDeletionPolicy()
     44            self.clean("IN")
    4345            self.clean("P2")
    4446            self.clean("ST")
     
    4850            if not self.waitForPollTime(): break
    4951   
     52    '''
     53    Reports results of cleanup for this set of IDs
     54    '''
     55    def reportResults(self, name, ids, success):
     56
     57        if len(ids) > 0:
     58            self.logger.infoSeparator()
     59            self.logger.infoPair("Removed from " + name, "%d of %d" % (success, len(ids)))
     60   
     61
    5062    '''
    5163    Finds stuff to delete for this batch type, then:
     
    6274
    6375        loadedDatastoreIDs = self.ippToPspsDb.getLoadedToODMButNotDeletedFromDatastore(batchType)
    64         loadedDxlayerIDs = self.ippToPspsDb.getLoadedToODMButNotDeletedFromDXLayer(batchType)
     76        deleteFromDxLayerIDs = self.ippToPspsDb.getLoadedToODMButNotDeletedFromDXLayer(batchType)
    6577        mergedLocalIDs = self.ippToPspsDb.getMergedButNotDeletedFromLocalDisk(batchType)
    6678
     
    6880        purgedLocalIDs = self.ippToPspsDb.getPurgedButNotDeletedFromLocalDisk(batchType)
    6981
    70         self.logger.infoPair("Loaded to ODM but still on datastore", "%d" % len(loadedDatastoreIDs))
    71         self.logger.infoPair("Loaded to ODM but still in DXLayer", "%d" % len(loadedDxlayerIDs))
    72         self.logger.infoPair("Merged but still on local disk", "%d" % len(mergedLocalIDs))
    73         self.logger.infoPair("Purged but still on datastore", "%d" % len(purgedDatastoreIDs))
    74         self.logger.infoPair("Purged but still on local disk", "%d" % len(purgedLocalIDs))
     82        deleteFromDatastoreIDs = loadedDatastoreIDs + purgedDatastoreIDs
     83        deleteFromLocalIDs = mergedLocalIDs + purgedLocalIDs
     84
     85        # report to log what we are going to do
     86        self.logger.infoPair("To delete from datastore", "%d" % len(deleteFromDatastoreIDs))
     87        self.logger.infoPair("To delete from DXLayer", "%d" % len(deleteFromDxLayerIDs))
     88        self.logger.infoPair("To delete from local disk", "%d" % len(deleteFromLocalIDs))
    7589   
     90        # delete stuff from local disk
    7691        if self.config.deleteLocal:
    77             self.logger.infoSeparator()
    7892            count = 0
    79             ids = mergedLocalIDs + purgedLocalIDs
    80             for id in ids:
     93            for id in deleteFromLocalIDs:
    8194       
    8295                if Batch.deleteFromDisk(self.logger, self.config.basePath, batchType, self.config.dvoLabel, id):
     
    8497                    count = count + 1
    8598   
    86             self.logger.infoSeparator()
    87             self.logger.infoPair("Removed from local disk", "%d" % count)
    88             self.logger.infoPair("Remaining on local disk", "%d" % (len(ids) - count))
    89        
     99            self.reportResults("local disk", deleteFromLocalIDs, count)
    90100   
     101        # remove stuff from datastore
    91102        if self.config.deleteDatastore:
    92             self.logger.infoSeparator()
    93103            count = 0
    94             ids = loadedDatastoreIDs + purgedDatastoreIDs
    95             for id in ids:
     104            for id in deleteFromDatastoreIDs:
    96105       
    97106                batchName = Batch.getNameFromID(id)
     
    100109                    count = count + 1
    101110   
    102             self.logger.infoSeparator()
    103             self.logger.infoPair("Removed from datastore", "%d" % count)
    104             self.logger.infoPair("Remaining on datastore", "%d" % (len(ids) - count))
     111            self.reportResults("datastore", deleteFromDatastoreIDs, count)
    105112       
     113        # remove stuff from DXLayer
    106114        if self.config.deleteDxLayer:
    107             self.logger.infoSeparator()
    108115            count = 0
    109             for id in loadedDxlayerIDs:
     116            for id in deleteFromDxLayerIDs:
    110117       
    111118                if self.dxlayer.deleteBatch(id):
     
    113120                    count = count + 1
    114121   
    115             self.logger.infoSeparator()
    116             self.logger.infoPair("Removed from DXLayer", "%d" % count)
    117             self.logger.infoPair("Remaining on DXLayer", "%d" % (len(loadedDxlayerIDs) - count))
     122            self.reportResults("DXLayer", deleteFromDxLayerIDs, count)
    118123       
    119 
    120124    '''
    121125    Overrides base-class version
     
    128132Start of program
    129133'''
    130 cleanup = Cleanup(sys.argv)
    131 cleanup.run()
    132 cleanup.exitProgram("finished")
     134try:
     135    cleanup = Cleanup(sys.argv)
     136    cleanup.run()
     137    cleanup.exitProgram("completed")
     138except Exception, e:
     139    print str(e)
     140    traceback.print_exc()
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/config.py

    r33558 r33948  
    3939    '''
    4040    def printAll(self):
     41
     42        self.logger.infoTitle("Config")
    4143
    4244        try:
     
    133135    def getDbPassword(self, dbType): return self.settingsDoc.find(dbType +"/password").text
    134136
    135 
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/datastore.py

    r33259 r33948  
    102102
    103103        firstInt = int(first[1:])
    104         lastInt = int(last[1:])
     104        lastInt = int(last[1:]) + 1
    105105
    106106        for i in range(firstInt, lastInt):
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/datastoreRemover.py

    r33470 r33948  
    4646Start of program
    4747'''
    48 datastoreRemover = DatastoreRemover(sys.argv)
    49 datastoreRemover.run()
    50 datastoreRemover.exitProgram("finished")
     48try:
     49    datastoreRemover = DatastoreRemover(sys.argv)
     50    datastoreRemover.run()
     51    datastoreRemover.exitProgram("completed")
     52except: pass
    5153
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/detectionbatch.py

    r33353 r33948  
    5353               useFullTables)
    5454
    55        if not self.everythingOK: return
    56 
    5755       # get camera meta data
    5856       meta = self.gpc1Db.getCameraStageMeta(self.id)
    5957       if not meta:
    60            self.everythingOK = False
    61            return
     58           self.logger.errorPair("Could not get", "camera metadata")
     59           raise
    6260
    6361       self.expID = meta[0];
     
    9391       # get a fre primary header values. if in test mode, then use defaults
    9492       if self.safeDictionaryAccessWithDefault(self.header, 'MJD-OBS', "1") == "NULL":
    95            self.everythingOK = False
    96            return
     93           self.logger.errorPair("Could not get", "MJD-OBS")
     94           raise
    9795
    9896       if self.safeDictionaryAccessWithDefault(self.header, 'EXPTIME', "1") == "NULL":
    99            self.everythingOK = False
    100            return
     97           self.logger.errorPair("Could not get", "EXPTIME")
     98           raise
    10199
    102100       if self.safeDictionaryAccessWithDefault(self.header, 'FILTERID', "g.0000") == "NULL":
    103            self.everythingOK = False
    104            return
     101           self.logger.errorPair("Could not get", "FILTERID")
     102           raise
    105103       
    106104       self.obsTime = float(self.header['MJD-OBS']) + (float(self.header['EXPTIME']) / 172800.0)
     
    418416               ,momentYY \
    419417               ,apMag \
     418               ,kronFlux \
     419               ,kronFluxErr \
    420420               ,infoFlag \
    421421               ,sky \
     
    436436               ,X_PSF_SIG \
    437437               ,Y_PSF_SIG \
    438                ,POW(10.0, (-0.4*PSF_INST_MAG)) / "+self.header['EXPTIME']+" \
    439                ,ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / "+self.header['EXPTIME']+")) / 1.085736) \
    440                ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / "+self.header['EXPTIME']+" \
     438               ,POW(10.0, (-0.4*PSF_INST_MAG)) / " + self.header['EXPTIME'] + " \
     439               ,ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / " + self.header['EXPTIME'] + ")) / 1.085736) \
     440               ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / " + self.header['EXPTIME'] + " \
    441441               ,PSF_MAJOR \
    442442               ,PSF_MINOR \
     
    448448               ,MOMENTS_YY \
    449449               ,AP_MAG \
     450               ,KRON_FLUX / " + self.header['EXPTIME'] + " \
     451               ,KRON_FLUX_ERR / " + self.header['EXPTIME'] + " \
    450452               ,FLAGS\
    451453               ,SKY \
     
    755757       else : regex = ".*.psf"
    756758 
    757        columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG FLAGS SKY SKY_SIGMA EXT_NSIGMA"
     759       columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG KRON_FLUX KRON_FLUX_ERR FLAGS SKY SKY_SIGMA EXT_NSIGMA"
    758760
    759761       return super(DetectionBatch, self).importIppTables(columns, regex)
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/dvo.py

    r33676 r33948  
    1717from java.sql import *
    1818
    19 
    2019'''
    2120Abstract base-class for DVO classes
     
    4847       
    4948        # connect to the specified scratch database
    50         self.scratchDb = ScratchDb(self.logger, self.config, scratchDbName)
     49        try:
     50            self.scratchDb = ScratchDb(self.logger, self.config, scratchDbName)
     51        except: raise
     52
    5153        self.scratchDb.setUseFullTables(True)
    5254
     
    9092            return
    9193
    92 
    9394    '''
    9495    Loads the DVO Photcodes.dat FITS file
     
    218219        self.regionsAlreadyIngested = []
    219220        self.regionsIngestedButOutOfDate = []
     221        tablesToCleanup = []
    220222
    221223        # loop through all regions in DVO inside this bounding-box
     
    256258               continue
    257259
     260           # we have no record of ingesting this region, but does the table exist?
     261           # May hev been left behind after a crash, and therefore needs to be cleaned-up
     262           for fileType in self.ingestFileTypes:
     263               tableName = self.scratchDb.getDbFriendlyTableName(regionPath + "." + fileType)
     264               if self.scratchDb.tableExists(tableName):
     265                   tablesToCleanup.append(tableName)
     266
    258267           # check if we have out-of-date versions of any interested files, if so, add region to the purge list
    259268           outOfDate = False
     
    279288        self.sizeOfRegionsToPurge = self.getDiskSizeOfRegions(self.regionsToPurge)
    280289        self.sizeOfRegionsToIngest = self.getDiskSizeOfRegions(self.regionsToIngest)
     290
     291        # any tables need cleaning up?
     292        if len(tablesToCleanup) > 0:
     293            self.logger.infoPair("Found tables to be cleaned up", "%d" % len(tablesToCleanup))
     294            self.scratchDb.dropTables(tablesToCleanup)
     295           
    281296
    282297    '''
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/gpc1db.py

    r33527 r33948  
    7272        elif batchType == "ST":       
    7373
    74             stage = "staticsky_multi"
    75             sql = "SELECT DISTINCT stack_id, ra, decl FROM staticskyInput \
     74            stage = "staticsky"
     75            sql = "SELECT DISTINCT stack_id, radeg, decdeg FROM staticskyInput \
    7676                   JOIN addRun ON(staticskyInput.sky_id = addRun.stage_id) \
    7777                   JOIN minidvodbRun USING(minidvodb_name) \
    7878                   JOIN minidvodbProcessed USING(minidvodb_id) \
    79                    JOIN  stackRun USING(stack_id) JOIN skycells.skycell USING(skycell_id) \
     79                   JOIN  stackRun USING(stack_id) JOIN skycell USING(skycell_id) \
    8080                   WHERE minidvodbRun.minidvodb_group = '" + dvoDb + "' \
    8181                   AND minidvodbRun.state = 'merged' \
     
    8383                   AND addRun.stage = '" + stage + "' \
    8484                   AND addRun.state = 'full' \
    85                    AND decl BETWEEN " + str(minDec) + " AND " + str(maxDec) + " \
    86                    AND ra BETWEEN " + str(minRA) + " AND " + str(maxRA)
     85                   AND decdeg BETWEEN " + str(minDec) + " AND " + str(maxDec) + " \
     86                   AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA)
    8787
    8888        try:
     
    266266               AND minidvodbRun.minidvodb_group = '" + dvoDb + "' \
    267267               AND minidvodbRun.state = 'merged' \
    268                AND stage = 'staticsky_multi'"
     268               AND stage = 'staticsky'"
    269269        '''
    270270
     
    282282               AND mergedvodbRun.state = 'full' \
    283283               AND mergedvodbRun.mergedvodb = '" + dvoDb + "' \
    284                AND stage = 'staticsky_multi'"
     284               AND stage = 'staticsky'"
    285285
    286286
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/initbatch.py

    r33353 r33948  
    5050    '''
    5151    def importIppTables(self, filter=""):
    52         self.logger.debug("importIppTables method here to satidfy base-class")
     52        self.logger.debug("importIppTables method here to satisfy base-class")
     53        return True
    5354
    5455    '''
     
    6364    def populatePspsTables(self):
    6465        self.logger.debug("No processing required for this batch type")
    65         return 1
     66        return True
    6667
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/ipptopsps.py

    r33711 r33948  
    3838        self.SECONDS = None
    3939
     40        self.createNewConfig = False
     41        self.rotateConfigs = False
     42        # a new config?
     43        if CONFIGNAME == "edit": self.createNewConfig = True
    4044        # should we rotate configs for this program?
    41         if CONFIGNAME == "all": self.rotateConfigs = True
    42         else:  self.rotateConfigs = False
     45        elif CONFIGNAME == "all": self.rotateConfigs = True
    4346
    4447        # set up config object
     
    4750
    4851        # create connection to databases database
    49         self.ippToPspsDb = IppToPspsDb(self.logger, self.config)
     52        try:
     53            self.ippToPspsDb = IppToPspsDb(self.logger, self.config)
     54        except:
     55            self.exitProgram("Could not connect to ipptopsps Db")
     56            raise
    5057
    5158        self.checkClientStatus()
     
    5966        self.logger.infoPair("Host", self.HOST)
    6067        self.logger.infoPair("PID", "%d" % self.PID)
    61         self.logger.infoPair("Config", CONFIGNAME)
     68        self.logger.infoPair("Config", self.config.name)
    6269
    6370    '''
     
    97104
    98105        # write message to log or stdout if no logger set up
    99         msg = sys.argv[0] + " <configName|all> " + extra
     106        msg = sys.argv[0] + " <configName|all|edit> " + extra
    100107        try:
    101108            self.logger.errorPair("Usage:", msg)
     
    103110            print "*** Usage: " + msg
    104111
    105 
    106112    '''
    107113    Refreshes the config then recreates objects with new settings
    108114    '''
    109115    def refreshConfig(self):
     116
     117        # new config?
     118        if self.createNewConfig:
     119            self.ippToPspsDb.editConfig()
     120            self.ippToPspsDb.setConfigForThisClient(self.config.name, self.HOST, self.PID)
     121            self.createNewConfig = False
    110122
    111123        # if we are rotating configs, then look for next active one in list
     
    163175        # write message to log or stdout if no logger set up
    164176        try:
    165             self.logger.infoPair("Program exited", exitReason)
     177            self.logger.infoPair(self.PROGNAME + " exited", exitReason)
    166178        except:
    167179            print "*** Program exited: " + exitReason
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/ipptopspsdb.py

    r33710 r33948  
    854854        return configs
    855855
    856 
    857     '''
    858     Writes current Config object to Db
    859     '''
    860     def writeConfig(self):
    861 
    862         sql = "UPDATE config \
    863                SET \
    864                datastore_product = '" + self.config.datastoreProduct + "' \
    865                ,datastore_type = '" + self.config.datastoreType + "' \
    866                ,datastore_publish = " + self.config.datastorePublishing + " \
    867                ,dvo_label = '" + self.config.dvoLabel + "' \
    868                ,dvo_location = '" + self.config.dvoLocation + "' \
    869                ,min_ra = " + self.config.minRa + " \
    870                ,max_ra = " + self.config.maxRa + " \
    871                ,min_dec = " + self.config.minDec + " \
    872                ,max_dec = " + self.config.maxDec + " \
    873                ,box_size = " + self.config.boxSize + " \
    874                ,base_path = '" + self.config.basePath + "' \
    875                ,data_release = " + self.config.dataRelease + " \
    876                ,delete_local = " + self.config.deleteLocal + " \
    877                ,delete_datastore = " + self.config.deleteDatastore + " \
    878                ,delete_dxlayer = " + self.config.deleteDxLayer + " \
    879                ,epoch = '" + self.config.epoch + "' \
    880                ,survey = '" + self.config.survey + "' \
    881                ,psps_survey = '" + self.config.pspsSurvey + "' \
    882                ,queue_P2 = " + self.config.queuingThisBatchType("P2") + " \
    883                ,queue_ST = " + self.config.queuingThisBatchType("ST") + " \
    884                ,queue_OB = " + self.config.queuingThisBatchType("OB") + " \
    885                WHERE name = '" + self.config.name + "'"
    886 
    887         self.execute(sql)
     856    '''
     857    Prompts user for info about a new or existing config and lets them neter the various details
     858    '''
     859    def editConfig(self):
     860
     861       print " ********************************************************************"
     862       print " *              Config editor"
     863       print " *"
     864       response = raw_input(" * Name for new config, or existing config to edit? ")
     865       if response == "": return
     866       self.config.name = response
     867
     868       # attempt to insert new config, if it already exists then carry on with update
     869       sql = "INSERT INTO config (name) VALUES ('" + self.config.name + "')"
     870       try:       
     871           self.execute(sql)
     872       except: pass
     873
     874       # for each column in the config table
     875       sql = "SHOW COLUMNS FROM config"
     876       rs = self.executeQuery(sql)
     877       while (rs.next()):
     878
     879           field = rs.getString(1)
     880           type = rs.getString(2)
     881           null = rs.getString(3)
     882
     883           # things we don;t want the user to edit
     884           if field == 'timestamp': continue
     885           if field == 'name': continue
     886
     887           # get current value for this field, if any
     888           try:
     889               rs2 = self.executeQuery("SELECT " + field + " FROM config WHERE name = '" + self.config.name + "'")
     890               rs2.first()
     891               default = rs2.getString(1)
     892           except: pass
     893
     894           question = " * " + field + " (" + type + ")"
     895
     896           # there may not be a default value
     897           try: question = question +  " hit return to accept default of: '" + default + "'"
     898           except: pass
     899
     900           # prompt the user for new value or to accept existing value
     901           question = question +  "? "
     902           response = raw_input(question)
     903           if response != "":
     904               if type.find("varchar") != -1 or type.find("timestamp") != -1: quotes = "'"
     905               else: quotes = ""
     906               self.execute("UPDATE config SET " + field + " = " + quotes + response + quotes + " WHERE name = '" + self.config.name + "'")
     907       
     908       print " *"
     909       print " ********************************************************************"
    888910
    889911    '''
     
    951973            else: self.config.datastorePublishing = False
    952974            self.config.dvoLabel = rs.getString(4)
     975
     976            # if dvoLabel is null is can break queries, so set to something
     977            if not self.config.dvoLabel: self.config.dvoLabel = "none"
    953978            self.config.dvoLocation = rs.getString(5)
    954979            self.config.minRa = rs.getDouble(6)
     
    12551280
    12561281        self.execute("CREATE TEMPORARY TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)")
    1257         count = 0
    12581282        for row in rows:
    12591283
     
    12621286                       VALUES (%d, %f, %f)" % (row[0], row[1], row[2])
    12631287                self.execute(sql)
    1264                 count += 1
    12651288            except: continue
    12661289
    1267         self.logger.infoPair("All items written to Db", "%d" % count)
     1290        count = self.getRowCount("all_pending")
     1291        self.logger.infoPair("Items written to Db", "%d" % count)
    12681292
    12691293    '''
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/loader.py

    r33677 r33948  
    4545                self.scratchDb.disconnect()
    4646                continue
    47             self.logger.infoPair("Using scratch Db", self.scratchDb.dbName)
    4847            break
    4948
    50         if not self.scratchDb.connected:
    51             self.logger.errorPair("Cannot connect to a", "scratch database")
     49        if not self.scratchDb.connected:
     50            self.exitProgram("Cannot connect to a scratch database")
     51            raise
    5252       
    5353        # create Datastore objects
     
    108108    '''
    109109    def run(self):
     110
     111        if not self.scratchDb.connected: return
    110112
    111113        numAttempts = 0
     
    152154                    if batchType != "OB":
    153155                        # look in DVO for this box (with extra border)
    154                         #self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSizeWithBorder)
    155                         self.dvoDetections.setSkyArea()
     156                        self.logger.infoPair("Querying DVO for this sky area", "")
     157                        self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSizeWithBorder)
     158                        #self.dvoDetections.setSkyArea()
    156159                        sizeToBeIngested = self.dvoDetections.getDiskSizeOfRegionsToBeIngested()
    157160                        if sizeToBeIngested == 0.0: smfsPerGB = 999999999
     
    160163                        self.logger.infoPair("smfs-per-GB", "%.1f" % smfsPerGB)
    161164                        # should do we pre-ingest stuff from DVO?
    162                         if smfsPerGB > 30:
     165                        if batchType == 'P2' and smfsPerGB > 30:
    163166                            if not self.dvoDetections.sync():
    164167                                self.logger.errorPair("Could not sync DVO with MySQL", "skipping")
     
    195198   
    196199            self.ippToPspsDb.unlockTables()
     200            self.ippToPspsDb.deletePendingItem(batchType, id)
     201
     202            # catch any raised exceptions in batch constructors
     203            try:
     204                if batchType == "P2":
     205                    batch = DetectionBatch(self.logger,
     206                            self.config,
     207                            self.gpc1Db,
     208                            self.ippToPspsDb,
     209                            self.scratchDb,
     210                            id,
     211                            batchID,
     212                            useFullTables)
     213                elif batchType == "ST":
     214                    batch = StackBatch(self.logger,
     215                            self.config,
     216                            self.gpc1Db,
     217                            self.ippToPspsDb,
     218                            self.scratchDb,
     219                            id,
     220                            batchID,
     221                            useFullTables)
     222   
     223                elif batchType == "OB":
     224                    batch = ObjectBatch(self.logger,
     225                            self.config,
     226                            self.gpc1Db,
     227                            self.ippToPspsDb,
     228                            self.scratchDb,
     229                            id,
     230                            batchID,
     231                            useFullTables)
     232   
     233                batch.run()
    197234   
    198             self.ippToPspsDb.deletePendingItem(batchType, id)
    199 
    200             if batchType == "P2":
    201                 batch = DetectionBatch(self.logger,
    202                         self.config,
    203                         self.gpc1Db,
    204                         self.ippToPspsDb,
    205                         self.scratchDb,
    206                         id,
    207                         batchID,
    208                         useFullTables)
    209             elif batchType == "ST":
    210                 batch = StackBatch(self.logger,
    211                         self.config,
    212                         self.gpc1Db,
    213                         self.ippToPspsDb,
    214                         self.scratchDb,
    215                         id,
    216                         batchID,
    217                         useFullTables)
    218    
    219             elif batchType == "OB":
    220                 batch = ObjectBatch(self.logger,
    221                         self.config,
    222                         self.gpc1Db,
    223                         self.ippToPspsDb,
    224                         self.scratchDb,
    225                         id,
    226                         batchID,
    227                         useFullTables)
    228    
    229             batch.run()
    230    
     235            # if batch fails, ignore and move on to the next one
     236            except:
     237                self.logger.errorPair("Problem with this %s batch (%d)" % (batchType, id), "skipping")
     238                pass
     239
    231240            if not self.checkClientStatus(): return False
    232241   
     
    253262    loader = Loader(sys.argv)
    254263    loader.run()
    255     loader.exitProgram("finished")
     264    loader.exitProgram("completed")
    256265except Exception, e:
    257266    print str(e)
    258267    traceback.print_exc()
     268
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/metrics.py

    r33712 r33948  
    191191Start of program.
    192192'''
    193 metrics = Metrics(sys.argv)
    194 metrics.run()
    195 metrics.exitProgram("finished")
    196 
    197 
    198 
     193try:
     194    metrics = Metrics(sys.argv)
     195    metrics.run()
     196    metrics.exitProgram("completed")
     197except: pass
     198
     199
     200
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/mysql.py

    r33683 r33948  
    3434        self.dbPass = config.getDbPassword(dbType)
    3535
     36        # a user friendly connection sring
     37        connectionStr = self.dbName + "@" + self.dbHost
     38
    3639        # set up JDBC connection
    3740        self.url = "jdbc:mysql://"+self.dbHost+"/"+self.dbName+"?autoReconnect=true&user="+self.dbUser+"&password="+self.dbPass
     
    3942            self.con = DriverManager.getConnection(self.url)
    4043            self.connectionID = self.getLastConnectionID()
    41             self.logger.debug("MySQL connection to %s with ID %d" % (dbType, self.connectionID))
     44            self.logger.infoPair("Connected to MySQL Db", connectionStr)
    4245        except:
    43             self.logger.error("Unable to connect to " + self.url)
    44             self.everythingOK = False # TODO need this?
     46            self.logger.errorPair("Unable to connect to", connectionStr)
    4547            self.connected = False
    46             return
    47 
    48         self.everythingOK = True
     48            raise
     49
    4950        self.connected = True
    5051
     
    8889        sql = "KILL %d" % connectionID
    8990        self.execute(sql)
     91
     92    '''
     93    Checks whether this table exists
     94    '''
     95    def tableExists(self, tableName):
     96
     97        sql = "SELECT COUNT(*) \
     98               FROM information_schema.tables \
     99               WHERE table_schema = '" + self.dbName + "' \
     100               AND table_name = '" + tableName + "'"
     101
     102        try:
     103            rs = self.executeQuery(sql)
     104            rs.first()
     105            if rs.getInt(1) > 0: return True
     106            else: return False
     107        except:
     108            self.logger.errorPair("Could not check if table exists", sql)
     109            pass
     110
     111        return False
    90112
    91113    '''
     
    159181
    160182    '''
     183    Drops a list of tables
     184    '''
     185    def dropTables(self, tables):
     186        for table in tables: self.dropTable(table)
     187
     188    '''
    161189    Drops a table
    162190    '''
     
    224252        except: pass
    225253            #self.logger.warn("Index already in place on '" + column + "' for table '" + table + "'")
     254
     255    '''
     256    Checks that we have a connection
     257    '''
     258    def isConnected(self):
     259
     260        try:
     261            self.con
     262            self.connected = True
     263        except:
     264            self.logger.errorPair("Not connected to", self.url)
     265            self.connected = False
     266
     267        return self.connected
     268
    226269    '''
    227270    TODO
    228271    '''
    229272    def execute(self, sql):
     273
     274        if not self.isConnected(): raise
    230275
    231276        stmt = self.con.createStatement()
     
    238283    def executeQuery(self, sql):
    239284
     285        if not self.isConnected(): raise
     286 
    240287        stmt = self.con.createStatement()
    241288        rs = stmt.executeQuery(sql)
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/objectbatch.py

    r33715 r33948  
    5151               1)
    5252
    53        if not self.everythingOK: return
    54 
    55        self.dvoObjects = DvoObjects(self.logger, self.config, self.scratchDb.dbName)
     53       try:
     54           self.dvoObjects = DvoObjects(self.logger, self.config, self.scratchDb.dbName)
     55       except:
     56           self.logger.errorPair("Unable to create instance of", "DvoObjects")
     57           raise
    5658
    5759       # create an output filename, which is {dvoINDEX}.FITS
     
    7880    def alterPspsTables(self):
    7981
    80         self.logger.debug("Altering PSPS tables")
     82        # dec is reserved in MySQL, so STILTS replaces if with dec_, which PSPS doesn't like. so, force it back again using ``
     83        self.scratchDb.execute("ALTER TABLE Object CHANGE dec_ `dec` double")
     84
    8185        return True
    8286
     
    9599    def insertMags(self, cpsTable):
    96100
    97         # list of all filters we are interested in
    98         allFilters = ['g', 'r', 'i', 'z', 'y']
     101        # list of all filters PSPS is interested in
     102        interestedFilters = ['g', 'r', 'i', 'z', 'y']
    99103       
    100         # this loop looks into the DVO Photcodes tables and gets the 'CODE' for each the filters above that are listed
    101         filters = []
    102         for filter in allFilters:
    103             code = self.scratchDb.getCodeForThisFilter(filter)
    104             if code < 0: continue
    105             filters.append([code, filter])
     104        filters = self.scratchDb.getOrderedListOfFiltersFromPhotcodesTable(interestedFilters)
    106105   
    107106        # get a count of the available filters
    108107        filterCount = len(filters)
    109108
    110         self.logger.infoPair("Available filters", filters)
     109        self.logger.infoPair("Available filters in Photcodes", filters)
    111110
    112111        # the 'code' now defines the order in the cps file that the mags are listed for a given filter
     112        self.logger.infoPair("Adding magnitudes from", "cps table")
    113113        for filter in filters:
    114114
    115115            sql = "UPDATE Object \
    116                    JOIN " + cpsTable + " AS cps ON (cps.row = (Object.row*" + str(filterCount) + ")-" + str(filter[0]) + ") \
     116                   JOIN " + cpsTable + " AS cps ON (cps.row = (Object.row*" + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) \
    117117                   SET \
    118118                   n" + filter[1] + " = NCODE \
     
    120120                   ," + filter[1] + "MeanFlux = 3631 * POW(10.0, (-0.4*MAG)) \
    121121                   ," + filter[1] + "MeanMagErr = MAG_ERR \
    122                    ," + filter[1] + "Min = MAG_20 \
    123                    ," + filter[1] + "Max = MAG_80 \
     122                   ," + filter[1] + "Min = MAG_20/1000 \
     123                   ," + filter[1] + "Max = MAG_80/1000 \
    124124                   "
    125 
     125           
     126            self.scratchDb.execute(sql)
     127
     128        # now set to null all MeanMagErr values > 0.5 (cut set by Gene, 2012-04-12)
     129        cut = 0.5
     130        self.logger.infoPair("Setting to NULL all MeanMagErr value >", "%f" % cut)
     131        for filter in filters:
     132
     133            sql = "UPDATE Object \
     134                   SET " + filter[1] + "MeanMagErr = null \
     135                   WHERE " + filter[1] + "MeanMagErr > " + str(cut)
    126136            self.scratchDb.execute(sql)
    127137
     
    131141    def updateColors(self):
    132142
     143        self.logger.infoPair("Calculating", "colors")
    133144        sql = "UPDATE Object \
    134145               SET \
     
    147158            self.logger.errorPair("Couldn't calculate colors", sql)
    148159
    149 
    150     '''
    151     Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
    152     '''
    153     def populatePspsTables(self):
     160    '''
     161    Populates the Object table
     162    '''
     163    def populateObjectTable(self):
    154164
    155165        cptTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cpt")
    156166        cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps")
    157167
    158         self.logger.infoPair("Inserting objects from", "cpt")
    159         sql = "INSERT INTO Object (\
     168        self.logger.infoPair("Populating", "ObjectCalColor")
     169        self.logger.infoPair("Inserting objects from", "cpt file")
     170
     171        # note `` around dec here, as this is a reserved word in MySQL
     172        sql = "INSERT IGNORE INTO Object (\
    160173               objID \
    161174               ,ippObjID \
    162175               ,objInfoFlag \
     176               ,varFlag \
    163177               ,surveyID \
    164178               ,ra \
    165                ,dec_ \
     179               ,`dec` \
    166180               ,raErr \
    167181               ,decErr \
    168182               ,nDetections \
     183               ,dataRelease \
    169184               ) \
    170185               SELECT \
     
    172187               ,CAT_ID*1000000000 + OBJ_ID \
    173188               ,FLAGS \
     189               ,0 \
    174190               ," + str(self.surveyID) + " \
    175191               ,RA \
     
    178194               ,DEC_ERR \
    179195               ,NMEASURE \
     196               , " + str(self.config.dataRelease) + "\
    180197               FROM " + cptTableName
    181198
     
    184201        except:
    185202            self.logger.errorPair("Couldn't populate Object table", sql)
     203            return False
    186204
    187205        # add row count columns so we can perform joins to get colors
     
    190208        self.scratchDb.addRowCountColumn(cpsTableName, "row")
    191209
    192         self.logger.infoPair("Adding magnitudes from", "cps table")
    193210        self.insertMags(cpsTableName)
    194211
    195         self.logger.infoPair("Calculating", "colors")
    196212        self.updateColors()
    197213
     
    205221        return True
    206222
     223    '''
     224    Populates the ObjectCalColor table
     225    '''
     226    def populateObjectCalColorTable(self):
     227
     228        self.logger.infoPair("Populating", "ObjectCalColor")
     229
     230        sql = "INSERT INTO ObjectCalColor ( \
     231               objID \
     232               ,ippObjID \
     233               ,dataRelease \
     234               ) \
     235               SELECT \
     236               objID \
     237               ,ippObjID \
     238               ,dataRelease \
     239               FROM Object"
     240        try:
     241            self.scratchDb.execute(sql)
     242        except:
     243            self.logger.errorPair("Couldn't populate ObjectCalColor table", sql)
     244            return False
     245
     246        return True
     247
     248    '''
     249    Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
     250    '''
     251    def populatePspsTables(self):
     252
     253        if not self.populateObjectTable(): return False
     254        #if not self.populateObjectCalColorTable(): return False
     255
     256        # now remove the objID duplicates. We could not do this before as cpt/cps tables relate by row number
     257        self.logger.infoPair("Forcing uniqueness on", "objID in Object table")
     258        rowCountBefore = self.scratchDb.getRowCount("Object")
     259        self.scratchDb.execute("ALTER IGNORE TABLE Object ADD UNIQUE INDEX(objID)")
     260        rowCountAfter = self.scratchDb.getRowCount("Object")
     261        self.logger.infoPair("Number of duplicated objIDs removed", "%d out of %d" % ((rowCountBefore - rowCountAfter), rowCountBefore))
     262
     263        return True
     264
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/odm.py

    r33559 r33948  
    7878                DETAILS = doc.find("{%s}OdmBatchState/{%s}Details" % (NAMESPACE, NAMESPACE)).text
    7979                results['DETAILS'] = DETAILS
    80             if re.search("processing", STATE):
     80            elif re.search("processing", STATE):
    8181                loadedToODM = 1
    8282            if re.search("MergeWorthy", MESSAGE):
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/plot.py

    r33685 r33948  
    6262
    6363        f.flush()
     64        f.close()
    6465        #os.remove(tempFilename)
    6566
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/plotter.py

    r33679 r33948  
    3939Start of program
    4040'''
    41 plotter = Plotter(sys.argv)
    42 plotter.exitProgram("finished")
     41try:
     42    plotter = Plotter(sys.argv)
     43    plotter.exitProgram("completed")
     44except: pass
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/pollOdm.py

    r33709 r33948  
    4242        else: self.stages = [self.STAGE]
    4343
    44         if self.BATCHTYPE == "all": self.batchTypes = ['P2', 'ST', 'OB']
     44        if self.BATCHTYPE == "all": self.batchTypes = ['IN', 'P2', 'ST', 'OB']
    4545        else: self.batchTypes = [self.BATCHTYPE]
    4646
     
    126126    '''
    127127    def printUsage(self):
    128         super(PollOdm, self).printUsage("<P2|ST|OB|all> <unloaded|unmergeworthy|unmerged|all> [hours]")
     128        super(PollOdm, self).printUsage("<IN|P2|ST|OB|all> <unloaded|unmergeworthy|unmerged|all> [hours]")
    129129   
    130130   
     
    132132Program starts here
    133133'''
    134 pollodm = PollOdm(sys.argv)
    135 pollodm.run()
    136 pollodm.exitProgram("finished")
     134try:
     135    pollodm = PollOdm(sys.argv)
     136    pollodm.run()
     137    pollodm.exitProgram("completed")
     138except: pass
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/queue.py

    r33674 r33948  
    2727        super(Queue, self).__init__(argv)
    2828
    29 
    3029        # create various objects
    3130        self.gpc1Db = Gpc1Db(self.logger, self.config)
    3231        self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb)
    33         self.dvoObjects = DvoObjects(self.logger, self.config)
     32        try:
     33            self.dvoObjects = DvoObjects(self.logger, self.config)
     34        except:
     35            self.exitProgram("Unable to create instance of DvoObject")
     36            raise
    3437
    3538        self.config.printAll()
     
    115118                       while dec <= self.config.maxDec:
    116119           
    117                            self.checkClientStatus()
    118120                           box_id = self.ippToPspsDb.insertBox(ra, dec)
    119121           
     
    134136                self.logger.info("+-------------+-------------+-------------+-------------+")
    135137
     138            self.checkClientStatus()
    136139            if not self.waitForPollTime(): break
    137140
     
    158161    '''
    159162    def printUsage(self):
    160         super(Cleanup, self).printUsage("[<repeat time in hours>]")
     163        super(Queue, self).printUsage("[<repeat time in hours>]")
    161164
    162165
     
    164167Start of program.
    165168'''
    166 queue = Queue(sys.argv)
    167 queue.run()
    168 queue.exitProgram("finished")                             
     169try:
     170    queue = Queue(sys.argv)
     171    queue.run()
     172    queue.exitProgram("completed")
     173except: pass
     174
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/run.sh

    r33717 r33948  
    1 ~/jre1.7.0/bin/java -Xbootclasspath/a:../jars/stilts.jar:../jars/commons-math-2.2.jar:../jars/mysql-connector-java-5.1.14-bin.jar -jar ~/jython2.5.3b1/jython.jar $1 $2 $3 $4 $5 $6 $7 $8 $9
     1~ipp/jre1.7.0_03/bin/java -Xbootclasspath/a:../jars/stilts.jar:../jars/commons-math-2.2.jar:../jars/mysql-connector-java-5.1.14-bin.jar -jar ~/jython2.5.3b1/jython.jar $1 $2 $3 $4 $5 $6 $7 $8 $9
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/scratchdb.py

    r33689 r33948  
    278278            rs.close()
    279279        except:
    280             self.logger.errorPai("Can't query for ingested regions", sql)
     280            self.logger.errorPair("Can't query for ingested regions", sql)
    281281
    282282        return regions
     
    408408                    self.logger.errorPair("Unable to delete " + fileType + " file from", self.dvoDoneTable)
    409409
    410                sql = "DROP TABLE " + self.getDbFriendlyTableName(region + "." + fileType)
    411                self.execute(sql)
     410               tableName = self.getDbFriendlyTableName(region + "." + fileType)
     411               sql = "DROP TABLE " + tableName
     412               try: self.execute(sql)
     413               except:
     414                    self.logger.errorPair("Unable to drop table", tableName)
     415                    pass
    412416
    413417        deletedDetectionCount = detectionCount - self.getRowCount(self.dvoDetectionTable)
     
    540544
    541545    '''
    542     Gets the 'code' for the provided filter
    543     '''
    544     def getCodeForThisFilter(self, filter):
    545 
    546         code = -1
    547         sql = "SELECT CODE FROM " + self.dvoPhotcodesTable + " WHERE NAME = '" + filter + "'"
    548         try:
    549             rs = self.executeQuery(sql)
    550             rs.first()
    551             code = rs.getInt(1)
     546    Gets a list of filters ordered as thy are in the DVO Photcodes table, as this reflects the order they apper in the cps file
     547    '''
     548    def getOrderedListOfFiltersFromPhotcodesTable(self, interestedFilters):
     549
     550        sql = "SELECT NAME FROM " + self.dvoPhotcodesTable + " WHERE "
     551
     552        count = 0
     553        for filter in interestedFilters:
     554           if count != 0: sql = sql + " OR "
     555           sql = sql + " name = '" + filter + "'"
     556           count += 1
     557
     558        sql = sql + " ORDER BY CODE"
     559
     560        orderedFilters = []
     561        try:
     562            rs = self.executeQuery(sql)
     563            row = 1
     564            while (rs.next()):
     565                orderedFilters.append([row,rs.getString(1)])
     566                row += 1
    552567            rs.close()
    553568        except:
    554             self.logger.errorPair("Could not get filter code using", sql )
    555 
    556         return code
    557 
     569            self.logger.errorPair("Could not get ordered filter list", sql )
     570
     571        return orderedFilters
     572
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/setupScratchDb.py

    r33589 r33948  
    2525            self.exitProgram("incorrect args")
    2626
    27         self.scratchDb = ScratchDb(self.logger, self.config, argv[2])
     27        try:
     28            self.scratchDb = ScratchDb(self.logger, self.config, argv[2])
     29        except:
     30            self.exitProgram("Could not connect to a scratch Db")
     31            raise
    2832
    2933
     
    5256Program starts here
    5357'''
    54 setupScratchDb = SetupScratchDb(sys.argv)
    55 setupScratchDb.run()
    56 setupScratchDb.exitProgram("finished")
     58try:
     59    setupScratchDb = SetupScratchDb(sys.argv)
     60    setupScratchDb.run()
     61    setupScratchDb.exitProgram("completed")
     62except: pass
    5763
    5864
  • branches/eam_branches/ipp-20120405/ippToPsps/jython/stackbatch.py

    r33530 r33948  
    5050               useFullTables)
    5151
    52        if not self.everythingOK: return
    53 
    5452       self.stackType = "DEEP_STACK" # TODO
    5553
     
    5755       meta = self.gpc1Db.getStackStageMeta(self.id)
    5856       if not meta:
    59            self.everythingOK = False
    60            return
     57           self.logger.errorPair("Could not get stack", "metadata")
     58           raise
    6159
    6260       self.filter = meta[0];
     
    366364               ,X_PSF_SIG \
    367365               ,Y_PSF_SIG \
    368                ,POW(10.0, (-0.4*PSF_INST_MAG)) / "+str(self.expTime)+" \
    369                ,ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / "+str(self.expTime)+")) / 1.085736) \
    370                ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / "+str(self.expTime)+" \
     366               ,POW(10.0, (-0.4*PSF_INST_MAG)) / " + str(self.expTime) + " \
     367               ,ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / " + str(self.expTime) + ")) / 1.085736) \
     368               ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / " + str(self.expTime) + " \
    371369               ,SKY \
    372370               ,SKY_SIGMA \
     
    389387               ,AP_MAG \
    390388               , NULL \
    391                ,KRON_FLUX \
    392                ,KRON_FLUX_ERR \
     389               ,KRON_FLUX / " + str(self.expTime) + " \
     390               ,KRON_FLUX_ERR / " + str(self.expTime) + " \
    393391               , NULL \
    394392               , NULL \
  • branches/eam_branches/ipp-20120405/ippToPsps/perl/pspsSchema2xml.pl

    r31759 r33948  
    44#
    55# Script that searches a dir containing PSPS schema files, finds those that comtain the
    6 # tables on interest then parses them into an XML format. Also generates C-header files
    7 # containing enums that detail table column names and numbers.
     6# tables on interest then parses them into the VOTable format. Also generates trac-wiki
     7# formatted tables.
    88#
    99#######################################################################################
     
    5151
    5252my $enumsHeader = ucfirst($type)."BatchEnums";
    53 open(OUT, ">".$enumsHeader.".h") or die("Error");
    54 
    55 print OUT "#ifndef ".uc($enumsHeader)."_H\n";
    56 print OUT "#define ".uc($enumsHeader)."_H\n\n";
    57 
    58 # tables file
    59 my $tablesOutput = new IO::File(">tables.xml");
    60 my $tablesWriter = new XML::Writer(OUTPUT => $tablesOutput, DATA_MODE => 1, DATA_INDENT=>2);
    61 $tablesWriter->xmlDecl('UTF-8');
    62 $tablesWriter->startTag('tableDescriptions', "type" => "$type");
    63 
    64 # map file
    65 my $mapOutput = new IO::File(">map.xml");
    66 my $mapWriter = new XML::Writer(OUTPUT => $mapOutput, DATA_MODE => 1, DATA_INDENT=>2);
    67 $mapWriter->xmlDecl('UTF-8');
    68 $mapWriter->startTag('tabledata', "type" => "$type");
    6953
    7054# VOTable file
     
    8266
    8367# finish up XML
    84 $tablesWriter->endTag();
    85 $tablesWriter->end();
    86 
    87 # finish up XML
    88 $mapWriter->endTag();
    89 $mapWriter->end();
    90 
    91 # finish up XML
    9268$votWriter->endTag(); # end RESOURCE tag
    9369$votWriter->endTag(); # end of TABLE tag
    9470$votWriter->end();
    9571
    96 print OUT "\n#endif";
    97 close OUT;
    9872close WIKI;
    9973
     
    208182
    209183    parseTable("Object");
     184    #parseTable("ObjectCalColor");
    210185}
    211186
     
    230205    print WIKI "|| '''!".$tableNameOut."''' ||||||||||||||\n";
    231206    print WIKI "|| '''ODM attribute''' || '''units''' || '''Data type''' || '''Default''' || '''Description''' || '''IPP source''' || '''IPP variable/notes''' ||\n";
    232     print OUT "\ntypedef enum {\n";
    233     $tablesWriter->startTag('table', "name" => $tableNameOut);
    234     $mapWriter->startTag('table',
    235             "name" => $tableNameOut,
    236             "ippfitsextension" => "");
    237207    $votWriter->startTag('TABLE',
    238208            "name" => "$tableNameOut");
     
    287257
    288258    if (!$found) {print "Could not find table '$tableName'\n";}
    289     $tablesWriter->endTag();
    290     $mapWriter->endTag();
    291259
    292260    $votWriter->startTag('DATA');
     
    295263        $votWriter->endTag(); # end DATA tag
    296264        $votWriter->endTag(); # end TABLE tag
    297         print OUT "} ".$tableNameOut.";\n";
    298265
    299266    close SCHEMA;
     
    384351    $colNum++;
    385352
    386     print OUT "  ".uc($tableName)."_".uc($name)." = ".$colNum.",\n";
    387353    print WIKI "|| ".$name."||".$unit."||".$mstype."||".$default."||".$comment."|| || ||\n";
    388 
    389     $tablesWriter->startTag('column',
    390             "name" => $name,
    391             "type" => $type,
    392             "default" => $default,
    393             "comment" => $fullComment);
    394     $tablesWriter->endTag();
    395354
    396355    # get VOTable type
     
    413372    $votWriter->endTag();
    414373
    415     $mapWriter->comment(" **MISSING** <map pspsName=\"$name\" ippType=\"$type\" ippName=\"\" comment=\"$fullComment\"/>");
    416 
    417 #    $mapWriter->endTag();
    418 
    419374    return $colNum;
    420375}
  • branches/eam_branches/ipp-20120405/ippToPsps/src/Dvo.c

    r33595 r33948  
    188188    this->dvoConfig = dvoConfigRead(&argc, argv);
    189189
    190     for (int i=0; i<argc; i++) free(argv[i]);
    191     free(argv);
     190    //for (int i=0; i<argc; i++) free(argv[i]);
     191    //free(argv);
    192192
    193193    // method pointers
  • branches/eam_branches/ipp-20120405/ippconfig

  • branches/eam_branches/ipp-20120405/ippconfig/Makefile.am

    r33208 r33948  
    33        isp \
    44        gpc1 \
     5        gpc1-tdi \
    56        cfh12k \
    67        megacam \
  • branches/eam_branches/ipp-20120405/ippconfig/cfh12k/camera.config

    r26265 r33948  
    122122  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    123123  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     124  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    124125  CMF.DETEFF STR {CHIP.NAME}.deteff
    125126
  • branches/eam_branches/ipp-20120405/ippconfig/configure.ac

    r33211 r33948  
    1414  isp/Makefile
    1515  gpc1/Makefile
     16  gpc1-tdi/Makefile
    1617  cfh12k/Makefile
    1718  megacam/Makefile
  • branches/eam_branches/ipp-20120405/ippconfig/esowfi/camera.config

    r26265 r33948  
    8989  CMF.XSRC   STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    9090  CMF.XFIT   STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     91  CMF.XRAD   STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    9192  CMF.DETEFF STR {CHIP.NAME}.deteff
    9293
  • branches/eam_branches/ipp-20120405/ippconfig/gpc1/ghost.model.mdc

    r23814 r33948  
     1# Original center models
     2# GHOST.CENTER.X METADATA
     3#   NORDER_X S32 3
     4#   NORDER_Y S32 3
     5#   VAL_X00_Y00  F64 -4.421024e+01
     6#   VAL_X01_Y00  F64 1.216270e-02
     7#   VAL_X02_Y00  F64 -9.721643e-08
     8#   VAL_X03_Y00  F64 9.976554e-11
     9#   VAL_X00_Y01  F64 -1.762476e-03
     10#   VAL_X01_Y01  F64 1.247212e-07
     11#   VAL_X02_Y01  F64 3.629557e-11
     12#   VAL_X00_Y02  F64 -1.040174e-07
     13#   VAL_X01_Y02  F64 1.074674e-10
     14#   VAL_X00_Y03  F64 1.564112e-11
     15#   NELEMENTS  S32 10
     16# END
     17
     18# GHOST.CENTER.Y METADATA
     19#   NORDER_X S32 3
     20#   NORDER_Y S32 3
     21#   VAL_X00_Y00  F64 -2.189470e+00
     22#   VAL_X01_Y00  F64 -4.186514e-03
     23#   VAL_X02_Y00  F64 1.131554e-07
     24#   VAL_X03_Y00  F64 1.415192e-11
     25#   VAL_X00_Y01  F64 1.569104e-02
     26#   VAL_X01_Y01  F64 -1.782801e-07
     27#   VAL_X02_Y01  F64 8.179602e-11
     28#   VAL_X00_Y02  F64 2.577055e-07
     29#   VAL_X01_Y02  F64 8.879423e-11
     30#   VAL_X00_Y03  F64 5.767429e-11
     31#   NELEMENTS  S32 10
     32# END
     33
     34# Updated models of 2012-05-07
     35# Corrected(?) parity
     36# GHOST.CENTER.X METADATA
     37#   NORDER_X S32 3
     38#   NORDER_Y S32 3
     39#   VAL_X00_Y00  F64  3.314569e+01
     40#   VAL_X01_Y00  F64  1.110664e-02
     41#   VAL_X02_Y00  F64 -1.904158e-07
     42#   VAL_X03_Y00  F64  8.470224e-11
     43#   VAL_X00_Y01  F64 -1.616877e-03
     44#   VAL_X01_Y01  F64  1.646508e-07
     45#   VAL_X02_Y01  F64  5.623381e-11
     46#   VAL_X00_Y02  F64 -2.342888e-07
     47#   VAL_X01_Y02  F64  1.023761e-10
     48#   VAL_X00_Y03  F64  2.836980e-11
     49#   NELEMENTS  S32 10
     50# END
     51
     52# GHOST.CENTER.Y METADATA
     53#   NORDER_X S32 3
     54#   NORDER_Y S32 3
     55#   VAL_X00_Y00  F64 -2.860068e+01
     56#   VAL_X01_Y00  F64 -8.790076e-03
     57#   VAL_X02_Y00  F64  2.456534e-07
     58#   VAL_X03_Y00  F64  2.947749e-11
     59#   VAL_X00_Y01  F64  1.948855e-02
     60#   VAL_X01_Y01  F64 -2.639927e-07
     61#   VAL_X02_Y01  F64  4.951474e-11
     62#   VAL_X00_Y02  F64  4.341716e-07
     63#   VAL_X01_Y02  F64  1.643046e-10
     64#   VAL_X00_Y03  F64 -1.737983e-12
     65#   NELEMENTS  S32 10
     66# END
     67
     68# Switched order
    169GHOST.CENTER.X METADATA
    270  NORDER_X S32 3
    371  NORDER_Y S32 3
    4   VAL_X00_Y00  F64 -4.421024e+01
    5   VAL_X01_Y00  F64 1.216270e-02
    6   VAL_X02_Y00  F64 -9.721643e-08
    7   VAL_X03_Y00  F64 9.976554e-11
    8   VAL_X00_Y01  F64 -1.762476e-03
    9   VAL_X01_Y01  F64 1.247212e-07
    10   VAL_X02_Y01  F64 3.629557e-11
    11   VAL_X00_Y02  F64 -1.040174e-07
    12   VAL_X01_Y02  F64 1.074674e-10
    13   VAL_X00_Y03  F64 1.564112e-11
     72  VAL_X00_Y00  F64 -1.215661e+02
     73  VAL_X01_Y00  F64  1.321875e-02
     74  VAL_X02_Y00  F64 -4.017026e-09
     75  VAL_X03_Y00  F64  1.148288e-10
     76  VAL_X00_Y01  F64 -1.908074e-03
     77  VAL_X01_Y01  F64  8.479150e-08
     78  VAL_X02_Y01  F64  1.635732e-11
     79  VAL_X00_Y02  F64  2.625405e-08
     80  VAL_X01_Y02  F64  1.125586e-10
     81  VAL_X00_Y03  F64  2.912432e-12
    1482  NELEMENTS  S32 10
    1583END
     
    1886  NORDER_X S32 3
    1987  NORDER_Y S32 3
    20   VAL_X00_Y00  F64 -2.189470e+00
    21   VAL_X01_Y00  F64 -4.186514e-03
    22   VAL_X02_Y00  F64 1.131554e-07
    23   VAL_X03_Y00  F64 1.415192e-11
    24   VAL_X00_Y01  F64 1.569104e-02
    25   VAL_X01_Y01  F64 -1.782801e-07
    26   VAL_X02_Y01  F64 8.179602e-11
    27   VAL_X00_Y02  F64 2.577055e-07
    28   VAL_X01_Y02  F64 8.879423e-11
    29   VAL_X00_Y03  F64 5.767429e-11
     88  VAL_X00_Y00  F64  2.422174e+01
     89  VAL_X01_Y00  F64  4.170486e-04
     90  VAL_X02_Y00  F64 -1.934260e-08
     91  VAL_X03_Y00  F64 -1.173657e-12
     92  VAL_X00_Y01  F64  1.189352e-02
     93  VAL_X01_Y01  F64 -9.256748e-08
     94  VAL_X02_Y01  F64  1.140772e-10
     95  VAL_X00_Y02  F64  8.123932e-08
     96  VAL_X01_Y02  F64  1.328378e-11
     97  VAL_X00_Y03  F64  1.170865e-10
    3098  NELEMENTS  S32 10
    3199END
    32100
     101
     102
     103# These are semi-major/minor axes
     104# These are my (CZW) quadratic solutions
     105# GHOST.INNER.MAJOR METADATA
     106#   NORDER_X S32 2
     107#   VAL_X00  F64 2.2622e+01
     108#   VAL_X01  F64 1.3822e-02
     109#   VAL_X02  F64 -3.7005e-07
     110#   NELEMENTS  S32 3
     111# END
     112
     113# GHOST.INNER.MINOR METADATA
     114#   NORDER_X S32 2
     115#   VAL_X00  F64 4.9626e+01
     116#   VAL_X01  F64 -2.4257e-04
     117#   VAL_X02  F64 -1.2007e-07
     118#   NELEMENTS  S32 3
     119# END
     120
     121# GHOST.OUTER.MAJOR METADATA
     122#   NORDER_X S32 2
     123#   VAL_X00  F64 9.6490e+01
     124#   VAL_X01  F64 9.4250e-03
     125#   VAL_X02  F64 6.5680e-07
     126#   NELEMENTS  S32 3
     127# END
     128
     129# GHOST.OUTER.MINOR METADATA
     130#   NORDER_X S32 2
     131#   VAL_X00  F64 9.5450e+01
     132#   VAL_X01  F64 2.8775e-03
     133#   VAL_X02  F64 -3.1409e-07
     134#   NELEMENTS  S32 3
     135# END
     136
     137# These are the original linear solutions
    33138GHOST.INNER.MAJOR METADATA
    34139  NORDER_X S32 1
  • branches/eam_branches/ipp-20120405/ippconfig/gpc1/ppImage.config

    r33642 r33948  
    2525NOISEMAP                BOOL    FALSE          # Apply read noise map
    2626
    27 
     27# Final detrending options
     28HAS.VIDEO       BOOL    FALSE           # Treat this OTA as if it has video data
     29USE.VIDEO.DARK  BOOL    FALSE           # Use a video dark if we have video data?
     30USE.VIDEO.MASK  BOOL    TRUE            # Use a video mask if we have video data?
    2831
    2932
  • branches/eam_branches/ipp-20120405/ippconfig/gpc1/psastro.config

    r33668 r33948  
    113113
    114114# *** make sure the choice of CATDIR (dvo database) contains the photcodes desired below
    115 PSASTRO.CATDIR              STR      SYNTH.GRIZY
     115# PSASTRO.CATDIR              STR      SYNTH.GRIZY
     116PSASTRO.CATDIR          STR     PS1.REF.20120503
     117
    116118DVO.GETSTAR.PHOTCODE        STR      i
    117119DVO.GETSTAR.MAX.RHO         F32      3000.0
     
    130132  ZEROPT   F32 24.563
    131133  PHOTCODE STR g
    132   GHOST_MAX_MAG                   F32 -20.0
     134  GHOST_MAX_MAG                   F32 -16.5
    133135END
    134136PHOTCODE.DATA METADATA
     
    346348  PSASTRO.MATCH.FIT.NITER S32    5
    347349
    348   PSASTRO.CATDIR        STR     STS.PP5.REFCAT
     350  # CATDIR with PS1 astrometry from PP5 pointing. Only works for that field
     351  # PSASTRO.CATDIR      STR     STS.PP5.REFCAT
    349352END
    350353
    351354DEFAULT_RECIPE METADATA
    352    PSASTRO.CATDIR               STR     PS1.REF.20120325
     355   PSASTRO.CATDIR               STR     PS1.REF.20120503
    353356   ZERO.POINT.USE.MEAN          BOOL    TRUE 
    354357END
     
    356359LAP_ASTRO METADATA
    357360#  PSASTRO.CATDIR                STR      3PI.20110505.REFCAT
    358    PSASTRO.CATDIR                STR      SYNTH.GRIZY
    359 END
     361#   PSASTRO.CATDIR               STR      SYNTH.GRIZY
     362    PSASTRO.CATDIR               STR     PS1.REF.20120503
     363   ZERO.POINT.USE.MEAN          BOOL    TRUE 
     364END
     365
     366SYNTH_CAT METADATA
     367   PSASTRO.CATDIR               STR SYNTH.GRIZY
     368END
     369
     370TEST_REFCAT METADATA
     371   PSASTRO.CATDIR               STR /data/ipp064.0/ipp/ippRefs/catdir.refcat.20120524.v0
     372END
  • branches/eam_branches/ipp-20120405/ippconfig/isp/camera.config

    r30120 r33948  
    6262  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    6363  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     64  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    6465  CMF.DETEFF STR {CHIP.NAME}.deteff
    6566
  • branches/eam_branches/ipp-20120405/ippconfig/lulin/camera.config

    r26265 r33948  
    6363  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    6464  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     65  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    6566  CMF.DETEFF STR {CHIP.NAME}.deteff
    6667
  • branches/eam_branches/ipp-20120405/ippconfig/megacam/camera.config

    r33713 r33948  
    137137  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    138138  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     139  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    139140  CMF.DETEFF STR {CHIP.NAME}.deteff
    140141
  • branches/eam_branches/ipp-20120405/ippconfig/mosaic2/camera.config

    r25756 r33948  
    9090  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    9191  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     92  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    9293  CMF.DETEFF STR {CHIP.NAME}.deteff
    9394
  • branches/eam_branches/ipp-20120405/ippconfig/recipes/filerules-mef.mdc

    r33636 r33948  
    5959PPIMAGE.INPUT.SRC       INPUT    @FILES        CHIP       CMF
    6060PPIMAGE.MASK            INPUT    @DETDB        CHIP       MASK
     61PPIMAGE.VIDEOMASK       INPUT    @DETDB        CHIP       MASK
    6162PPIMAGE.BIAS            INPUT    @DETDB        CHIP       IMAGE
    6263PPIMAGE.DARK            INPUT    @DETDB        CHIP       DARK
     64PPIMAGE.VIDEODARK       INPUT    @DETDB        CHIP       DARK
    6365PPIMAGE.FLAT            INPUT    @DETDB        CHIP       IMAGE
    6466PPIMAGE.FRINGE          INPUT    @DETDB        CHIP       FRINGE
  • branches/eam_branches/ipp-20120405/ippconfig/recipes/filerules-simple.mdc

    r33636 r33948  
    2323PPIMAGE.INPUT.SRC         INPUT    @FILES        READOUT    CMF       
    2424PPIMAGE.MASK              INPUT    @DETDB        CHIP       MASK
     25PPIMAGE.VIDEOMASK         INPUT    @DETDB        CHIP       MASK
    2526PPIMAGE.BIAS              INPUT    @DETDB        CHIP       IMAGE     
    2627PPIMAGE.DARK              INPUT    @DETDB        CHIP       DARK     
     28PPIMAGE.VIDEODARK         INPUT    @DETDB        CHIP       DARK
    2729PPIMAGE.FLAT              INPUT    @DETDB        CHIP       IMAGE     
    2830PPIMAGE.FRINGE            INPUT    @DETDB        CHIP       FRINGE
  • branches/eam_branches/ipp-20120405/ippconfig/recipes/filerules-split.mdc

    r33690 r33948  
    3636PPIMAGE.INPUT             INPUT    @FILES        CHIP       IMAGE
    3737PPIMAGE.INPUT.MASK        INPUT    @FILES        CHIP       MASK
     38PPIMAGE.VIDEOMASK         INPUT    @DETDB        CHIP       MASK
    3839PPIMAGE.INPUT.VARIANCE    INPUT    @FILES        CHIP       VARIANCE
    3940PPIMAGE.INPUT.PSF         INPUT    @FILES        CHIP       PSF
     
    4344PPIMAGE.NOISEMAP          INPUT    @DETDB        CHIP       IMAGE
    4445PPIMAGE.DARK              INPUT    @DETDB        CHIP       DARK
     46PPIMAGE.VIDEODARK         INPUT    @DETDB        CHIP       DARK
    4547PPIMAGE.FLAT              INPUT    @DETDB        CHIP       IMAGE
    4648PPIMAGE.FRINGE            INPUT    @DETDB        CHIP       FRINGE
  • branches/eam_branches/ipp-20120405/ippconfig/recipes/ppImage.config

    r33642 r33948  
    153153
    154154GAIN.OVERRIDE   BOOL    FALSE           # Override a non-finite gain?
     155
     156# Final detrending options
     157HAS.VIDEO       BOOL    FALSE           # Treat this OTA as if it has video data
     158USE.VIDEO.DARK  BOOL    FALSE           # Use a video dark if we have video data?
     159USE.VIDEO.MASK  BOOL    FALSE           # Use a video mask if we have video data?
    155160
    156161DETREND.CONSTRAINTS  METADATA
  • branches/eam_branches/ipp-20120405/ippconfig/recipes/psastro.config

    r32950 r33948  
    254254END
    255255
    256 LAP_ASTRO METADATA
    257  
     256LAP_ASTRO METADATA
     257END
     258
     259SYNTH_CAT METADATA
     260END
     261
     262TEST_REFCAT METADATA
    258263END
    259264
  • branches/eam_branches/ipp-20120405/ippconfig/recipes/psphot.config

    r33642 r33948  
    3838SKY_CLIP_SIGMA                      F32   2.0             # statistic used to measure background
    3939SKY_SIG                             F32   1.0             # optional sky error for
     40SKY_SLOPE_MIN                       F32   3.0             # exit radial profile loop when abs(slope) is less than this
    4041
    4142# allowed values for SKY_STAT:
     
    5758PEAKS_POS2_NSIGMA_LIMIT             F32   25.0            # peak signficance threshold for POS2 sources. (ppSub)
    5859                                                          # input pixels contribute less than this fraction of the flux
     60PEAKS_NMAX_TOTAL                    S32   0               # maximum allowed number of peaks 0 == unlimited
     61
    5962# parameters which adjust the footprint analysis
    6063USE_FOOTPRINTS                      BOOL  TRUE            # use new pmFootprint peak packaging
     
    6568FOOTPRINT_CULL_NSIGMA_MIN           F32   1               # Minimum height of colls in units of skyStdev
    6669FOOTPRINT_CULL_NSIGMA_PAD           F32   0.01            # Fractional Padding for stdev
     70FOOTPRINT_USE_UNSUBTRACTED          BOOL  TRUE            # find footprints without sources subtracted
    6771
    6872# parameter for the simple deblending
     
    186190
    187191KRON_ITERATIONS                     S32   2
     192KRON_APPLY_WEIGHT                   BOOL  FALSE
     193KRON_APPLY_WINDOW                   BOOL  FALSE
     194KRON_SMOOTH                         BOOL  FALSE
     195KRON_SMOOTH_SIGMA                   F32   1.7
     196KRON_SMOOTH_NSIGMA                  S32   2
    188197
    189198# Extended source fit parameters
     
    368377  PSF_MODEL                           STR   PS_MODEL_GAUSS
    369378  EXT_MODEL                           STR   PS_MODEL_QGAUSS
     379  PEAKS_NMAX_TOTAL                    S32   50000 # maximum allowed number of peaks - To avoid memory explosion
    370380END
    371381
  • branches/eam_branches/ipp-20120405/ippconfig/recipes/reductionClasses.mdc

    r33642 r33948  
    225225        BACKGROUND_PSWARP       STR     BACKGROUND
    226226END
     227
     228DEFAULT_SYNTHCAT                METADATA
     229        CHIP_PPIMAGE      STR     CHIP
     230        CHIP_PSPHOT       STR     CHIP
     231        WARP_PSWARP       STR     WARP
     232        STACK_PPSTACK     STR     STACK
     233        STACK_PPSUB       STR     STACK
     234        STACK_PSPHOT      STR     STACK
     235        DIFF_PPSUB        STR     DIFF
     236        DIFF_PSPHOT       STR     DIFF
     237        JPEG_BIN1         STR     PPIMAGE_J1
     238        JPEG_BIN2         STR     PPIMAGE_J2
     239        FAKEPHOT          STR     FAKEPHOT
     240        ADDSTAR           STR     ADDSTAR
     241        PSASTRO           STR     SYNTH_CAT
     242        STACKPHOT_PSPHOT  STR     STACKPHOT
     243        STACKPHOT_PPSUB   STR     STACKPHOT
     244        STACKPHOT_PPSTACK STR     STACKPHOT
     245        STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
     246        BACKGROUND_PPBACKGROUND STR     BACKGROUND
     247        BACKGROUND_PSWARP       STR     BACKGROUND
     248        PSVIDEOPHOT             STR     PSVIDEOPHOT
     249        STATICSKY_CALIBRATION   STR     STATICSKY_CAL
     250END
     251
    227252
    228253# Sweetspot reduction class
     
    933958END
    934959
     960CNP_DATASET     METADATA
     961        CHIP_PPIMAGE      STR     CHIP
     962        CHIP_PSPHOT       STR     CHIP
     963        WARP_PSWARP       STR     WARP
     964        STACK_PPSTACK     STR     STACK
     965        STACK_PPSUB       STR     STACK
     966        STACK_PSPHOT      STR     STACK
     967        DIFF_PPSUB        STR     DIFF
     968        DIFF_PSPHOT       STR     DIFF
     969        JPEG_BIN1         STR     PPIMAGE_J1
     970        JPEG_BIN2         STR     PPIMAGE_J2
     971        FAKEPHOT          STR     FAKEPHOT
     972        ADDSTAR           STR     ADDSTAR
     973        PSASTRO           STR     CNP_DATASET
     974        STACKPHOT_PSPHOT  STR     STACKPHOT
     975        STACKPHOT_PPSUB   STR     STACKPHOT
     976        STACKPHOT_PPSTACK STR     STACKPHOT
     977        STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
     978        BACKGROUND_PPBACKGROUND STR     BACKGROUND
     979        BACKGROUND_PSWARP       STR     BACKGROUND
     980        PSVIDEOPHOT             STR     PSVIDEOPHOT
     981        STATICSKY_CALIBRATION   STR     STATICSKY_CAL
     982END
     983
    935984# random user tests (may not be stable or consistent)
    936985TEST1 METADATA
     
    9521001END
    9531002   
     1003TEST_REFCAT             METADATA
     1004        CHIP_PPIMAGE      STR     CHIP
     1005        CHIP_PSPHOT       STR     CHIP
     1006        WARP_PSWARP       STR     WARP
     1007        STACK_PPSTACK     STR     STACK
     1008        STACK_PPSUB       STR     STACK
     1009        STACK_PSPHOT      STR     STACK
     1010        DIFF_PPSUB        STR     DIFF
     1011        DIFF_PSPHOT       STR     DIFF
     1012        JPEG_BIN1         STR     PPIMAGE_J1
     1013        JPEG_BIN2         STR     PPIMAGE_J2
     1014        FAKEPHOT          STR     FAKEPHOT
     1015        ADDSTAR           STR     ADDSTAR
     1016        PSASTRO           STR     TEST_REFCAT
     1017        STACKPHOT_PSPHOT  STR     STACKPHOT
     1018        STACKPHOT_PPSUB   STR     STACKPHOT
     1019        STACKPHOT_PPSTACK STR     STACKPHOT
     1020        STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
     1021        BACKGROUND_PPBACKGROUND STR     BACKGROUND
     1022        BACKGROUND_PSWARP       STR     BACKGROUND
     1023        PSVIDEOPHOT             STR     PSVIDEOPHOT
     1024        STATICSKY_CALIBRATION   STR     STATICSKY_CAL
     1025END
     1026
  • branches/eam_branches/ipp-20120405/ippconfig/sdssmosaic/camera.config

    r26265 r33948  
    9393  CMF.XSRC STR cmf.xsrc
    9494  CMF.XFIT STR cmf.xfit
     95  CMF.XRAD STR cmf.xrad # use .PSF and .EXT?
    9596  CMF.DETEFF STR cmf.deteff
    9697
  • branches/eam_branches/ipp-20120405/ippconfig/simmosaic/camera.config

    r26265 r33948  
    7272        CMF.XSRC        STR     {CHIP.NAME}.xsrc # use .PSF and .EXT?
    7373        CMF.XFIT        STR     {CHIP.NAME}.xfit # use .PSF and .EXT?
     74        CMF.XRAD        STR     {CHIP.NAME}.xrad # use .PSF and .EXT?
    7475        CMF.DETEFF      STR     {CHIP.NAME}.deteff
    7576
  • branches/eam_branches/ipp-20120405/ippconfig/simple/camera.config

    r26265 r33948  
    5858  CMF.DATA STR psf
    5959  CMF.XSRC STR xsrc
     60  CMF.XRAD STR xrad
    6061  CMF.XFIT STR xfit
    6162  CMF.DETEFF STR deteff
  • branches/eam_branches/ipp-20120405/ippconfig/ssp/camera.config

    r33208 r33948  
    5959  CMF.XSRC STR xsrc
    6060  CMF.XFIT STR xfit
     61  CMF.XRAD STR xrad
    6162  CMF.DETEFF STR deteff
    6263
  • branches/eam_branches/ipp-20120405/ippconfig/ssp/format.config

    r33208 r33948  
    55        SIMPLE          BOOL    TRUE
    66###     NAXIS           S32     2
     7        DETECTOR        STR     rspiusb0
    78END
    89
  • branches/eam_branches/ipp-20120405/ippconfig/system.config

    r33208 r33948  
    1010        SDSS                    STR     sdss/camera.config              # Sloan Digital Sky Survey
    1111        GPC1                    STR     gpc1/camera.config              # Pan-STARRS GPC1
     12        GPC1-TDI                STR     gpc1-tdi/camera.config          # Pan-STARRS GPC1 with TDI guiding
    1213        ESOWFI                  STR     esowfi/camera.config            # ESO Wide-Field Imager
    1314        LBCRED                  STR     lbc_red/camera.config           # Large Binocular Camera Red
  • branches/eam_branches/ipp-20120405/ippconfig/tek/camera.config

    r26265 r33948  
    6060  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    6161  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     62  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    6263  CMF.DETEFF STR {CHIP.NAME}.deteff
    6364
  • branches/eam_branches/ipp-20120405/ippconfig/uh8k/camera.config

    r26265 r33948  
    7070  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    7171  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     72  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    7273  CMF.DETEFF STR {CHIP.NAME}.deteff
    7374
  • branches/eam_branches/ipp-20120405/ippconfig/vysos20/camera.config

    r26265 r33948  
    6363  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    6464  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     65  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    6566  CMF.DETEFF STR {CHIP.NAME}.deteff
    6667
  • branches/eam_branches/ipp-20120405/ippconfig/vysos5/camera.config

    r26265 r33948  
    6363  CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
    6464  CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
     65  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
    6566  CMF.DETEFF STR {CHIP.NAME}.deteff
    6667
  • branches/eam_branches/ipp-20120405/pstamp/scripts

  • branches/eam_branches/ipp-20120405/pstamp/scripts/pstamp_cleanup.pl

    r32785 r33948  
    4242    'name=s'            =>  \$name,
    4343    'outdir=s'          =>  \$outdir,
    44     'reqType=s'           =>  \$reqType,
     44    'reqType=s'         =>  \$reqType,
    4545    'product=s'         =>  \$product,
    4646    'uri=s'             =>  \$uri,
    47     'outdir=s'          =>  \$outdir,
    4847    'redirect-output'   =>  \$redirect_output,
    4948    'verbose'           =>  \$verbose,
     
    8281
    8382my_die("Cleanup not yet supported for reqType: $reqType", $req_id, $PS_EXIT_UNKNOWN_ERROR)
    84     if ($reqType ne "pstamp") and ($reqType ne "NULL");
     83    if ($reqType ne "pstamp") and ($reqType ne "NULL") and ($reqType ne "dquery");
    8584
    8685my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
  • branches/eam_branches/ipp-20120405/psvideophot

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.