Improvements to mask interpolation
Add tests for prepare_data