Skip to content
Closed
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
53 changes: 46 additions & 7 deletions increments.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,18 @@ def venparallax():
Hdeg=10

tab = r'''\noindent
\begin{tabular}[t]{|c|cccccc|}
\multicolumn{7}{c}{\textbf{Parallax of Venus and Mars}}\\
\begin{tabular}[t]{|c|c|cccccc|}
\multicolumn{8}{c}{\textbf{Parallax of the Sun, Venus and Mars}}\\
'''
tab += r"""\hline
$H_{a}$ HP & \textbf{.1'} & \textbf{.2'} & \textbf{.3} & \textbf{.4'} & \textbf{.5'} & \textbf{.6'} \\
$H_{a}$ HP & \textbf{Sun} & \textbf{.1'} & \textbf{.2'} & \textbf{.3} & \textbf{.4'} & \textbf{.5'} & \textbf{.6'} \\
\hline
"""
while Hdeg<90:
hp = 0.1
hpsun = 0.1489
line = r"\textbf{{ {}$^\circ$}} ".format(Hdeg)
line += "& {:.2f} ".format(parallax(hpsun, Hdeg, 0)) # Sun parallax
while hp < 0.7:
line += "& {:.1f} ".format(parallax(hp, Hdeg, 0))
hp += 0.1
Expand All @@ -253,6 +255,39 @@ def venparallax():
"""
return tab

def moonsdaugment(hp, deg, min):
#returns moon SD augmentation in min due to topocentric vs geocentric difference
#using Stark approx. formula
k = 0.2725 #ratio radius moon/earth - by definition SD = k * hp
aug = ((k * hp / (1 - sin(rad(0, hp)) * sin(rad(deg, min)))) - k * hp)
return aug


def moonsdaugmenttab():
hp = 54.0

tab = r'''\noindent
\begin{tabular}[t]{|c|ccccccccc|}
\multicolumn{10}{c}{\textbf{Moon SD augmentation}}\\
'''
tab += r"""\hline
HP $H_{a}$ & \textbf{10$^\circ$} & \textbf{20$^\circ$} & \textbf{30$^\circ$} & \textbf{40$^\circ$} & \textbf{50$^\circ$} & \textbf{60$^\circ$} & \textbf{70$^\circ$} & \textbf{80$^\circ$} & \textbf{90$^\circ$} \\
\hline
"""
while hp <= 61.5:
Hdeg = 10
line = r"\textbf{{ {}}} ".format(hp)
while Hdeg <= 90:
line += "& {:.1f} ".format(moonsdaugment(hp, Hdeg, 0))
Hdeg += 10
line += "\\\ \n"
tab += line
hp += 1.5
tab = tab + r"""\hline
\end{tabular}
"""
return tab


def makelatex():
lx = r"""\documentclass[ 10pt, twoside, a4paper]{scrreprt}
Expand Down Expand Up @@ -286,8 +321,9 @@ def makelatex():
\begin{multicols}{2} \begin{scriptsize}
'''
lx = lx + venparallax()
lx = lx + moonsdaugmenttab()
lx = lx + r'''\end{scriptsize} \newpage
\section*{About these tables}
\small\section*{About these tables}
The preceding static tables are independent from the year. They differ from the tables found in the official paper versions of the Nautical almanac in two important considerations.
\begin{itemize}
\item My tables are not arranged as \textit{critical} tables. So chose the value that fits best to your value and interpolate in the rare cases where this should be necessary.
Expand All @@ -305,9 +341,12 @@ def makelatex():
\[R_0=\cot \left( H_a + \frac{7.31}{H_a+4.4}\right)\]
For other than standard conditions, calculate a correction factor for $R_0$ by: \[f=\frac{0.28P}{T+273}\] where $P$ is the pressure in hectopascal and $T$ is the temperature in $^\circ$C. No table is given for this correction so far.
\subsubsection*{Parallax}
For moon sight (and if necessary for Mars and Venus) a parallax correction is necessary. For Mars and Venus the horizontal parallax ($HP$) is never more than 0.5' and can be omitted if this kind of precision is not necessary. The parallax ($P$) can be calculated from horizontal parallax ($HP$) and apparent altitude $H_a$ with the following formula:
For moon sight (and if necessary for the Sun, Mars and Venus) a parallax correction is necessary. For the Sun, Mars and Venus the horizontal parallax ($HP$) is never more than 0.6' and can be omitted if this kind of precision is not necessary. The parallax ($P$) can be calculated from horizontal parallax ($HP$) and apparent altitude $H_a$ with the following formula:
\[P={HP} \times \cos(H_a)\]
The table for the moon gives the parallax for a horizontal parallax of 54' which is the lowest value for the moon. For all other values, the value in the lower half of the table has to be added. Note that this table is only for parallax and does not correct for refraction and semidiameter. For all moon and sun sights, semidiameter has to be added for lower limb sights and subtracted for upper limb sights. The value for HP and semidiameter is tabulated in the daily pages. The smaller parallax table is for parallax of Venus and Mars.
The table for the moon gives the parallax for a horizontal parallax of 54' which is the lowest value for the moon. For all other values, the value in the lower half of the table has to be added. Note that this table is only for parallax and does not correct for refraction and semidiameter. For all moon and sun sights, semidiameter has to be added for lower limb sights and subtracted for upper limb sights. The value for HP and semidiameter is tabulated in the daily pages. The smaller parallax table is for parallax of the Sun, Venus and Mars.
\subsubsection*{Moon SD augmentation}
Due to its proximity, moon topo- and geocentric SD differ. The Moon SD augmentation table provides a correction to be added to the moon SD before calculating $H_o$. This correction was calculated using Stark approximate formula:
\[SD_{aug}=SD \div (1 - \sin(HP) \cdot \sin(H_a))\]
\subsubsection*{Altitude correction}
To correct your sextant altitude $H_s$ do the following:
Calculate $H_a$ by
Expand All @@ -332,7 +371,7 @@ def makelatex():
if sys.version_info[0] != 3:
raise Exception("This runs with Python 3")

fn = "inc"
fn = "increments_corrections"
filename = fn + ".tex"
outfile = open(filename, mode="w", encoding="utf8")
outfile.write(makelatex())
Expand Down