@@ -42,7 +42,6 @@ def coord2pix(lon, lat=None, coord='C', res='F'):
42
42
elif res == 'B' :
43
43
res = 9
44
44
45
-
46
45
#I believe this is the relevant code from coorconv.pro that I need to follow
47
46
#uvec = cconv(input*1.,-1) #convert to unit vector
48
47
#uvec = skyconv(uvec, inco=in_coord, outco='E') #convert to ecliptic
@@ -58,25 +57,13 @@ def coord2pix(lon, lat=None, coord='C', res='F'):
58
57
coord = 'geocentrictrueecliptic'
59
58
60
59
if lat is not None :
61
- if npts > 1 :
62
- c = []
63
- for lon_tmp , lat_tmp in zip (lon , lat ):
64
- c_tmp = SkyCoord (lon_tmp , lat_tmp , unit = 'deg' , equinox = 'J2000' , frame = coord )
65
- c .append (c_tmp )
66
- else :
67
- c = SkyCoord (lon , lat , unit = 'deg' , equinox = 'J2000' , frame = coord )
60
+ c = SkyCoord (lon , lat , unit = 'deg' , equinox = 'J2000' , frame = coord )
68
61
else :
69
62
c = lon
70
63
71
- if npts == 1 :
72
- c = c .geocentrictrueecliptic #check to see if this is the right ecliptic
73
- c = c .cartesian
74
- else :
75
- c2 = []
76
- for i in range (npts ):
77
- c2 .append (c [i ].geocentrictrueecliptic )
78
- c2 [i ] = c2 [i ].cartesian
79
- c = c2
64
+ c = c .geocentrictrueecliptic #check to see if this is the right ecliptic
65
+ c = c .cartesian
66
+
80
67
output = _uv2pix (c , res = res )
81
68
82
69
if npts == 1 :
@@ -1096,7 +1083,7 @@ def _rastr(pixel, res=6, face=False, sixpack=False, data=-1, bad_pixval=0.0):
1096
1083
1097
1084
return raster , x_out , y_out
1098
1085
1099
- def _pix2dat (pixel , x_in = None , y_in = None , raster = None ):
1086
+ def _pix2dat (raster , pixel = None , x_in = None , y_in = None ):
1100
1087
'''This function creates a data array given either a list of
1101
1088
pixels or a set of x and y raster coordinates and a raster
1102
1089
image (sky cube or face). The skycube can be in either unfolded
@@ -1126,7 +1113,7 @@ def _pix2dat(pixel, x_in=None, y_in=None, raster=None):
1126
1113
raise ValueError ("Improper image size" )
1127
1114
1128
1115
#Determine number of pixels / get column and row numbers if pixel entry
1129
- if pixel . size != 0 :
1116
+ if pixel is not None :
1130
1117
num_pix = pixel .size
1131
1118
1132
1119
if input_l == input_h :
0 commit comments