IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39786 for trunk


Ignore:
Timestamp:
Oct 21, 2016, 1:09:00 PM (10 years ago)
Author:
heather
Message:

minor typos and fixes -- can now make GO batches! :)

Location:
trunk/ippToPsps
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/config/changes.txt

    r36201 r39786  
    99
    1010-- not yet alter table batch add column smf_version varchar(16) after comment;
     11
     12alter table skychunk add column queue_FG tinyint after queue_FO;
     13alter table skychunk add column queue_GO tinyint after queue_FG;
     14
     15alter table skychunk change column queue_FG queue_FG tinyint(1);
     16alter table skychunk change column queue_GO queue_GO tinyint(1);
     17alter table skychunk change column queue_GO queue_GO tinyint(1) default 0;
     18alter table skychunk change column queue_FO queue_FO tinyint(1) default 0;
     19alter table skychunk change column queue_FG queue_FG tinyint(1) default 0;
  • trunk/ippToPsps/config/ippToPspsDbSchema.sql

    r39785 r39786  
    219219) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    220220SET character_set_client = @saved_cs_client;
     221--
     222-- Table structure for table `forcedgalobject`
     223--
     224DROP TABLE IF EXISTS `forcedgalobject`;
     225SET @saved_cs_client     = @@character_set_client;
     226SET character_set_client = utf8;
     227CREATE TABLE `forcedgalobject` (
     228  `batch_id` bigint(20) unsigned NOT NULL,
     229  `region` varchar(50) default NULL,
     230  KEY `batch_id` (`batch_id`),
     231  CONSTRAINT `forcedgalobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`)
     232) ENGINE=InnoDB DEFAULT CHARSET=latin1;
     233SET character_set_client = @saved_cs_client;
     234
     235
     236
     237--
     238-- Table structure for table `gaiaobject`
     239--
     240DROP TABLE IF EXISTS `gaiaobject`;
     241SET @saved_cs_client     = @@character_set_client;
     242SET character_set_client = utf8;
     243CREATE TABLE `gaiaobject` (
     244  `batch_id` bigint(20) unsigned NOT NULL,
     245  `region` varchar(50) default NULL,
     246  KEY `batch_id` (`batch_id`),
     247  CONSTRAINT `gaiaobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`)
     248) ENGINE=InnoDB DEFAULT CHARSET=latin1;
     249SET character_set_client = @saved_cs_client;
     250
    221251
    222252--
  • trunk/ippToPsps/config/settings.xml

    r39644 r39786  
    819819  <!-- ippToPsps Db section (REAL version) -->
    820820  <ipptopspsdatabase>
    821     <name>ipptopsps2</name>
     821    <name>ipptopsps3</name>
    822822    <host>ipp006</host>
    823823    <user>dvo</user>
  • trunk/ippToPsps/jython/Makefile.am

    r39007 r39786  
    1919  dvoforcedgalaxy.py \
    2020  dvoobjects.py \
     21  dvogaiaobjects.py \
    2122  dvo.py \
    2223  dxlayer.py \
     
    2526  forcedwarpbatch.py \
    2627  forcedgalaxybatch.py \
     28  gaiaobjectbatch.py \
    2729  gpc1db.py \
    2830  initbatch.py \
  • trunk/ippToPsps/jython/gaiaobjectbatch.py

    r39785 r39786  
    1414from ipptopspsdb import IppToPspsDb
    1515from scratchdb import ScratchDb
    16 from dvoobjects import DvoObjects
     16from dvogaiaobjects import DvoGaiaObjects
    1717from sqlUtility import sqlUtility
    1818
     
    4949               dvoID,
    5050               batchID,
    51                "OB",
     51               "GO",
    5252               None)
    5353
     
    8484    '''
    8585    def alterPspsTables(self):
     86       
     87        self.scratchDb.execute("ALTER TABLE GaiaFrameCoordinate CHANGE dec_ `dec` double")
    8688
    8789        return True
     
    119121        cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps")
    120122
    121         if False:
     123        #if False:
     124        #    self.
    122125            # XXX EAM 20140724 : this is probably wrong : flux measurements can be 0.0 or negative: please review
    123126        self.logger.info("Populating GaiaFrameCoordinate")
     
    134137        sqlLine.group("batchID",         "'" + str(self.batchID) + "'")
    135138        sqlLine.group("ra",          "RA_MEAN")
    136         sqlLine.group("dec",         "DEC_MEAN")
     139        sqlLine.group("`dec`",         "DEC_MEAN")
    137140        sqlLine.group("raErr",       "RA_ERR")
    138141        sqlLine.group("decErr",      "DEC_ERR")
    139 
     142        sqlLine.group("gaiaFlag",     "FLAGS")
    140143        sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
    141144
     
    179182            #count out of range
    180183   
    181             sql = "SELECT count(*) FROM gaiaFrameCoordinate where \
    182                   gaiaFrameCoordinate.dec > " + str(decMax) + " \
    183                   or gaiaFrameCoordinate.dec < " + str(decMin) + " \
    184                   or gaiaFrameCoordinate.ra > " + str(raMax) + " \
    185                   or gaiaFrameCoordinate.ra < " + str(raMin)       
     184            sql = "SELECT count(*) FROM GaiaFrameCoordinate where \
     185                  GaiaFrameCoordinate.`dec` > " + str(decMax) + " \
     186                  or GaiaFrameCoordinate.`dec` < " + str(decMin) + " \
     187                  or GaiaFrameCoordinate.ra > " + str(raMax) + " \
     188                  or GaiaFrameCoordinate.ra < " + str(raMin)       
    186189       
    187190            rs = self.scratchDb.executeQuery(sql)
     
    193196           
    194197     
    195             sql = "DELETE FROM gaiaFrameCoordinate where \
    196                   gaiaFrameCoordinate.dec > (" + str(decMax) + " + .0033) or \
    197                   gaiaFrameCoordinate.dec < (" + str(decMin) + " - .0033) or \
    198                   gaiaFrameCoordinate.ra > (" + str(raMax) + " + .0033) or \
    199                   gaiaFrameCoordinate.ra < (" + str(raMin) + " - .0033)"
     198            sql = "DELETE FROM GaiaFrameCoordinate where \
     199                  GaiaFrameCoordinate.`dec` > (" + str(decMax) + " + .0033) or \
     200                  GaiaFrameCoordinate.`dec` < (" + str(decMin) + " - .0033) or \
     201                  GaiaFrameCoordinate.ra > (" + str(raMax) + " + .0033) or \
     202                  GaiaFrameCoordinate.ra < (" + str(raMin) + " - .0033)"
    200203            self.logger.infoPair("Deleting", str(nToDelete) + " objects outside of ra/dec range")
    201204   
     
    203206                self.scratchDb.execute(sql)
    204207            except:
    205                 self.logger.errorPair("Couldn't cull outsiders from gaiaFrameCoordinate table", sql)
     208                self.logger.errorPair("Couldn't cull outsiders from GaiaFrameCoordinate table", sql)
    206209                raise
    207210
     
    210213        self.logger.infoPair("updatePspsUniqueIDs","end")
    211214
    212         self.logger.infoPair("Dropping row column from", "gaiaFrameCoordinate table")
    213         self.scratchDb.dropColumn("gaiaFrameCoordinate", "row")
    214         self.logger.infoPair("Dropped row column", "gaiaFrameCoordinate")
    215 
    216         self.setMinMaxObjID(["gaiaFrameCoordinate"])
     215        self.logger.infoPair("Dropping row column from", "GaiaFrameCoordinate table")
     216        self.scratchDb.dropColumn("GaiaFrameCoordinate", "row")
     217        self.logger.infoPair("Dropped row column", "GaiaFrameCoordinate")
     218
     219        self.setMinMaxObjID(["GaiaFrameCoordinate"])
    217220
    218221        return True
     
    234237
    235238        ### force objID uniqueness on *** ObjectThin ***
    236         self.logger.infoPair("Forcing uniqueness on", "objID in gaiaFrameCoordinate table")
    237         rowCountBefore = self.scratchDb.getRowCount("gaiaFrameCoordinate")
     239        self.logger.infoPair("Forcing uniqueness on", "objID in GaiaFrameCoordinate table")
     240        rowCountBefore = self.scratchDb.getRowCount("GaiaFrameCoordinate")
    238241
    239242        # XXX EAM : note that in mysql versions later than 5.1, this fails
     
    246249            self.scratchDb.execute("set session old_alter_table=1")
    247250           
    248         self.scratchDb.execute("ALTER IGNORE TABLE gaiaFrameCoordinate ADD UNIQUE INDEX(objID)")
     251        self.scratchDb.execute("ALTER IGNORE TABLE GaiaFrameCoordinate ADD UNIQUE INDEX(objID)")
    249252        if self.scratchDb.version > 5.1:
    250253            self.scratchDb.execute("set session old_alter_table=0")
    251254
    252         rowCountAfter = self.scratchDb.getRowCount("gaiaFrameCoordinate")
     255        rowCountAfter = self.scratchDb.getRowCount("GaiaFrameCoordinate")
    253256        self.logger.infoPair("Number of duplicated objIDs removed", "%d out of %d" % ((rowCountBefore - rowCountAfter), rowCountBefore))
    254257
  • trunk/ippToPsps/jython/ipptopspsdb.py

    r39785 r39786  
    828828        self.execute(sql)
    829829
    830             '''
     830    '''
    831831    Inserts some gaiaobject metadata for this batch ID
    832832    '''
  • trunk/ippToPsps/jython/loader.py

    r39785 r39786  
    3030from forcedobjectbatch import ForcedObjectBatch
    3131from forcedgalaxybatch import ForcedGalaxyBatch
     32from gaiaobjectbatch import GaiaObjectBatch
     33
    3234#
    3335#
Note: See TracChangeset for help on using the changeset viewer.