<p>Let's see if this is what you need:</p>
<p>Starting with</p>
<pre><code>  phi = ((HJD-T0)/P)%1
</code></pre>
<p>rewriting in MathJax:</p>
<p><span class="math-container">$$\phi = \mod((H_{JD} - T_0) \ / P, \ 1)$$</span></p>
<p>We just need to push it by 0.5 so it wraps sooner by <span class="math-container">$\mod()$</span> , then subtract the 0.5 again on the outside to recenter it:</p>
<p><span class="math-container">$$\phi = \mod((H_{JD} - T_0) \ / P + 0.5 , \ 1) - 0.5$$</span></p>

CC BY-SA 4.0
2022-03-23T15:49:45.310Z
I think, you dropped a "  / P " in your formula.
SpaceCore
CC BY-SA 4.0
2022-03-23T17:42:11.060Z
@SpaceCore fixed; thanks!
uhoh
CC BY-SA 4.0
2022-03-21T11:41:12.243Z
2022-03-23T17:42:01.157Z
2022-03-23T17:42:01.157Z
uhoh
<p>Take your final result for the phase and then subtract 1 if it is <span class="math-container">$&gt;0.5$</span>.</p>

CC BY-SA 4.0
2022-03-21T12:51:43.717Z
2022-03-21T12:51:43.717Z
ProfRob
<p>How to get phase-folded data (-0.5,0.5)? For phase-folded value to the interval (0,1), I use:</p>
<p><span class="math-container">$$ \phi = \frac{H_{JD}-T_0}{P} \mod 1$$</span></p>
<p><span class="math-container">$\phi$</span> is phase</p>
<p><em>H</em><sub>JD</sub> is time</p>
<p><em>T</em><sub>0</sub> is the reference time</p>
<p><em>P</em> is the period</p>
<p><em>T</em><sub>0</sub> should correspond to <span class="math-container">$\phi$</span> = 0</p>

<data-analysis>
How to get phase-folded data (-0.5,0.5)?
Carly
# How to get phase-folded data (-0.5,0.5)?

(Asked by: username_0 on 2022-03-21)

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

*H*JD is time

*T*0 is the reference time

*P* is the period

*T*0 should correspond to $\phi$ = 0

**Tags:** data-analysis


---

## 2 answers

### Answer by username_3 on 2022-03-21. Score: 4 | Accepted answer

Take your final result for the phase and then subtract 1 if it is $>0.5$.


---

### Answer by username_1 on 2022-03-21. Score: 4

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$$

> **Comments:**
> **username_2**: I think, you dropped a "  / P " in your formula.  
> **username_1**: @username_2 fixed; thanks!  

---

