AstroAccelerateOrg / astro-accelerate

AstroAccelerate is a many-core accelerated software package for processing time-domain radio-astronomy data.
https://www.oerc.ox.ac.uk/research-groups/astroaccelerate/
GNU General Public License v3.0
42 stars 16 forks source link

Overcompensating for binning? #209

Open mmalenta opened 5 years ago

mmalenta commented 5 years ago

Issue Summary In the the GPU binning kernel in aa_device_binning_kernel.cu, line 42, the added values are divided by a factor of 2, meaning we get the mean of whatever we have. Later, at the dedispersion stage, in both dedispersion kernels in aa_device_dedispersion_kernel.cu in line 75 in the standard shared kernel for example, the dedispersed value is divided again, this time by the full binning factor. This causes the dedispersed values to decreased by a factor of 2 between ranges with different binning factors, which is most clearly visible in the MSD values:

Range 1, binning of 1: MSD:[127.002228; 0.780149; 26580716.000000] Range 2, binning of 2: MSD:[63.335045; 0.354628; 6323154.000000] Range 3, binning of 4: MSD:[31.626286; 0.098126; 3215454.000000]

This should not have any effect on scientific results, as the data is essentially just scaled differently, but it might become problematic when higher DMs and larger scrunching factors are used due to squashing the data and introducing some precision issues, aspecially in the case of standard deviation.

Steps to Reproduce Any data with multiple ranges and different binning factors per range.

Expected Outcome Mean for each range to be similar, dedispersed values for different ranges to be similar.

Actual Outcome Dedispersed values and means for different ranges decrease by a factor of 2 between ranges.

Configuration

Notes