def LoadAllWavesFromPxp(filepath): """ Given a file path to an igor pxp file, loads all waves associated with it Args: filepath: path to igor pxp file Returns: list of WaveObj (see ParseSingleWave), containing data and metadata """ # XXX use file system to filter? records,_ = loadpxp(filepath) mWaves = [] for i,record in enumerate(records): # if this is a wave with a proper name, go for it if isinstance(record, WaveRecord): mWave =record.wave # determine if the wave is something we care about if (not ProcessSingleWave.ValidName(mWave)): continue # POST: have a valid name try: WaveObj = ProcessSingleWave.WaveObj(record=mWave, SourceFile=filepath) except ValueError as e: # strange tuple error? continue mWaves.append(WaveObj) return mWaves
import pandas import numpy import matplotlib.pyplot as plt """ <Description> Args: param1: This is the first param. Returns: This is a description of what is returned. """ experiment = loadpxp("./2019.01.01.SdrGBullCantileverRampClamp_clean.pxp") # experiment = loadpxp("./2019.01.01.SdrGBullCantileverRampClamp_delTraceClean.pxp") # unpack the pxp _, file_structure = experiment count = 0 # get the folder we care about folder_we_care_about = file_structure['root']['ForceClamp']['SavedData'] print(count) while count < 2000: print (count) strCount = str(count) Defl_wave = folder_we_care_about['DefV'+strCount].wave Defl_labels = Defl_wave['wave']['labels']
import numpy import re import pandas import numpy import matplotlib.pyplot as plt import os.path """ <Description> Args: param1: This is the first param. Returns: This is a description of what is returned. """ experiment = loadpxp("./210202.FLSopE2_BestTraces_clean.pxp") # experiment = loadpxp("./2019.01.01.SdrGBullCantileverRampClamp_delTraceClean.pxp") # unpack the pxp _, file_structure = experiment # get the folder we care about folder_we_care_about = file_structure['root']['MyForceData']['WLCFits'] dictkeys = [] dictkeys = folder_we_care_about.keys() print(dictkeys) print(len(dictkeys)) print(type(folder_we_care_about)) count = 0 combinedData = numpy.array([]) for i in dictkeys: print(str(i))
import matplotlib.pyplot as plt import os.path """ <Description> Args: param1: This is the first param. Returns: This is a description of what is returned. """ experiment = loadpxp("./FLSopE2.pxp") # experiment = loadpxp("./2019.01.01.SdrGBullCantileverRampClamp_delTraceClean.pxp") # unpack the pxp _, file_structure = experiment # get the folder we care about folder_we_care_about = file_structure['root']['MyForceData']['WLCFits'] dictkeys = [] dictkeys = folder_we_care_about.keys() print (dictkeys) print (len(dictkeys)) print(type(folder_we_care_about)) count = 0 combinedData = numpy.array([]) for i in dictkeys: print (str(i))
from dateutil.tz import tzlocal import os.path from pprint import pprint import numpy import platform import matplotlib.pyplot as plt import pynwb filename = '141117c2.pxp' filename = '141210c3.pxp' protocols = {'nm10Dec2014c3_000': 'Control', 'nm10Dec2014c3_002': 'Norepinephrine', 'nm10Dec2014c3_003':'Washout'} protocol_info = {'nm10Dec2014c3_000': 'Prior to drug application', 'nm10Dec2014c3_002': 'Application of norepinephrine (noradrenaline)', 'nm10Dec2014c3_003':'Following wash out of drug'} path = os.path.join('./', filename) records,filesystem = loadpxp(path) from datetime import datetime now = datetime.now() # current date and time date_time = now.strftime("%d %B %Y, %H:%M:%S") gen_info = 'NWB file generated on %s with pynwb v%s and Python %s' %(date_time, pynwb.__version__,platform.python_version()) print gen_info sub = pynwb.file.Subject( description='Mouse', species='Mus musculus', ) nwbfile = pynwb.NWBFile('Golgi cell ephys recordings', filename, datetime.now(tzlocal()), experimenter='Frederic Lanore',
import numpy import re import pandas import numpy import matplotlib.pyplot as plt import os.path """ <Description> Args: param1: This is the first param. Returns: This is a description of what is returned. """ experiment = loadpxp("./combinedGoodFiles_Sptp_clean.pxp") # experiment = loadpxp("./2019.01.01.SdrGBullCantileverRampClamp_delTraceClean.pxp") # unpack the pxp _, file_structure = experiment # get the folder we care about folder_we_care_about = file_structure['root']['MyForceData']['WLCFits'] dictkeys = [] dictkeys = folder_we_care_about.keys() print(dictkeys) print(len(dictkeys)) print(type(folder_we_care_about)) count = 0 combinedData = numpy.array([]) for i in dictkeys: print(str(i))