diff options
author | dencheva <dencheva@stsci.edu> | 2011-08-19 12:28:32 -0400 |
---|---|---|
committer | dencheva <dencheva@stsci.edu> | 2011-08-19 12:28:32 -0400 |
commit | 707e9b522e7ac69ccf7bdd8e6795201f01c33f22 (patch) | |
tree | d75bcd3a940bb20feffc18418c34180124f1140d /lib/stwcs/distortion/models.py | |
parent | 01a72d0468f4d71876b20be05806efdd90f65f54 (diff) | |
download | stwcs_hcf-707e9b522e7ac69ccf7bdd8e6795201f01c33f22.tar.gz |
Cleaning the model.shift method
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13641 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/distortion/models.py')
-rw-r--r-- | lib/stwcs/distortion/models.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/stwcs/distortion/models.py b/lib/stwcs/distortion/models.py index 96d5d72..db48a9f 100644 --- a/lib/stwcs/distortion/models.py +++ b/lib/stwcs/distortion/models.py @@ -63,7 +63,7 @@ class GeometryModel: self.pscale = 1.0 - def shift(self,cx,cy,xs,ys): + def shift(self, xs, ys): """ Shift reference position of coefficients to new center where (xs,ys) = old-reference-position - subarray/image center. @@ -72,8 +72,8 @@ class GeometryModel: to the reference position of the chip. """ - _cxs = np.zeros(shape=cx.shape,dtype=cx.dtype) - _cys = np.zeros(shape=cy.shape,dtype=cy.dtype) + _cxs = np.zeros(shape=self.cx.shape,dtype=self.cx.dtype) + _cys = np.zeros(shape=self.cy.shape,dtype=self.cy.dtype) _k = self.norder + 1 # loop over each input coefficient for m in xrange(_k): @@ -86,9 +86,10 @@ class GeometryModel: _jlist = range(n, i - (m-n)+1) # sum from n to i-(m-n) for j in _jlist: - _cxs[m,n] += cx[i,j]*combin(j,n)*combin((i-j),(m-n))*pow(xs,(j-n))*pow(ys,((i-j)-(m-n))) - _cys[m,n] += cy[i,j]*combin(j,n)*combin((i-j),(m-n))*pow(xs,(j-n))*pow(ys,((i-j)-(m-n))) - return _cxs,_cys + _cxs[m,n] += self.cx[i,j]*combin(j,n)*combin((i-j),(m-n))*pow(xs,(j-n))*pow(ys,((i-j)-(m-n))) + _cys[m,n] += self.cy[i,j]*combin(j,n)*combin((i-j),(m-n))*pow(xs,(j-n))*pow(ys,((i-j)-(m-n))) + self.cx = _cxs.copy() + self.cy = _cys.copy() def convert(self, tmpname, xref=None,yref=None,delta=yes): """ |