modiey for phantoms and function to resample. Also segment the data for the PD fit