# ----------------------------------------------------------------------------- # Automated Phanerozoic Biodiversity Curve Generator # Bjorn-Gustaf J. Brooks, November 8, 2007 # ----------------------------------------------------------------------------- In order to describe the methods necessary to replicating my Phanerozoic biodiversity curves using data downloaded from the Paleobiology Database (www.paleodb.org), I have created a simple BASH script executable that makes calls to other AWK, BASH, C-shell, PSQL, and SED scripts in order to automatically generate PostgreSQL tables and query those tables to provide the necessary interpolated Phanerozoic biodiversity counts sampled at 1 Myr increments. These programs are standard in most or all Linux distributions. If you are running Linux, make sure you have PSQL priveledges to create databases and tables. Once you have extracted the tar file, 'cd' into the 'supplement' directory. Next execute the create_db.bash script. # ----------------------------------------------------------------------------- # GENERATE PHANEROZOIC BIODIVERSITY DATA -------------------------------------- If you are running PSQL and wish to generate our summary age-range data tables and biodiversity query results execute the following command: ./create_db.bash This will take several hours to populate your database, find the first and last occurrences (FADs & LADs) of each genus name, generate the interpolated age ranges for each genus name and plot your graphs with the Monte Carlo trials. Determining the FADs & LADs is the step that takes the longest, by far. You may want to use nohup and dump standard error from /dev/null into a log file, so that you can log out, and have a hot cup of coffee while the machine toils away for you: (nohup time ./create_db.bash < /dev/null ) >& create_db.log & After the script is complete the results to your query will be output as .csv files in the various subdirectories of 'query' such as 'deep', 'marine', and 'marine_indet'. These two column .csv files contain the time and biodiversity counts necessary for your spectral analysis. # ----------------------------------------------------------------------------- # GENERATE PHANEROZOIC BIODIVERSITY DATA & PLOTS ------------------------------ If you are also running Octave or Matlab and wish to generate our plots, which will also plot the average of the Monte Carlo random step and random block trial routines. Remember that to save time I have preset the Monte Carlo loop to 200 trials, not the 10,000 trials which we used in our paper. You will have to navigate to the directory of interest (supplement/g21663/query/gba/) and edit the Matlab/Ocatave file 'dft.m', substituting 'numtest=200' with 'numtest=10000' in both places within the file (one place for the number of random step iterations and the second for the number of random block iterations). # ----------------------------------------------------------------------------- # WHERE TO FIND OUR PAPER ----------------------------------------------------- http://www.climatemodeling.org/paleo/diversity/ # ----------------------------------------------------------------------------- # WHERE TO FIND OUR ROUTINES -------------------------------------------------- http://www.climatemodeling.org/paleo/diversity/supplement.tar.gz http://www.climatemodeling.org/paleo/diversity/supplement.zip # ----------------------------------------------------------------------------- # DOCUMENTATION --------------------------------------------------------------- These methods are described in detail through our Supplementary Information of 'Sources of Cycles in Phanerozoic Biodiversity', and also here: http://www.climatemodeling.org/paleo/diversity/ Enjoy!