3
3
import edu .caltech .ipac .astro .IpacTableException ;
4
4
import edu .caltech .ipac .astro .IpacTableWriter ;
5
5
import edu .caltech .ipac .firefly .server .util .ipactable .DataGroupReader ;
6
+ import edu .caltech .ipac .firefly .util .DataSetParser ;
6
7
import edu .caltech .ipac .util .DataGroup ;
7
8
import edu .caltech .ipac .util .DataObject ;
8
9
import edu .caltech .ipac .util .DataType ;
15
16
* To convert a Light Curve DataGroup into a phase folded Light Curve DataGroup.
16
17
*/
17
18
public class PhaseFoldedLightCurve {
19
+ private static final String PHASE_COL = "phase" ;
18
20
19
21
//Empty constructor
20
22
public PhaseFoldedLightCurve (){};
@@ -38,13 +40,17 @@ public void addPhaseCol (DataGroup dg, float period, String timeColName)
38
40
}
39
41
40
42
//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 );
42
44
//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
-
47
45
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 );
48
54
49
55
//Find the minimum time:
50
56
double tzero = Double .MAX_VALUE ;
0 commit comments