Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _free_or_fix(self, free, radius, normalization_only):
for src_name in self.point_sources:
src = self.point_sources[src_name]
this_d = angular_distance(
self._ra_center,
self._dec_center,
src.position.ra.value,
src.position.dec.value,
)
if this_d <= radius:
if normalization_only:
src.spectrum.main.shape.K.free = free
else:
for par in src.spectrum.main.shape.parameters:
src.spectrum.main.shape.parameters[par].free = free