Changeset 375

Show
Ignore:
Timestamp:
10/05/11 22:12:55 (20 months ago)
Author:
jnowacki
Message:

DACInfo section is now fully read; 'recChName' and 'recChUnit' changed to 'ADCChName' and 'ADCChUnit' to be consistent with 'DACChName' and 'DACChUnit'

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/neo0.2/neo/io/axonio.py

    r353 r375  
    272272                        num = header['nADCPtoLChannelMap'][i] 
    273273                    elif version >=2. : 
    274                         name = header['listADCInfo'][i]['recChNames'] 
    275                         unit = header['listADCInfo'][i]['recChUnits'] 
     274                        name = header['listADCInfo'][i]['ADCChNames'] 
     275                        unit = header['listADCInfo'][i]['ADCChUnits'] 
    276276                        num = header['listADCInfo'][i]['nADCNum'] 
    277277                    t_start = float(episodArray[j]['offset'])/sampling_rate 
     
    412412                    else : 
    413413                        ADCInfo[key] = np.array(val) 
    414                 ADCInfo['recChNames'] = strings[ADCInfo['lADCChannelNameIndex']-1] 
    415                 ADCInfo['recChUnits'] = strings[ADCInfo['lADCUnitsIndex']-1] 
     414                ADCInfo['ADCChNames'] = strings[ADCInfo['lADCChannelNameIndex']-1] 
     415                ADCInfo['ADCChUnits'] = strings[ADCInfo['lADCUnitsIndex']-1] 
    416416                 
    417417                header['listADCInfo'].append( ADCInfo ) 
     
    444444            header['listTag'] = listTag 
    445445             
     446            # DAC sections 
     447            header['listDACInfo'] = [ ] 
     448            for i in range(sections['DACSection']['llNumEntries']) : 
     449                #  read DACInfo 
     450                fid.seek(sections['DACSection']['uBlockIndex']*\ 
     451                            BLOCKSIZE+sections['DACSection']['uBytes']*i) 
     452                DACInfo = { } 
     453                for key, format in DACInfoDescription : 
     454                    val = fid.read_f(format ) 
     455                    if len(val) == 1: 
     456                        DACInfo[key] = val[0] 
     457                    else : 
     458                        DACInfo[key] = np.array(val) 
     459                DACInfo['DACChNames'] = strings[DACInfo['lDACChannelNameIndex']-1] 
     460                DACInfo['DACChUnits'] = strings[DACInfo['lDACChannelUnitsIndex']-1] 
     461                 
     462            header['listDACInfo'].append( DACInfo ) 
    446463             
    447464        fid.close() 
     
    649666       ('fInstrumentHoldingLevel', 'f'), 
    650667       ('fDACScaleFactor','f'), 
    651        ('fDACHoldingLevel','h'), 
     668       ('fDACHoldingLevel','f'), 
    652669       ('fDACCalibrationFactor','f'), 
    653670       ('fDACCalibrationOffset','f'),