\contentslabel
[\thecontentslabel]1.25cm \titlerule*[.5pc]. \thecontentspage\contentslabel[\thecontentslabel]1.25cm \thecontentspage[]\contentslabel[\thecontentslabel]1.25cm \titlerule*[.5pc]. \thecontentspage[] ThemostlimitlessanduserfiendlywaytodevelopprogramsinAstronomyisusingPython,therearemanypackages,modules,functionsnowavailabletohelpyouinalmostanything.Me,asanundergradengineerI’musedtoprogramonanuserinterfaceandnotdirectlyinaterminal.So,hereIwillexplainyoumyownwayofdoingthings.ImakemyprogramsontheCanopyeditor,itshowswhenandwhereyouhaveprogramingerrorandwarnings,andtheinterfaceiseasytolearn,nowtorun,Iopenaterminal,gotothedirectorywheremyprogramis,typeipythonwaitandthentyperunmyProgram.py,andwaitfortheresult.NowtherearealotoffancierwaystoworkwithPython,youcanprogramandtestdirectlyusingIPythonNotebookonawebbrosweroryoucanjustgofortheterminal,usenanoorviorthetexteditoryoulikeandthenrunitbytypingpythonmyProgram.py.Atthispointisuptoyou,butheyherearesomelinkstostartandthepackages/modulesyoushouldinstall. PyCharm,itadevelopmentenvironment,justlikeCodeBlocksorNetBeanshttp://www.jetbrains.com/pycharm/ Spyder,actuallythisistheinterfacethatcomeswiththePythondiscritutionAnaconda,youwillgetthePythondistricutionandtheintrerface.https://store.continuum.io/cshop/anaconda/ Canopy,thisistheoneImentionedbefore,itsupereasytouseandyoucaninstallpackageswithoneclick.https://www.enthought.com/products/canopy/
InPython,modulesarelikethelibrariesinC,therefore,tousemath,astronomyandcomputersciencetoolsyouneedtoinstallthem.Tolearnwhetheryoualreadyhaveamoduleinstalledornot,typeoniPythonimportandreaModule,iftheoutputresultissomethinglikeImportError:NomodulenamedandreaModule,youdefinitelydon’thaveitinstalled.Thestrategyheretoinstallpackagesitfairlyeasy,findtheirwebsite,gotothedownloadsectionandfollowtheinstructions,almostallthepackagesareavailableonthePythonPackaingIndexandmaybeinstalledbyrunning: pip install pyfits Tolearnhowtousethemcheckthedocumentationpage,usermanualsortheirAPI’s,ifyouhaveexperienceonobjectorientedprogramingitwillbelikerunninganewbikeandifyoudon’t,don’tworrytoomuch,Pythonwasdesignedtobeeasytoprogram,justlearntherulesofthegame. Astropy,thispackageisthemusthaveofeveryastronomer,containstoolstohandlecoordinatesystems,units,convolution..wellisbetterifyoutakealookatthewebpage.http://www.astropy.org/ Numpy,thispackagecontainsthemathmagicfunctions,linearalgebratoolsandthearraymanagementvariables,makesureyoulearnallaboutNumpyarraysyouwillworkwiththemallthetime.http://www.numpy.org/ SciPy,wellthispackageisthebaseofallscikitmoduleswhichcontainthefunctionsyouwilluseinimageprocessingandmachinelearning.http://www.scipy.org/ ScikitImage,containsimageprocessingtools,itistheOpenCVforPythonhttp://scikit-image.org/ ScikitLearn,containsdataminingalgorithms,prettymuchcontainseverythingthatyouwilleverneed.http://scikit-learn.org/ Matplotlib,thispackageisprobablyoneofthemostpowerfultoolsvisualizedata,youcandrawalmostanythingyouwantandexaclyhowyouwantit.AnexampleofthataretheimagesoftheAstroMLbook,youcanaccesstotheimagelibrarycodeandlearnhowtheyaremade,thisisthewebsitehttp://www.astroml.org/book_figures/index.html.11Statistics,DataMining,andMachineLearninginAstronomybook,itwasmentionedbefore.Youcandownloadthepackageherehttp://matplotlib.org/. PyFITS,inthispackageyouwillfindtoolstomanipulateFITSfiles,createnewones,createimagecubes,tables,anddoallkindsofthingswiththeirheaders.Certainlythispackageismorethanuseful.http://www.stsci.edu/institute/software_hardware/pyfits InthepathofresearchingI’mcertainyouwillfindmoreandnewpackagesandbythemyouwillbepreparedtoinstallanything. Thisisatoolkitforassemblingastronomicalimagesintomosaics,butithasmorefunctionsthatyoumayneedinthefuturetoprepareyourdatabeforeprocessingit.TherearetwowaysofinstallingandIwouldsaythatisbettertohavethemboth.Oneistoinstallthetoolkitandanytimeyouneedit,yourunthecommandsontheterminal,theotheroneistoinstallaPythonmoduleanduseitjustlikeanyothermodule.Toinstallmontageforterminal,downloadthelastestversioninthiswebsitehttp://montage.ipac.caltech.edu/docs/download.html,readtheREADMEfileorgotothiswebsitehttp://montage.ipac.caltech.edu/docs/build.htmlandfollowthesteps,nowifyoudon’thaveanyprobleminstallingit,youcantrytestingitwithanexampleprogramfoundonthiswebsitehttp://montage.ipac.caltech.edu/docs/pleiades_tutorial.html,incaseyouarehavingtroubleandyourcomputerisaMAC,insteadofdoingstepfive(IfyouwanttobeabletoruntheMontageexecutablesfromanydirectory),trythis: Openafilecalled.profilelocatedinyouruserfolder.(e.g./Users/Laureth) $ vi .profile Includeinthefilethefollowing export PATH=/Applications/Montage_v3.3/bin:$PATH Inthislink(https://github.com/LaurethTeX/Clustering/blob/master/Tools.md#the-profile-file)youwillfindanexampleofhowthisfileshouldlook.Afteryoumodifyit,makesurethatyousaveitandtypein/Users/Laureth, $ source .profile ThentrytestingtheMontagecommands,andI’msurethatitwillmagicallywork,justrememberthatanytimeyouuseanycommand,typesource.profile.
Nowtheotherwaytoinstall,impliesonlytoinstallaPythonmodulebutthismodulecontainslessfunctionsthattheterminalapplication,inanycasecheckthewebsitehttp://www.astropy.org/montage-wrapper/,thereyouwillfindallthedocumentationyoumayneedandtheinstructionstoinstallit(Spoilerspipinstallmontage-wrapper).
Anyquestionsyoumayhaveandhowtoinstall,hereismyGitHubpageforsoftwaretoolshttps://github.com/LaurethTeX/Clustering/blob/master/Tools.md\chapterimageboat.png
Understandyourdata
Beforecontinuing,firstandmostimportantlyyoumustselecttherawdatayouaregoingtoprocessandlaterafteryouaquireexperiencewithanspecificdatasettheideaistoexpandthealgorithmstoanykindofdataset.Theimportantthingsaretolearnhowtoinputthedatacorrectly,establishtherightlearningparamentersintheselectedalgorithmandfindthebestwaytovisualizeyourresultsandinterpretthemcorrectly.Nowlet’sstartwithbasicconceptsthatvaryfromanengineeringtoanastronomerpointofview.