meerklass / museek

A flexible and easy-to-extend data processing pipeline for multi-instrument autocorrelation radio experiments
GNU General Public License v3.0
3 stars 3 forks source link

Offset correction #91

Open mariogrs opened 3 months ago

mariogrs commented 3 months ago

Method to calibrate the offsets (and maybe amplitude) for each block:

  1. Pixelise map.
  2. Calculate final averaged temperature on pixels where all blocks overlap - this could be an issue if the number of points per pixel changes - need check. The idea of the average is to reduce scatter due to noise
  3. Compare averaged temp per pixel to model - correct offset if correlation is good?
  4. Look at scatter plot between each block and the averaged temp (for pixels with complete overlap)
  5. fit a curve to the scatter - get slope and offset
  6. correct block with such slope and offset
  7. re average all the blocks, this time using all pixels

@wkhu-astro

mariogrs commented 3 months ago

Let's please discuss things here @wkhu-astro @spinemart . The idea to use the average maps to calibrate the offset instead of picking a reference map is that the scatter due to noise will be smaller. But I think we need to make sure the average in each pixel is done over the same scans. We don't need pixels with all the scans/blocks. But we need to make sure they all use the same scans for the average.

wkhu-astro commented 2 months ago

I did the offset correction for 2023 data in desi1 :block_name_list = ['1684087370', '1682448988', '1679605292', '1676657789', '1676313206', '1675816512', '1675643846', '1675623808', '1675210948', '1675021905']. Below are some results. This is the overlap region of these blocks, I will use these pixels to calculate the offset. overlap For the frequency, I select the frequency points that are not masked in any blocks, the used frequency is shown below: used_frequency Then, I take the median for these frequencies and then calculate the offset. The weighted average (the weight is the inverse of the rms of the the difference between four neighboring channels (so-called ABBA) ) of maps versus the synch model (both maps and model are at the the median of selected frequencies) : Taver_Tmodel_freqmedian I use the *T_average = A T_pixel + offset** to fit the weighted average versus temperature at pixels, where A is the slope. The weighted average of maps versus the each individual map: T_Tmodel_block1675021905 T_Tmodel_block1675210948 T_Tmodel_block1675623808 T_Tmodel_block1675643846 T_Tmodel_block1675816512 T_Tmodel_block1676313206 T_Tmodel_block1676657789 T_Tmodel_block1679605292 T_Tmodel_block1682448988 T_Tmodel_block1684087370 Apply the offset (& slope) correction to each block and redo the weighted average, below is the comparison between combined maps without and with correction. allantennas_temp_synch_mapmaking_700MHz allantennas_temp_synch_mapmaking_700MHz_offsetc allantennas_temp_synch_mapmaking_900MHz allantennas_temp_synch_mapmaking_900MHz_offsetc

I also fit the offset (& slope ) at each selected frequency point and plot the offset (& slope ) as a function of frequency: slope_offset_vs_freq_block1675021905 slope_offset_vs_freq_block1675210948 slope_offset_vs_freq_block1675623808 slope_offset_vs_freq_block1675643846 slope_offset_vs_freq_block1675816512 slope_offset_vs_freq_block1676313206 slope_offset_vs_freq_block1676657789 slope_offset_vs_freq_block1679605292 slope_offset_vs_freq_block1682448988 slope_offset_vs_freq_block1684087370

mariogrs commented 2 months ago

what is the difference between the red and black lines in the T_aver versus T_pix plots above @wkhu-astro ?

wkhu-astro commented 2 months ago

what is the difference between the red and black lines in the T_aver versus T_pix plots above @wkhu-astro ?

For the T_aver vs. T_model, the red-dashed line refers to f(x) = x. For the T_aver vs. T_pixel, the red-dashed line is the fitting results, the black-dashed line is f(x) = x.

wkhu-astro commented 2 months ago

The index vs. T_pixel for all used blocks:
T_index_allblocks

wkhu-astro commented 1 month ago

I split the data used for offset correction into two sub set (sub1 and sub2): overlap_sub1 overlap_sub2 I run the offset correction for the two sub data, the spectrum after offset correction: combined_spectra_sub1 combined_spectra_sub2

wkhu-astro commented 1 month ago

"check if final pixel versus frequency still shows the "square drops" if you remove the block which was flagged in those regions"

I remove one block and then do the offset correction, the results with all blocks and one block removed:

1680644082

combined_spectra_removeflaggedblock combined_spectra