Skip to content

Commit

Permalink
added warning if outer radius exceeds FoV
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgomer committed Apr 13, 2023
1 parent 1a8cc5f commit ed6f9a0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions coolest/api/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
from astropy.coordinates import SkyCoord
import warnings

from coolest.api.composable_models import *
from coolest.api import util
Expand Down Expand Up @@ -192,6 +193,17 @@ def half_light_radius(self, outer_radius=10, center=None, initial_guess=1, initi
center_x, center_y = light_model.estimate_center()
else:
center_x, center_y = center

#if limit of integration exceeds FoV, raise warning
x_FoV=self.coolest.observation.pixels.field_of_view_x
y_FoV=self.coolest.observation.pixels.field_of_view_y
out_of_FoV=False
if center_x - outer_radius < x_FoV[0] or center_x + outer_radius > x_FoV[1]:
out_of_FoV=True
if center_y - outer_radius < y_FoV[0] or center_y + outer_radius > y_FoV[1]:
out_of_FoV=True
if out_of_FoV is True:
warnings.warn("Warning: Outer limit of integration exceeds FoV; effective radius may not be accurate.")

#initialize
grid_res=np.abs(x[0,0]-x[0,1])
Expand Down

0 comments on commit ed6f9a0

Please sign in to comment.