Skip to content

Commit

Permalink
do not check the culmination angle for sources between 22.76 and 34.7…
Browse files Browse the repository at this point in the history
…6 dec
  • Loading branch information
marialainez committed Sep 26, 2024
1 parent 0b25f30 commit 7bfbdb2
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/osa/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,20 +465,21 @@ def get_RF_model(run_str: str) -> Path:

closest_declination = min(dec_values, key=lambda x: abs(x - source_dec))
closest_dec_culmination = utils.culmination_angle(closest_declination)
log.debug(
f"The declination closest to {source_dec} is: {closest_declination}."
"Checking if the culmination angle is larger than the one of the target source."
)

while closest_dec_culmination > source_culmination:
# If the culmination angle of the closest declination line is larger than for the source,
# remove it from the declination lines list and look for the second closest declination line.
corresponding_dict = get_corresponding_string(dec_list, dec_values)
declination_str = corresponding_dict[closest_declination]
dec_values.remove(closest_declination)
dec_list.remove(declination_str)
closest_declination = min(dec_values, key=lambda x: abs(x - source_dec))
closest_dec_culmination = utils.culmination_angle(closest_declination)

if source_dec < 22.76*u.deg or source_dec > 34.76*u.deg:
log.debug(
f"The declination closest to {source_dec} is: {closest_declination}."
"Checking if the culmination angle is larger than the one of the target source."
)
while closest_dec_culmination > source_culmination:
# If the culmination angle of the closest declination line is larger than for the source,
# remove it from the declination lines list and look for the second closest declination line.
corresponding_dict = get_corresponding_string(dec_list, dec_values)
declination_str = corresponding_dict[closest_declination]
dec_values.remove(closest_declination)
dec_list.remove(declination_str)
closest_declination = min(dec_values, key=lambda x: abs(x - source_dec))
closest_dec_culmination = utils.culmination_angle(closest_declination)

log.debug(f"The declination line to use for the DL2 production is: {closest_declination}")

Expand Down

1 comment on commit 7bfbdb2

@contrera
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to introduce a condition which is more general? Does not depend on concrete values as 22.76?
The general case is the two closest values are at both sides of the latitude something like (de1-lat)*(dec2-lat)<0

Please sign in to comment.