Skip to content

Commit

Permalink
adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marialainez committed Sep 19, 2024
1 parent 0c15ed7 commit d6c45cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/osa/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import lstchain
from astropy.table import Table
from astropy import units as u
from astropy.coordinates import SkyCoord
from lstchain.onsite import (find_systematics_correction_file,
find_time_calibration_file,
find_filter_wheels)
Expand Down Expand Up @@ -445,8 +446,13 @@ def get_RF_model(run_str: str) -> Path:
run = run_catalog[run_catalog["run_id"]==int(run_str)]
target_name = run["source_name"]

tcu_server = cfg.get("database", "tcu_db")
source_dec = utils.get_source_dec_from_TCU(target_name[0], tcu_server)
if options.test:
source_coordinates = SkyCoord.from_name(target_name[0])
source_dec = source_coordinates.dec
else:
tcu_server = cfg.get("database", "tcu_db")
source_dec = utils.get_source_dec_from_TCU(target_name[0], tcu_server)

source_culmination = utils.culmination_angle(source_dec)

rf_models_dir = Path(cfg.get("LST1", "RF_MODELS"))
Expand Down
2 changes: 1 addition & 1 deletion src/osa/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def culmination_angle(dec: u.Quantity) -> u.Quantity:
"""
location = observatory_locations["cta_north"]
Lat = location.lat # latitude of the LST1 site
return abs(Lat - dec*u.deg)
return abs(Lat - dec)


def get_source_dec_from_TCU(source_name: str, tcu_server: str) -> u.Quantity:
Expand Down

0 comments on commit d6c45cd

Please sign in to comment.