How to use the gwcs.coordinate_frames.StokesProfile function in gwcs

To help you get started, we’ve selected a few gwcs 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 spacetelescope / gwcs / gwcs / coordinate_frames.py View on Github external
def coordinate_to_quantity(self, *coords):
        if isinstance(coords[0], str):
            if coords[0] in StokesProfile.profiles.keys():
                return StokesProfile.profiles[coords[0]] * u.one
        else:
            return coords[0]
github spacetelescope / gwcs / gwcs / coordinate_frames.py View on Github external
----------
        indexes : `int`, `numpy.ndarray`
            An index or array of indices to construct StokesProfile objects from.
        """

        nans = np.isnan(indexes)
        indexes = np.asanyarray(indexes, dtype=int)
        out = np.empty_like(indexes, dtype=object)

        out[nans] = np.nan

        for profile, index in cls.profiles.items():
            out[indexes == index] = profile

        if out.size == 1 and not nans:
            return StokesProfile(out.item())
        elif nans.all():
            return np.array(out, dtype=float)
        return out
github spacetelescope / gwcs / gwcs / coordinate_frames.py View on Github external
def _world_axis_object_classes(self):
        return {'stokes': (
            StokesProfile,
            (),
            {},
            StokesProfile.from_index)}
github spacetelescope / gwcs / gwcs / coordinate_frames.py View on Github external
def _world_axis_object_classes(self):
        return {'stokes': (
            StokesProfile,
            (),
            {},
            StokesProfile.from_index)}