Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from builtins import zip 

2import numpy as np 

3from .baseStacker import BaseStacker 

4from .ditherStackers import wrapRA 

5 

6__all__ = ['SdssRADecStacker'] 

7 

8class SdssRADecStacker(BaseStacker): 

9 """convert the p1,p2,p3... columns to radians and wrap them """ 

10 colsAdded = ['RA1', 'Dec1', 'RA2', 'Dec2', 'RA3', 'Dec3', 'RA4', 'Dec4'] 

11 

12 def __init__(self, pcols = ['p1','p2','p3','p4','p5','p6','p7','p8']): 

13 """ The p1,p2 columns represent the corners of chips. Could generalize this a bit.""" 

14 self.units = ['rad']*8 

15 self.colsReq = pcols 

16 

17 def _run(self, simData, cols_present=False): 

18 if cols_present: 

19 # Assume this is unusual enough to run that you really mean it. 

20 pass 

21 for pcol, newcol in zip(self.colsReq, self.colsAdded): 

22 if newcol[0:2] == 'RA': 

23 simData[newcol] = wrapRA(np.radians(simData[pcol])) 

24 else: 

25 simData[newcol] = np.radians(simData[pcol]) 

26 return simData