Commit aab3851c authored by LUSTIG Peter's avatar LUSTIG Peter

corrected error

parent 3475b41f
......@@ -181,7 +181,7 @@ class transUniformCoords():
self.decuniformlimits = decuniformlimits
def __call__(self, relra, reldec, angle):
def __call__(self, relcoordinate, angle):
'''
Parameters
----------
......@@ -191,9 +191,10 @@ class transUniformCoords():
ralimits = self.ralimits
decuniformlimits = self.decuniformlimits
relra, reldec = relcoordinate
ra = rel_to_coord(*ralimits, relra) * u.deg
angle = angle * 360 * u.deg
decuniform_inrange = rel_to_coord(*decuniformlimits, reldec)
# decuniform_inrange = rel_to_coord(*decuniformlimits, reldec)
# rescale uniform coordinate to hold in range
reldec = rel_to_coord(*decuniformlimits, reldec)
......@@ -206,6 +207,25 @@ class transUniformCoords():
class CatalogShifter(object):
def __init__(self, catalog, mapshape, mapwcs):
'''
Class that takes source catalog and shifts source positions to area
that is covered by a map with shape ``mapshape`` and `astropy.wcs.WCS`
``wcs``
Parameters
----------
catalog : :class:`astropy.table.Table`
Table containing the source positions. Must provide columns
'ra' and 'dec'
mapshape : tuple
shape of the map that shall contain shifted sources
wcs : :class:`astropy.wcs.WCS`
wcs of the map
Returns
-------
CatalogShifter object that can be called to create shifted catalogs
'''
# create centerframe
centerpixel = (np.array(nm.shape)/2).astype(int)
......@@ -219,6 +239,22 @@ class CatalogShifter(object):
self.centerframe = centerframe
def __call__(self, coord_in_center, rotation=0*u.deg, transform=None):
'''
Parameters
----------
coord_in_center : :class:`astropy.coordinates.SkyCoord`
coordinate that is shifted in the center of the map
rotation : :class:`astropy.units.Quantity`
catalog is rotated through this angle
transform: callable or None.
If not None, takes coord_in_center and rotation as argument
and transforms them to a :class:`astropy.coordinates.SkyCoord`
and an angle that are used as coord_in_center and rotation.
Returns
-------
catalog : :class:``astropy.table.Table``
catalog containing new source positions
'''
catalog = self.catalog
catcoords = self.catcoords
centerframe = self.centerframe
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment