Skip to content

mcoughlin/ztfperiodic

Repository files navigation

ztfperiodic

Scripts for analyzing ZTF periodic data

Period Search

This package implements several period-searching algorithms. Below we explain some of them.

  • Generalized Conditional Entropy (GCE)
    ztfperiodic uses code written by Michael Katz (in cuda); Algorithm paper: Graham et al. (2013)
    Download: git clone https://github.com/mikekatz04/gce
    Installation: python setup.py install (you need a CUDA-capable machine.)

  • Analysis Of Variance (AOV)
    Code originally from this website; Algorithm paper: Schwarzenberg-Czerny (1996) and Schwarzenberg-Czerny (1989). Note that ncov is the number of phase coverages (defualt=2, ok), and nh2 is the number of phase bins (default=3, better to increase this).
    First, run source build.sh in the ztfperiodic/pyaov/ directory, then copy the aov.cpython-36m-darwin.so file to lib/python3.7/site-packages/ or equivalent.

  • Lomb-Scargle (LS)

  • Box-fitting Least Squares (BLS)

  • Phase Dispersion Minimization (PDM, PDM2)
    Algorithm papers: Stellingwerf (1978)

  • Fast Fourier Transform (FFT)

Consult this paper if you're not sure which algorithm to adopt.

Example

Below we list several examples to run scripts in the /bin directory.

python ztfperiodic_object_followup.py --doGPU --ra your_ra --declination your_dec --doSpectra --user your_kowalski_username --pwd your_kowalski_password

Docker

If copying to schoty, copy a netrc that can talk to schoty into the current directory, otherwise touch netrc should do.

nvidia-docker build -t python-ztfperiodic . nvidia-docker run -it python-ztfperiodic

For debugging: docker run -it python-ztfperiodic

Trouble Shooting

  • cuda
    If you see GPUassert: all CUDA-capable devices are busy or unavailable gcex/src/manager.cu 57, type nvidia-smi and check Volatile GPU-Util. Try export CUDA_VISIBLE_DEVICES=1.

Installation

Using a conda environment:
conda install astropy Cython h5py matplotlib numpy pandas scipy pytables
conda install -c conda-forge astropy-healpix astroquery astroplan healpy
pip install penquins
Install from source: https://github.com/ejaszewski/periodfind

[you may find that a single call including all the packages listed under conda results in a more smooth install]