Were the bvals in a numpy array? If they are, then surely `bval*D1` (where D1 is a scalar) should give you back an array as well.