Skip to content

gen_phs bug for single frequency case #19

@AaronParsons

Description

@AaronParsons
   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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions