How to get phase-folded data (-0.5,0.5)? For phase-folded value to the interval (0,1), I use:
$$ \phi = \frac{H_{JD}-T_0}{P} \mod 1$$
$\phi$ is phase
HJD is time
T0 is the reference time
P is the period
T0 should correspond to $\phi$ = 0
Astronomy Stack Exchange is a question and answer site for astronomers and astrophysicists. It only takes a minute to sign up.
Sign up to join this communityTake your final result for the phase and then subtract 1 if it is $>0.5$.
Let's see if this is what you need:
Starting with
phi = ((HJD-T0)/P)%1
rewriting in MathJax:
$$\phi = \mod((H_{JD} - T_0) \ / P, \ 1)$$
We just need to push it by 0.5 so it wraps sooner by $\mod()$ , then subtract the 0.5 again on the outside to recenter it:
$$\phi = \mod((H_{JD} - T_0) \ / P + 0.5 , \ 1) - 0.5$$