wrap_ra

jwst.assign_wcs.util.wrap_ra(ravalues)[source]

Test for 0/360 wrapping in RA values and filter out non-finite values.

If RA wrapping exists it makes it difficult to determine the RA range of a region on the sky. This problem is solved by putting all the points either around 0 degrees or 360 degrees.

This is just a thin wrapper around the astropy.coordinates.wrap_at function, where we test for a large difference between the min and max RA values to determine if wrapping correction is needed, and then apply it if necessary.

Parameters:
ravaluesndarray or list

The input RA values

Returns:
ndarray or list

A numpy array or list of RA values all around either 0 or 360 degrees