-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/v0.1.0: (23 commits) Release v0.1.0. Add version history. In conda recipe, run rs_download_data before unit tests to download rubin_sim data. Pin version of rubin_sim in conda recipe. Add Jenkinsfile for conda build. Add unit tests for MakeScheduler class. Add MakeScheduler class to help create scheduler configurations for AuxTel from list of Target/Tiles. Add type checking utility. Add Tiles class to define groups of targets for the scheduler. Add Target class to define single targets for the scheduler. Add unit tests for utils module. Add auxtel tiles definition. Add utils modules with utilities to get the path to the data dir and to read auxtel tiles. Ignore qa and type checking in conf.py Add basis functions for survey utility, Add unit tests for basis functions utilities. Add init file to define auxtel module. Add utility function to generate image survey for auxtel. Add auxtel utilities to generate basis functions for image, cwfs and spectroscopic surveys. Update package init to deal with version import. ...
- Loading branch information
Showing
23 changed files
with
3,117 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@Library('JenkinsShared')_ | ||
CondaPipeline([], "ts-fbs-utils", "lsst.ts.fbs.utils", "noarch") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% set data= load_setup_py_data() %} | ||
package: | ||
name: ts-fbs-utils | ||
version: {{ data.get('version') }} | ||
|
||
source: | ||
path: ../ | ||
|
||
build: | ||
noarch: python | ||
script: python -m pip install --no-deps --ignore-installed . | ||
|
||
test: | ||
requires: | ||
- ts-conda-build =0.3 | ||
- rubin-sim =0.8.0a2 | ||
source_files: | ||
- python | ||
- tests | ||
- setup.cfg | ||
- pyproject.toml | ||
commands: | ||
- rs_download_data | ||
- pytest -vsx tests/ | ||
|
||
requirements: | ||
host: | ||
- python | ||
- pip | ||
- setuptools_scm | ||
- setuptools | ||
run: | ||
- python | ||
- setuptools | ||
- setuptools_scm | ||
- rubin-sim 0.8.0a2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _Version_History: | ||
|
||
=============== | ||
Version History | ||
=============== | ||
|
||
v0.1.0 | ||
------ | ||
|
||
* Initial version of Feature Based Scheduler Utility package focused on AuxTel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[build-system] | ||
requires = [ "setuptools", "setuptools_scm" ] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "ts-fbs-utils" | ||
description = "Utility package for the Feature Based Scheduler." | ||
license = { text = "GPL" } | ||
classifiers = [ "Programming Language :: Python :: 3" ] | ||
urls = { documentation = "https://ts-scheduler.lsst.io", repository = "https://github.com/lsst-ts/ts_fbs_utils" } | ||
dynamic = [ "version" ] | ||
|
||
[tools.setuptools] | ||
package-data = {"" = "*.csv"} | ||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "setuptools_scm.get_version" } | ||
|
||
[tool.setuptools.packages.find] | ||
where = [ "python" ] | ||
|
||
[tool.setuptools_scm] | ||
write_to = "python/lsst/ts/fbs/utils/version.py" | ||
write_to_template = """ | ||
# Generated by setuptools_scm | ||
__all__ = ["__version__"] | ||
__version__ = "{version}" | ||
""" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--black --flake8 --mypy --ignore-glob=*/version.py" | ||
flake8-ignore = ["E133", "E203", "E226", "E228", "N802", "N803", "N806", "N812", "N813", "N815", "N816", "W503"] | ||
flake8-max-line-length = 110 | ||
flake8-max-doc-length = 79 | ||
asyncio_mode = "auto" | ||
|
||
[tool.mypy] | ||
disallow_untyped_defs = "True" | ||
ignore_missing_imports = "True" | ||
exclude = "version.py" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"documenteer[pipelines]", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This file is part of ts_fbs_utils. | ||
# | ||
# Developed for the Vera Rubin Observatory Telescope and Site System. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
from .basis_functions import * | ||
from .surveys import * | ||
from .make_scheduler import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
# This file is part of ts_fbs_utils. | ||
# | ||
# Developed for the Vera Rubin Observatory Telescope and Site System. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
__all__ = [ | ||
"get_basis_functions_image_survey", | ||
"get_basis_functions_cwfs_survey", | ||
"get_basis_functions_spectroscopic_survey", | ||
] | ||
|
||
import typing | ||
from rubin_sim.scheduler import basis_functions | ||
|
||
|
||
def get_basis_functions_image_survey( | ||
ra: float, | ||
nside: int, | ||
note: str, | ||
ha_limits: typing.List[typing.Tuple[float, float]], | ||
wind_speed_maximum: float, | ||
nobs_reference: int, | ||
nobs_survey: int, | ||
note_interest: str, | ||
) -> typing.List[basis_functions.Base_basis_function]: | ||
"""Get the basis functions for the image survey. | ||
Parameters | ||
---------- | ||
ra : `float` | ||
Right Ascention for the observavtions, in degrees. | ||
nside : `int` | ||
The nside value for the healpix grid. | ||
note : `str` | ||
A identifier string to be attached to the survey observations. | ||
ha_limits : 'list` of `float` | ||
A two-element list with the hour angle limits, in hours. | ||
wind_speed_maximu : `float` | ||
Maximum wind speed tolerated for the observations of the survey, | ||
in m/s. | ||
nobs_reference : `int` | ||
Reference number of observations. | ||
nobs_survey : `int` | ||
Total number of observations expected for the survey. | ||
note_interest : `str` | ||
A substring that maps to surveys to be accounted for agains the | ||
reference number of observations. | ||
Returns | ||
------- | ||
`list` of `basis_functions.Base_basis_function` | ||
""" | ||
|
||
sun_alt_limit = -12.0 | ||
|
||
return [ | ||
basis_functions.Not_twilight_basis_function(sun_alt_limit=sun_alt_limit), | ||
basis_functions.Hour_Angle_limit_basis_function(RA=ra, ha_limits=ha_limits), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="g"), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="r"), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="i"), | ||
basis_functions.Moon_avoidance_basis_function(nside=nside), | ||
basis_functions.Zenith_shadow_mask_basis_function( | ||
min_alt=20.0, max_alt=85.0, nside=nside | ||
), | ||
basis_functions.VisitGap(note=note, gap_min=1440.0), | ||
basis_functions.AvoidDirectWind( | ||
wind_speed_maximum=wind_speed_maximum, nside=nside | ||
), | ||
basis_functions.BalanceVisits( | ||
nobs_reference=nobs_reference, note_survey=note, note_interest=note_interest | ||
), | ||
basis_functions.RewardNObsSequence( | ||
n_obs_survey=nobs_survey, | ||
note_survey=note, | ||
nside=nside, | ||
), | ||
] | ||
|
||
|
||
def get_basis_functions_cwfs_survey( | ||
nside: int, | ||
note: str, | ||
time_gap_min: float, | ||
wind_speed_maximum: float, | ||
) -> typing.List[basis_functions.Base_basis_function]: | ||
"""Get the basis functions for the CWFS survey. | ||
This is a background survey that will activate at specific points in time | ||
to make sure the telescope optics are aligned. | ||
Parameters | ||
---------- | ||
nside : `int` | ||
The nside value for the healpix grid. | ||
note : `str` | ||
A identifier string to be attached to the survey observations. | ||
time_gap_min : `float` | ||
The gap between observations of this survey, in minutes. | ||
wind_speed_maximu : `float` | ||
Maximum wind speed tolerated for the observations of the survey, | ||
in m/s. | ||
Returns | ||
------- | ||
`list` of `basis_functions.Base_basis_function` | ||
""" | ||
sun_alt_limit = -12.0 | ||
|
||
return [ | ||
basis_functions.Not_twilight_basis_function(sun_alt_limit=sun_alt_limit), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="g"), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="r"), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="i"), | ||
basis_functions.Moon_avoidance_basis_function(nside=nside), | ||
basis_functions.Zenith_shadow_mask_basis_function( | ||
min_alt=28.0, max_alt=85.0, nside=nside | ||
), | ||
basis_functions.VisitGap(note=note, gap_min=time_gap_min), | ||
basis_functions.AvoidDirectWind( | ||
wind_speed_maximum=wind_speed_maximum, nside=nside | ||
), | ||
] | ||
|
||
|
||
def get_basis_functions_spectroscopic_survey( | ||
ra: float, | ||
nside: int, | ||
note: str, | ||
ha_limits: typing.List[typing.Tuple[float, float]], | ||
wind_speed_maximum: float, | ||
gap_min: float, | ||
) -> typing.List[basis_functions.Base_basis_function]: | ||
"""Get basis functions for spectroscopic survey. | ||
Parameters | ||
---------- | ||
ra : `float` | ||
RA of the target, in degrees. | ||
nside : `int` | ||
Healpix maps resolution. | ||
note : `str` | ||
Survey note. | ||
ha_limits : `list` of `tuple` of (`float`, `float`) | ||
Hour angle limits, in hours. | ||
wind_speed_maximum : `float` | ||
Maximum wind speed, in m/s. | ||
gap_min : `float` | ||
Gap between subsequent observations, in minutes. | ||
Returns | ||
------- | ||
list of basis_functions.Base_basis_function | ||
List of basis functions. | ||
""" | ||
sun_alt_limit = -12.0 | ||
|
||
return [ | ||
basis_functions.Not_twilight_basis_function(sun_alt_limit=sun_alt_limit), | ||
basis_functions.Hour_Angle_limit_basis_function(RA=ra, ha_limits=ha_limits), | ||
basis_functions.M5_diff_basis_function(nside=nside), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="g"), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="r"), | ||
basis_functions.Slewtime_basis_function(nside=nside, filtername="i"), | ||
basis_functions.Moon_avoidance_basis_function(nside=nside), | ||
basis_functions.Zenith_shadow_mask_basis_function( | ||
min_alt=28.0, max_alt=85.0, nside=nside | ||
), | ||
basis_functions.VisitGap(note=note, gap_min=gap_min), | ||
basis_functions.AvoidDirectWind( | ||
wind_speed_maximum=wind_speed_maximum, nside=nside | ||
), | ||
] |
Oops, something went wrong.