Skip to content

Commit

Permalink
CLI surveys (#173)
Browse files Browse the repository at this point in the history
* more hydra 1.1 changes

* two more changes because of a hydra update

* surveys implemented will
now be config files, added functions to convert cfg to
survey objects

* correct format for new survey as config files structure

* config files for various surveys added

* added CFHT

* HSC survey added

* get_surveys function is now working!

* fix main so it uses new survey infrasctructure

* TODO is resolved :)

* hydra has a new env resolver

* fix tests to new compatible way of getting surveys from config

* update help

* add explanation for how to use new surveys config infra

* a couple more tests

* add a little more tests on specific surveys

* clean up tests imports

* need an extra \

* band in a more standard order

* typo

* changing order of bands in Rubin changes seed so need to adjust values in tests

* option to customize surveys directly in get_surveys
  • Loading branch information
ismael-mendoza authored Jul 2, 2021
1 parent 6d64955 commit 560aa65
Show file tree
Hide file tree
Showing 29 changed files with 591 additions and 515 deletions.
7 changes: 2 additions & 5 deletions btk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from btk.measure import MeasureGenerator
from btk.metrics import MetricsGenerator
from btk.sampling_functions import available_sampling_functions
from btk.survey import available_surveys
from btk.survey import _get_survey_from_cfg


def main(cfg: OmegaConf):
Expand All @@ -30,11 +30,8 @@ def main(cfg: OmegaConf):

surveys = []
for survey_name in cfg.surveys:
if survey_name not in available_surveys:
raise ValueError(f"Survey '{survey_name}' is not implemented in BTK.")
survey = available_surveys[survey_name]
survey = _get_survey_from_cfg(cfg.surveys[survey_name])
surveys.append(survey)
# TODO: Possibility to customize PSF inside each filter, etc.

# get draw blends generator.
if cfg.draw_blends.name not in available_draw_blends:
Expand Down
2 changes: 1 addition & 1 deletion btk/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def draw_plots(value):
zorder=-10,
)
ax[2 * i + 1].set_xlabel("Magnitude") # noqa: W605
ax[2 * i + 1].set_ylabel(f"$\Delta${k}") # noqa: W605
ax[2 * i + 1].set_ylabel(f"$\\Delta${k}") # noqa: W605
plt.tight_layout()

if save_path is not None:
Expand Down
Loading

0 comments on commit 560aa65

Please sign in to comment.