Skip to content

Commit

Permalink
Merge pull request #357 from Caltech-IPAC/DM-10149-PeriodogramIssues
Browse files Browse the repository at this point in the history
DM-10149 fix the phase value range of phase folded chart
  • Loading branch information
cwang2016 committed Apr 20, 2017
2 parents 2fba617 + e5387a7 commit 7bedf61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/firefly/html/firefly.html
Expand Up @@ -21,7 +21,7 @@
options : {
MenuItemKeys: {maskOverlay:true},
catalogSpacialOp: 'polygonWhenPlotExist',
charts: {chartEngine: ''}
charts: {chartEngine: 'plotly'}
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/firefly/js/templates/lightcurve/LcPeriodPlotly.jsx
Expand Up @@ -340,8 +340,8 @@ class PhaseFoldingChart extends Component {
//color: 'blue',
color: 'rgba(63, 127, 191, 0.5)'
},
x: data.map((d) => d[0]),
y: data.map((d) => d[1]),
x: data&&data.map((d) => d[0]),
y: data&&data.map((d) => d[1]),
hoverinfo: 'text'
}],
plotlyLayout: {
Expand Down
2 changes: 1 addition & 1 deletion src/firefly/js/templates/lightcurve/LcPhaseTable.js
Expand Up @@ -75,7 +75,7 @@ export function doPFCalculate(flux, time, period, tzero) {
*/
export function getPhase(time, timeZero, period, dec=DEC_PHASE) {
var q = (time - timeZero)/period;
var p = q >= 0 ? (q - Math.floor(q)) : (q + Math.floor(-q));
var p = q >= 0 ? (q - Math.floor(q)) : (q + Math.floor(-q) + 1.0);

return p.toFixed(dec);
}
Expand Down

0 comments on commit 7bedf61

Please sign in to comment.