Fleshed out T, w, L portions of setupHDR.m