EoRImaging / eppsilon

eppsilon - error propagated power spectrum with interleaved observed noise
BSD 2-Clause "Simplified" License
5 stars 4 forks source link

Added support for passing in 3D mask or bin arrays to 1D binning code #18

Closed bhazelton closed 6 years ago

bhazelton commented 7 years ago

This is a significant re-write of the 1d binning code to support passing in either a 3d mask (1s and 0s) to dictate which voxels to include or a 3d bin array that tells the code which 1d bin to put each voxel into.

Details: Either the mask array or the bin array is passed in using the bin_arr_3d keyword (it is treated as a mask if there are no values greater than 1, any voxels with zero are excluded from the binning) If nothing is specified, the masking and binning is worked out as before from the other keywords (e.g. kperp_range, wedge_amp, kperp_power, etc) and a 3d bin array is generated as before and passed out via the bin_arr_3d keyword -- it can be passed back in to reproduce the same binning. If a mask array is passed in (no values greater than 1 in bin_arr_3d) then the only additional masking that is applied is the binning required for the density correction (if that is requested) and the binning is worked out as before from other keywords (e.g. kperp_power) and a 3d bin array is generated as before and passed out via the bin_arr_3d keyword -- it can be passed back in to reproduce the same binning.

Note that this allows any crazy masking or binning you want, including @miguelfmorales' 'diagonal binning'

This PR addresses issue #14

nicholebarry commented 7 years ago

Did you want this to be internal only? At the moment, this can only be accessed internally --- I can't pass bin_arr_3d into ps_wrapper.

bhazelton commented 7 years ago

oops, that's a mistake. I'll fix it, thanks!

bhazelton commented 6 years ago

@nicholebarry where are we on this PR? has it been tested? I'd like to merge it so things don't diverge...

nicholebarry commented 6 years ago

It's on the backburner while I frantically try to graduate

bhazelton commented 6 years ago

gotcha. I'll leave you out of it.

bhazelton commented 6 years ago

This has now been verified.