EoRImaging / FHD

Fast Holographic Deconvolution
BSD 2-Clause "Simplified" License
20 stars 10 forks source link

uvf extent problems #108

Open nicholebarry opened 6 years ago

nicholebarry commented 6 years ago

This is a problem that has been looked at over the past month, but making an official issue now.

There appears to be some window contamination that is dependent on how far out we grid before going to Healpix. Below is 2D dirty PS (from a in-situ sim) from gridding out to 60, 100, 150, and 300 wavelengths. screenshot from 2018-01-03 12 06 57 There is a rise in yellow at the lower part of the EoR window the farther out we grid.

This can also be seen from the 1D power spectra as well. uvf_1d_ps

Looking at real data seems to complicate the issue. Below is the 6-panel 2D PS from a regular gridding extent (300 wavelengths) and from a small gridding extent (60 wavelengths) for 64 obs from the golden set. fhd_nb_2013longrun_autocal_aug23_longrunstyle_averemove_bh_dencorr_2dkpower fhd_nb_2013longrun_autocal_pskspan60_smooth_aug23_longrunstyle_averemove_bh_dencorr_2dkpower Looking at the 1D power spectrum for the model, there appears to be more than one issue going on that was not apparent immediately from the simulations.

20171223002033

There is an rise in the lower part of the EoR window and an overall EoR floor.

jpober commented 6 years ago

The 1D power spectrum may be a confusing metric unless you're doing a k-perp cut on the 3D k cube before binning. That is, I think spherical shells of constant |k| can grab more/less wedge depending on how far out in k_perp your extent is. Maybe you're already doing this, but I think you want to take the k cubes and keep only voxels corresponding to the 60 wavelength cut. This should also allow you to make 2D difference plots which might be more informative.

nicholebarry commented 6 years ago

Thanks Jonnie. The 1D plots are only including kperp of wavelengths 10 to 50. The 2D difference plots would definitely be more informative than by-eye comparisons, so I'll take a look at that.

nicholebarry commented 6 years ago

I've made difference plots out to 60 wavelengths for each test. The below 2D differences are between: 60 - 100, 60 - 150, and 60 - 300, where "60" is the gridded 60 wavelength extent, "100" is the gridded 100 wavelength extent, etc. fhd_nb_sim_uvf_averemove_bh_dencorr__pskspan60_obs_id_6296_minus_pskspan100_obs_id_6296_2dkpower fhd_nb_sim_uvf_averemove_bh_dencorr__pskspan60_obs_id_6296_minus_pskspan150_obs_id_6296_2dkpower fhd_nb_sim_uvf_averemove_bh_dencorr__pskspan60_obs_id_6296_minus_pskspan300_obs_id_6296_2dkpower

nicholebarry commented 6 years ago

Here are the same tests, but with uvf inputs into eppsilon. This essentially skips FFTing (FHD), Healpix interpolation (FHD), and the subsequent DFTing (eppsilon). I'll be the first to say they don't look great; the resolution on those cubes are ridiculously high and do not get any nice smearing from going to Healpix, resulting in streakiness. BUT, it appears as though there is no floor problem seen above.

Gridded out to 60,100,150, and 300 wavelengths.

screen shot 2018-01-04 at 4 07 25 pm

bhazelton commented 6 years ago

Ideas we just generated on this issue include: -- Do baselines get clipped separately at different frequencies or if they don't make it in the lowest frequency are they excluded in the higher frequencies? -- Does the uv plane get clipped before the FT to image space if the full plane isn't gridded (i.e can we be getting aliasing from that edge) -- Are we gridding to a square rather than a circle? Could that be causing some aliasing?

nicholebarry commented 6 years ago

We wanted to run a test where we made it worse (I know, surprising!).

We ran a test where we constrained the max baseline. This would give us zeros along the outside of the uv plane depending on the ps_kspan specified. Currently, when ps_kspan is specified, it forces that uv plane to be that extent (so, there is no zero-padding....so no weird clipping/aliasing as mentioned in the above comment). But, we forced there to be zero-padding to get a feel for the resulting error.

Below is a comparison between when 1) the max baseline is constrained to 150 wavelengths and zero-padded out to 300 wavelengths and 2) ps_kspan constrained to 150 wavelengths. There are two issues being looked at here: what is the effect of zero padding and is there a problem with Healpix interpolation. We have not changed the Healpix pixels, so (1) is has a matching pixel area while (2) does not.

(1) minus (2) fhd_nb_sim_averemove_bh_dencorr__max150_obs_id_6296_minus_uvf_pskspan150_obs_id_6296_2dkpower

power kslice for (1) and (2) kzslice_power_020_max150 kzslice_power_020_pskspan150

weights kslice for (1) and (2) kzslice_weights_020_max150 kzslice_weights_020_pskspan150

I think the next logical step is to compare to something with the same Healpix interpolation. That is running. Any one have revelations from this, though?

bhazelton commented 6 years ago

So that I understand, you're saying that the previous plots you made where you were "gridding out to" some wavelength extent was actually changing the ps_kspan variable rather than setting the max_baseline variable?

If that's the case, I agree that the 2nd idea I posted 2 comments ago is a moot point.

nicholebarry commented 6 years ago

That's right, Bryna.

And now for the other promised test.

(1) is the same test (the max baseline is constrained to 150 wavelengths and zero-padded out to 300 wavelengths). (2) is now FHD gridding out to 300 wavelengths and eppsilon cutting that down to 150 wavelengths. This removes any difference in the Healpix interpolation.

(1) minus (2) _averemove_bh_dencorr__ps_obs_id_6296_minus_ps_150_obs_id_6296_2dkpower

power slice for (1) (repeated from above) and (2) kzslice_power_020_max150 kzslice_power_020_epps150

weights slice for (1) (repeated from above) and (2) kzslice_weights_020_max150 kzslice_weights_020_epps150

My interpretation: clipping in the uv plane is probably not the issue. The clipped uv plane still performs better than the 300-wavelength-gridded uv plane.

Comments?

nicholebarry commented 6 years ago

Here is confirmation that there is no signal loss when there is less gridding extent by FHD.

I put through a hash signal and had FHD only grid out to 60 wavelengths (blue). There is no signal loss compared to gridding out to 300 wavelengths (black). So we really have a bug on our hands here!

screenshot from 2018-01-10 17 52 17

nicholebarry commented 6 years ago

screenshot from 2018-01-11 23 34 37 Left: orthoslant image, gridding out to 100 wavelengths in UV space. Right: orthoslant image, gridding out to 300 wavelengths in UV space. Units are all over the place, but that's not the point.

Bryna pointed out horizontal/vertical aliasing features in the left image. It's present in the right as well, but on different scales. This is most likely due to the inherent fact that we are gridding a rectangular UV plane.

But then, why does the right image do worse in the power spectrum? When we grid on different scales, we are moving around contamination, but definitely not removing it. Perhaps the right image does worse just in the region that matters.

Potential solution: apply anti-aliasing filter (Tukey probably) on the UV plane.

Thoughts?

bhazelton commented 6 years ago

@nicholebarry can you also post the healpix images for these two? That's where I originally noticed the horizontal and vertical bars.

isullivan commented 6 years ago

I notice that the image on the right has a larger FoV, or at least a taper from the primary beam if I'm confused about that. I suspect that would perform some anti-aliasing for you. So, one additional suggestion would be to use the larger uv extent (ps_kspan) and higher uv resolution when gridding the cubes, take the FFT of that, and crop the field of view when converting to HEALPix.

nicholebarry commented 6 years ago

Ian, I was zooming in on the orthoslant images, there is no difference in the image extents. Both go out beyond the first sidelobe.

Healpix images: screenshot from 2018-01-12 11 26 09

isullivan commented 6 years ago

That makes perfect sense, since I didn't really think you had been varying the uv pixel size. However, I think that might not be a bad idea to check out. It will increase the time and memory, but if you double the uv resolution but crop the images back to the normal FoV it should drastically reduce any aliasing.

nicholebarry commented 6 years ago

Again, my units are all over the place. Here are the orthoslant weights. screenshot from 2018-01-12 12 39 13

I hesitate to zoom in the color bar since the units don't make sense....but I can if that's desired.