{"id":17191037,"url":"https://github.com/dfm/peerless","last_synced_at":"2025-04-13T19:50:29.915Z","repository":{"id":28266675,"uuid":"31776976","full_name":"dfm/peerless","owner":"dfm","description":"Single transit events in Kepler","archived":false,"fork":false,"pushed_at":"2020-06-12T18:24:37.000Z","size":36882,"stargazers_count":4,"open_issues_count":4,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-27T10:21:37.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfm.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-06T16:02:06.000Z","updated_at":"2024-08-01T06:57:20.000Z","dependencies_parsed_at":"2022-08-27T15:22:55.896Z","dependency_job_id":null,"html_url":"https://github.com/dfm/peerless","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Fpeerless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Fpeerless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Fpeerless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Fpeerless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfm","download_url":"https://codeload.github.com/dfm/peerless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248773677,"owners_count":21159516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T01:24:42.006Z","updated_at":"2025-04-13T19:50:29.880Z","avatar_url":"https://github.com/dfm.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"peerless\n========\n\nThe search for the transits of long-period exoplanets and binary star systems\nin the archival *Kepler* light curves.\n\n\nRunning the code\n----------------\n\nThis project is (in theory) reproducible given enough compute time. Here are\nthe steps:\n\nSet up the environment \u0026 build extensions\n+++++++++++++++++++++++++++++++++++++++++\n\nTo get started, you'll need to install `miniconda3\n\u003chttps://www.continuum.io/downloads\u003e`_ and then install the ``peerless``\nenvironment:\n\n.. code-block:: bash\n\n    conda env create -f environment.yml\n    source activate peerless\n\nwhere ``environment.yml`` is in the root of this repository.\n\nThere are two packages that you'll need to install following the specific\ninstallation instructions in their documentation: *(a)* the 1.0-dev branch of\n`george \u003chttps://github.com/dfm/george\u003e`_, and *(b)* `transit\n\u003chttps://github.com/dfm/transit\u003e`_.\n\nOnce this environment is enabled, set the environment variable:\n\n.. code-block:: bash\n\n    export PEERLESS_DATA_DIR=\"/path/to/scratch/\"\n\nto the directory where you want peerless to save all of its output. You'll\nneed something like a TB of disk space to run the full pipeline.\n\nThen, you'll need to build the peerless extensions:\n\n.. code-block:: bash\n\n    python setup.py build_ext --inplace\n\n\nTarget selection \u0026 data download\n++++++++++++++++++++++++++++++++\n\nNext up, run the target selection and download all the relevant datasets:\n\n.. code-block:: bash\n\n    scripts/peerless-targets\n    scripts/peerless-datasets -p {ncpu}\n    scripts/peerless-download -p {ncpu}\n\nwhere ``{ncpu}`` is the number of CPUs that you want to run in parallel using\n``multiprocessing`` (they must be on the same node).\n\n\nTransit search\n++++++++++++++\n\nTo search these targets for transits, run:\n\n.. code-block:: bash\n\n    scripts/peerless-search -p {ncpu} -q --no-plots -o {searchdir}\n\nwhere ``{ncpu}`` is the same as above and ``{searchdir}`` is the root\ndirectory for the output.\n\n\nInjection \u0026 recovery tests\n++++++++++++++++++++++++++\n\nThen to run a single pass of injection tests (one per target), run:\n\n.. code-block:: bash\n\n    scripts/peerless-search -p {ncpu} -q --no-plots --inject -o {injdir}/{someinteger}\n\nSince you'll want to run many rounds of this script, the output directory\nshould be something like ``/path/to/injections/{someinteger}`` where\n``{someinteger}`` is an integer identifying the run.\n\nTo collect the results of the search and injection tests, run:\n\n.. code-block:: bash\n\n    scripts/peerless-collect {searchdir} {injdir} -o {resultsdir}\n\nwhere ``{searchdir}`` and ``{injdir}`` are from above and ``{resultsdir}`` is\nthe location where these should be saved. Some of the figure scripts will\nexpect ``{resultsdir}`` to be ``results`` in this directory so, if you choose\na different location, the figures might fail.\n\nTo predict the masses of the injected planets, run:\n\n.. code-block:: bash\n\n    scripts/peerless-collect {searchdir} {injdir} -o {resultsdir}\n\n\nMCMC sampling\n+++++++++++++\n\nTo set up the MCMC fits for the candidates, run:\n\n.. code-block:: bash\n\n    scripts/peerless-init {resultsdir}/candidates.csv -p -o {mcmcdir}\n\nwhere ``{mcmcdir}`` is the directory where the MCMC results should be saved.\nThen, to run the MCMC analysis, run:\n\n.. code-block:: bash\n\n    export NP={number_of_processes}\n    mpiexec -np $NP scripts/peerless-fit {mcmcdir}/{kicid}/init.pkl --nwalkers $((NP*2))\n\nfor each ``{kicid}``. You'll probably want to rerun this script a few times to\nget more samples.\n\nTo collect the MCMC fit results, run:\n\n.. code-block:: bash\n\n    scripts/peerless-collect-fits {resultsdir}/candidates.csv {mcmcdir} -o {resultsdir}\n\nThis script saves a table of posterior quantiles to ``{resultsdir}/fits.csv``,\nfigures to the directory ``document/figures`` for use in the manuscript, and\nHDF5 archives of thinned MCMC chains to ``{resultsdir}/chains``.\n\n\nFalse positive simulations \u0026 analysis\n+++++++++++++++++++++++++++++++++++++\n\nRun the `predictions notebook\n\u003chttps://github.com/dfm/peerless/blob/master/prediction/prediction.ipynb\u003e`_.\nDependencies are `exosyspop \u003chttps://github.com/timothydmorton/exosyspop\u003e`_, which\nfurther depends on `isochrones \u003chttps://github.com/timothydmorton/isochrones\u003e`_ and\n`vespa \u003chttps://github.com/timothydmorton/vespa\u003e`_.\n\n\nGenerate LaTeX tables and macros\n++++++++++++++++++++++++++++++++\n\nFinally, to generate the LaTeX tables and macros for the paper, run:\n\n.. code-block:: bash\n\n    scripts/peerless-write-tex {resultsdir}/candidates.csv {resultsdir}/fits.csv {resultsdir}/injections-with-mass.h5 {resultsdir}/fpp.csv\n\nThis will save several ``.tex`` files to the ``document`` directory.\n\nLicense\n-------\n\nCopyright 2015-2016 Daniel Foreman-Mackey\n\nLicensed under the terms of the MIT License (see LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm%2Fpeerless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfm%2Fpeerless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm%2Fpeerless/lists"}