Igor to Python Module

From PharmWiki
Jump to navigation Jump to search
Igor Python Module
Igor Python Igor Pro Python Igor Pro Example Python Example % Complete Comments/Caveats/Notes
?: Question() WaveName = Expression ? TrueExpression : FalseExpression WaveName=Question(ExpressionStr,TrueExpressionStr, FalseExpressionStr) w=w[p]==0 ? Nan : w(p) w=Question("w[p]==0", "none","w[p]") Conception I have written some code in there.
cmpstr() cmpstr() cmpstr(string1,string2) cmpstr(string1,string2) if (cmpstr(string1,string2)==1)
print "Hello, World!"

end if

if ((cmpstr(string1,string2)==1):
print("Hello, World!")
50%
Make MakeWave() Make Options WaveName;Command1;Command2 WaveName=MakeWave(OptionStr,CommandStr='',ImplictWaveName='') Make\O\D w=sine(p) w=MakeWave("\O\D","w=sin(p)") In Progress In the Python module, you cannot make multiple Wave Commands; I need to come up with a custom dtype for Waves
num2str() num2str() num2str(number) num2str(number) print num2str(number) print(num2str(number)) 100%
for[1] for for(VariableType Item:WaveName)

Commands

endfor

for Item in WaveName1D[2]:

Commands

for(String s:TextWave1D)
print s

endfor

for s in TexWave1D[2]:
print(s)
Conception
for[2] Gfor() for(VariableType Item:WaveName)
IgorCommands

endfor

IgorCommands="""Igor Commands"""

Gfor(Item, WaveName,IgorCommands)

for(String s:TextWave0)
print s

endfor

IgorCommands="""print s"""[3]

Gfor(s,TextWave0,IgorCommands)

Conception Need a IgorParser for IgorCommands
for Pfor() for(VariableType Item:WaveName)
IgorCommands

endfor

PythonComands="""PythonCommands"""

Pfor(Item,WaveName,PythonCommands)

for(String s:TextWave0)</code)

print s endfor

PythonCommands="""print(s)"""

Pfor(s,Textwave0,PythonCommands)

Conception Need Function to clean up Python 'Commands
for for with LinearizeWave()[4] for(VariableType Item:WaveName)
Commands

endfor

for Item in LinearizeWave(WaveName):[5]
Commands
for(String s:TextWave0)
print s

endfor

for s in LinearizeWave(TextWave0):
print s
Conception This is probably the best option. In order to parse it, I need to identify the wave as a wave.

Wave Format

  • Waves seem like a complex data format.
  • p = seems to be a reserved row indexing variable
  • q = seems to be a reserved column indexing variable

Parts of a Wave

  • WaveName
  • ImplicitWaveName
  • Xarray
  • Yarray
  • Tarray

To Do

  • Make a Wave a custom data type in Python

WaveNames=[WaveName1, WaveName2, WaveName3] # Through Arrays (Too confusiont

WaveNames=MakeWave(OptionsStr,CommandStr,ImpicitNames)

WaveFormat

WaveName=[ImplictNameStr,XArray, Array] # Array format

WaveName={

'implicit':ImplicitWaveNameStr, # defines an implicit string for a wave name
'scaling':{
'x':RowArray, # reserved indice variable p
'y':ColumnsArray, # reserved indice variable q
'z':LayersArray, # reserved indice variable s
't':ChunkArray, # reserved indice variable r
},
'data':DataArray #1D-4D Array
}

RowArray initially has numbers as p

Igor004.png

Reference List

  1. A for statement for 1D waves
  2. for statement of multidimensional waves
  3. You can do block text in here using """
  4. https://stackoverflow.com/questions/27516849/how-to-convert-list-of-numpy-arrays-into-single-numpy-array
  5. When it is going through Igor Pro, the Wave is treated as a linear Wave.