Xrf fit

Use the same trick as above with `np.clip`, might have to cast index to float for this section.