def main(options, data_groups):
    output_preamble_to_log(data_groups)
    processed_files_info = process_data_groups(
        data_groups, options.topdir, options.ami_dir, array="LA", script=options.script
    )

    with open(options.outfile, "w") as f:
        driveami.save_calfile_listing(processed_files_info, f)
    sys.exit(0)
 def test_expected_raw(self):
     s = StringIO()
     driveami.save_calfile_listing(self.testdata, s)
     with self.assertRaises(ValueError):
         listing, datatype = driveami.load_listing(StringIO(s.getvalue()),
                           expected_datatype=driveami.Datatype.ami_la_raw)
 def test_calfiles_roundtrip(self):
     s = StringIO()
     driveami.save_calfile_listing(self.testdata, s)
     listing, datatype = driveami.load_listing(StringIO(s.getvalue()))
     self.assertEqual(datatype, driveami.Datatype.ami_la_calibrated)
     self.assertEqual(listing, self.testdata)