Coder Social home page Coder Social logo

h-xie / ztf_sim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zwickytransientfacility/ztf_sim

0.0 0.0 0.0 7.4 MB

:telescope: Zwicky Transient Facility survey scheduler

License: BSD 3-Clause "New" or "Revised" License

Python 11.33% Jupyter Notebook 88.67%

ztf_sim's Introduction

ztf_sim

๐Ÿ”ญ Scheduling library for the Zwicky Transient Facility.

Implements the Integer Linear Programming scheduling algorithm described in Bellm et al. 2019 (PASP 131, 1000).

Installation

You will need a license for the Gurobi optimizer on the machine you want to run simulations on. Free academic licenses are readily available.

You are strongly encouraged to use conda and a conda environment for the installation.

conda create -n ztf_sim_test

conda activate ztf_sim_test

conda install python=3.7


conda config --add channels conda-forge 
conda config --add channels http://conda.anaconda.org/gurobi
conda install pip numpy scipy astropy astroplan pandas scikit-learn xgboost sqlalchemy gurobi


pip install sklearn_pandas 
pip install transitions

pip install -e git+https://github.com/ZwickyTransientFacility/ztf_sim.git#egg=ztf_sim

(To remove the environment, use conda remove --name ztf_sim_test --all.)

Configuration

Scheduler Configuration

The scheduler configuration determines which observing programs will run (fields, filters, cadences, etc.)

An example set of scheduler configuration file is provided in sims/.

You can copy them locally with

wget https://raw.githubusercontent.com/ZwickyTransientFacility/ztf_sim/master/sims/example_scheduler_config.json
wget https://raw.githubusercontent.com/ZwickyTransientFacility/ztf_sim/master/sims/survey_180501.json
wget https://raw.githubusercontent.com/ZwickyTransientFacility/ztf_sim/master/sims/reference_building.json

Simulation Configuration

The simulation configuration determines which nights to simulate, which historical weather to use, and whether to overwrite the existing simulated database.

An example configuration file is provided in config/default.cfg.

You can copy it locally with wget https://raw.githubusercontent.com/ZwickyTransientFacility/ztf_sim/master/config/default.cfg

Running

run_ztf_sim --help summarizes the argument of the command line driver for the simulations. Assuming you've copied the configuration files to your current directory, you should now be able to run

run_ztf_sim example_scheduler_config.json default.cfg

which will write an sqlite database file named example_ztf_schedule.db to the current directory.

Output

The simulated schedule is written to a SQLite database in the LSST Operations Simulator format with a few additional columns. Example code for reading and summarizing the simulated schedule is located in the bin/ directory, and can be run as

analyze_ztf_sim example_ztf_schedule.db

The simulator also writes a logfile, which may be monitored while the simulation is running with tail -f example_ztf_schedule_log.txt

ztf_sim's People

Contributors

ebellm avatar danny-kh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.