snana tutorial

41
SNANA Tutorial R. Kessler May 2016 1

Upload: others

Post on 29-Dec-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SNANA Tutorial

SNANATutorial

R.KesslerMay2016

1

Page 2: SNANA Tutorial

2

GOOGLESearch:No,notthisSNANA

Page 3: SNANA Tutorial

3

Thisone

Page 4: SNANA Tutorial

Outline

•  Architecture•  SoBwareInterfaceforPrivateCode•  SystemaKcs&MulK-CoreJobs•  Output•  DocumentaKon

4

Page 5: SNANA Tutorial

Architecture:SummaryofReady-to-RunProgramsin

$SNANA_DIR•  SimulaKonpackage(catalog,notpixels)•  LightCurveFiYng&TemplateFiYng•  HubbleDiagramFiYng(old,simple,fast:be[ercodeselsewhere)

•  UKliKesforsystemaKcs&mulK-coreprocessing•  NOImage-ProcessingTools

5

Page 6: SNANA Tutorial

$SNDATA_ROOT

Architecture:Environment•  SimulaKonpackage(catalog,notpixels)•  LightCurveFiYng&TemplateFiYng•  HubbleDiagramFiYng•  UKliKesforsystemaKcs&mulK-core

processing

6

filters

BD17

MWex/nc/on

Efficien

cym

aps

Ibc IIP

$SNANA_DIR

Host

Page 7: SNANA Tutorial

SNANAArchitecture

SIMULATION LightCurveFiKng

SALT-IIMLCS2k2SNooPyStretchDouble-Stretch

SN Ia models

7

Page 8: SNANA Tutorial

SNANAArchitecture

SIMULATION LightCurveFiKng

SALT-IIMLCS2k2SNooPyStretchDouble-Stretch

SN Ia models

“NON1a”Templates(e.g.,CC)“SIMSED”Sequences(e.g.,Kasenmodels)

8

Page 9: SNANA Tutorial

SNANAArchitecture

SIMULATION LightCurveFiKng

SALT-IIMLCS2k2SNooPyStretchDouble-Stretch

SN Ia models

“NON1a”Templates(e.g.,CC)“SIMSED”Sequences(e.g.,Kasenmodels)

GRID ExternalProgram(e.g.KarpenkaCCtemplates)

9

Page 10: SNANA Tutorial

SNANAArchitecture

SIMULATION LightCurveFiKng

SALT-IIMLCS2k2SNooPyStretchDouble-Stretch

SN Ia models

“NON1a”Templates(e.g.,CC)“SIMSED”Sequences(e.g.,Kasenmodels)

GRID ExternalProgram(e.g.KarpenkaCCtemplates)

PSNIDExternal

10

Page 11: SNANA Tutorial

WhyUseGRID?(versusmodelparams&redshiR)

•  Allowsusingtemplatesconstructedfromnon-SNANAprograms

•  AnySNmodelàstandardmodelformatfortemplate-fiYngprogramssuchasPSNID

•  Canbefaster(e.g.,hugespeed-upforSNooPy)

11

Page 12: SNANA Tutorial

SNANAArchitecture:FileSharing

12

SNANAwasimplicitlydesignedtorunonaclusterwithmanyuserssharingfiles.

Hey,didyouupdatethefiltertransmissionfiles?

Page 13: SNANA Tutorial

SNANAArchitecture:FileSharing

13

SNANAwasimplicitlydesignedtorunonaclusterwithmanyuserssharingfiles.

$SNDATA_ROOT contains•  Data•  Simulatedoutput•  Filtertransmissions•  PrimarySEDs•  Ia&CCspectraltemplates•  MWexKncKonmap•  SNmodelparameters•  SIMLIBfiles•  HOSTLIBfiles•  Efficiencymaps•  Etc...

MostSNANAinputsarein$SNDATA_ROOT.Canruntestswithfile(s)inyourprivatedirectory,butgoalistosharefileswithcommunityvia$SNDATA_ROOT

Page 14: SNANA Tutorial

SNANAArchitecture:SharingProprietaryFiles

14

During analysis it is useful to share proprietary SNANA files,

$SNDATA_ROOT/INTERNAL/SDSS$SNDATA_ROOT/INTERNAL/DES$SNDATA_ROOT/INTERNAL/LSST

INTERNAL directories are not in SNANA downloads.

ENV can be used as part of any input fileName, e.g., set $DES_ROOT = $SNDATA_ROOT/INTERNAL/DES SIMLIB_FILE: $DES_ROOT/simlibs/DES_DIFFIMG.SIMLIB

Page 15: SNANA Tutorial

SNANASimulaKonCapabiliKes•  MulKpleSNIa+IntrinsicSca[ermodels•  CCTemplateswitharbitraryweight,magOff,sca[er•  PeculiarVelociKes(Gausssca[er)•  HostGalaxynoise,photo-z,SNcorrelaKons(HOSTLIB)•  GalacKcExKncKon(SFD98orSchlaffly2012update)•  Arbitraryz-dependenceforanyparam:e.g.,β(z)•  Usemeasuredcadence,skyNoise,ZP,PSF(SIMLIB)•  Wrong-HostmodelwithincorrectzHost•  Flux-ErrorCorrecKon(e.g.,fromfakesonimages)•  SurveyDetecKonEfficvs.S/N(feedstriggerlogic)•  TriggerLogic(e.g.,2nightsabovethreshold)•  SurveyEfficmapforSpec-Confirmed•  SurveyEfficmapforSpec-zHost(e.g.,OzDESeffic)•  SurveyEfficmapforphoto-zHost(e.g.,forSN+hostphoto-zfit)

15

PHYSICS

SURVEY

Page 16: SNANA Tutorial

SNANASimulaKonCapabiliKes•  MulKpleSNIa+IntrinsicSca[ermodels•  CCTemplateswitharbitraryweight,magOff,sca[er•  PeculiarVelociKes(Gausssca[er)•  HostGalaxynoise,photo-z,SNcorrelaKons(HOSTLIB)•  GalacKcExKncKon(SFD98orSchlaffly2012update)•  Arbitraryz-dependenceforanyparam:e.g.,β(z)•  Usemeasuredcadence,skyNoise,ZP,PSF(SIMLIB)•  Wrong-HostmodelwithincorrectzHost•  Flux-ErrorCorrecKon(e.g.,fromfakesonimages)•  SurveyDetecKonEfficvs.S/N(feedstriggerlogic)•  TriggerLogic(e.g.,2nightsabovethreshold)•  SurveyEfficmapforSpec-Confirmed•  SurveyEfficmapforSpec-zHost(e.g.,OzDESeffic)•  SurveyEfficmapforphoto-zHost(e.g.,forSN+hostphoto-zfit)

16

PHYSICS

SURVEYCharacterizingthesurveyiscrucialtoavoidmis-interpre/nginstrumentalar/factsasastrophysics.

Page 17: SNANA Tutorial

SNANACPUProc-TimeIntel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz

•  DESSimulaKon-GenerateSALT-IIlightcurves:70Hzàacceptedrate:8Hz-GenerateCClightcurves:600Hzàacceptedrate:5Hz•  LightCurveFiYng(DES)withSALT-II:4Hz•  NotethatProcessingKmescaleswithnumberofobservaKonsandredshiBrange.

17

Page 18: SNANA Tutorial

SimulaKonSpeed-upTrick

18

Whenefficiencyisverylow(e.g.,forCC),generaKonspeedcanbelimitedbyreadinganewSIMLIBentryforeachevent.Trick:use“SIMLIB_NREPEAT”keytore-useeachSIMLIBentrymanyKmesbeforereadingthenextone.

Page 19: SNANA Tutorial

SoBwareInterfacetoAddPrivateCode

HowtowriteyourownSNANAcode

19

Page 20: SNANA Tutorial

NoInterfaceforSimulaKon

•  However,withoutre-compilingcanadd+newsurvey,filters,SIMLIB,HOSTLIB,calibraKoninfo+newCCtemplates,weights+newSIMSEDmodel(e.g.,Kilonova)(new“soBwaremodel”takes~hourtoinstall)

20

Page 21: SNANA Tutorial

InterfaceforAnalysis

SNANAprogram•  readdataorsim•  Applycuts•  Createtable,LCPLOTfile

21

Page 22: SNANA Tutorial

InterfaceforAnalysis

UserApplicaKon:SNLC_FIT

UserApplicaKon:PSNID

SNANAprogram•  readdataorsim•  Applycuts•  Createtable,LCPLOTfile

22

Page 23: SNANA Tutorial

InterfaceforAnalysis

UserApplicaKon:SNLC_FIT

UserApplicaKon:PSNID

UserApplicaKon:PRIVATE_JOB(C,fortran)-  EnKreanalysis-  modifySNANArouKne-  Writetospecialformat-  Etc...

SNANAprogram•  readdataorsim•  Applycuts•  Createtable,LCPLOTfile

SNANAPrograms

23

Page 24: SNANA Tutorial

InterfaceforAnalysis

UserApplicaKon:SNLC_FIT

UserApplicaKon:PSNID

UserApplicaKon:PRIVATE_JOB(C,fortran)-  EnKreanalysis-  modifySNANArouKne-  Writetospecialformat-  Etc...

SNANAprogram•  readdataorsim•  Applycuts•  Createtable,LCPLOTfile

SNANAPrograms

Writeyourownanalysiscodeinpython(e.g.,Zoheyr’sKNsearch)

24

Page 25: SNANA Tutorial

SystemaKcs&MulK-CoreJobs•  PrecisionanalysestypicallyrequiremanyiteraKonsofsimulaKonsandanalysis,eachwithasmallvariaKoninparametersormethod.

•  SNANAhastoolstoimplementmulK-iteraKonanalysesusingmulK-coreplauorms.

(e.g.,Fermilab,NERSC,Argonne,Midway,Folio...)

25

SNANA

console

SwitchingtoC11Intrinsicsca[ermodel

Page 26: SNANA Tutorial

SystemaKcs&MulK-CoreJobs•  Sim&AnalysiscodesreadinputinstrucKonsfromatextfile.

•  SpecifyvariaKonswithcommand-lineoverridestoavoidmoreinputfiles.

•  SNANAScriptsusecommand-lineoverridefeaturetolaunchmulKplejobsinbatchsystem.

26

sim_SNmix.plLaunchmulKpleSIM(Ia+CC)jobs

split_and_fit.plLaunchmulKplelightcurvefitjobs

Page 27: SNANA Tutorial

SystemaKcs&MulK-CoreJobs

27

sim_SNmix.plLaunchmulKpleSIM(Ia+CC)jobs

Example:SubsetofsimjobsforJLAsystemaKcs.Eachjobàseparatecore

Page 28: SNANA Tutorial

SystemaKcs&MulK-CoreJobs

28

Example:SubsetoffitjobsforPS1systemaKcs

split_and_fit.plLaunchmulKplelightcurvefitjobs

Page 29: SNANA Tutorial

SNANAOutput

29

Page 30: SNANA Tutorial

SIMULATIONOutput

30

DataFiles•  FITSformatforlargejobsor• ASCIIformatfortesKng(1fileperSN)

IsaidNEVERuseasciiformatforlargesimjobs!

Page 31: SNANA Tutorial

SIMULATIONOutput

31

DataFiles•  FITSformatforlargejobsor• ASCIIformatfortesKng(1fileperSN)

IsaidNEVERuseasciiformatforlargesimjobs!

ASCIISummaryFile•  1rowperacceptedSNor•  1rowpergeneratedSN(forefficiency)

Page 32: SNANA Tutorial

SIMULATIONOutput

32

NeverTrustSimulaKonOutputàAlwayscheckdata/MCdistribuKons(redshiB,fitparams,SNR,etc...)

Y’all don’t have to worrynone; I generated themsimulations myself.Who took my beer ?

Page 33: SNANA Tutorial

AnalysisOutputàSNTABLEs

•  SNANAtablebeforefit(1rowperSN)•  FITREStableaBerfit(1rowperSN)•  LCPLOTtablewithlightcurve&best-fitcurve

33

Page 34: SNANA Tutorial

AnalysisOutputàSNTABLEs

•  SNANAtablebeforefit(1rowperSN)•  FITREStableaBerfit(1rowperSN)•  LCPLOTtablewithlightcurve&best-fitcurve

34

Formats:•  TEXT(1filepertable)• HBOOK(alltablesà1file)•  ROOT(alltablesà1file)

•  EasiertoinstallSNANAwithoutHBOOKorROOT(butwillmissmostoutputvariablesfromanalysis)•  NewformatcanbeaddedifinterfacerouKnesareprovided

Page 35: SNANA Tutorial

AnalysisOutputàSNTABLEs

•  SNANAtablebeforefit(1rowperSN)•  FITREStableaBerfit(1rowperSN)

35

-  ALLvariablesstoredinHBOOK&ROOTformat(comparedtoTEXT,moreefficienttoread&write)-  SubsetstoredinTEXTforinputtocosmologyfit-  UKlitytoappendTEXTfile(fromHBOOKorROOT)-  See“sntable_dump”toview,dump,appendtables-  SlowlymovingawayTEXT(exceptfordebug)

Page 36: SNANA Tutorial

SNANADocumentaKon

36

Page 37: SNANA Tutorial

UserInterfaceforManual•  120pagemanualwithnointerfaceexcept‘preview’

•  Difficulttogetstartedwithoutusingexamplesfromsomebodyelse.

•  Wouldappreciatecommunityhelpmakingthisbe[er.

37

Page 38: SNANA Tutorial

TrackingChanges

Ignoreboring“MISC”thatismainlyforme

38

Page 39: SNANA Tutorial

TrackingChanges

YoushouldreadIMPORTANT&USEFULupdates

39

Page 40: SNANA Tutorial

Miscellaneous•  ReportbugsASAP;don’tjusthackaprivatefixforyourself.•  ReportcompilaKonwarnings.•  ThinkabouthowyoucancontributetoSNANA.

•  Inpapers,SNANAcitaKonisnotenough;alsocitesourceofmodels,templatedata,galaxycatalogs,etc.

40

Page 41: SNANA Tutorial

Conclusion

41SNANA Tutorial, May 14 2008 20

From the SNANA Legal Team:

• SIDE EFFECTS include, but are not limited to:

confusion, frustration, watery eyes, head-

aches, weight loss, weight gain,

systematics-limited results, incorrect

results, denial of tenure.

• Do not drive or operate heavy machinery

while using SNANA.

I agree to do whatever the

SNANA instructors request !