def __init__(self, crpix, pc, phip, thetap, lonp, projcode, projparams={}): self.projcode = projcode.upper() self.crpix = crpix self.pc = pc self.thetap = thetap self.lonp = lonp self.phip = phip if projcode not in projections.projcodes: raise ValueError('Projection code %s, not recognized' % projcode) # create a projectiontransform projklassname = 'Sky2Pix_' + projcode projklass = getattr(projections, projklassname) prj = projklass(**projparams) # determine the Euler angles and create a RotateCelestial2Native transform c2n = models.RotateCelestial2Native(phip, thetap, lonp) # create shift transforms in x and y offx = models.ShiftModel(crpix[0]) offy = models.ShiftModel(crpix[1]) # create a transform for the CD/PC matrix pcrot = models.MatrixRotation2D(rotmat=pc).inverse() # create the composite transform SCompositeModel.__init__(self, [c2n, prj, pcrot, offx, offy], inmap=[['x', 'y'], ['x', 'y'], ['x', 'y'], ['x'], ['y']], outmap=[['x', 'y'], ['x', 'y'], ['x', 'y'], ['x'], ['y']])
def __init__(self, crpix, pc, phip, thetap, lonp, projcode, projparams={}): self.projcode = projcode.upper() self.crpix = crpix self.pc = pc self.thetap = thetap self.lonp = lonp self.phip = phip if projcode not in projections.projcodes: raise ValueError('Projection code %s, not recognized' %projcode) # create a projectiontransform projklassname = 'Sky2Pix_' + projcode projklass = getattr(projections, projklassname) prj = projklass(**projparams) # determine the Euler angles and create a RotateCelestial2Native transform c2n = models.RotateCelestial2Native(phip, thetap, lonp) # create shift transforms in x and y offx = models.ShiftModel(crpix[0]) offy = models.ShiftModel(crpix[1]) # create a transform for the CD/PC matrix pcrot = models.MatrixRotation2D(rotmat=pc).inverse() # create the composite transform SCompositeModel.__init__(self, [c2n, prj, pcrot, offx, offy], inmap=[['x', 'y'], ['x', 'y'], ['x', 'y'], ['x'], ['y']], outmap=[['x', 'y'], ['x', 'y'], ['x', 'y'], ['x'], ['y']])
def __init__(self, crpix, pc, phip, thetap, lonp, projcode, projparams={}): self.projcode = projcode.upper() self.crpix = crpix self.pc = pc self.phip = phip self.lonp = lonp self.thetap = thetap if projcode not in projections.projcodes: raise ValueError('Projection code %s, not recognized' % projcode) # create a projection transform projklassname = 'Pix2Sky_' + self.projcode projklass = getattr(projections, projklassname) prj = projklass(**projparams) # Create a RotateNative2Celestial transform using the Euler angles n2c = models.RotateNative2Celestial(phip, thetap, lonp) # create shift transforms in x and y offx = models.ShiftModel(-crpix[0]) offy = models.ShiftModel(-crpix[1]) # create a CD/PC transform pcrot = models.MatrixRotation2D(rotmat=pc) # finally create the composite transform which does pixel to sky transformation SCompositeModel.__init__(self, [offx, offy, pcrot, prj, n2c], inmap=[['x'], ['y'], ['x', 'y'], ['x', 'y'], ['x', 'y']], outmap=[['x'], ['y'], ['x', 'y'], ['x', 'y'], ['x', 'y']]) self.has_inverse = True
def __init__(self, crpix, pc, phip, thetap, lonp, projcode, projparams={}): self.projcode = projcode.upper() self.crpix = crpix self.pc = pc self.phip = phip self.lonp = lonp self.thetap = thetap if projcode not in projections.projcodes: raise ValueError('Projection code %s, not recognized' %projcode) # create a projection transform projklassname = 'Pix2Sky_' + self.projcode projklass = getattr(projections, projklassname) prj = projklass(**projparams) # Create a RotateNative2Celestial transform using the Euler angles n2c = models.RotateNative2Celestial(phip, thetap, lonp) # create shift transforms in x and y offx = models.ShiftModel(-crpix[0]) offy = models.ShiftModel(-crpix[1]) # create a CD/PC transform pcrot = models.MatrixRotation2D(rotmat=pc) # finally create the composite transform which does pixel to sky transformation SCompositeModel.__init__(self, [offx, offy, pcrot, prj, n2c], inmap=[['x'], ['y'], ['x', 'y'], ['x', 'y'], ['x', 'y']], outmap=[['x'], ['y'], ['x', 'y'],['x', 'y'], ['x','y']]) self.has_inverse = True