Changeset 14115 for fact/tools


Ignore:
Timestamp:
06/08/12 15:11:47 (12 years ago)
Author:
neise
Message:
added member euch2chid and debugges map file access
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/pyfact/coor.py

    r13402 r14115  
    2626        """
    2727        _CheckPath(map_file_path)
    28 
     28        path = os.path.abspath(__file__)
     29        path = os.path.dirname(path)
     30        map_file_path = os.path.join(path, map_file_path)
    2931        chid, xe, ye = np.loadtxt(map_file_path, unpack=True)
    3032        # -ye in order to correct for the sign difference between my mapping file
     
    6971        chid2coor_np = {}
    7072        chid2vec  = {}
     73        euc2chid = {}
    7174        # we will fill these translators now.
    7275        for vector_and_chid in vectors_and_chids:
     
    110113            # the calculation of the neighbors needs it
    111114            coor2chid[ coor ] = chid
     115            euc2chid[(vec[0],vec[1])] = chid
    112116
    113117
     
    140144        self.coor2chid = coor2chid
    141145        self.chid2vec  = chid2vec
     146        self.euc2chid = euc2chid
    142147       
    143148#        for chid in chid2nn.keys():
     
    155160    path = os.path.dirname(path)
    156161    inpath = os.path.join(path, inpath)
    157         if not os.path.isfile(inpath):
    158             raise IOError('not able to find file: '+inpath)
     162    if not os.path.isfile(inpath):
     163        raise IOError('not able to find file: '+inpath)
    159164
Note: See TracChangeset for help on using the changeset viewer.