加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 PDL-Book-20120205

PDL-Book-20120205.pdf

PDL-Book-20120205

liweitianux
2012-05-13 0人阅读 举报 0 0 暂无简介

简介:本文档为《PDL-Book-20120205pdf》,可适用于IT/计算机领域

ThePDLBookFebruaryforPDLvTableofContentsPageTableofContentsTheBeginningsofPDLpThecaseforahighlevelapproachpThecaseforafreeDataLanguagepSowhyPerlpFirstStepswithPDLpAlright,let'sdosomethingpWhirlingthroughtheWhirlpoolpMeasuringthebrightnessofMpTwinkle,twinkle,littlestarpGettingComplexwithMpRoundoffpConstructingPDLspThebasicconstructor,pdl()pArrayallocation:zeroes()andones()pIndexPDLs:xvals,yvals,rvals,sequence,ndcoordspSpecialtyconstructorspGettingvaluesintoandoutofPDLspConstruction:slurpingPerlarrayspAssignmentwith=pImportingdatadirectlyfrommemory:getdatarefpConversiontoPerltypes:atandlistpDataTypesandContextspRefresheronPerlDataTypesContextspPDLDataTypespPDLsandPerlContextspBADValuespDataflowpThreadingpThreadingrulespConrollingthreadinganddimensionorder:xchg,mv,reorder,flat,clump,andreshapepDummyDimensionspCollapseReduceOperatorsandReductionpPDLHeaderspSelectionandLocationinPDLspAquicktourofselectionpSelectionOperatorspNiceSlicearraysubfieldsyntaxpNiceSliceExamplespSlicestringconrolledsubfieldsofaPDLpDicepullarbitraryrowsfromaPDLpIndexselectelementsfromaDPDLpIndexNDselectelementsfromanNDPDLpRangeselectsubfieldsfromanNDPDLpLocationOperatorspThewhereoperatorpThewhichoperatorpThewhichNDoperatorpTableofContentsPageOperatingonPDLspExpressionswithPDLspPDLsasbooleanvalueslogicalsandmaskspCollapsereduce:SummarizingbyrowpArithmeticcollapse:prodoverandsumoverpLogicalcollapse:andoverandoroverpStatisticalcollapse:averageandstatsoverpGeneralpurposecollapsereduction:reducepCombinationoperators:PDLsandPerllistspGlobalglommingshredding:pdlandlistpGatheringscattering:catanddogpExtendingaPDL:appendpFinercontrolusegluepInterpolationpInterpolatevirtuallyanyregulargrid:interpNDpInterpolateonaDirregulargrid:interpol,interpolatepSlicing,DicingandThreadingdimswithPDLpFindingpiddledimensionspTheslicefunctionregularsubsetsalongaxespThebasicslicingspecificationpModifyingslicespDoesasliceconsumememorypAdvancedslicesyntaxpPDL'sMethodnotationpThediceanddiceaxisfunctionsirregularsubsetsalongaxespUsingmv,xchgandreordertransposingdimensionspCombiningdimensionswithclumppAddingdimensionswithdummypCompletelygeneralsubsetsofdatawithindex,whichpPDLthreadingandsignaturespThreadingpAsimpleexamplepWhybotherpMoreexamplespWhythreadingandwhycallitthreadingpThegeneralcase:PDLfunctionsandtheirsignaturepYoucanwriteyourownthreadingroutinespMatchingthreadingdimensionspWritingyourownfunctionsintoPDLpUsingPDLFunctionspMovingFunctionsintoSeparateFilespGettingPDLtolookforyourfunctionsinotherplacespDocumentingyourFunctionspPlottingandLabellingDataandImagesusingPGPLOTpIntroducingPDL::Graphics::PGPLOTpAnoverviewofDplottingcommandspOptionsinplotcommandspHardcopiesandplotoptionspSettingdefaultvaluesforoptionspSettinguptheplotareapTableofContentsPageDrawinglinesandplottingpointspPlottingerrorbarspDrawinglinespPlottinghistogramspDrawingpolygonspDisplayingimagespTransformspColourbarwedgepContourplotsandvectorfieldspDrawingsimpleshapespTextandlegendspNonalphanumericsymbolspLabellingyourfiguresinPGPLOTpUsingcolourpThreadinginPDL::Graphics::PGPLOTpRecordingandplayingbackplotcommandspRedoingaplotwithslightlydifferentdatapUsingrecordinginscriptspTheobjectorientedapproachpWhyusetheOOinterfacepUsageoftheOOinterfacepUsingPGPLOTcommandsdirectlypGraphicswithPLplotpIntroducingPDL::Graphics::PLplotpPlottingasimpleparabolapObjectOrientedExamplespAxislabellingandtitlespInteractivecrosshairswiththewxwidgetsoutputdevicepsettingtheDEVandFILEoptions,andusingthealiasedoptionfornew()pOutputtingpostscriptpToolsforplottingpointspASymbolsexamplepPlottingmultiplecurvespPlottingmultiplecurveswithamultidimensionalpiddlepColorizingmultipledatasetspPlottingmultiplecurveswithdifferentlycoloredcallstoxyplotpAmultiplecurvewithxyplotpSolvingcurveclippingonmultiplexyplotswiththeBOXoptionpPlottingmultiplecurveswithstripplotpStripplotsandreadingDATAwithrcolspMultipleplotswithSUBPAGEpBoxesandViewportspUsingInsetspBasicsofviewportspSurfacedimensionspViewportpositioningpTheclippingboxpPagesizepViewportupperrightpViewportcenteredpTableofContentsPageViewportextremeboundspViewportmultipleplotspThebasicboxpThetweakedboxpBoxwithplotspMultipleplots,changingtheboxwithinasingleviewportpBoxandviewportsummarypOthertypesofplotpShadeplotpHistogrampHistogramheightpBargraphpBargraphcolorandbarheightpBargraphwithlabellingpUsingtheMEMdevicepCreatingaMEMmemorybufferpPlottingoveranimagewiththeMEMdevicepFunctionalprogrammingstyleexamplespSimplelineplotandmultiplewindowsdemoxpMultiplewindowandcolormapdemoxpPolarplotdemoxpLogplotdemoxpHistogramdemoxpFontdemoxpFontdemoxpdplotdemoxpContourplotdemoxpWindowpositioningdemoxpMeshplotdemoxpBarchartdemoxpsimplepiechartxpShadeplotdemoxpplshadedemo,usingcolorfillxpAsimplestripchartwithfourpensxpdlineandpointplotdemoxpBackdropplottingofworld,USmapsxpGriddatademoxpSimplevectorplotxpDisplaysGreeklettersandmathematicallyinterestingUnicoderangesxpUnicodePaceFlagxpDrawingpolygonsxpFrequencyAmplitudeandPhasexpSpirographcurvesepitrochoids,cycolids,roulettesxpplmtex,plptexdemoxpPlotsusingdatetimeformattingforaxesxpAlphacolorvaluesdemonstrationxpUsingpllegendincludingunicodesymbolsxpTypesetting,greekletters,symbolspAbasictypsettingexampleppsfragpannotationsandTEXTPOSITIONpTEXTPOSITIONargumentformpTableofContentsPageTEXTPOSITIONargumentformpLegendspDGraphicswithOpenGLpIntroductionpParametricGraphicspTypesofDGraphicalObjectspMorethanoneImagepPuttingitalltogethercoolhackspThePDLPreProcessorpBasicspGettingStartedpReturningValuespExerciseSetpSpecifyingDimensionsandUsingExplicitLoopingpExerciseSetpTipspRecappAppendixA:InstallingInline::PdlpppAppendixB:SolutionstoExercisespExcerciseSetpExerciseSetpPDLBookCreditspChapter:TheBeginningsofPDLPageTheBeginningsofPDL"Whyisitthatweentertainthebeliefthatforeverypurposeoddnumbersarethemosteffectual"PlinytheElderThePDLprojectbeganinFebruary,whenIdecidedtoexperimentwithwritingmyown'DataLanguage'IamanastronomerMydayjobinvolvesalotofanalysisofdigitaldataaccumualatedonmanynightsobservingontelescopesaroundtheworldSuchdatamightforexamplebeimagescontainingmillionsofpixelsandthousandsofimagesofdistantstarsandgalaxiesOrmoreabstrusely,manyhundredsofdigitalspectralrevealingthesecretsofthecompositionandpropertuesofthesedistantobjectsObviouslymanyastronomersbeforehavedealtwiththeseproblems,andalargeamountofsoftwarehasbeenconstructedtofacilitatetheiranalysisHowever,likemanyofmycolleagues,IwasconstantlyfrustratedbythelackofgeneralityandflexibilityoftheseprogramsandthedifficultyofdoinganythingoutoftheordinaryquicklyandeasilyWhatIwantedhadaname:'DataLanguage',iealanguagewhichallowedthemanipulationoflargeamountsofdatawithsimplearithmeticexpressionsInfactsomecommericialsoftwareworkedlikethis,andIwasimpressedwiththecapabilitiesbutnotwiththepricetagAndIthoughtIcoulddobetterAsafairlycomputerliterateastronomer(read'nerd'or'geek'accordingtoyourlocalargot)Iwasveryfamiliarwith'Perl',acomputerlanguagewhichnowseemstofilltheshelvesofmanybookstoresaroundtheworldIwasimpressedbyit'spowerandflexibility,andespeciallyit'seaseofuseIhadevenexploredthedepthsofit'sinternalsandwrittenaninterfacetoallowgraphicsthePGPLOTmodule(ThePGPLOTmoduleforperlisaninterfacetothepgplotgraphicslibrary(writteninCandFortran)createdbyTimPearsonofCaltechMoreinformationaboutthislibrarycanbeobtainedfrom:http:astrocaltechedu~tjppgplot)TheeasewithwhichIcouldthencreatechartsandgraphs,formypapers,wasrefreshingVersionofPerlhadjustbeenreleased,andIwasfascinatedbythenewfeaturesavailableEspeciallythesupportofarbitrarydatastructures(or'objects'inmodernparlance)andtheabilityto'overload'operatorsiemakemathematicalsymbolslike*dowhateveryoufeltlikeItseemedtomeitoughttobepossibletowriteanextensiontoPerlwhereIcouldplaywithmydatainageneralway:forexampleusingthemathsoperatorsmanipulatewholeimagesatonceWelloneslownightatanobservatoryIjustthoughtIwouldtryalittleexperimentInaboredmomentIfiredupatexteditorandstartedtocreateafilecalledPDLxsaPerlextensionmoduletomanipulatedatavectorsAfewhourslaterIactuallyhadsomethinghalfdecentworking,whereIcouldaddtwoimagesinthePerllanguage,fast!ThiswassomethingIcouldnotletrest,anditprobablycostmeoneortwoscientificpapersworthofproductivityAfewweekslaterthePerlDataLanguageversionwasbornItwasaprettybareinfant:verylittlewasthereapartfromthebasicarithmeticoperatorsButencouragedImadeitavailableontheInternettoseewhatpeoplethoughtWellpeoplewerefairlycriticalamongthemostvocalwereTuomasLukkaandChristianSoellerUnfortunatelyforthemtheywerebothPerlenthusiaststooandsoonfoundthemselvesimprovingmycodetoimplementallthefeaturestheythoughtPDLoughttohaveandIhadheinouslyneglectedPDLisaprimeexampleofthatmodernphenomenonofauthoringlargefreesoftwarepackagesviatheInternetLargenumbersofpeople,mostofwhomhavenevermet,havemadecontributionsrangingforcorefunctionalitytolargemodulestothesmallestofbugpatchesPDLversionisnowhere(thoughitshouldperhapshavebeencalledversiontoreflecttheamountofgrowthinsizeandfunctionality)andthephenomenoncontinuesIfirmlybelievethatPDLisagreattoolfortacklinggeneralproblemsofdataanalysisItispowerful,fast,easytoaddtooandfreelyavailabletoanyoneIwishIhadhaditwhenIwasagraduatestudent!Ihopeyoutoowillfinditofimmensevalue,IhopeitwillsaveyoufromheapsoftimeandfrustrationinsolvingcomplexproblemsOfcourseitcan'tdoeverything,butitprovidestheframework,thehammersandthenailsforbuildingsolutionswithouthavingtoreinventwheelsorleversChapter:TheBeginningsofPDLPageKarlGlazebrook,Sydney,AustraliaMarchThecaseforahighlevelapproachWe'veallbeenthereYouknowhowyouwanttoanalyseyourdataYouneedtoFouriertransformit,takethesquareroot,multiplybyahighpassfilterandsumupallthehighfrequencemodesButit'stwointhemorningandyouarestaringatthegutsofyourCorFORTRANprogramtryingtofigureoutwhyyourprogramkeepscrashingwitharrayoverflowerrorsYouknowtheseproblemshavebeensolvedindividuallyinnumerabletimesinthepast,carefullywrittensubroutinesareavailabletodoitWhyshoulditbesodifficultThereasonisthoughsubroutinesareavailablelowlevellanguagesstillforcealotofcomplexityonyouYoumustmanagememoryyourself,declarevariableshowevertrivial,callsubroutineswithawholebunchofargumentsincasejustoneofthemisneeded,etcAndyoumustbeabletopulltogetherseperatesubroutinelibrariestodofileinputoutput,userinteraction,dataprocessingandgraphicsWhereasallyoureallywanttodoistellthecomputerthingslike'readthis','Fouriertransformthat',and'Plotthis',andhaveitbesmartenoughtodotherightthingWhatyouarewishingforisineffectahighlevellanguage,inthiscaseitiscalled'English'Whilenaturallanguageunderstandingisstillquitealongwayoff,highlevelcomputerlanguagesarecurrentlyproliferatingExamplesincludePerl,TCL,JAVAscriptm,VisualBasic,Python,andmanymoreSuchsystemshavealsobeendevelopedfordataprocessingWorthyofnotearecommericialsoftwaresuchasIDL('ImageDataLanguage'fromResearchSystemsInchttp:wwwrsinccom),MATLAB(fromTheMathworks,Inchttp:wwwmathworkscom)andthepublicdomainprogramOctavehttp:wwwoctaveorgTheseimplementspecialpurposehighlevellanguageswheredataishandledinlargechunks,via'vectoroperations'WhatdoesthismeaninpracticeItmeansifyousay:C=ABthentheoperationisperformedevenifAandBarelargearrayscontainingmanymillionsofnumbersFurtheryoucansaysomethinglike:D=FFT(C)(toapplyaFastFourierTransform)andgetwhatyouwantNomessingaboutThesedataanalysislanguagesalsoimplementnicegraphicslayers,aswellasalargesuiteofmathematicalalgorithmsHavingusedthesesystemsourselvestheauthorsofPDLcanattesttothesuperiorityofthatapproachintermsofplaingettingthingsdoneWeofcoursebelievethatPDLisnowbetterthanallthosesystems,forquiteafewreasons,andthatyourlifewillbeeasierifyougetitanduseitThecaseforafreeDataLanguageThefreesoftwarecommunityhastakenofftoanextraordinaryextentinthefewyearsThishasbeenmostvividinthesuccessoftheLinux,afreeUNIXlikeOperatingSystemSometimesthismovementisalsodescribedas'OpenSource'ratherthan'free,'andtheterm'free'isoftenusedtomeanfreedomofuseratherthanfreedomfrompriceAthoughmuchofthecodeisindeedfreepublicdomainmoneyismadeoutofthesaleofpackageddistributions,support,books,etcNeverthelessthesoftwareisusuallyavailableatminimalcostOnekeypointisthatthesourcecodeisavailable,sothathoweverthesoftwareisobtainedonehastheabilitytotakeitandinprinciplebeabletochangeittodowhateverisrequiredwithitHowisthisrelevanttodatalanguagesTheauthorsofPDLareallscientistsWewrite,obviously,asscientistsbutbelieveourideasaredirectlyrelevanttoallusersofPDLThescientificcommunityhasChapter:TheBeginningsofPDLPageforhundredsofyearsbelievedinthefreeexchangeofideasIthasbeentraditionaltopublishfulldetailsabouthowresearchisdoneopenlyinjournalsThisisverycloseinspirittotheideasbehindthefreesoftwareThesedaysmuchofwhatscientistsdoinvolvessoftware,infactlargesoftwarepackagestofacilitatecertainkindsofanalysisareoftenthesubjectofmajorpapersthemselveswiththesoftwarebeingfreelyavailableontheInternetSuchsoftwareiscommonlywritteninCorFORTRANtoallowgeneraluseWhyaren'ttheyworkingatahigherlevelAsweexplainedabovethiswouldallowfastercreationandmakethesoftwaremoreportableandmoreeasilycustomisableWellinourviewoneofthereasonsthishasnothappenedisbecauseofthelackofasuitablefreehighleveldatacentriclanguage,withpowerfulenoughfacilitiesThisisnotjustaminorpoint,itiscriticalEvenifsoftwareisnotpublishedandisforinternaluseamongateamofresearchers,inthemodernworldtheteamisoftendistributedamongdozensofindividualsacrossmanyinstititutesandnationsTheonlywaytoensurethatallwillbeabletousesoftwareisifitisfreelyavailableAllthePDLauthorshavehaddirectexperiencewiththisprobleminthepastWehaveoftenbeenhinderedinsharingourcodebycollaboratorshavinglackofaccesstosoftwareMoreoverscientificworkofteninvolvesextensiveinnovationsandmodificationstooldwaysofdoingthingsForsoftwareaswellasbeingfreelyavailableitiscriticaltohaveaccesstothesourcec

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/41

PDL-Book-20120205

仅供在线阅读

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利