PSims / BayesEoR

Code to estimate the power spectrum of redshifted 21-cm emission from interferometric observations, within a Bayesian forward modelling framework.
https://bayeseor.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Bug in HEALPix pixel selection #11

Open jburba opened 12 months ago

jburba commented 12 months ago

The longitude selection criteria can't properly handle the periodic longitudinal boundary conditions. The example below shows (an unlikely) case where the FoV is set so large that it overlaps with the longitude wrap from 360 to 0 (or equivalently 180 to -180). The FoV gets clipped at this boundary.

Shown below is a filtered white noise map at the HERA longitude with a FoV of 120 deg. The bottom right corner of the masked pixel map is clipped at the longitude wrap (vertical center line of map).

image

There are two options to fix this:

  1. Fix the logic in the longitudinal filter in BayesEoR.model.healpix.Healpix.get_pixel_filter
  2. Use the simple_za_filter=True kwarg which ignores longitude altogether
jburba commented 9 months ago

Using a circular FoV appears to be okay (see figure below comparing results using the test dataset and a square or circular FoV in the sky model). This will need to be tested further (e.g. when including FGs).

image

Changes to make

Tests to run

Questions

  1. Once the default is changed to a circular FoV:

    • [ ] Remove support for rectangular FoVs altogether?
    • [ ] Or is there some way to support a "rectangular" FoV when using the circular filter? This is potentially useful in that our observations will span a larger range of RAs compared to Decs for drift scan observations.
    • [ ] Or change the command line argument to specify a rectangular FoV instead of a circular FoV?
  2. Does the location of the center of the sky model matter? I don't remember why I chose to center the sky model above the location of the telescope model. I don't think the location of the center of the map should matter? Should I move the center of the map to a different location?

    • This constraint will affect the rectangular zenith angle filter unless I think of 1) a reason to keep the rectangular filter and 2) a better way to implement the rectangular filter given the phase wrap of RA.
    • Does anything weird happen if I place the origin at the vertex of the 0th index HEALPix pixel (i.e. theta = 0)? This would be convenient for plotting purposes.
    • Or should I place the origin at theta = pi/2, phi = 0 (or 90, 180, etc.)?
    • Is there any benefit to having zenith at the center of a HEALPix pixel? Having the origin at theta = 0 would make this impossible which would mean we don't sample l = m = 0.
jburba commented 9 months ago

Regarding question 2 above, I don't think it's worth changing the location of the center of the sky model. It's best to leave this to astropy as it automatically compensates for the direction the beam moves across the sky model (both the direction and speed). This varies as a function of telescope latitude. There's no point in re-inventing the wheel, so going forward we will use the telescope location in the image domain pixel selection.

Should the telescope location become a component of the instrument model? Or is it okay to leave it as a command line argument?