Skip to content

Commit

Permalink
fix bug when abs mag is unkonwn
Browse files Browse the repository at this point in the history
  • Loading branch information
rcboufleur authored and glaubervila committed Apr 18, 2024
1 parent 2931767 commit cbc85ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ def compute_magnitude_drop(asteroid_visual_magnitude, star_visual_magnitude):
Returns:
- float: The magnitude drop of the asteroid relative to the star.
"""
if asteroid_visual_magnitude is None or star_visual_magnitude is None:
return None

delta_magnitude = asteroid_visual_magnitude - star_visual_magnitude
drop_magnitude = 2.5 * np.log10(1 + 10 ** (delta_magnitude * 0.4))
return drop_magnitude
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ def run_occultation_path_coeff(predict_table_path: Path, obj_data: dict):
for column in ast_data_columns:
df[column] = obj_data.get(column)

# Correcao de valores nao validos para H (magnitude absoluta do asteroide)
if obj_data["h"] > 99:
df["h"] = None

# -------------------------------------------------
# Provenance Fields
# Adiciona algumas informacoes de Proveniencia a cada evento de predicao
Expand Down

0 comments on commit cbc85ba

Please sign in to comment.