sdf_example /

Filename Size Date modified Message
38 B
Changing hgignore file
347 B
Moving files around a bit. Adding F90 example from Anatoly Kylpin
1.1 KB
README edited online with Bitbucket
2.3 KB
Wrong year.
596 B
Wrong year.
2.9 KB
Wrong year.
Low-Level Routines for Reading SDF Files

example.c: Read in a few halos from ds14_a_halos_1.0000, also calculating the total number of halos in the file.
example.F90: Read in first 50 halos from ds14_a_halos_1.0000
libsdf_example.c: Link to libSDF for more generalized access. 

Feel free to just type:


To compile the libSDF example, type:

    make sdf

This will download the SDF library using git.

Manual Compilation


    gcc -o example_c -O3 -std=c99 example.c


    gfortran -o example_F90 -O3 example.f90


    git clone
    cd SDF
    cd ../
    gcc -o example_sdf -O3 -Wunused -std=c99 -I./SDF -L./SDF libsdf_example.c -lSDF

The simple C and F90 examples will only work on ds14_a_halos_1.0000:

    ./example_c path/to/ds14_a_halos_1.0000
    ./example_f90 path/to/ds14_a_halos_1.0000

The libSDF example should work on many SDF halo catalogs:

    ./example_sdf path/to/any/halo/file