Skip to content

Commit

Permalink
Merge pull request #5 from lsst/tickets/OPSIM-1093
Browse files Browse the repository at this point in the history
Tickets/opsim 1093
  • Loading branch information
yoachim authored Nov 8, 2023
2 parents 152a804 + c44c0c9 commit 84c9a42
Show file tree
Hide file tree
Showing 131 changed files with 27,657 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
scheduler_download_data --tdqm_disable -d 'site_models,skybrightness_pre,scheduler'
scheduler_download_data --tdqm_disable -d 'site_models,skybrightness_pre,scheduler,utils'
scheduler_download_data --tdqm_disable -d tests --force
- name: conda list
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_tests_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ jobs:
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
scheduler_download_data --tdqm_disable -d 'site_models,scheduler,skybrightness_pre'
scheduler_download_data --tdqm_disable -d tests --force
scheduler_download_data --tdqm_disable -d 'site_models,scheduler,skybrightness_pre,utils'
- name: conda list
shell: bash -l {0}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[![DOI](https://zenodo.org/badge/712606243.svg)](https://zenodo.org/doi/10.5281/zenodo.10076770)


# rubin_scheduler

Feature Based Scheduler for Vera C. Rubin Observatory's Legacy Survey of Space and Time (LSST).

This repository contains the scheduling algorithms for the LSST, as implemented in the Feature Based Scheduler (FBS). More documentation on the FBS is available at https://rubin-scheduler.lsst.io and in jupyter notebooks available in our [tutorials repository](https://github.com/lsst/rubin_sim_notebooks/tree/main/scheduler).
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ dependencies = [
"matplotlib",
"healpy",
"numexpr",
"palpy",
"scipy",
"astropy",
"tables",
"h5py",
"astroplan",
"requests",
"shapely",
"tqdm",
]

Expand Down
10 changes: 1 addition & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,10 @@ matplotlib
healpy
pandas
numexpr
palpy
scipy
sqlalchemy
astropy
pytables
h5py
openorb
openorb-data-de405
astroplan
colorcet
cycler
george
scikit-learn
requests
shapely
tqdm
1 change: 1 addition & 0 deletions rubin_scheduler/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .data_sets import * # noqa: F403
from .scheduler_download_data import *
18 changes: 13 additions & 5 deletions rubin_scheduler/data/scheduler_download_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__all__ = ("data_dict", "scheduler_download_data")
__all__ = ("data_dict", "scheduler_download_data", "download_rubin_data", "DEFAULT_DATA_URL")

import argparse
import os
Expand Down Expand Up @@ -32,6 +32,7 @@ def data_dict():
"scheduler": "scheduler_2023_10_16.tgz",
"site_models": "site_models_2023_10_02.tgz",
"skybrightness_pre": "skybrightness_pre_2023_10_17.tgz",
"utils": "utils_2023_11_02.tgz",
}
return file_dict

Expand Down Expand Up @@ -82,15 +83,20 @@ def scheduler_download_data(file_dict=None):
download_rubin_data(
data_dict(),
dirs=args.dirs,
versions=args.versions,
print_versions_only=args.versions,
force=args.force,
url_base=args.url_base,
tdqm_disable=args.tdqm_disable,
)


def download_rubin_data(
file_dict, dirs=None, versions=False, force=False, url_base=DEFAULT_DATA_URL, tdqm_disable=False
file_dict,
dirs=None,
print_versions_only=False,
force=False,
url_base=DEFAULT_DATA_URL,
tdqm_disable=False,
):
"""Download external data blobs
Expand Down Expand Up @@ -118,12 +124,12 @@ def download_rubin_data(
data_dir = get_data_dir()
if not os.path.isdir(data_dir):
os.mkdir(data_dir)
version_file = os.path.join(data_dir, "versions.txt")

versions = data_versions()
if versions is None:
versions = {}

if versions:
if print_versions_only:
print("Versions on disk currently // versions expected for this release:")
match = True
for k in file_dict:
Expand All @@ -137,6 +143,8 @@ def download_rubin_data(
print("Versions do not match")
return 1

version_file = os.path.join(data_dir, "versions.txt")

# See if base URL is alive
url_base = url_base
try:
Expand Down
1 change: 1 addition & 0 deletions rubin_scheduler/scheduler/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .sim_runner import *
4 changes: 4 additions & 0 deletions rubin_scheduler/scheduler/basis_functions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .basis_functions import *
from .feasibility_funcs import *
from .mask_basis_funcs import *
from .rolling_funcs import *
Loading

0 comments on commit 84c9a42

Please sign in to comment.