You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wokxy2radec doesn't like getting a one-element array input; it is fine with > 1 element array however. I could dig into this myself if you prefer me to.
This code:
dec = np.array([52.58780416] * 1, dtype=np.float64)
racen = 14.289097510524789
deccen = 51.98826274680977
jd = 2459491.7920949073
pa = 41.42279
x, y, warn, ha, pa = coordio.utils.radec2wokxy(ra, dec, jd, 'Apogee',
racen, deccen, pa, 'APO', jd)
ra2, dec2, warn2 = coordio.utils.wokxy2radec(x, y, 'Apogee',
racen, deccen, pa,
'APO', jd)
Leads to the error:
IndexError Traceback (most recent call last)
<ipython-input-39-3b3b7ca72fba> in <module>
9 racen, deccen, pa, 'APO', jd)
10
---> 11 ra2, dec2, warn2 = coordio.utils.wokxy2radec(x, y, 'Apogee',
12 racen, deccen, pa,
13 'APO', jd)
~/products/coordio/coordio/utils.py in wokxy2radec(xWok, yWok, waveName, raCen, decCen, obsAngle, obsSite, obsTime, pressure, relativeHumidity, temperature)
273 wok = Wok(xyzWok, site=site, obsAngle=obsAngle)
274 focal = FocalPlane(wok, wavelength=wavelength, site=site)
--> 275 field = Field(focal, field_center=obsCen, wavelength=wavelength)
276 obs = Observed(field, site=site, wavelength=wavelength)
277 icrs = ICRS(obs, epoch=obsTime, wavelength=wavelength)
~/products/coordio/coordio/telescope.py in __new__(cls, value, **kwargs)
90 initArray = numpy.zeros((len(value), 2))
91 obj = super().__new__(cls, initArray, **kwargs)
---> 92 obj._fromFocalPlane(value)
93 else:
94 raise CoordIOError(
~/products/coordio/coordio/telescope.py in _fromFocalPlane(self, fpCoords)
146 continue
147
--> 148 thetaFocal, phiFocal, fieldWarn = conv.focalToField(
149 xFP,
150 yFP,
~/products/coordio/coordio/conv.py in focalToField(xFocal, yFocal, zFocal, site, waveCat)
437 rFocal = numpy.sqrt(xFocal**2 + yFocal**2)
438 v = numpy.array([rFocal, zFocal]).T
--> 439 v[:, 1] = v[:, 1] - b
440
441 # unit vector pointing toward object on focal plane from circle center
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed```
The text was updated successfully, but these errors were encountered:
There is a simple patch for this. Use v[...,1] = v[...,1] -b
in line 439 instead to handle 1-d and 2-d arrays. One would actually write this self-assignment as v[...,1] -= b
wokxy2radec doesn't like getting a one-element array input; it is fine with > 1 element array however. I could dig into this myself if you prefer me to.
This code:
Leads to the error:
The text was updated successfully, but these errors were encountered: