% file: bp_write_fits.i % % Output the bpl structure to a FITS bin table. % A little tedious since I have bpl as an array % of structures and not a structure of arrays... % define bp_write_fits (filename) { % setup the column arrays... variable columns = struct { id, ignore, lam, grp, desc, % string lfit, lclo, lchi, afit, aclo, achi, wfit, wclo, wchi, cfit, cclo, cchi, chifit, rgfit }; % string % John's clever way to do this: foreach (get_struct_field_names (columns)) { variable f = (); set_struct_field (columns, f, array_struct_field (bpl, f)); } variable keywords = struct {creator}; keywords.creator = "bp_write_fits.i"; % and write it out... fits_write_binary_table(filename, "BUMPS", columns, keywords); }