Skip to content

Commit 3463141

Browse files
authored
DM-7594: Display phase column with 8 decimal places precision. Merge pr #180
DM-7594: Display phase column with 8 decimal places precision
2 parents d6f5c13 + c597def commit 3463141

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/firefly/java/edu/caltech/ipac/firefly/server/query/lc/PhaseFoldedLightCurve.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import edu.caltech.ipac.astro.IpacTableException;
44
import edu.caltech.ipac.astro.IpacTableWriter;
55
import edu.caltech.ipac.firefly.server.util.ipactable.DataGroupReader;
6+
import edu.caltech.ipac.firefly.util.DataSetParser;
67
import edu.caltech.ipac.util.DataGroup;
78
import edu.caltech.ipac.util.DataObject;
89
import edu.caltech.ipac.util.DataType;
@@ -15,6 +16,7 @@
1516
* To convert a Light Curve DataGroup into a phase folded Light Curve DataGroup.
1617
*/
1718
public 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

Comments
 (0)