<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Fabian<div class=""><br class=""></div><div class="">I prefer to do this kind of operations in Python. It provides better interaction with pro Fit, while still allowing e.g. to iterate through the files in a directory. Here is a script that iterates through all files in a directory, imports each file as data file, runs a fit, and gets the fit result. The code below only gets the value of ‘Am-1’, which is parameter 7 of the Gaussian function, but this merely serves as an example:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">import os</div><div class=""><br class=""></div><div class=""># the directory to iterate through, adapt this to your needs:</div><div class="">dataDir = '/Users/kurt/Documents/datafiles'</div><div class=""><br class=""></div><div class=""># select the function to fit and set its default parameters</div><div class="">pf.SelectObject(pf.GetFunctionObject(function = "Peaks.Gauss-Peaks"))</div><div class="">pf.SetParameterProperties(parameter = 1, value = 1)</div><div class=""><br class=""></div><div class=""># set the options for importing data from text files. Adapt this to your needs.</div><div class="">pf.DataImportOptions(mode = pf.withoutTitles, headerLines = 0, headerDelimiter = "", copyInfo = False, withTitles = False, titleDelimiter = "", titleLength = 0, lineFormat = "", lineLength = 0, terminator = "", useDoublequotes = False, checkForDates = False, dateFormat = "", useGMT = False)</div><div class=""><br class=""></div><div class=""># recusrively iterate through the directory </div><div class="">for root, dirs, files in os.walk(dataDir):</div><div class=""> for name in files:</div><div class=""> </div><div class=""> # open the file</div><div class=""> p = os.path.join(root, name)</div><div class=""> print 'processing', p</div><div class=""> pf.OpenFile(file = p, type = pf.dataType)</div><div class=""> </div><div class=""> # run the fit</div><div class=""> fitObj = pf.FitCreate(function = 'Peaks.Gauss-Peaks')</div><div class=""> pf.FitSetExperiment(fitObject = fitObj, xColumn = 1, yColumn = 2) </div><div class=""> fitResultObj = pf.FitExecute(fitObject = fitObj)</div><div class=""> </div><div class=""> # close the window</div><div class=""> pf.CloseWindow(window = name, saveOption = pf.dontSave)</div><div class=""> </div><div class=""> # get the fit result. In the Gaussian function, parameter ‘Am-1’ has index 7</div><div class=""> print 'Am-1 =', pf.FitResult(fitResultObject = fitResultObj, result = pf.fittedParameter, index1 = 7)</div><div class=""> </div><div class="">print 'done'</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I hope this gets you started.</div><div class=""><br class=""></div><div class="">Best regards </div><div class=""><br class=""></div><div class="">Kurt Sutter</div><div class="">QuantumSoft</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 29 Jan 2015, at 2:22, Wohlfender Fabian <<a href="mailto:fabian.wohlfender@stud.unibas.ch" class="">fabian.wohlfender@stud.unibas.ch</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">Hi there,<div class=""><br class=""></div><div class="">I have to fit a many histograms (data stored in a text file) using a single gauss peak. Therefore I would like to set up a batch processing using an Apple Script approach. The manual and the tech note <i class="">batch processing</i> did not help much, therefor I am asking for your help/ support. I am using Mac OS X 10.7.5 and pro Fit 6.2.16.</div><div class=""><br class=""></div><div class="">I would need the following parameters of the calculated fit: Am-1 (amplitude of the gaussian), x0-1 (location of the peak on the x-axis), s-1 (half width at half maximum) and their errors.</div><div class=""><br class=""></div><div class="">I am truly grateful for your help.</div><div class=""><br class=""></div><div class="">Best regards</div><div class="">Fabian Wohlfender</div></div>_______________________________________________<br class="">proFit-list mailing list<br class=""><a href="mailto:proFit-list@quantum-soft.com" class="">proFit-list@quantum-soft.com</a><br class="">http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com<br class=""></div></blockquote></div><br class=""></div></body></html>