Skip to content

Commit

Permalink
Merge pull request #306 from LSSTDESC/3dcorrelation
Browse files Browse the repository at this point in the history
Adds 3d spatial correlation function to CCL. Adds C unit test and C and python notebook examples.
  • Loading branch information
ellison-j committed Apr 11, 2018
2 parents 488d0ab + bedc753 commit 543e13d
Show file tree
Hide file tree
Showing 28 changed files with 1,313 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

if LOCALCLASS
SUBDIRS = include
else
Expand Down Expand Up @@ -29,7 +28,8 @@ endif
noinst_PROGRAMS = tests/check_ccl
TESTS = tests/check_ccl tests/check_swig_timestamp.sh

tests_check_ccl_SOURCES = tests/ccl_test.c tests/ccl_test_utils.c tests/ccl_test_params.c tests/ccl_test_cosmology.c tests/ccl_test_distances.c tests/ccl_test_distances_hiz.c tests/ccl_test_growth.c tests/ccl_test_growth_hiz.c tests/ccl_test_bbks.c tests/ccl_test_eh.c tests/ccl_test_cls.c tests/ccl_test_cmblens.c tests/ccl_test_sigmaM.c tests/ccl_test_massfunc.c tests/ccl_test_correlation.c tests/ccl_test_bcm.c tests/ccl_test_emu.c tests/ccl_test_emu_nu.c
tests_check_ccl_SOURCES = tests/ccl_test.c tests/ccl_test_utils.c tests/ccl_test_params.c tests/ccl_test_cosmology.c tests/ccl_test_distances.c tests/ccl_test_distances_hiz.c tests/ccl_test_growth.c tests/ccl_test_growth_hiz.c tests/ccl_test_bbks.c tests/ccl_test_eh.c tests/ccl_test_cls.c tests/ccl_test_cmblens.c tests/ccl_test_sigmaM.c tests/ccl_test_massfunc.c tests/ccl_test_correlation.c tests/ccl_test_correlation_3d.c tests/ccl_test_bcm.c tests/ccl_test_emu.c tests/ccl_test_emu_nu.c

tests_check_ccl_CPPFLAGS = -I./tests/ -I./include/
tests_check_ccl_LDFLAGS = -L./ -lccl -lgsl -lgslcblas -lfftw3 $(CLASS_LIB)

Expand Down
20 changes: 19 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ am_tests_check_ccl_OBJECTS = tests/tests_check_ccl-ccl_test.$(OBJEXT) \
tests/tests_check_ccl-ccl_test_sigmaM.$(OBJEXT) \
tests/tests_check_ccl-ccl_test_massfunc.$(OBJEXT) \
tests/tests_check_ccl-ccl_test_correlation.$(OBJEXT) \
tests/tests_check_ccl-ccl_test_correlation_3d.$(OBJEXT) \
tests/tests_check_ccl-ccl_test_bcm.$(OBJEXT) \
tests/tests_check_ccl-ccl_test_emu.$(OBJEXT) \
tests/tests_check_ccl-ccl_test_emu_nu.$(OBJEXT)
Expand Down Expand Up @@ -450,7 +451,7 @@ libccl_la_SOURCES = src/ccl_background.c src/ccl_core.c src/ccl_error.c src/ccl_
@LOCALCLASS_TRUE@libccl_la_LIBADD = class/libclass.a
@LOCALCLASS_FALSE@libccl_la_CPPFLAGS = -I./include/ -I$(CLASSDIR)/include -D__CCL_DATA_DIR__=$(datadir)/ccl
@LOCALCLASS_TRUE@libccl_la_CPPFLAGS = -I./include/ -I./class/include -D__CCL_DATA_DIR__=$(datadir)/ccl
tests_check_ccl_SOURCES = tests/ccl_test.c tests/ccl_test_utils.c tests/ccl_test_params.c tests/ccl_test_cosmology.c tests/ccl_test_distances.c tests/ccl_test_distances_hiz.c tests/ccl_test_growth.c tests/ccl_test_growth_hiz.c tests/ccl_test_bbks.c tests/ccl_test_eh.c tests/ccl_test_cls.c tests/ccl_test_cmblens.c tests/ccl_test_sigmaM.c tests/ccl_test_massfunc.c tests/ccl_test_correlation.c tests/ccl_test_bcm.c tests/ccl_test_emu.c tests/ccl_test_emu_nu.c
tests_check_ccl_SOURCES = tests/ccl_test.c tests/ccl_test_utils.c tests/ccl_test_params.c tests/ccl_test_cosmology.c tests/ccl_test_distances.c tests/ccl_test_distances_hiz.c tests/ccl_test_growth.c tests/ccl_test_growth_hiz.c tests/ccl_test_bbks.c tests/ccl_test_eh.c tests/ccl_test_cls.c tests/ccl_test_cmblens.c tests/ccl_test_sigmaM.c tests/ccl_test_massfunc.c tests/ccl_test_correlation.c tests/ccl_test_correlation_3d.c tests/ccl_test_bcm.c tests/ccl_test_emu.c tests/ccl_test_emu_nu.c
tests_check_ccl_CPPFLAGS = -I./tests/ -I./include/
tests_check_ccl_LDFLAGS = -L./ -lccl -lgsl -lgslcblas -lfftw3 $(CLASS_LIB)
all: config.h
Expand Down Expand Up @@ -621,6 +622,8 @@ tests/tests_check_ccl-ccl_test_massfunc.$(OBJEXT): \
tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp)
tests/tests_check_ccl-ccl_test_correlation.$(OBJEXT): \
tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp)
tests/tests_check_ccl-ccl_test_correlation_3d.$(OBJEXT): \
tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp)
tests/tests_check_ccl-ccl_test_bcm.$(OBJEXT): tests/$(am__dirstamp) \
tests/$(DEPDIR)/$(am__dirstamp)
tests/tests_check_ccl-ccl_test_emu.$(OBJEXT): tests/$(am__dirstamp) \
Expand Down Expand Up @@ -660,6 +663,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_check_ccl-ccl_test_cls.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_check_ccl-ccl_test_cmblens.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation_3d.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_check_ccl-ccl_test_cosmology.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_check_ccl-ccl_test_distances.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_check_ccl-ccl_test_distances_hiz.Po@am__quote@
Expand Down Expand Up @@ -998,6 +1002,20 @@ tests/tests_check_ccl-ccl_test_correlation.obj: tests/ccl_test_correlation.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_check_ccl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests/tests_check_ccl-ccl_test_correlation.obj `if test -f 'tests/ccl_test_correlation.c'; then $(CYGPATH_W) 'tests/ccl_test_correlation.c'; else $(CYGPATH_W) '$(srcdir)/tests/ccl_test_correlation.c'; fi`

tests/tests_check_ccl-ccl_test_correlation_3d.o: tests/ccl_test_correlation_3d.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_check_ccl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests/tests_check_ccl-ccl_test_correlation_3d.o -MD -MP -MF tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation_3d.Tpo -c -o tests/tests_check_ccl-ccl_test_correlation_3d.o `test -f 'tests/ccl_test_correlation_3d.c' || echo '$(srcdir)/'`tests/ccl_test_correlation_3d.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation_3d.Tpo tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation_3d.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ccl_test_correlation_3d.c' object='tests/tests_check_ccl-ccl_test_correlation_3d.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_check_ccl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests/tests_check_ccl-ccl_test_correlation_3d.o `test -f 'tests/ccl_test_correlation_3d.c' || echo '$(srcdir)/'`tests/ccl_test_correlation_3d.c

tests/tests_check_ccl-ccl_test_correlation_3d.obj: tests/ccl_test_correlation_3d.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_check_ccl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests/tests_check_ccl-ccl_test_correlation_3d.obj -MD -MP -MF tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation_3d.Tpo -c -o tests/tests_check_ccl-ccl_test_correlation_3d.obj `if test -f 'tests/ccl_test_correlation_3d.c'; then $(CYGPATH_W) 'tests/ccl_test_correlation_3d.c'; else $(CYGPATH_W) '$(srcdir)/tests/ccl_test_correlation_3d.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation_3d.Tpo tests/$(DEPDIR)/tests_check_ccl-ccl_test_correlation_3d.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ccl_test_correlation_3d.c' object='tests/tests_check_ccl-ccl_test_correlation_3d.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_check_ccl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests/tests_check_ccl-ccl_test_correlation_3d.obj `if test -f 'tests/ccl_test_correlation_3d.c'; then $(CYGPATH_W) 'tests/ccl_test_correlation_3d.c'; else $(CYGPATH_W) '$(srcdir)/tests/ccl_test_correlation_3d.c'; fi`

tests/tests_check_ccl-ccl_test_bcm.o: tests/ccl_test_bcm.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_check_ccl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests/tests_check_ccl-ccl_test_bcm.o -MD -MP -MF tests/$(DEPDIR)/tests_check_ccl-ccl_test_bcm.Tpo -c -o tests/tests_check_ccl-ccl_test_bcm.o `test -f 'tests/ccl_test_bcm.c' || echo '$(srcdir)/'`tests/ccl_test_bcm.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_check_ccl-ccl_test_bcm.Tpo tests/$(DEPDIR)/tests_check_ccl-ccl_test_bcm.Po
Expand Down
Binary file modified doc/0000-ccl_note/0000-ccl_note.pdf
Binary file not shown.
Binary file added doc/0000-ccl_note/analytic_xi.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions doc/0000-ccl_note/authors.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ Bull,Philip,Philip Bull,Contributor,"Jet Propulsion Laboratory, California Insti
Campagne,Jean-\'Eric,Jean-\'Eric Campagne,Contributor,"Laboratoire de l'Acc\'el\'erateur Lin\'eaire, Universit\'e Paris-Sud, CNRS/IN2P3, Universit\'e Paris-Saclay, Orsay, France",Angpow builder and contributed to the interface with CCL.,campagne@lal.in2p3.fr
Chisari,Elisa,N. Elisa Chisari,Contributor,"Department of Physics, University of Oxford, Denys Wilkinson building, Keble Road, Oxford OX1 3RH, United Kingdom","Co-led project, coordinated hack projects \& communication, contributed to: correlation function \& power spectrum implementation, documentation, and comparisons with benchmarks.",elisa.chisari@physics.ox.ac.uk
Drlica-Wagner,Alex,Alex Drlica-Wagner,Contact,"Fermi National Accelerator Laboratory, P. O. Box 500, Batavia, IL 60510, USA",Helped with document preparation.,kadrlica@fnal.gov
Du,Zilong,"Zilong Du",Contributor,"Department of Physics and Astronomy, University of California, Riverside, CA 92521, USA","Implemented the 3d correlation function.",zdu011@ucr.edu
Eifler,Tim,Tim Eifler,Contributor,"Jet Propulsion Laboratory, California Institute of Technology, Pasadena, CA 91109, USA",Reviewed/tested code.,tim.eifler@jpl.nasa.gov
Eifler,Tim,Tim Eifler,Contributor,"Department of Physics, California Institute of Technology, Pasadena, CA 91125, USA",Reviewed/tested code.,tim.eifler@jpl.nasa.gov
Ellison,John,"John Ellison",Contributor,"Department of Physics and Astronomy, University of California, Riverside, CA 92521, USA","Implemented the 3d correlation function; wrote text describing 3d correlation function for this note.",john.ellison@ucr.edu
Hlozek,Ren\'ee,Ren\'ee Hlozek,Contributor,"Dunlap Institute for Astronomy and Astrophysics \& Department for Astronomy and Astrophysics, University of Toronto, ON M5S 3H4","Contributed initial code for error handling structures, reviewed other code edits.", hlozek@dunlap.utoronto.ca
Ishak, Mustapha,Mustapha Ishak,Contributor,"Department of Physics, The University of Texas at Dallas, Richardson, TX 75083, USA",Contributed to planning of code capabilities and structure; reviewed code; identified and fixed bugs.,mishak@utdallas.edu
Kirby, Matthew,Matthew Kirby, Contributor,"Univeristy of Arizona, Tucson, AZ 85721, USA",Performed comparison of physical constants.,matthewkirby@email.arizona.edu
Expand Down
4 changes: 4 additions & 0 deletions doc/0000-ccl_note/authors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
\affiliation{Department of Physics, University of Oxford, Denys Wilkinson building, Keble Road, Oxford OX1 3RH, United Kingdom}
\author{Alex Drlica-Wagner}
\affiliation{Fermi National Accelerator Laboratory, P. O. Box 500, Batavia, IL 60510, USA}
\author{Zilong Du}
\affiliation{Department of Physics and Astronomy, University of California, Riverside, CA 92521, USA}
\author{Tim Eifler}
\affiliation{Jet Propulsion Laboratory, California Institute of Technology, Pasadena, CA 91109, USA}
\affiliation{Department of Physics, California Institute of Technology, Pasadena, CA 91125, USA}
\author{John Ellison}
\affiliation{Department of Physics and Astronomy, University of California, Riverside, CA 92521, USA}
\author{Ren\'ee Hlozek}
\affiliation{Dunlap Institute for Astronomy and Astrophysics \& Department for Astronomy and Astrophysics, University of Toronto, ON M5S 3H4}
\author{Mustapha Ishak}
Expand Down
Binary file added doc/0000-ccl_note/benchmark_xi_abs.pdf
Binary file not shown.
Binary file added doc/0000-ccl_note/benchmark_xi_rel.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions doc/0000-ccl_note/contributions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Jean-\'Eric Campagne: Angpow builder and contributed to the interface with CCL. \\
N. Elisa Chisari: Co-led project, coordinated hack projects \& communication, contributed to: correlation function \& power spectrum implementation, documentation, and comparisons with benchmarks. \\
Alex Drlica-Wagner: Helped with document preparation. \\
Zilong Du: Implemented the 3d correlation function. \\
Tim Eifler: Reviewed/tested code. \\
John Ellison: Implemented the 3d correlation function; wrote text describing 3d correlation function for this note. \\
Ren\'ee Hlozek: Contributed initial code for error handling structures, reviewed other code edits. \\
Mustapha Ishak: Contributed to planning of code capabilities and structure; reviewed code; identified and fixed bugs. \\
Matthew Kirby: Performed comparison of physical constants. \\
Expand Down
1 change: 0 additions & 1 deletion doc/0000-ccl_note/main.bib
Original file line number Diff line number Diff line change
Expand Up @@ -693,4 +693,3 @@ @ARTICLE{Tinker2010
}



Binary file modified doc/0000-ccl_note/main.pdf
Binary file not shown.

0 comments on commit 543e13d

Please sign in to comment.