Skip to content

DM-7594: Display phase column with 8 decimal places precision #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import edu.caltech.ipac.astro.IpacTableException;
import edu.caltech.ipac.astro.IpacTableWriter;
import edu.caltech.ipac.firefly.server.util.ipactable.DataGroupReader;
import edu.caltech.ipac.firefly.util.DataSetParser;
import edu.caltech.ipac.util.DataGroup;
import edu.caltech.ipac.util.DataObject;
import edu.caltech.ipac.util.DataType;
Expand All @@ -15,6 +16,7 @@
* To convert a Light Curve DataGroup into a phase folded Light Curve DataGroup.
*/
public class PhaseFoldedLightCurve {
private static final String PHASE_COL = "phase";

//Empty constructor
public PhaseFoldedLightCurve(){};
Expand All @@ -38,13 +40,17 @@ public void addPhaseCol (DataGroup dg, float period, String timeColName)
}

//Add a new data type and colunm: phase
DataType phaseType = new DataType("phase", "phase", Double.class, DataType.Importance.HIGH, null, false);
DataType phaseType = new DataType(PHASE_COL, PHASE_COL, Double.class, DataType.Importance.HIGH, null, false);
//DataType phaseType = new DataType("phase", Double.class);

// TODO DM-7594 / DM-7595:
// phaseType.setFormatInfo... and attribute to appear as description in ipac table header.

dg.addDataDefinition(phaseType);
phaseType.getFormatInfo().setDataFormat("%.8f");
phaseType.getFormatInfo().setWidth(15);

// add meta info for the added phase column
String desc = "number of period elapsed since starting time.";
dg.addAttribute(null, PHASE_COL);
dg.addAttribute(null, "___ " + desc);
dg.addAttribute(DataSetParser.makeAttribKey(DataSetParser.DESC_TAG, PHASE_COL), desc);

//Find the minimum time:
double tzero = Double.MAX_VALUE;
Expand Down