How to use the astromodels.utils.angular_distance.angular_distance function in astromodels

To help you get started, we’ve selected a few astromodels examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github threeML / threeML / threeML / catalogs / Fermi.py View on Github external
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