33import edu .caltech .ipac .astro .IpacTableException ;
44import edu .caltech .ipac .astro .IpacTableWriter ;
55import edu .caltech .ipac .firefly .server .util .ipactable .DataGroupReader ;
6+ import edu .caltech .ipac .firefly .util .DataSetParser ;
67import edu .caltech .ipac .util .DataGroup ;
78import edu .caltech .ipac .util .DataObject ;
89import edu .caltech .ipac .util .DataType ;
1516 * To convert a Light Curve DataGroup into a phase folded Light Curve DataGroup.
1617 */
1718public class PhaseFoldedLightCurve {
19+ private static final String PHASE_COL = "phase" ;
1820
1921 //Empty constructor
2022 public PhaseFoldedLightCurve (){};
@@ -38,13 +40,17 @@ public void addPhaseCol (DataGroup dg, float period, String timeColName)
3840 }
3941
4042 //Add a new data type and colunm: phase
41- DataType phaseType = new DataType ("phase" , "phase" , Double .class , DataType .Importance .HIGH , null , false );
43+ DataType phaseType = new DataType (PHASE_COL , PHASE_COL , Double .class , DataType .Importance .HIGH , null , false );
4244 //DataType phaseType = new DataType("phase", Double.class);
43-
44- // TODO DM-7594 / DM-7595:
45- // phaseType.setFormatInfo... and attribute to appear as description in ipac table header.
46-
4745 dg .addDataDefinition (phaseType );
46+ phaseType .getFormatInfo ().setDataFormat ("%.8f" );
47+ phaseType .getFormatInfo ().setWidth (15 );
48+
49+ // add meta info for the added phase column
50+ String desc = "number of period elapsed since starting time." ;
51+ dg .addAttribute (null , PHASE_COL );
52+ dg .addAttribute (null , "___ " + desc );
53+ dg .addAttribute (DataSetParser .makeAttribKey (DataSetParser .DESC_TAG , PHASE_COL ), desc );
4854
4955 //Find the minimum time:
5056 double tzero = Double .MAX_VALUE ;
0 commit comments