Changeset 1675 for TI10-WorkingGrid


Ignore:
Timestamp:
07/11/06 16:57:58 (13 years ago)
Author:
selatham
Message:

further development

Location:
TI10-WorkingGrid/trunk/CEDAR_specific
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI10-WorkingGrid/trunk/CEDAR_specific/db_funcs.py

    r1669 r1675  
    1515        connection_string = HOST + ':' + DATABASE + ':' + USER + ':' + PW 
    1616        connection = pgdb.connect(connection_string) 
    17         cursor     = connection.cursor() 
    18         return cursor 
     17        return connection 
    1918 
    2019 
  • TI10-WorkingGrid/trunk/CEDAR_specific/postgresdb2moles.py

    r1669 r1675  
    4444    rdbname= sys.argv[2] 
    4545    rdbhost= sys.argv[3] 
    46     reccount, filecount = 0 
     46    reccount = 0 
     47    filecount = 0 
    4748 
    4849    #set up constants 
    4950    schemeID='NDG-B0' 
     51    mNS='http://ndg.nerc.ac.uk/moles' 
    5052 
    5153    #set up lists to hold stuff 
    5254    all_ids=[] 
     55 
    5356 
    5457    #connect to db (in separate db functions module) 
     
    5659 
    5760    #get a list of all the db keys for DataEntitys which match the repositoryID. 
    58     select_string="select a.fld_data_provider_local_id from ndgb.tbl_data_entities as a where a.fld_data_provider_id=%s" %repositoryID 
     61    select_string="select a.fld_data_provider_local_id from ndgb.tbl_data_entities as a where a.fld_data_provider_id='%s'" %repositoryID 
    5962    cursor     = connection.cursor() 
    6063    cursor.execute(select_string) 
     
    7477 
    7578        #MetaData ID 
    76         dgMID=M.dgMetadataID(schemeIdentifier=schemeID, repositoryIdentifier=repositoryID, localIdentifier=localID) 
     79        dgMID=M.dgMetadataID(mNS,schemeIdentifier=schemeID, repositoryIdentifier=repositoryID, localIdentifier=localID) 
    7780 
    7881        #create data granules 
    79         datagranules=[] 
    80         DMid=M.dataModelID(schemeIdentifier='URI', repositoryIdentifier=repositoryID,localIdentifier= localID) 
    81         DG  = M.dgDataGranule(dataModelID=DMid) 
    82         datagranules.append(DG) 
     82        dataGranules=[] 
     83        DMid=M.dataModelID(mNS,schemeIdentifier='URI', repositoryIdentifier=repositoryID,localIdentifier= localID) 
     84        DG  = M.dgDataGranule(mNS,dataModelID=DMid) 
     85        dataGranules.append(DG) 
    8386 
    8487        #create coverage 
     
    8891        dgST=M.dgSpatioTemporalCoverage(dgSpatialCoverage = dgSc, dgTemporalCoverage=dgTc) 
    8992        dgCv=M.dgCoverage(dgSpatioTemporalCoverage=dgST) 
     93 
     94        #create parameter summaries 
     95        parameterSummaries=[] 
     96        VTID=M.dgValidTermID(mNS,ParentListID='1', TermID='1') 
     97        SPM=M.dgStdParameterMeasured(mNS,dgValidTerm= 'a standard name', dgValidTermID=VTID) 
     98        RDP=M.dgRangeDataParameter(mNS,HighValue='', LowValue='') 
     99        PS  = M.dgParameterSummary(mNS,dgRangeDataParameter=RDP, dgStdParameterMeasured=SPM) 
     100        parameterSummaries.append(PS) 
    90101 
    91102        #create data summary: 
Note: See TracChangeset for help on using the changeset viewer.