moved automatic masking to fit_resonator