Build Thermodynamic Partition Function
z = CalcThermoPartition(cw,mm,q)
z(q,a) = sum_i( |CWT(a,b(i))|^q ), where b = (b(i)) is a list of wavelet transform maxima