<p>The blue <code>fraction</code> function reaches its maximum at full moon time, 12. März in your diagram.</p>

<p>At that time, the fractional part of the red <code>phase</code>, i.e., <code>moon$phase - floor(moon$phase)</code> reaches 0.5, because a full Moon occurs at half time.</p>

<p>I see no "out of sync" here.</p>

CC BY-SA 3.0
2017-10-03T16:06:26.227Z
Perhaps they just decided to indicate the start of a new moon at the start of the interval when it is oceanographically significant, rather than following the astronomical concept of minimal illumination, which would be in the middle of the oceanographically significant interval of new moon.
antlersoft
CC BY-SA 3.0
2017-05-06T08:34:41.667Z
2017-05-06T08:34:41.667Z
laune
<p>This is a partial answer since your question is still unclear.  I would recommmend finding an astronomy package for tools like this rather than using what's basically a "bonus feature" from an oceanographic package. </p>

<p>From the help pages for package <code>oce</code>,</p>

<blockquote>
  <p><strong>illuminatedFraction</strong><br>
   fraction of moon’s visible disk that is
   illuminated<br>
  <strong>phase</strong><br>
   phase of the moon, defined in equation 32.3 of Meeus
   [1982]. The fractional part of which is 0 for new moon, 1/4 for first
   quarter, 1/2 for full moon, and 3/4 for last quarter.</p>
</blockquote>

<p>Perhaps you are missing the fact that marginally more than 50% of the moon is illuminated, and thus at first/last quarter marginally more than 50% of the visible disk is illuminated?  I would also recommend looking up the referenced "equation 32.3" to see what the definition is and how it applies to a zero-altitude viewer.</p>

CC BY-SA 3.0
2017-03-06T18:47:32.910Z
I was actually wondering why oce comes with `moonAngle`.
René Nyffenegger
CC BY-SA 3.0
2017-03-06T16:00:31.750Z
2017-03-06T16:14:10.937Z
2017-03-06T16:14:10.937Z
Carl Witthoft
<p>I am using the following R script to plot the moon phase and the moon's illuminated fraction:</p>

<pre><code>library(oce)

X11()

t_start &lt;- as.POSIXct("2017-02-23", tz='UTC')
t_end   &lt;- t_start + 75 * 24 * 3600  # 35 days

tm &lt;- seq(from = t_start,
           to  = t_end,
           by  = 10000
        )

moon     &lt;- moonAngle(t=tm, longitude=-8, latitude=47)
fraction &lt;- moon$illuminatedFraction
phase    &lt;- moon$phase - floor(moon$phase)

plot (tm, fraction, type="l", col='blue')
lines(tm, phase   , type="l", col='red' )

grid()

# wait for mouse click or enter pressed
locator(1)
</code></pre>

<p>This is plotted:
<a href="https://i.sstatic.net/WezOk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WezOk.png" alt="enter image description here"></a></p>

<p>The red lines indicate the phase (0 = new moon, 1/4 = first quarter, 1/2 = full moon etc.), the blue curve indicates the how much of the moon is illuminated.</p>

<p>I have expected the illuminated fraction to be zero exactly then when also the phase is zero. However, this is not the case.</p>

<p>So, is there something I am missing, am I doing something wrong in my script or is the implementation of <code>oce</code> inaccurate?</p>

CC BY-SA 3.0
2017-03-06T13:20:37.090Z
First of all, you should provide the `R` package you are using.  Second, you might check all the documentation provided in that package to see if there's any discussion of known inaccuracies.  Third, can you explain why you're using `floor` rather than `min` ?
Carl Witthoft
CC BY-SA 3.0
2017-03-06T14:28:23.507Z
The library I am using is *oce* and I cannot explain why I am using `floor` rather than `min`.
René Nyffenegger
<the-moon><software>
Why is the moon phase not in sync with the moon's illuminated fraction?
René Nyffenegger
# Why is the moon phase not in sync with the moon's illuminated fraction?

(Asked by: username_0 on 2017-03-06)

I am using the following R script to plot the moon phase and the moon's illuminated fraction:
library(oce)

X11()

t_start <- as.POSIXct("2017-02-23", tz='UTC')
t_end   <- t_start + 75 * 24 * 3600  # 35 days

tm <- seq(from = t_start,
           to  = t_end,
           by  = 10000
        )

moon     <- moonAngle(t=tm, longitude=-8, latitude=47)
fraction <- moon$illuminatedFraction
phase    <- moon$phase - floor(moon$phase)

plot (tm, fraction, type="l", col='blue')
lines(tm, phase   , type="l", col='red' )

grid()

# wait for mouse click or enter pressed
locator(1)

This is plotted:

The red lines indicate the phase (0 = new moon, 1/4 = first quarter, 1/2 = full moon etc.), the blue curve indicates the how much of the moon is illuminated.
I have expected the illuminated fraction to be zero exactly then when also the phase is zero. However, this is not the case.
So, is there something I am missing, am I doing something wrong in my script or is the implementation of oce inaccurate?

**Tags:** the-moon, software
> **Comments:**
> **username_1**: First of all, you should provide the `R` package you are using.  Second, you might check all the documentation provided in that package to see if there's any discussion of known inaccuracies.  Third, can you explain why you're using `floor` rather than `min` ?  
> **username_0**: The library I am using is *oce* and I cannot explain why I am using `floor` rather than `min`.  

---

## 2 answers

### Answer by username_2 on 2017-05-06. Score: 1

The blue `fraction` function reaches its maximum at full moon time, 12. März in your diagram.

At that time, the fractional part of the red `phase`, i.e., `moon$phase - floor(moon$phase)` reaches 0.5, because a full Moon occurs at half time.

I see no "out of sync" here.

> **Comments:**
> **username_3**: Perhaps they just decided to indicate the start of a new moon at the start of the interval when it is oceanographically significant, rather than following the astronomical concept of minimal illumination, which would be in the middle of the oceanographically significant interval of new moon.  

---

### Answer by username_1 on 2017-03-06. Score: 1

This is a partial answer since your question is still unclear. I would recommmend finding an astronomy package for tools like this rather than using what's basically a "bonus feature" from an oceanographic package.

From the help pages for package `oce`,

> **illuminatedFraction**  
> fraction of moon’s visible disk that is
> illuminated  
> **phase**  
> phase of the moon, defined in equation 32.3 of Meeus
> [1982]. The fractional part of which is 0 for new moon, 1/4 for first
> quarter, 1/2 for full moon, and 3/4 for last quarter.

Perhaps you are missing the fact that marginally more than 50% of the moon is illuminated, and thus at first/last quarter marginally more than 50% of the visible disk is illuminated? I would also recommend looking up the referenced "equation 32.3" to see what the definition is and how it applies to a zero-altitude viewer.

> **Comments:**
> **username_0**: I was actually wondering why oce comes with `moonAngle`.  

---

