Save detx file.

def write(self, filename):
        """Save detx file."""
        with open(filename, 'w') as f:
            f.write(self.ascii)
        self.print("Detector file saved as '{0}'".format(filename))