I find the following sentence in the function`gen_phs` of `aipy.phs` module, in the case of only a single frequency channel, will get an error.
if not srcshape is None: phs *= self.resolve_src(u, v, srcshape=srcshape)
It calls the function `resolve_src`, which returns
return n.where(x == 0, 1, 2 * _cephes.j1(x)/x).squeeze()
When there is only one frequency channel, phs and x will be an numpy array of shape (N,1), where N
is an integer number, then the array returned by resolve_src has a shape (N,) for N>1 and () for N=1.
In the former case, the shape of the array phs and the returned array won't match, so an error occurs.
While it is OK in all cases for
return n.where(x == 0, 1, 2 * _cephes.j1(x)/x)
so maybe it's better to drop the squeeze operation.
In addition, in the function sim of aipy.amp module, there is a sentence
u,v,w = self.gen_uvw(i, j, src=s_eqs)
here (u,v,w) has computed, but used nowhere else. It is not a bug, but it takes time whenever sim
is called.
When there is only one frequency channel,
phs
andx
will be an numpy array of shape (N,1), where N is an integer number, then the array returned byresolve_src
has a shape (N,) for N>1 and () for N=1. In the former case, the shape of the arrayphs
and the returned array won't match, so an error occurs. While it is OK in all cases forreturn n.where(x == 0, 1, 2 * _cephes.j1(x)/x)
so maybe it's better to drop thesqueeze
operation. In addition, in the functionsim
ofaipy.amp
module, there is a sentenceu,v,w = self.gen_uvw(i, j, src=s_eqs)
here
(u,v,w)
has computed, but used nowhere else. It is not a bug, but it takes time wheneversim
is called.