1. A method of calibrating a device, comprising:generating x-rays from an x-ray generator within a housing;
receiving a return signal emitted by a material struck by the x-rays in a sensor, the material being of a shutter within the housing;
providing data generated by the sensor to electronics connected to the x-ray generator and the sensor;
processing the data in the electronics;
wherein the electronics comprise at least one processor, and the data from the sensor comprises wavelengths of a set of peak magnitudes of a return spectrum, and the at least one processor compares the wavelengths of the set of peak magnitudes of the return spectrum with a set of expected wavelengths of peak magnitudes of a return spectrum, and updates parameters relating to the operation of the x-ray generator and sensor based on the analysis of the comparison of the wavelengths of the set of peak magnitudes of the return spectrum with the set of expected wavelengths of peak magnitudes of the return spectrum, the updated parameters including parameters relating to a length of time of generation of x-rays by the device.