(ebook) an introduction to programming with idl: interactive data language by kenneth p. bowman isbn

Page 1


(Ebook) An Introduction to Programming with IDL: Interactive Data Language by Kenneth P. Bowman ISBN 9780080489278, 9780120885596, 012088559X, 0080489273 download

https://ebooknice.com/product/an-introduction-to-programmingwith-idl-interactive-data-language-1398226

Explore and download more ebooks at ebooknice.com

Here are some recommended products for you. Click the link to download, or explore more at ebooknice.com

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN 9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna Bodemyr ISBN 9789127456600, 9127456609

https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-petersons-sat-ii-success-1722018

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042

https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arcomaster-the-sat-subject-test-math-levels-1-2-2326094

(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048, 1398375144, 1398375047

https://ebooknice.com/product/cambridge-igcse-and-o-level-historyworkbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

(Ebook) Interactive Data Visualization for the Web: An Introduction to Designing with D3 by Scott Murray ISBN 9781491921289, 1491921285

https://ebooknice.com/product/interactive-data-visualization-for-the-weban-introduction-to-designing-with-d3-6769294

(Ebook) Interactive Data Visualization for the Web: An Introduction to Designing with D3 by Murray, Scott ISBN 9781449339739, 1449339735

https://ebooknice.com/product/interactive-data-visualization-for-the-weban-introduction-to-designing-with-d3-55920266

(Ebook) Interactive Data Visualization for the Web: An Introduction to Designing with D3 by Scott Murray ISBN 9781491921289, 1491921285

https://ebooknice.com/product/interactive-data-visualization-for-the-weban-introduction-to-designing-with-d3-7187934

(Ebook) Open Heritage Data: An introduction to research, publishing and programming with open data in the heritage sector by Henriette Roued-Cunliffe ISBN 9781783303595, 178330359X

https://ebooknice.com/product/open-heritage-data-an-introduction-toresearch-publishing-and-programming-with-open-data-in-the-heritagesector-23775922

Preface

ItisatritebuttrueObservation,thatExampleswork moreforciblyontheMindthanPrecepts.

Studentsinundergraduatescienceandengineeringprogramstypicallytake onesemesterofcomputerprogramming,oftenusingFortranorCor,more recently,JavaorC++.Althoughtheselanguagesareallusedtowritescientific software,inoneortwosemestersitisdifficultforstudentstodeveloptheskills neededtowriteusefulprograms.Studentswhogoontograduateschoolare frequentlyunpreparedtobeginwriting,orevenusing,scientificsoftware.

InteractiveDataLanguage(IDL)isahigh-levellanguagedesignedspecificallyforscientificprogramminganddataanalysis.Inadditiontoacomplete setofbasicprogrammingtools(numericaltypes,strings,arrays,structures, pointers,etc.),itincludesawiderangeofgraphicalfunctionsanddevice drivers.AmajoradvantageofIDLcomparedtotraditionalprogramming languagesisthatbeginnerscanbeginwritingprogramsandplottinggraphs afteronlyafewhoursofuse.Althoughnotcoveredinthisbook,IDLalso makesiteasytocreateprogramswithpoint-and-clickgraphicaluserinterfaces andtodevelopprogramsusinganobject-orientedstyle.IDLisavailableon MicrosoftWindowsandUnix-derivedoperatingsystems,includingpopular commercialversionsofUnix,Linux,andApple’sMacOSX.Withalittle planning,IDLprogramscanbemovedeasilybetweenplatforms.

Thisbookisintendedtobeusedinanintroductorycomputerprogrammingcourseforscienceandengineeringstudentsateithertheundergraduate orgraduatelevel.StudentscanlearnIDLquicklyenoughthatitcanbetaught aspartofatopicalcourse,eitherasaseparate“lab”sectionorasanintegral partofthecourse.Itdoesnotassumethatstudentshaveexperiencewith anotherprogramminglanguage,althoughoccasionalcomparisonsaremade withFortranorCtohelpstudentswhoarefamiliarwiththoselanguages adjusttoIDLsyntaxandprogrammingstyle.

Thegoalofthisbookistoteachbeginnersenoughaboutprogramming,and givethemenoughpracticalexperience,thattheycanwriteusefulprogramsfor

coursesintheirdisciplineorfortheirresearch.Thisbookintroducesstudents tothefollowingconcepts:

■ Variablesanddatastructures

– Variableassignmentandexpressionevaluation

– Whentouseintegersandfloating-pointnumbers

– Underflowandoverflow

– Round-offerror

– InfinitiesandNot-a-Numbers

– ArraysandIDLarraysyntax

– Datastructures

■ Inputandoutput

– Whenandhowtousetextfiles,binaryfiles,andscientificfileformats, suchasnetCDF

– Trade-offsamongspeed,portability,simplicity,andtransparency

■ Proceduresandfunctions

– Howproceduresandfunctionswork

– Positionalarguments

– Keywordarguments

■ Programmingstyle

– Writingreadableprograms

– Modularizingprograms

■ Graphics

– Makinggoodgraphs:linegraphs,contourgraphs,andmaps

– Generatingprintedoutput

■ Typicalapplications

– Basicstatisticsandpseudorandomnumbers

– Interpolation

– FastFouriertransforms

Youwillnoticethatthislistcontainssomerelativelyfundamentalconcepts, suchasintegerandfloating-pointarithmetic,andsomeverypracticaltopics, suchashowtoplotamaporprintagraph.Inkeepingwiththequotationatthe beginningofthispreface,theseconceptsaretaughtprimarilythroughexamples.Theexampleprogramsanddatasetsusedinthisbookareallavailable viatheWorldWideWeb(seeChapter3fordetails).

Acknowledgments

Manypeopleassistedwiththepreparationofthisbook;myapologiesto anyoneImayhaveoverlooked.Mythanksgofirsttothestudentsinmy classesatTexasA&MUniversityforwhomIwrotethisbook.Theyusedearlier versionswhenitwasonlyasetofclassnotesandhelpedtrackdownnumerous errorsalongtheway.ThepeopleofResearchSystems,Inc.,thedevelopers ofIDL,havebeenverysupportiveofthiseffort,particularlyKarlNichols, whoencouragedmewhenIfirstapproachedRSIforhelp.Muchofthefinal draftofthebookwascompletedwhileIwasavisitortotheAtmospheric ChemistryDivision(ACD)attheNationalCenterforAtmosphericResearch (NCAR),whichisfundedbytheNationalScienceFoundation.Mythanks tomyhost,BillRandel,andanoutstandinggroupofcolleaguesandfriends, AndrewGettelman,DougKinnison,SteveMassie,DanMarsh,LauraPan, andmanyothers,aswellastoACDandNCAR,forprovidingsuchanexcellent environmentinwhichtowork.Iwouldliketothankallofthecontributorsto theUsenetnewsgroup comp.lang.idl−pvwave,wherezealous,convivial, andsometimesperplexingdiscussionsofIDLgooneveryday.Overtheyears IhavelearnedmuchofwhatIknowaboutIDLfromthegenerousassistanceof itsparticipants.Itis,inmyexperience,auniquegroupofonlinecompatriots, manyofwhomhavemetonlyelectronically.Finally,thankstomyfamily, JeanAnnandEllie,forputtingupwithallthetimeawayfromthemneeded towriteabook.

Introduction

1.1WhatIsIDL?

IDLisacomputersoftwaresystemthatisproducedandsoldbyResearch SystemsInc.ofBoulder,Colorado.IDLisanacronymfor InteractiveData Language. 1 IDLconsistsofbothaninteractiveprogrammingenvironment andaprogramminglanguage.Itisusedinawiderangeofscienceand engineeringdisciplinesforprocessingandanalyzingnumericalandimage data.Itdrawsfeaturesfrommanyotherprogramminglanguages,including Fortran,C,BASIC,andAPL,butitdiffersfromeachofthoselanguagesin importantways.

ThemostimportantdifferencebetweenIDLandmanyofthelanguages usedfordataanalysisisthatitistrulyinteractive.WithintheIDLenvironment(or interpreter ),itispossibletotypeacommandandseetheresults immediately.ThisisquitedifferentfromFortranandC,twolanguagesthat areoftenusedtowritescientificdataanalysissoftware.TocreateaFortran program,aprogrammermustfirstcreateafile(ormultiplefiles)containing theFortranprogram(alsocalledthe sourcecode ).Thisisdonewitha text editor,whichisaword-processingprogramsuitedforwritingcomputerprograms.TheFortranprogramconsistsofstatementsintheFortranlanguage. TheFortranprogramisthen compiled intoaformthatthecomputercan understandandexecute.Thecompiledprogramisreferredtoasthe object code.Theobjectcodeisthen linked withanyotherprecompiledprograms (libraries )thatareneeded.Theobjectcodecanthenbeexecuted.Ifanerror (or bug )isfoundintheprogram,itcanbecorrected,recompiled,relinked, andthenre-executed.Althoughmuchofthisprocesscanbeautomated(using autilityprogramcalled make,forexample),itcanberathertime-consuming towriteanddebugaFortranprogram.

CompiledlanguageslikeFortranandCdohavesomeadvantagesover interactiveorinterpretedlanguages.Foronething,compilerscanoftenorganizetheobjectcodesothatitexecutesveryquickly.Thisiscalled optimization. Asaresult,compiledlanguagescanusuallyexecuteaprogramfasterthan theequivalentprogramwritteninaninteractivelanguage.Largecomputer

1Nottobeconfusedwithanothertypeofsoftwarecalled InterfaceDefinitionLanguage that hasthesameacronym.

modelsthathaveheavycomputationalrequirementsareusuallywrittenin FortranorC.

Manymoderndesktopcomputersandworkstationshavemorethanone centralprocessingunit(CPU).Forsometypesofoperations,IDLcanmake useofasmallnumberofCPUs(probablyintherangeoftwotoeightCPUs) usingatechniquecalledmultithreading.Large-scalescientificcomputers,on theotherhand,oftenhavehundredsoreventhousandsofCPUs.IDLisnot designedtomakeuseofthose massivelyparallel computers.Therefore,when developingforhigh-performance,highlyparallelcomputers,programmers generallyuseadvanced parallel FortranandCcompilers.

WhyuseIDL,then?Thereareseveralgoodreasons.Oneisthatyoucan takeaquicklookatadatasetwithoutgoingtothetroubleofwritingan entireprogramforthatpurpose.UsingIDLitisoftenpossibletobrowse throughalargedatasetwithonlyafewIDLcommands.Evencomplex graphscanusuallybeplottedwithonlyafewlinesofIDL.Asecondreason touseIDListhatthe“programmer’sloop”ofwrite-compile-execute-debug canbedoneveryquicklywithouttheuseofspecialsoftwareknownasa debugger.(IDL is thedebugger.)Third,IDLcontainsa large numberofbuiltinfunctionsforstatistics,graphics,linearalgebra,andthelike.Finally,itis remarkablyeasytowriteself-containedprogramsinIDLwithtruly interactive interfaces,includingmenus,buttons,windows,dialogboxes,andgraphics. Intheauthor’sexperience,thecombinationofthesefactorsmakesitpossible towritebetter,moreflexibleprogramsmuchfasterthanusingFortranorC. Ifyouhaveexperiencewithotherprogramminglanguages,someoftheother advantagesofIDLwillbecomemoreapparentasyouuseit.

ThemostrecentversionofIDLrunsunderavarietyofoperatingsystems, includingthemostcommonlyusedversionsofUnix,Linux,MacOSX, andWindows.(ThisbookwasdevelopedandtestedwithIDLVersion6.1.) VisittheResearchSystemswebsite(seeSection1.2)forcurrentinformation ontheplatformssupported.Withamodestamountofcare,IDLprograms canbewrittenthatwillrunonallsupportedsystems.IDLprogramsarethus quite portable. RecentversionsofIDLalsoincludeextensive object-orientedprogramming features.However,object-orientedprogrammingisnotcoveredin thisbook.

1.2IDLResources

InformationaboutIDLisavailablefromtheResearchSystemswebsite: http://rsinc.com

Amongotherthings,youcandownloadanalmostfullyfunctionaldemo versionofIDLfromthewebsiteandinstallitonyourcomputer.Withoutpurchasingalicense,thedemoversionwillrunfor7minutesbefore automaticallyexiting.

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
(ebook) an introduction to programming with idl: interactive data language by kenneth p. bowman isbn by sallypascoe6407 - Issuu