From a8b29b4509754dfe6ab7619d3eafc552f2a76ed1 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Mon, 25 May 2020 21:07:36 -0400 Subject: [PATCH] Renamed lunar eclipse info member from 'center' to 'peak'. This makes the name consistent with the solar eclipse fields. --- demo/csharp/lunar_eclipse/lunar_eclipse.cs | 14 +++++++------- demo/nodejs/lunar_eclipse.js | 14 +++++++------- demo/python/lunar_eclipse.py | 14 +++++++------- generate/dotnet/csharp_test/csharp_test.cs | 12 ++++++------ generate/lunar_eclipse_test.js | 12 ++++++------ generate/template/astronomy.cs | 10 +++++----- generate/template/astronomy.js | 10 +++++----- generate/template/astronomy.py | 14 +++++++------- generate/test.py | 12 ++++++++---- source/csharp/README.md | 6 +++--- source/csharp/astronomy.cs | 10 +++++----- source/js/README.md | 6 +++--- source/js/astronomy.js | 10 +++++----- source/js/astronomy.min.js | 2 +- source/python/README.md | 10 +++++----- source/python/astronomy.py | 14 +++++++------- 16 files changed, 87 insertions(+), 83 deletions(-) diff --git a/demo/csharp/lunar_eclipse/lunar_eclipse.cs b/demo/csharp/lunar_eclipse/lunar_eclipse.cs index f7996f49..586d36fc 100644 --- a/demo/csharp/lunar_eclipse/lunar_eclipse.cs +++ b/demo/csharp/lunar_eclipse/lunar_eclipse.cs @@ -34,7 +34,7 @@ namespace lunar_eclipse if (++count == 10) break; } - eclipse = Astronomy.NextLunarEclipse(eclipse.center); + eclipse = Astronomy.NextLunarEclipse(eclipse.peak); } return 0; @@ -43,29 +43,29 @@ namespace lunar_eclipse static void PrintEclipse(LunarEclipseInfo eclipse) { // Calculate beginning/ending of different phases - // of an eclipse by subtracting/adding the center time + // of an eclipse by subtracting/adding the peak time // with the number of minutes indicated by the "semi-duration" // fields sd_partial and sd_total. const double MINUTES_PER_DAY = 24 * 60; - AstroTime p1 = eclipse.center.AddDays(-eclipse.sd_partial / MINUTES_PER_DAY); + AstroTime p1 = eclipse.peak.AddDays(-eclipse.sd_partial / MINUTES_PER_DAY); Console.WriteLine("{0} Partial eclipse begins.", p1); if (eclipse.sd_total > 0.0) { - AstroTime t1 = eclipse.center.AddDays(-eclipse.sd_total / MINUTES_PER_DAY); + AstroTime t1 = eclipse.peak.AddDays(-eclipse.sd_total / MINUTES_PER_DAY); Console.WriteLine("{0} Total eclipse begins.", t1); } - Console.WriteLine("{0} Peak of {1} eclipse.", eclipse.center, eclipse.kind.ToString().ToLowerInvariant()); + Console.WriteLine("{0} Peak of {1} eclipse.", eclipse.peak, eclipse.kind.ToString().ToLowerInvariant()); if (eclipse.sd_total > 0.0) { - AstroTime t2 = eclipse.center.AddDays(+eclipse.sd_total / MINUTES_PER_DAY); + AstroTime t2 = eclipse.peak.AddDays(+eclipse.sd_total / MINUTES_PER_DAY); Console.WriteLine("{0} Total eclipse ends.", t2); } - AstroTime p2 = eclipse.center.AddDays(+eclipse.sd_partial / MINUTES_PER_DAY); + AstroTime p2 = eclipse.peak.AddDays(+eclipse.sd_partial / MINUTES_PER_DAY); Console.WriteLine("{0} Partial eclipse ends.", p2); Console.WriteLine(); } diff --git a/demo/nodejs/lunar_eclipse.js b/demo/nodejs/lunar_eclipse.js index 0cae3de4..887b55e8 100644 --- a/demo/nodejs/lunar_eclipse.js +++ b/demo/nodejs/lunar_eclipse.js @@ -35,27 +35,27 @@ function FormatDate(t) { function PrintEclipse(e) { // Calculate beginning/ending of different phases - // of an eclipse by subtracting/adding the center time + // of an eclipse by subtracting/adding the peak time // with the number of minutes indicated by the "semi-duration" // fields sd_partial and sd_total. const MINUTES_PER_DAY = 24 * 60; - const p1 = e.center.AddDays(-e.sd_partial / MINUTES_PER_DAY); + const p1 = e.peak.AddDays(-e.sd_partial / MINUTES_PER_DAY); console.log(`${FormatDate(p1)} - Partial eclipse begins.`); if (e.sd_total > 0) { - const t1 = e.center.AddDays(-e.sd_total / MINUTES_PER_DAY); + const t1 = e.peak.AddDays(-e.sd_total / MINUTES_PER_DAY); console.log(`${FormatDate(t1)} - Total eclipse begins.`); } - console.log(`${FormatDate(e.center)} - Peak of ${e.kind} eclipse.`); + console.log(`${FormatDate(e.peak)} - Peak of ${e.kind} eclipse.`); if (e.sd_total > 0) { - const t2 = e.center.AddDays(+e.sd_total / MINUTES_PER_DAY); + const t2 = e.peak.AddDays(+e.sd_total / MINUTES_PER_DAY); console.log(`${FormatDate(t2)} - Total eclipse ends.`); } - const p2 = e.center.AddDays(+e.sd_partial / MINUTES_PER_DAY); + const p2 = e.peak.AddDays(+e.sd_partial / MINUTES_PER_DAY); console.log(`${FormatDate(p2)} - Partial eclipse ends.`); console.log(''); } @@ -71,7 +71,7 @@ function Demo() { break; } } - eclipse = Astronomy.NextLunarEclipse(eclipse.center); + eclipse = Astronomy.NextLunarEclipse(eclipse.peak); } } diff --git a/demo/python/lunar_eclipse.py b/demo/python/lunar_eclipse.py index 79f5b094..cbf46ba3 100755 --- a/demo/python/lunar_eclipse.py +++ b/demo/python/lunar_eclipse.py @@ -17,20 +17,20 @@ from astronomy import Time, SearchLunarEclipse, NextLunarEclipse, EclipseKind def PrintEclipse(e): # Calculate beginning/ending of different phases - # of an eclipse by subtracting/adding the center time + # of an eclipse by subtracting/adding the peak time # with the number of minutes indicated by the "semi-duration" # fields sd_partial and sd_total. MINUTES_PER_DAY = 24 * 60 - p1 = e.center.AddDays(-e.sd_partial / MINUTES_PER_DAY) + p1 = e.peak.AddDays(-e.sd_partial / MINUTES_PER_DAY) print('{} Partial eclipse begins.'.format(p1)) if e.sd_total > 0.0: - t1 = e.center.AddDays(-e.sd_total / MINUTES_PER_DAY) + t1 = e.peak.AddDays(-e.sd_total / MINUTES_PER_DAY) print('{} Total eclipse begins.'.format(t1)) - print('{} Peak of {} eclipse.'.format(e.center, e.kind.name.lower())) + print('{} Peak of {} eclipse.'.format(e.peak, e.kind.name.lower())) if e.sd_total > 0.0: - t2 = e.center.AddDays(+e.sd_total / MINUTES_PER_DAY) + t2 = e.peak.AddDays(+e.sd_total / MINUTES_PER_DAY) print('{} Total eclipse ends.'.format(t2)) - p2 = e.center.AddDays(+e.sd_partial / MINUTES_PER_DAY) + p2 = e.peak.AddDays(+e.sd_partial / MINUTES_PER_DAY) print('{} Partial eclipse ends.'.format(p2)) print() @@ -50,7 +50,7 @@ def main(args): if e.kind != EclipseKind.Penumbral: count += 1 PrintEclipse(e) - e = NextLunarEclipse(e.center) + e = NextLunarEclipse(e.peak) if __name__ == '__main__': diff --git a/generate/dotnet/csharp_test/csharp_test.cs b/generate/dotnet/csharp_test/csharp_test.cs index 1dca21e4..c36c04a1 100644 --- a/generate/dotnet/csharp_test/csharp_test.cs +++ b/generate/dotnet/csharp_test/csharp_test.cs @@ -1647,8 +1647,8 @@ namespace csharp_test return 1; } - // Check eclipse center. - double diff_days = eclipse.center.ut - peak_time.ut; + // Check eclipse peak time. + double diff_days = eclipse.peak.ut - peak_time.ut; // Tolerate missing penumbral eclipses - skip to next input line without calculating next eclipse. if (partial_minutes == 0.0 && diff_days > 20.0) @@ -1670,9 +1670,9 @@ namespace csharp_test if (diff_minutes > diff_limit) { - Console.WriteLine("C# LunarEclipseTest expected center: {0}", peak_time); - Console.WriteLine("C# LunarEclipseTest found center: {1}", eclipse.center); - Console.WriteLine("C# LunarEclipseTest({0} line {1}): EXCESSIVE center time error = {2} minutes ({3} days).", filename, lnum, diff_minutes, diff_days); + Console.WriteLine("C# LunarEclipseTest expected peak: {0}", peak_time); + Console.WriteLine("C# LunarEclipseTest found peak: {1}", eclipse.peak); + Console.WriteLine("C# LunarEclipseTest({0} line {1}): EXCESSIVE peak time error = {2} minutes ({3} days).", filename, lnum, diff_minutes, diff_days); return 1; } @@ -1711,7 +1711,7 @@ namespace csharp_test /* calculate for next iteration */ - eclipse = Astronomy.NextLunarEclipse(eclipse.center); + eclipse = Astronomy.NextLunarEclipse(eclipse.peak); } Console.WriteLine("C# LunarEclipseTest: PASS (verified {0}, skipped {1}, max_diff_minutes = {2}, avg_diff_minutes = {3}, moon calcs = {4})", lnum, skip_count, max_diff_minutes, (sum_diff_minutes / diff_count), Astronomy.CalcMoonCount); } diff --git a/generate/lunar_eclipse_test.js b/generate/lunar_eclipse_test.js index 281c3ce7..84bcc7d0 100644 --- a/generate/lunar_eclipse_test.js +++ b/generate/lunar_eclipse_test.js @@ -54,8 +54,8 @@ function TestLunarEclipse() { return 1; } - // Check eclipse center. - let diff_days = eclipse.center.ut - peak_time.ut; + // Check eclipse peak. + let diff_days = eclipse.peak.ut - peak_time.ut; // Tolerate missing penumbral eclipses - skip to next input line without calculating next eclipse. if (partial_minutes == 0.0 && diff_days > 20.0) { @@ -68,9 +68,9 @@ function TestLunarEclipse() { ++diff_count; if (diff_minutes > diff_limit) { - console.error(`JS LunarEclipseTest expected center: ${peak_time}`); - console.error(`JS LunarEclipseTest found center: ${eclipse.center}`); - console.error(`JS LunarEclipseTest(${filename} line ${lnum}): EXCESSIVE center time error = ${diff_minutes} minutes (${diff_days} days).`); + console.error(`JS LunarEclipseTest expected peak: ${peak_time}`); + console.error(`JS LunarEclipseTest found peak: ${eclipse.peak}`); + console.error(`JS LunarEclipseTest(${filename} line ${lnum}): EXCESSIVE peak time error = ${diff_minutes} minutes (${diff_days} days).`); return 1; } @@ -107,7 +107,7 @@ function TestLunarEclipse() { /* calculate for next iteration */ - eclipse = Astronomy.NextLunarEclipse(eclipse.center); + eclipse = Astronomy.NextLunarEclipse(eclipse.peak); } console.log(`JS LunarEclipseTest: PASS (verified ${lnum}, skipped ${skip_count}, max_diff_minutes = ${max_diff_minutes}, avg_diff_minutes = ${sum_diff_minutes / diff_count}, moon calcs = ${Astronomy.CalcMoonCount})`); return 0; diff --git a/generate/template/astronomy.cs b/generate/template/astronomy.cs index d0728986..62cb650d 100644 --- a/generate/template/astronomy.cs +++ b/generate/template/astronomy.cs @@ -867,12 +867,12 @@ namespace CosineKitty /// The `kind` field thus holds `EclipseKind.Penumbral`, `EclipseKind.Partial`, /// or `EclipseKind.Total`, depending on the kind of lunar eclipse found. /// - /// Field `center` holds the date and time of the center of the eclipse, when it is at its peak. + /// Field `peak` holds the date and time of the center of the eclipse, when it is at its peak. /// /// Fields `sd_penum`, `sd_partial`, and `sd_total` hold the semi-duration of each phase /// of the eclipse, which is half of the amount of time the eclipse spends in each /// phase (expressed in minutes), or 0 if the eclipse never reaches that phase. - /// By converting from minutes to days, and subtracting/adding with `center`, the caller + /// By converting from minutes to days, and subtracting/adding with `peak`, the caller /// may determine the date and time of the beginning/end of each eclipse phase. /// public struct LunarEclipseInfo @@ -881,7 +881,7 @@ namespace CosineKitty public EclipseKind kind; /// The time of the eclipse at its peak. - public AstroTime center; + public AstroTime peak; /// The semi-duration of the penumbral phase in minutes. public double sd_penum; @@ -892,10 +892,10 @@ namespace CosineKitty /// The semi-duration of the total phase in minutes, or 0.0 if none. public double sd_total; - internal LunarEclipseInfo(EclipseKind kind, AstroTime center, double sd_penum, double sd_partial, double sd_total) + internal LunarEclipseInfo(EclipseKind kind, AstroTime peak, double sd_penum, double sd_partial, double sd_total) { this.kind = kind; - this.center = center; + this.peak = peak; this.sd_penum = sd_penum; this.sd_partial = sd_partial; this.sd_total = sd_total; diff --git a/generate/template/astronomy.js b/generate/template/astronomy.js index 3a78688e..83ab518b 100644 --- a/generate/template/astronomy.js +++ b/generate/template/astronomy.js @@ -4236,12 +4236,12 @@ Astronomy.Constellation = function(ra, dec) { * The `kind` field thus holds one of the strings `"penumbral"`, `"partial"`, * or `"total"`, depending on the kind of lunar eclipse found. * - * Field `center` holds the date and time of the center of the eclipse, when it is at its peak. + * Field `peak` holds the date and time of the peak of the eclipse, when it is at its peak. * * Fields `sd_penum`, `sd_partial`, and `sd_total` hold the semi-duration of each phase * of the eclipse, which is half of the amount of time the eclipse spends in each * phase (expressed in minutes), or 0 if the eclipse never reaches that phase. - * By converting from minutes to days, and subtracting/adding with `center`, the caller + * By converting from minutes to days, and subtracting/adding with `peak`, the caller * may determine the date and time of the beginning/end of each eclipse phase. * * @class @@ -4250,7 +4250,7 @@ Astronomy.Constellation = function(ra, dec) { * @property {string} kind * The type of lunar eclipse found. * - * @property {Astronomy.AstroTime} center + * @property {Astronomy.AstroTime} peak * The time of the eclipse at its peak. * * @property {number} sd_penum @@ -4264,9 +4264,9 @@ Astronomy.Constellation = function(ra, dec) { * */ class LunarEclipseInfo { - constructor(kind, center, sd_penum, sd_partial, sd_total) { + constructor(kind, peak, sd_penum, sd_partial, sd_total) { this.kind = kind; - this.center = center; + this.peak = peak; this.sd_penum = sd_penum; this.sd_partial = sd_partial; this.sd_total = sd_total; diff --git a/generate/template/astronomy.py b/generate/template/astronomy.py index 136af4fe..72361cd3 100644 --- a/generate/template/astronomy.py +++ b/generate/template/astronomy.py @@ -4189,19 +4189,19 @@ class LunarEclipseInfo: The `kind` field thus holds one of the values `EclipseKind.Penumbral`, `EclipseKind.Partial`, or `EclipseKind.Total`, depending on the kind of lunar eclipse found. - Field `center` holds the date and time of the center of the eclipse, when it is at its peak. + Field `peak` holds the date and time of the peak of the eclipse, when it is at its peak. Fields `sd_penum`, `sd_partial`, and `sd_total` hold the semi-duration of each phase of the eclipse, which is half of the amount of time the eclipse spends in each phase (expressed in minutes), or 0 if the eclipse never reaches that phase. - By converting from minutes to days, and subtracting/adding with `center`, the caller + By converting from minutes to days, and subtracting/adding with `peak`, the caller may determine the date and time of the beginning/end of each eclipse phase. Attributes ---------- kind : string The type of lunar eclipse found. - center : Time + peak : Time The time of the eclipse at its peak. sd_penum : float The semi-duration of the penumbral phase in minutes. @@ -4210,9 +4210,9 @@ class LunarEclipseInfo: sd_total : float The semi-duration of the penumbral phase in minutes, or 0.0 if none. """ - def __init__(self, kind, center, sd_penum, sd_partial, sd_total): + def __init__(self, kind, peak, sd_penum, sd_partial, sd_total): self.kind = kind - self.center = center + self.peak = peak self.sd_penum = sd_penum self.sd_partial = sd_partial self.sd_total = sd_total @@ -4238,7 +4238,7 @@ def SearchLunarEclipse(startTime): See #LunarEclipseInfo for more information. To find a series of lunar eclipses, call this function once, then keep calling #NextLunarEclipse as many times as desired, - passing in the `center` value returned from the previous call. + passing in the `peak` value returned from the previous call. Parameters ---------- @@ -4296,7 +4296,7 @@ def NextLunarEclipse(prevEclipseTime): After using #SearchLunarEclipse to find the first lunar eclipse in a series, you can call this function to find the next consecutive lunar eclipse. - Pass in the `center` value from the #LunarEclipseInfo returned by the + Pass in the `peak` value from the #LunarEclipseInfo returned by the previous call to `SearchLunarEclipse` or `NextLunarEclipse` to find the next lunar eclipse. diff --git a/generate/test.py b/generate/test.py index 3e94a8d6..9c47997c 100755 --- a/generate/test.py +++ b/generate/test.py @@ -1167,11 +1167,15 @@ def Test_LunarEclipse(): elif eclipse.kind == astronomy.EclipseKind.Total: valid = (eclipse.sd_penum > 0.0) and (eclipse.sd_partial > 0.0) and (eclipse.sd_total > 0.0) else: + print('PY Test_LunarEclipse({} line {}): invalid eclipse kind {}.'.format(filename, lnum, eclipse.kind)) + return 1 + + if not valid: print('PY Test_LunarEclipse({} line {}): invalid semidurations.'.format(filename, lnum)) return 1 - # Check eclipse center. - diff_days = eclipse.center.ut - peak_time.ut + # Check eclipse peak time. + diff_days = eclipse.peak.ut - peak_time.ut # Tolerate missing penumbral eclipses - skip to next input line without calculating next eclipse. if partial_minutes == 0.0 and diff_days > 20.0: @@ -1184,7 +1188,7 @@ def Test_LunarEclipse(): if diff_minutes > diff_limit: print("PY Test_LunarEclipse expected center: {}".format(peak_time)) - print("PY Test_LunarEclipse found center: {}".format(eclipse.center)) + print("PY Test_LunarEclipse found center: {}".format(eclipse.peak)) print("PY Test_LunarEclipse({} line {}): EXCESSIVE center time error = {} minutes ({} days).".format(filename, lnum, diff_minutes, diff_days)) return 1 @@ -1219,7 +1223,7 @@ def Test_LunarEclipse(): # calculate for next iteration - eclipse = astronomy.NextLunarEclipse(eclipse.center) + eclipse = astronomy.NextLunarEclipse(eclipse.peak) print("PY Test_LunarEclipse: PASS (verified {}, skipped {}, max_diff_minutes = {}, avg_diff_minutes = {}, moon calcs = {})".format(lnum, skip_count, max_diff_minutes, (sum_diff_minutes / diff_count), astronomy._CalcMoonCount)) return 0 diff --git a/source/csharp/README.md b/source/csharp/README.md index c140a781..a8ebab4e 100644 --- a/source/csharp/README.md +++ b/source/csharp/README.md @@ -1669,18 +1669,18 @@ Total eclipses occur when the entire Moon passes into the Earth's umbra. The `kind` field thus holds `EclipseKind.Penumbral`, `EclipseKind.Partial`, or `EclipseKind.Total`, depending on the kind of lunar eclipse found. -Field `center` holds the date and time of the center of the eclipse, when it is at its peak. +Field `peak` holds the date and time of the center of the eclipse, when it is at its peak. Fields `sd_penum`, `sd_partial`, and `sd_total` hold the semi-duration of each phase of the eclipse, which is half of the amount of time the eclipse spends in each phase (expressed in minutes), or 0 if the eclipse never reaches that phase. -By converting from minutes to days, and subtracting/adding with `center`, the caller +By converting from minutes to days, and subtracting/adding with `peak`, the caller may determine the date and time of the beginning/end of each eclipse phase. | Type | Name | Description | | --- | --- | --- | | [`EclipseKind`](#EclipseKind) | `kind` | The type of lunar eclipse found. | -| [`AstroTime`](#AstroTime) | `center` | The time of the eclipse at its peak. | +| [`AstroTime`](#AstroTime) | `peak` | The time of the eclipse at its peak. | | `double` | `sd_penum` | The semi-duration of the penumbral phase in minutes. | | `double` | `sd_partial` | The semi-duration of the partial phase in minutes, or 0.0 if none. | | `double` | `sd_total` | The semi-duration of the total phase in minutes, or 0.0 if none. | diff --git a/source/csharp/astronomy.cs b/source/csharp/astronomy.cs index 311686ad..f6e768b8 100644 --- a/source/csharp/astronomy.cs +++ b/source/csharp/astronomy.cs @@ -867,12 +867,12 @@ namespace CosineKitty /// The `kind` field thus holds `EclipseKind.Penumbral`, `EclipseKind.Partial`, /// or `EclipseKind.Total`, depending on the kind of lunar eclipse found. /// - /// Field `center` holds the date and time of the center of the eclipse, when it is at its peak. + /// Field `peak` holds the date and time of the center of the eclipse, when it is at its peak. /// /// Fields `sd_penum`, `sd_partial`, and `sd_total` hold the semi-duration of each phase /// of the eclipse, which is half of the amount of time the eclipse spends in each /// phase (expressed in minutes), or 0 if the eclipse never reaches that phase. - /// By converting from minutes to days, and subtracting/adding with `center`, the caller + /// By converting from minutes to days, and subtracting/adding with `peak`, the caller /// may determine the date and time of the beginning/end of each eclipse phase. /// public struct LunarEclipseInfo @@ -881,7 +881,7 @@ namespace CosineKitty public EclipseKind kind; /// The time of the eclipse at its peak. - public AstroTime center; + public AstroTime peak; /// The semi-duration of the penumbral phase in minutes. public double sd_penum; @@ -892,10 +892,10 @@ namespace CosineKitty /// The semi-duration of the total phase in minutes, or 0.0 if none. public double sd_total; - internal LunarEclipseInfo(EclipseKind kind, AstroTime center, double sd_penum, double sd_partial, double sd_total) + internal LunarEclipseInfo(EclipseKind kind, AstroTime peak, double sd_penum, double sd_partial, double sd_total) { this.kind = kind; - this.center = center; + this.peak = peak; this.sd_penum = sd_penum; this.sd_partial = sd_partial; this.sd_total = sd_total; diff --git a/source/js/README.md b/source/js/README.md index 5d7d6e52..9d8ecb80 100644 --- a/source/js/README.md +++ b/source/js/README.md @@ -494,12 +494,12 @@ Total eclipses occur when the entire Moon passes into the Earth's umbra. The `kind` field thus holds one of the strings `"penumbral"`, `"partial"`, or `"total"`, depending on the kind of lunar eclipse found. -Field `center` holds the date and time of the center of the eclipse, when it is at its peak. +Field `peak` holds the date and time of the peak of the eclipse, when it is at its peak. Fields `sd_penum`, `sd_partial`, and `sd_total` hold the semi-duration of each phase of the eclipse, which is half of the amount of time the eclipse spends in each phase (expressed in minutes), or 0 if the eclipse never reaches that phase. -By converting from minutes to days, and subtracting/adding with `center`, the caller +By converting from minutes to days, and subtracting/adding with `peak`, the caller may determine the date and time of the beginning/end of each eclipse phase. **Kind**: static class of [Astronomy](#Astronomy) @@ -508,7 +508,7 @@ may determine the date and time of the beginning/end of each eclipse phase. | Name | Type | Description | | --- | --- | --- | | kind | string | The type of lunar eclipse found. | -| center | [AstroTime](#Astronomy.AstroTime) | The time of the eclipse at its peak. | +| peak | [AstroTime](#Astronomy.AstroTime) | The time of the eclipse at its peak. | | sd_penum | number | The semi-duration of the penumbral phase in minutes. | | sd_partial | number | The semi-duration of the penumbral phase in minutes, or 0.0 if none. | | sd_total | number | The semi-duration of the penumbral phase in minutes, or 0.0 if none. | diff --git a/source/js/astronomy.js b/source/js/astronomy.js index 96e10d15..886fb1f9 100644 --- a/source/js/astronomy.js +++ b/source/js/astronomy.js @@ -5666,12 +5666,12 @@ Astronomy.Constellation = function(ra, dec) { * The `kind` field thus holds one of the strings `"penumbral"`, `"partial"`, * or `"total"`, depending on the kind of lunar eclipse found. * - * Field `center` holds the date and time of the center of the eclipse, when it is at its peak. + * Field `peak` holds the date and time of the peak of the eclipse, when it is at its peak. * * Fields `sd_penum`, `sd_partial`, and `sd_total` hold the semi-duration of each phase * of the eclipse, which is half of the amount of time the eclipse spends in each * phase (expressed in minutes), or 0 if the eclipse never reaches that phase. - * By converting from minutes to days, and subtracting/adding with `center`, the caller + * By converting from minutes to days, and subtracting/adding with `peak`, the caller * may determine the date and time of the beginning/end of each eclipse phase. * * @class @@ -5680,7 +5680,7 @@ Astronomy.Constellation = function(ra, dec) { * @property {string} kind * The type of lunar eclipse found. * - * @property {Astronomy.AstroTime} center + * @property {Astronomy.AstroTime} peak * The time of the eclipse at its peak. * * @property {number} sd_penum @@ -5694,9 +5694,9 @@ Astronomy.Constellation = function(ra, dec) { * */ class LunarEclipseInfo { - constructor(kind, center, sd_penum, sd_partial, sd_total) { + constructor(kind, peak, sd_penum, sd_partial, sd_total) { this.kind = kind; - this.center = center; + this.peak = peak; this.sd_penum = sd_penum; this.sd_partial = sd_partial; this.sd_total = sd_total; diff --git a/source/js/astronomy.min.js b/source/js/astronomy.min.js index c9f2725b..664563b7 100644 --- a/source/js/astronomy.min.js +++ b/source/js/astronomy.min.js @@ -174,6 +174,6 @@ d.Rotation_ECL_EQD(a);a=d.Rotation_EQD_HOR(a,b);return d.CombineRotation(c,a)};d 1800,-1296],[49,5418,5520,-1296],[84,3042,3180,-1308],[12,2220,2340,-1320],[14,4260,4620,-1320],[49,5100,5418,-1320],[56,5418,5520,-1320],[32,1440,1560,-1356],[84,3180,3960,-1356],[14,3960,4050,-1356],[5,6300,6480,-1368],[78,6480,7320,-1368],[38,7920,8400,-1368],[40,1152,1260,-1380],[64,1800,1980,-1380],[12,2340,2460,-1392],[63,0,480,-1404],[35,480,780,-1404],[63,8400,8640,-1404],[32,1560,1650,-1416],[56,5520,5911.5,-1440],[43,7320,7680,-1440],[64,1980,2160,-1464],[18,5460,5520,-1464],[5,5911.5,5970, -1464],[18,5370,5460,-1526],[5,5970,6030,-1526],[64,2160,2460,-1536],[12,2460,3252,-1536],[14,4050,4260,-1536],[27,4260,4620,-1536],[14,4620,5232,-1536],[18,4860,4920,-1560],[5,6030,6060,-1560],[40,780,1152,-1620],[69,1152,1650,-1620],[18,5310,5370,-1620],[5,6060,6300,-1620],[60,6300,6480,-1620],[81,7920,8400,-1620],[32,1650,2370,-1680],[18,4920,5310,-1680],[79,5310,6120,-1680],[81,0,480,-1800],[42,1260,1650,-1800],[86,2370,3252,-1800],[12,3252,4050,-1800],[55,4050,4920,-1800],[60,6480,7680,-1800], [43,7680,8400,-1800],[81,8400,8640,-1800],[81,270,480,-1824],[42,0,1260,-1980],[17,2760,4920,-1980],[2,4920,6480,-1980],[52,1260,2760,-2040],[57,0,8640,-2160]],ca,na,Fa=function(a,b,c,e){this.symbol=a;this.name=b;this.ra1875=c;this.dec1875=e};d.Constellation=function(a,b){if(-90>b||90a&&(a+=24);ca||(ca=d.Rotation_EQJ_EQD(new x(-45655.74141261017)),na=new x(0));a=new Z(a,b,1);a=d.VectorFromEquator(a,na);a=d.RotateVector(ca,a);a=d.EquatorFromVector(a); -b=10/240;for(var c=b/15,e=$jscomp.makeIterator(Ea),g=e.next();!g.done;g=e.next()){g=g.value;var h=g[1]*c,k=g[2]*c;if(g[3]*b<=a.dec&&h<=a.ra&&a.rab;++b){var c= +b=10/240;for(var c=b/15,e=$jscomp.makeIterator(Ea),g=e.next();!g.done;g=e.next()){g=g.value;var h=g[1]*c,k=g[2]*c;if(g[3]*b<=a.dec&&h<=a.ra&&a.rab;++b){var c= d.SearchMoonPhase(180,a,40);if(null===c)throw"Cannot find full moon.";a=E(c);if(1.8>57.29577951308232*Math.abs(a.geo_eclip_lat)&&(a=ta(c),a.r