IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 28, 2014, 6:20:27 AM (12 years ago)
Author:
eugene
Message:

dropping options for stilts dvo import methods; fixing a number of previously ignored errors (eg, dropping non-existent tables); allowing queue questions to strip leading and trailing spaces (so we can read from an input file); echo back the response so input from a file is clearer; re-write big sql blocks with new sql utility code; updating names in MeanObject, ObjectThin to be more consistent; add a new test code program; update detection fields to match new schema; drop the code for the old now-unused tables (detecitonCalib, SkinnyObject, etc)

Location:
branches/eam_branches/ipp-20140717/ippToPsps
Files:
2 edited

Legend:

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

  • branches/eam_branches/ipp-20140717/ippToPsps/jython/ipptopspsdb.py

    r36815 r37129  
    786786            and not self.consistentlyFailed(batchType, stageID)):
    787787           
    788             self.logger.infoPair("heather:","passed logic")
     788            # self.logger.infoPair("heather:","passed logic")
    789789
    790790            sql = "INSERT INTO batch ( \
     
    803803                       '" + self.skychunk.name + "' \
    804804                       )"
    805             self.logger.infoPair("heather:","sql")
     805 
     806            # self.logger.infoPair("heather:",sql)
    806807
    807808            self.execute(sql)
     
    816817            except:
    817818                self.logger.exception("Unable to get batch ID")
     819                self.logger.infoPair("sql:",sql)
     820
    818821                batchID = -1
    819822
     
    10171020       response = raw_input(" * Name for new skychunk, or existing skychunk to edit? ")
    10181021       if response == "": return
     1022       response = response.strip()
    10191023       self.skychunk.name = response
    10201024
     
    10561060           question = question +  "? "
    10571061           response = raw_input(question)
     1062           response = response.strip()
     1063           print "response: '" + response + "'"
    10581064           if response != "":
    10591065               if type.find("varchar") != -1 or type.find("timestamp") != -1: quotes = "'"
    10601066               else: quotes = ""
     1067               # print "UPDATE skychunk SET " + field + " = " + quotes + response + quotes + " WHERE name = '" + self.skychunk.name + "'"
    10611068               self.execute("UPDATE skychunk SET " + field + " = " + quotes + response + quotes + " WHERE name = '" + self.skychunk.name + "'")
    10621069       
     
    11301137        self.skychunk.batchTypes = []
    11311138        try:
     1139            # print "sql: " + sql
    11321140            rs = self.executeQuery(sql)
    11331141
     
    11761184            if rs.getInt(26) == 1: self.skychunk.parallel = True
    11771185            self.skychunk.P2_smf_version = rs.getString(27)
     1186            # options: "use_new", "not_reproc", "use_original"
     1187
    11781188            self.skychunk.ST_cmf_version = rs.getString(28)
     1189            # options: not used?
     1190
     1191            # NOTE : the rs (ResultSet) class is somewhat annoying and finicky esp about timestamp values
     1192            # for example, rs.getTimestamp(N) fails silently if the value is not a valid time.  this is
     1193            # also true to getString() on the same column.  Docs for the ResultSet class can be found here:
     1194            # http://docs.oracle.com/javase/1.5.0/docs/api/java/sql/ResultSet.html?is-external=true
     1195
     1196            # rsmd = rs.getMetaData()
     1197            # print "got metadata"
     1198            # print "number of columns: " + str(rsmd.getColumnCount())
     1199            # print "label: " + rsmd.getColumnLabel(25)
     1200            # print "label: " + rsmd.getColumnLabel(29)
     1201            # print "name: " + rsmd.getColumnName(25)
     1202            # print "name: " + rsmd.getColumnName(29)
     1203            # print "typename: " + rsmd.getColumnTypeName(25)
     1204            # print "typename: " + rsmd.getColumnTypeName(29)
     1205
     1206            # epochStamp = rs.getTimestamp(16)
     1207            # print "epoch: " + epochStamp.toString()
     1208
     1209            # print "label: " + rsmd.getColumnLabel(16)
     1210            # print "name: " + rsmd.getColumnName(16)
     1211            # print "typename: " + rsmd.getColumnTypeName(16)
     1212
    11791213            self.skychunk.trange_start = rs.getString(29)
     1214            # options: "YYYY-MM-DD,HH:MM:SS" or "0000-00-00 00:00:00"
     1215
    11801216            self.skychunk.trange_end = rs.getString(30)
     1217            # options: "YYYY-MM-DD,HH:MM:SS" or "0000-00-00 00:00:00"
    11811218
    11821219            if self.skychunk.parallel: print "USING parallel"
     
    16211658            pass
    16221659
    1623         self.execute("CREATE TEMPORARY TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)")
     1660        # XXX EAM : 20140727: for now this is not temporary (for debugging)
     1661        # self.execute("CREATE TEMPORARY TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)")
     1662        self.execute("CREATE TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)")
    16241663        for row in rows:
    16251664
     
    17021741        try:
    17031742            rs = self.executeQuery(sql)
    1704             while (rs.next()): ids.append(rs.getInt(1))
     1743            while (rs.next()):
     1744                ids.append(rs.getInt(1))
     1745                print "stage_id: " + str(rs.getInt(1))
    17051746        except:
    17061747            self.logger.errorPair("Can't get items in this box", sql)
Note: See TracChangeset for help on using the changeset viewer.