DOC PREVIEW
CU-Boulder CHEM 5181 - Lecture Notes

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

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 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 23 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 23 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 23 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

You don’t look like Prof. Jose-Luis Jimenez…Ingrid UlbrichChem 518129 August 2009Some Course InformationA 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 to solve new problems very quickly.”Clicker Q’s 1&2I’m a student in…a) Analytical Chemistryb) Physical Chemistryc) another division of Chemistryd) Engineeringe) Another departmentI’m in my ____ year of grad school.a) Firstb) Secondc) Thirdd) > ThirdGoals for First 2 Lectures (Ingrid)Why do I have to use Igor instead of software I already know?• Powerful analysis package– 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 programmingWhy should I learn programming? (1)• Functions create a record of the steps used in a calculation¾ Help find errors in multistep calculations• Functions make it easy to repeat the same calculation with different data¾ Standardized analysisWhy should I learn programming? (2)Clicker Q’s 3-6My experience with spreadsheets (e.g., Excel, etc.) is…My experience with Igor, Matlab, IDL, or other similar programs is…a) Nilb) Limited – I’ve worked with these programs, but don’t feel very confident.c) Moderate – I can get around programs like this, but I’m not an expert.d) Extensive with non-Igor software – I just have to learn Igor’s tweakse) Extensive with Igor – I’m a proMy experience with programming (in any computational language/script) is…a) Nilb) Limited – I can write simple functionsc) Strong – I can decide how to break a problem into pieces that should be functions and can write nested functions.d) Extensive – I can code anything I want to.My previous data analysis work mainly used…a) Pencil and paperb) Spreadsheetsc) Non-Igor analysis packagesd) IgorMass Spectrometry Overview• Everything in the mass spectrometer is Physics– Make ions, move them in an electric field– Study some physics!• Mass spec interpretation is Chemistry– recorded signals Æ determining fragments Æassigning molecules High VacuumSample InletIon SourceMassAnalyzerDetector RecorderMS InterpretationMass Spectrometry OverviewOur goal after these two lectures and two homeworks:Model a very simple ion detectorHigh VacuumSample InletIon SourceMassAnalyzerDetector RecorderMS InterpretationIgor Pro: Beyond “Getting Started”In-Class Today: Writing Simple FunctionsClicker Q’s 7-8Did 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.How do you feel about Igor so far?a) Ready and rarin’ to go!b) Lots to learn, but I’m ready.c) I’d rather use tools I already know.Igor File Vocabulary• Experiment: an Igor file where you store data 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)• 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)More 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 on functionName”– Most functions have Examples– Many functions have Related FunctionsData is usually stored in Waves• Wave: a vector (array) containing data– Exists until you “kill” it (even if you’re not looking at it in a graph or table)– Numbers (single precision by default) or text• Every wave has some number of “points” (length)• Waves have inherent “x” values = point number (0, 1, 2…)– When you display a wave, it’s plotted against the x values (unless you tell it to plot vs. something else)Wave 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 operationsMake/N=20 y_vals• 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”)Igor function that creates a waveFlag for makethat sets Number of points in waveName of waveGiving values to y_valsKill the table!• (Kill the wabbit, kill the wabbit…)• 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 changeCan you make the line go into the x<0 range?• Recall from “Getting Started” that you can change the inherent x-scalingData ÆChange Wave Scaling• The command for this change was printed in 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.Make a function for the line1. Simple versionOur Sample FunctionFunction LineValues()make/O/N=20 y_vals = 0.1 * x + 1endAnd let’s compile!And let’s run it (from the command line).Change the values. Does the line change?Function Name Function ArgumentsGotta end the functionStuff for the function to doMake a function for the line1. Simple version with variablesOur Sample Function, with VariablesFunction LineValues2()variable m = 0.1, b = 1make/O/N=20 y_vals = m * x + bendMake a function for the line1. Simple version with variables2. Generalize function with inputsOur Sample Function, with InputsFunction LineValues_input(m,b)variable m, bmake/O/N=20 y_vals = m * x + bendMake a function for the line1. Simple version2. Generalize function with inputs3. Print the equation of the


View Full Document

CU-Boulder CHEM 5181 - Lecture Notes

Download Lecture Notes
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 Lecture Notes 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 Lecture Notes 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?