DOC PREVIEW
CU-Boulder CHEM 5181 - Intro to Igor Pro

This preview shows page 1-2-21-22 out of 22 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

9/16/20101Intro to Igor Pro: Beyond “Getting Started”yg(Adapted from Ingrid Ulbrich 2009 lecture)CHEM-5181Fall 2010Prof. Jose L. JimenezTue 24-Aug-102A Note about Jose’s StyleFrom a past syllabus:“If you don't go through the effort of understanding and solving every problem yourself (after discussing it with others if you want) you'll find yourself at a large disadvantage in the exams where you have todisadvantage in the exams where you have to solve new problems very quickly.”9/16/20102Goals for First 2 Lectures (Ingrid)• Become familiar with Igor Pro softwareSt i d t–Storing data– Doing calculations– Making graphs– Writing simple functions•Short(ish)homeworksto work on these tasks•Short(ish) homeworksto work on these tasks– Start with examples that should already be familiar– “Model” one MS component in last homework Why do I have to use Igor instead of software I already know?• Powerful analysis packageSuperior to spreadsheets! Especially good for–Superior to spreadsheets! Especially good for• Reproducible and traceable calculations• Graphs with more options that are easier to manipulate– Cheaper than Matlab– Good user-community mailing list, excellent email support from Igor developers• Used almost exclusively in Jimenez, Tolbert, and Volkamer groups for data analysis• Good experience for learning programming9/16/20103Why should I learn programming? (1)• Functions create a record of the steps used in a llticalculation¾ Help find errors in multistep calculations• Functions make it easy to repeat the same calculation with different datacalculation with different data¾ Standardized analysisWhy should I learn programming? (2)• Functions are easier to share with others than idhtin a spreadsheet¾ Repeatable calculations for your collegues• Slice and dice big datasets–Aerosol Mass Spectrometer saves 500 mass pspectral values every 2.5 minutes• 104values per hour Æ 3x105per day Æ2x106per week¾ Way too much data to look at everything by hand!9/16/20104Did you do the Igor “Getting Started” Tour?a) Yes, all of it.b) Yes, most of it.c) Yes, some of it.d)No, or not very much of it.)ye) I need a coffee before I understand this questionIgor File Vocabulary• Experiment: an Igor file where you store data and graphs (.pxp)Let’s open a new experiment.and graphs (.pxp) Let s open a new experiment.• DataFolder: subdirectory in an experiment– Red Arrow in Data Browser shows current DataFolder• Notebook: “file” in an experiment where you can write notes, paste graphs– Windows ÆNew ÆNotebook (Formatted Text)Pdfi ib ( h)•Procedures: functions written by you (or others) – Some exist only in the experiment they are in– Can be shared with friends/colleagues– “Local” procedure window (ctrl+m)9/16/20105More Igor File Vocabulary• Data Browser–Can set Preferences to sort by “Name and Type”• Help Browser (F1)– Look for help on functions– Can also get function help by right-clicking on a function name, choosing“Help onfunctionName”function name, choosing Help on functionName– Most functions have Examples– Many functions have Related FunctionsData is usually stored in Waves• Wave: a vector (array) containing dataExists until you“kill”it (even if you’re not looking at–Exists until you kill it (even if you re not looking at it in a graph or table)• Contrast to e.g. Excel, data only exists if it is on the sheet– Numbers (single precision by default) or text• Every wave has some number of “points” (length)•Waves have inherent “x” values = point number Waves ave e e t va ues po t u be(0, 1, 2…)– When you display a wave, it’s plotted against the internal x values (unless you tell it to plot vs. something else)9/16/20106Wave Names have Rules• Wave names–Cannot include spaces, operators (+ - * /), special characters • Can use underscore ( _ )– Cannot begin with numbers– Must be ≤ 32 characters– Are not case sensitive– Cannot have the same name as functions, variables, Igor-used termsMaking Waves• Let’s make a really simple waves so that we can practice some simple operationscan practice some simple operationsMake/N=20 y_valsNl’lkh lih i blIgor function that creates a waveFlag for makethat sets Number of points in waveName of wave•Now let’s look at the values in the wave in a table:edit y_vals.id(special way to see the “x” and “data” values”)9/16/20107Giving values to y_vals• Now we can take advantage of the inherent “x” values and make y_vals = f(x)Y_vals = xDisplay y_valsFix the axes to have range -10, 40 for x and yAdd “zero lines” (Ticks and Grids tab)Copy and Paste this plot in your NotebookCh l b h h h d lChange your line by changing the equation in the command line (e.g., y_vals = 2*x y_vals = 2*x + 3)Copy and Paste a new plot in your NotebookNote that the y_vals.d changes in the table, too!Kill the table!• Check for the wave in the Data Browser–Waves exist until you kill them, even if you’re not looking at the them.– Very different from Excel, of course!• Make table again if you want to watch the data changeg9/16/20108Can you make the line go into the x<0 range?• Recall from “Getting Started” that you can hth i h tlichange the inherent x-scalingData ÆChange Wave Scaling• The command for this change was printed in the History in the Command Window!the History in the Command Window!– Useful for using this command in a function, since you can’t use the pulldown menu in a function.Our Sample FunctionFunction Name Function ArgumentsFunction LineValues()make/O/N=20 y_vals = 0.1 * x + 1endGotta end the functionStuff for the function to doAnd let’s compile!And let’s run it (from the command line).Change the values. Does the line change?9/16/20109Our Sample Function, with VariablesFunction LineValues2()variable m = 0.1, b = 1make/O/N=20 y_vals = m * x + bendOur Sample Function, with InputsFunction LineValues_input(m,b)variable m, bmake/O/N=20 y_vals = m * x + bend9/16/201010Our Sample Function, Print Equation Function LineValues(m,b)variable m, bmake/O/N=20 y_vals = m * x + bprint “Equation is y=“, m, “*x + “, bendOur Sample Function, Print Equation SometimesFtiLi V l(bitFl)FunctionLineValues(m, b, printFlag)variable m, b, printFlagmake/O/N=20 y_vals = m * x + bif(printFlag == 1)print“Equation is y=“m“*x+“bprintEquation is y=, m, x + , bendifend9/16/201011Our Sample


View Full Document

CU-Boulder CHEM 5181 - Intro to Igor Pro

Download Intro to Igor Pro
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Intro to Igor Pro and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Intro to Igor Pro 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?