Giter Site home page Giter Site logo

nasa / dorado-scheduling Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 8.0 13.21 MB

Dorado observation planning and scheduling simulations

License: Other

Python 100.00%
nasa ultraviolet astronomy scheduling-algorithms cplex healpix mixed-integer-programming optimization operations-research satellite

dorado-scheduling's Introduction

Dorado observation planning and scheduling simulations

Build Status Documentation Status Codecov PyPI - Python Version

Dorado is a proposed space mission for ultraviolet follow-up of gravitational wave events. This repository contains a simple target of opportunity observation planner for Dorado.

This project is free and open source, but it calls commercial software: it uses IBM ILOG CPLEX Optimization Studio ("CPLEX") for mathematical optimization. CPLEX is free for students, faculty, and staff at accredited educational institutions through the IBM Academic Initiative.

To get started with dorado-scheduling, see the quick start instructions in the manual.

Example Dorado observing plan

Features

  • Global: jointly and globally solves the problems of tiling (the set of telescope boresight orientations and roll angles) and the scheduling (which tile is observed at what time), rather than solving each sub-problem one at a time
  • Optimal: generally solves all the way to optimality, rather than finding merely a "good enough" solution
  • Fast: solve an entire orbit in about 5 minutes
  • General: does not depend on heuristics of any kind
  • Flexible: problem is formulated in the versatile framework of mixed integer programming

Dependencies

dorado-scheduling's People

Contributors

bwgref avatar lpsinger avatar mcoughlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dorado-scheduling's Issues

Fix incorrect units in compute_overlap

This method in dorado-scheduling-simsurvey computes the areal overlap between tiles. However, the result is expressed in nonsensical units of arcminutes.

CPLEX error in running the sample code

docplex.mp.utils.DOcplexLimitsExceeded: **** Promotional version. Problem size limits (1000 vars, 1000 consts) exceeded, model has 39825497 vars, 454925 consts, CPLEX code=1016

am receiving this error after running the code in the cluster
Using 100GB ram

Depend on or vendor code for kne.py

The file kne.py looks like it was copied from somewhere else. Where does it come from? Can we simply add the other project as a dependency?

If not, then the proper thing to do would be to vendor the code: place it in a directory like dorado/scheduling/vendor/name_of_other_package/kne.py, and place a copy of its license in the directory licenses/NAME_OF_OTHER_PACKAGE.rst.

Remove SurveyModel class and models.py

This is now just a container for things that are passed as command-line arguments to the main dorado-scheduling script. Removing it will enable further consolidation of command line arguments between dorado-scheduling and dorado-scheduling-simsurvey, etc.

Default command-line arguments for skygrid are broken by #55

$ dorado-scheduling examples/6.fits -o examples/6.ecsv
usage: dorado-scheduling [-h] [--version] [-l CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET] [-n NEXP]
                         [--mission {ultrasat,dorado,uvex}] [--exptime EXPTIME] [--delay DELAY]
                         [--duration DURATION] [--time-step TIME_STEP] [--roll-step ROLL_STEP]
                         [--skygrid-step SKYGRID_STEP]
                         (--skygrid-method {geodesic,golden-angle-spiral,healpix,sinusoidal} | --skygrid-file TILES.ecsv)
                         [--nside NSIDE] [--timeout TIMEOUT] [--output OUTPUT.ecsv] [-j [JOBS]]
                         FILE.fits[.gz]
dorado-scheduling: error: one of the arguments --skygrid-method --skygrid-file is required

Unify main.py and survey.py

It seems like there are very few important differences between these two files. The only differences that I can see are minor variations in the command line arguments.

Tried to run ULTRASAT survey, but process gets killed

dorado-scheduling --mission ultrasat --exptime 1200s --nexp 5 --out ex.ecsv -j 8
6.fits
|======================================| 3 / 3 (100.00%) 0s
2023-10-15 00:14:19,892 INFO evaluating field of regard
100%|██████████████████████████████████| 1437/1437 [00:12<00:00, 116.66it/s]
2023-10-15 00:14:37,699 INFO generating model
2023-10-15 00:14:37,727 INFO adding variable: observing schedule
Killed

I was trying to run ultrasat scheduling and this was the error I am recieving. Moreover, the output file is empty

Which versions of ligo.skymap and python-ligo-lw should be used?

When trying to import from dorado.scheduling import skygrid I get the error ImportError: cannot import name 'IDTypes' from 'ligo.lw.types'. I installed the package using pip install git+https://github.com/nasa/dorado-scheduling as recommended on the documentation page. I've looked at ligo.lw.types and it looks like IDTypes was removed from the file during v1.8. Additionally the ligo.skymap package updated in v0.61 to account for this. When using pip install git+https://github.com/nasa/dorado-scheduling I get v 0.52 for skymap but v1.83 for python-ligo-lw. These are incompatible versions. Which versions should I use?

Numerous problems with dust module

  • Hardcoded wavelengths and zero points
  • camelCase rather than lower_case method names (violates PEP 8)
  • Manual conversion between wavelengths and frequencies (may be done more concisely with astropy.units.equivalencies.spectral())
  • Manual conversions between fluxes and AB magnitudes (again, can be done concisely with Astropy units)
  • This module should not be necessary at all if we use the Astropy affiliated package, synphot, for evaluating extinction in band and converting between various equivalent flux units.

ultrasat issue

I have tried dorado-scheduling with ultrasat as mission. The skymap was taken from ligo data. The .sh file used is attached
test_dorado3.txt
I initially thought it was the issue with the fov. I modified it to the same as dorado and still recieved the error that RAM is insufficient. Once I also got a timeout error

BrokenProcessPool when running quickstart (M1 Mac)

I'm encountering errors (on an M1 Mac) when working through the quickstart guide.

Here are the lines I ran to install the software within a conda environment with python 3.10:

python /Applications/CPLEX_Studio2211/python/setup.py install
pip install git+https://github.com/nasa/radbelt.git
pip install git+https://github.com/nasa/dorado-scheduling

Note that I installed radbelt like this because the default installation had issues with the M1 arm64 architecture.

After the installation, I cloned this repo and ran:
dorado-scheduling examples/6.fits -o examples/6.ecsv

and got these errors:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 289, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/bhealy/miniforge3/envs/dorado-env/bin/dorado-scheduling", line 5, in <module>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from dorado.scheduling.scripts.main import main
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/scripts/main.py", line 14, in <module>
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
    from .. import mission as _mission
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/mission.py", line 152, in <module>
    orbit=Spice(
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/orbit/spice.py", line 63, in __init__
    exitcode = _main(fd, parent_sentinel)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
    for filename in download_files_in_parallel(kernels, cache=True):
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/data.py", line 1721, in download_files_in_parallel
    prepare(preparation_data)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 289, in run_path
    combined_paths = ProgressBar.map(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 735, in map
    return _run_module_code(code, init_globals, run_name,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 86, in _run_code
    results = cls.map_unordered(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 843, in map_unordered
    exec(code, run_globals)
  File "/Users/bhealy/miniforge3/envs/dorado-env/bin/dorado-scheduling", line 5, in <module>
    from dorado.scheduling.scripts.main import main
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/scripts/main.py", line 14, in <module>
    for i, f in enumerate(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/_base.py", line 222, in as_completed
    from .. import mission as _mission
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/mission.py", line 152, in <module>
    orbit=Spice(
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/orbit/spice.py", line 63, in __init__
    fs = set(fs)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 844, in <genexpr>
    for filename in download_files_in_parallel(kernels, cache=True):
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/data.py", line 1721, in download_files_in_parallel
    as_completed(p.submit(function, item) for item in items)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 737, in submit
    combined_paths = ProgressBar.map(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 735, in map
    self._adjust_process_count()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 697, in _adjust_process_count
    results = cls.map_unordered(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 843, in map_unordered
    self._spawn_process()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 714, in _spawn_process
    for i, f in enumerate(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/_base.py", line 222, in as_completed
    p.start()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/process.py", line 121, in start
    fs = set(fs)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 844, in <genexpr>
    self._popen = self._Popen(self)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
    return Popen(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    as_completed(p.submit(function, item) for item in items)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 737, in submit
    super().__init__(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 154, in get_preparation_data
    self._adjust_process_count()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 697, in _adjust_process_count
    _check_not_importing_main()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
    self._spawn_process()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 714, in _spawn_process
    p.start()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
    return Popen(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 289, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/bhealy/miniforge3/envs/dorado-env/bin/dorado-scheduling", line 5, in <module>
    from dorado.scheduling.scripts.main import main
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/scripts/main.py", line 14, in <module>
    from .. import mission as _mission
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/mission.py", line 152, in <module>
    orbit=Spice(
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/orbit/spice.py", line 63, in __init__
    for filename in download_files_in_parallel(kernels, cache=True):
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/data.py", line 1721, in download_files_in_parallel
    combined_paths = ProgressBar.map(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 735, in map
    results = cls.map_unordered(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 843, in map_unordered
    for i, f in enumerate(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/_base.py", line 222, in as_completed
    fs = set(fs)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 844, in <genexpr>
    as_completed(p.submit(function, item) for item in items)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 737, in submit
    self._adjust_process_count()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 697, in _adjust_process_count
    self._spawn_process()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/process.py", line 714, in _spawn_process
    p.start()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
    return Popen(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
|>------------------------------------------------------------------------------------------------|   0 /  3  ( 0.00%)
Traceback (most recent call last):
  File "/Users/bhealy/miniforge3/envs/dorado-env/bin/dorado-scheduling", line 5, in <module>
    from dorado.scheduling.scripts.main import main
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/scripts/main.py", line 14, in <module>
    from .. import mission as _mission
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/mission.py", line 152, in <module>
    orbit=Spice(
  File "/Users/bhealy/dorado-scheduling/dorado/scheduling/orbit/spice.py", line 63, in __init__
    for filename in download_files_in_parallel(kernels, cache=True):
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/data.py", line 1721, in download_files_in_parallel
    combined_paths = ProgressBar.map(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 735, in map
    results = cls.map_unordered(
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/site-packages/astropy/utils/console.py", line 847, in map_unordered
    results.append(f.result())
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/Users/bhealy/miniforge3/envs/dorado-env/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

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.