I've been running into this problem with people's files, where they estimated power in 0.001 bins, and I want to go to 0.005, but there are like 402 bins, so rebin(5) crashes saying the number of bins isn't evenly divisible. I know, I can carefully figure out how to "select" to a divisible number of bins before calling, but that is a nuisance. My ideal solution would be a function rebin_to_dk(0.005) which went along, dropped existing bins into the appropriate new bins based on kavg, defining new kedges, where any mismatch would be simply resolved by not requiring the new kedges to have exactly dk... they just would be if it was possible given the old and new (i.e., no smearing - every old bin goes to exactly one new bin)(another version of this is to let me put in my own new nominal kedges, where similarly the kedges that come out would not necessarily be exactly those)
I've been running into this problem with people's files, where they estimated power in 0.001 bins, and I want to go to 0.005, but there are like 402 bins, so rebin(5) crashes saying the number of bins isn't evenly divisible. I know, I can carefully figure out how to "select" to a divisible number of bins before calling, but that is a nuisance. My ideal solution would be a function rebin_to_dk(0.005) which went along, dropped existing bins into the appropriate new bins based on kavg, defining new kedges, where any mismatch would be simply resolved by not requiring the new kedges to have exactly dk... they just would be if it was possible given the old and new (i.e., no smearing - every old bin goes to exactly one new bin)(another version of this is to let me put in my own new nominal kedges, where similarly the kedges that come out would not necessarily be exactly those)