log2 of 0 is -Inf; std of array with -Inf throws error. Used masked array to fix