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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

from builtins import zip 

import numpy as np 

from .baseStacker import BaseStacker 

from .ditherStackers import wrapRA 

 

__all__ = ['SdssRADecStacker'] 

 

class SdssRADecStacker(BaseStacker): 

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

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

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

self.units = ['rad']*8 

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

self.colsReq = pcols 

 

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

if cols_present: 

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

pass 

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

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

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

else: 

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

return simData