Giter Club home page Giter Club logo

ttp's Introduction

ttpsolver

Astronomical observation planning tool using the Traveling Telescope Problem (TTP) formulation.

Purpose

ttpsolver helps you plan observations for over 100 targets within a specified time frame. It simplifies the process by allowing you to input your observatory details, observing time constraints, and a target table. The tool plans observations to maximize successful exposures and optimizes the path between targets.

Installation

To install ttpsolver, run:

Update this line with package installation

This will set up the environment with the exception of Gurobipy.

Installing Gurobi

ttpsolver relies on Gurobi for solving large matrix equations efficiently. Follow these steps to install and set up Gurobi:

  1. Create an an Account on Gurobi's registration site. Select that you are an "Academic", type in your home institution, and submit the form via "Access Now". You will receive an email to complete the registration.
  2. Download Gurobi for your OS from this download page.
  3. Request an Academic License from your user portal while connected to a university network. You want the 'Named-User Academic License' which has a one year lifetime.
  4. Retrieve the License by running the command from the popup window in a shell. It should look like:
grbgetkey 253e22f3...
  1. Install Gurobipy using either pip or conda after completing the previous steps.
pip install gurobipy

Or:

conda install -c gurobi gurobi

Algorithm

ttpsolver employs a Mixed-Integer Linear Programming formulation to optimize scheduling in a time-dependent manner, similar to the Traveling Salesman Problem. It determines both the order of targets and the timing of observations to respect celestial object rise and set times. The algorithm is detailed in the Astronomical Journal here. Please cite this work when using ttpsolver for planning scientific observations.

Tutorials

You can find a simple tutorial for using the package in the /tutorial directory.

ttp's People

Contributors

lukehandley avatar jluby127 avatar

Watchers

 avatar

ttp's Issues

formatting issue in TTP

@jluby127 checkout this error. does correct code live in dev branch.

Round 2 Model Solved.
Total Time to finish round 2 solver:  350.89
Round 2 complete.
done
Prepare schedule for the TTP.
Error: column names not correct.
Column names must be this format and this order: ['Starname', 'RA', 'Dec', 'Exposure Time', 'Exposures Per Visit', 'Visits In Night', 'Intra_Night_Cadence'].
Time in Night for Observations: 4.6 hours.
Traceback (most recent call last):
  File "/Users/petigura/miniforge3/envs/kpf-cc/lib/python3.10/pdb.py", line 1723, in main
    pdb._runscript(mainpyfile)
  File "/Users/petigura/miniforge3/envs/kpf-cc/lib/python3.10/pdb.py", line 1583, in _runscript
    self.run(statement)
  File "/Users/petigura/miniforge3/envs/kpf-cc/lib/python3.10/bdb.py", line 598, in run
    exec(cmd, globals, locals)
  File "<string>", line 1, in <module>
  File "/Users/petigura/code/optimalAllocation/generateScript.py", line 83, in <module>
    solution = model.TTPModel(startObs, endObs, targlist, tel, savepath)
  File "/Users/petigura/code/ttp/model.py", line 23, in __init__
    self.create_nodes()
  File "/Users/petigura/code/ttp/model.py", line 38, in create_nodes
    for s in self.stars:
TypeError: 'NoneType' object is not iterable
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /Users/petigura/code/ttp/model.py(38)create_nodes()
-> for s in self.stars:

Add wrap limit as plotting parameter

The 2D plots of the telescope path should have some indication of the wrap limit to make it clear when there are wrap unwinds. This could be either a line drawn on the plot at the wrap angle, or a shift in coordinates so that the wrap is placed at the top/bottom of the plot.

please include working example

I needed

realtesting.py, realtest.csv

  • plotly, (conda)

  • numpy, (conda)

  • astropy, (conda)

  • pandas (conda)

  • matplotlib (conda)

  • gurobipy (pip)

  • astroplan (pip)

Then failed at the gurobi license part

Slew rate units

Check the units of the .slewrate attribute of the telescope. My guess is that the current Keck slew rate, for example, would be less than one degree per second. Maybe this is just inverted?

Objective Scaling and Optimality Gap

We should discuss the scaling of different terms in the objective (i.e., the units of slew time). Ideally, the objective score would be interpretable to one of us, and it should be easily explained to others.

This will guide our discussion about the right way for users to specify optimality gap (perhaps a time in minutes from optimal?). We can then include this as a 'statistic' for the solved model. In principle we can get all this information from the model + objective score if we scale it in natural units.

For example:

Observations:
Obs Requested: 30
Obs Scheduled: 25
Best Bound: 28

Slews:
Discretized Slew Time: 10 minutes
Real Slew Time : 12 minutes
Best Bound: 9 minutes

refactor so it is a module

@jluby127: please refactor the code so that

from ttp import <module>

is possible.

We'll need this for the code to play nicely with other packages.

Resolve exposure time for multi-exposure targets

Lets agree on a formula for computing the effective visit time of a target which has multiple consecutive exposures. This can either occur internally for each star object, or a blanket function applied to every star in the model.

I think @jluby127 will already have a version of this for plotting, but it also needs to be considered during the data ingestion stage to get the exposure times right.

This might even be relevant for single exposure targets which have exposure times of a similar or less magnitude to the readout time.

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.