def __init__(self, header_or_wcs, dest_coord=None, resolution=None): """ Create a new WCS transform. Resolution is the number of steps to interpolate between each input line segment to approximate its path. """ CurvedTransform.__init__(self, resolution) #if wcs.naxis > 2: # wcs = wcs.wcssub([1, 2]) self.projection = get_kapteyn_projection(header_or_wcs) #self.wcs = wcs if dest_coord is not None: ctype1, ctype2 = self.projection.ctypes[:2] equinox = self.projection.equinox coord_guess = coord_system_guess(ctype1, ctype2, equinox) self.src_coord = coord_guess self.dest_coord = dest_coord if dest_coord == coord_guess: self.coord_conv_func = None else: self.coord_conv_func = coord_conv(coord_guess, dest_coord) else: self.src_coord = None self.dest_coord = None self.coord_conv_func = None
def __init__(self, header_or_wcs, src_coord=None, resolution=None): """ Create a new WCS transform. """ CurvedTransform.__init__(self, resolution) self.projection = get_kapteyn_projection(header_or_wcs) if src_coord is not None: self.src_coord = src_coord ctype1, ctype2 = self.projection.ctypes[:2] equinox = self.projection.equinox coord_guess = coord_system_guess(ctype1, ctype2, equinox) self.dest_coord = coord_guess if src_coord == coord_guess: self.coord_conv_func = None else: self.coord_conv_func = coord_conv(src_coord, coord_guess) else: self.src_coord = None self.dest_coord = None self.coord_conv_func = None