@hebcal/noaa 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +26 -33
- package/dist/esm/index.js +26 -33
- package/dist/index.d.ts +25 -20
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -119,16 +119,19 @@ exports.GeoLocation = GeoLocation;
|
|
|
119
119
|
/**
|
|
120
120
|
* The commonly used average solar refraction. Calendrical Calculations lists a more accurate global average of
|
|
121
121
|
* 34.478885263888294
|
|
122
|
+
* @private
|
|
122
123
|
*/
|
|
123
124
|
const refraction = 34 / 60;
|
|
124
125
|
// private double refraction = 34.478885263888294 / 60d;
|
|
125
126
|
/**
|
|
126
127
|
* The commonly used average solar radius in minutes of a degree.
|
|
128
|
+
* @private
|
|
127
129
|
*/
|
|
128
130
|
const solarRadius = 16 / 60;
|
|
129
131
|
/**
|
|
130
132
|
* The commonly used average earth radius in KM. At this time, this only affects elevation adjustment and not the
|
|
131
133
|
* sunrise and sunset calculations. The value currently defaults to 6356.9 KM.
|
|
134
|
+
* @private
|
|
132
135
|
*/
|
|
133
136
|
const earthRadius = 6356.9; // in KM
|
|
134
137
|
/**
|
|
@@ -429,7 +432,7 @@ class NOAACalculator {
|
|
|
429
432
|
}
|
|
430
433
|
/**
|
|
431
434
|
* Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the antimeridian.
|
|
432
|
-
*
|
|
435
|
+
* @private
|
|
433
436
|
* @see GeoLocation#getAntimeridianAdjustment()
|
|
434
437
|
* @return the adjusted Calendar
|
|
435
438
|
*/
|
|
@@ -594,7 +597,7 @@ class NOAACalculator {
|
|
|
594
597
|
}
|
|
595
598
|
/**
|
|
596
599
|
* A method that returns a <code>Date</code> from the time passed in as a parameter.
|
|
597
|
-
*
|
|
600
|
+
* @protected
|
|
598
601
|
* @param time
|
|
599
602
|
* The time to be set as the time for the <code>Date</code>. The time expected is in the format: 18.75
|
|
600
603
|
* for 6:45:00 PM.
|
|
@@ -633,7 +636,7 @@ class NOAACalculator {
|
|
|
633
636
|
}
|
|
634
637
|
/**
|
|
635
638
|
* Return the <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> from a Java Calendar
|
|
636
|
-
*
|
|
639
|
+
* @private
|
|
637
640
|
* @param calendar
|
|
638
641
|
* The Java Calendar
|
|
639
642
|
* @return the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days
|
|
@@ -656,7 +659,7 @@ class NOAACalculator {
|
|
|
656
659
|
}
|
|
657
660
|
/**
|
|
658
661
|
* Convert <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> to centuries since J2000.0.
|
|
659
|
-
*
|
|
662
|
+
* @private
|
|
660
663
|
* @param julianDay
|
|
661
664
|
* the Julian Day to convert
|
|
662
665
|
* @return the centuries since 2000 Julian corresponding to the Julian Day
|
|
@@ -667,7 +670,7 @@ class NOAACalculator {
|
|
|
667
670
|
}
|
|
668
671
|
/**
|
|
669
672
|
* Convert centuries since J2000.0 to <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a>.
|
|
670
|
-
*
|
|
673
|
+
* @private
|
|
671
674
|
* @param julianCenturies
|
|
672
675
|
* the number of Julian centuries since J2000.0
|
|
673
676
|
* @return the Julian Day corresponding to the Julian centuries passed in
|
|
@@ -678,7 +681,7 @@ class NOAACalculator {
|
|
|
678
681
|
}
|
|
679
682
|
/**
|
|
680
683
|
* Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_longitude">Mean Longitude</a> of the Sun.
|
|
681
|
-
*
|
|
684
|
+
* @private
|
|
682
685
|
* @param julianCenturies
|
|
683
686
|
* the number of Julian centuries since J2000.0
|
|
684
687
|
* @return the Geometric Mean Longitude of the Sun in degrees
|
|
@@ -695,7 +698,7 @@ class NOAACalculator {
|
|
|
695
698
|
}
|
|
696
699
|
/**
|
|
697
700
|
* Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_anomaly">Mean Anomaly</a> of the Sun.
|
|
698
|
-
*
|
|
701
|
+
* @private
|
|
699
702
|
* @param julianCenturies
|
|
700
703
|
* the number of Julian centuries since J2000.0
|
|
701
704
|
* @return the Geometric Mean Anomaly of the Sun in degrees
|
|
@@ -705,7 +708,7 @@ class NOAACalculator {
|
|
|
705
708
|
}
|
|
706
709
|
/**
|
|
707
710
|
* Return the <a href="http://en.wikipedia.org/wiki/Eccentricity_%28orbit%29">eccentricity of earth's orbit</a>.
|
|
708
|
-
*
|
|
711
|
+
* @private
|
|
709
712
|
* @param julianCenturies
|
|
710
713
|
* the number of Julian centuries since J2000.0
|
|
711
714
|
* @return the unitless eccentricity
|
|
@@ -716,7 +719,7 @@ class NOAACalculator {
|
|
|
716
719
|
}
|
|
717
720
|
/**
|
|
718
721
|
* Returns the <a href="http://en.wikipedia.org/wiki/Equation_of_the_center">equation of center</a> for the sun.
|
|
719
|
-
*
|
|
722
|
+
* @private
|
|
720
723
|
* @param julianCenturies
|
|
721
724
|
* the number of Julian centuries since J2000.0
|
|
722
725
|
* @return the equation of center for the sun in degrees
|
|
@@ -734,7 +737,7 @@ class NOAACalculator {
|
|
|
734
737
|
}
|
|
735
738
|
/**
|
|
736
739
|
* Return the true longitude of the sun
|
|
737
|
-
*
|
|
740
|
+
* @private
|
|
738
741
|
* @param julianCenturies
|
|
739
742
|
* the number of Julian centuries since J2000.0
|
|
740
743
|
* @return the sun's true longitude in degrees
|
|
@@ -744,22 +747,9 @@ class NOAACalculator {
|
|
|
744
747
|
const center = NOAACalculator.getSunEquationOfCenter(julianCenturies);
|
|
745
748
|
return sunLongitude + center; // in degrees
|
|
746
749
|
}
|
|
747
|
-
// /**
|
|
748
|
-
// * Returns the <a href="http://en.wikipedia.org/wiki/True_anomaly">true anamoly</a> of the sun.
|
|
749
|
-
// *
|
|
750
|
-
// * @param julianCenturies
|
|
751
|
-
// * the number of Julian centuries since J2000.0
|
|
752
|
-
// * @return the sun's true anamoly in degrees
|
|
753
|
-
// */
|
|
754
|
-
// private static double getSunTrueAnomaly(double julianCenturies) {
|
|
755
|
-
// double meanAnomaly = getSunGeometricMeanAnomaly(julianCenturies);
|
|
756
|
-
// double equationOfCenter = getSunEquationOfCenter(julianCenturies);
|
|
757
|
-
//
|
|
758
|
-
// return meanAnomaly + equationOfCenter; // in degrees
|
|
759
|
-
// }
|
|
760
750
|
/**
|
|
761
751
|
* Return the apparent longitude of the sun
|
|
762
|
-
*
|
|
752
|
+
* @private
|
|
763
753
|
* @param julianCenturies
|
|
764
754
|
* the number of Julian centuries since J2000.0
|
|
765
755
|
* @return sun's apparent longitude in degrees
|
|
@@ -772,7 +762,7 @@ class NOAACalculator {
|
|
|
772
762
|
}
|
|
773
763
|
/**
|
|
774
764
|
* Returns the mean <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial tilt).
|
|
775
|
-
*
|
|
765
|
+
* @private
|
|
776
766
|
* @param julianCenturies
|
|
777
767
|
* the number of Julian centuries since J2000.0
|
|
778
768
|
* @return the mean obliquity in degrees
|
|
@@ -786,7 +776,7 @@ class NOAACalculator {
|
|
|
786
776
|
/**
|
|
787
777
|
* Returns the corrected <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial
|
|
788
778
|
* tilt).
|
|
789
|
-
*
|
|
779
|
+
* @private
|
|
790
780
|
* @param julianCenturies
|
|
791
781
|
* the number of Julian centuries since J2000.0
|
|
792
782
|
* @return the corrected obliquity in degrees
|
|
@@ -798,7 +788,7 @@ class NOAACalculator {
|
|
|
798
788
|
}
|
|
799
789
|
/**
|
|
800
790
|
* Return the <a href="http://en.wikipedia.org/wiki/Declination">declination</a> of the sun.
|
|
801
|
-
*
|
|
791
|
+
* @private
|
|
802
792
|
* @param julianCenturies
|
|
803
793
|
* the number of Julian centuries since J2000.0
|
|
804
794
|
* @return
|
|
@@ -815,7 +805,7 @@ class NOAACalculator {
|
|
|
815
805
|
/**
|
|
816
806
|
* Return the <a href="http://en.wikipedia.org/wiki/Equation_of_time">Equation of Time</a> - the difference between
|
|
817
807
|
* true solar time and mean solar time
|
|
818
|
-
*
|
|
808
|
+
* @private
|
|
819
809
|
* @param julianCenturies
|
|
820
810
|
* the number of Julian centuries since J2000.0
|
|
821
811
|
* @return equation of time in minutes of time
|
|
@@ -842,7 +832,7 @@ class NOAACalculator {
|
|
|
842
832
|
/**
|
|
843
833
|
* Return the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunrise for the
|
|
844
834
|
* latitude.
|
|
845
|
-
*
|
|
835
|
+
* @private
|
|
846
836
|
* @param lat
|
|
847
837
|
* , the latitude of observer in degrees
|
|
848
838
|
* @param solarDec
|
|
@@ -862,7 +852,7 @@ class NOAACalculator {
|
|
|
862
852
|
* Returns the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunset for the
|
|
863
853
|
* latitude. TODO: use - {@link #getSunHourAngleAtSunrise(double, double, double)} implementation to avoid
|
|
864
854
|
* duplication of code.
|
|
865
|
-
*
|
|
855
|
+
* @private
|
|
866
856
|
* @param lat
|
|
867
857
|
* the latitude of observer in degrees
|
|
868
858
|
* @param solarDec
|
|
@@ -935,7 +925,7 @@ class NOAACalculator {
|
|
|
935
925
|
/**
|
|
936
926
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
937
927
|
* of sunrise for the given day at the given location on earth
|
|
938
|
-
*
|
|
928
|
+
* @private
|
|
939
929
|
* @param julianDay
|
|
940
930
|
* the Julian day
|
|
941
931
|
* @param latitude
|
|
@@ -974,7 +964,7 @@ class NOAACalculator {
|
|
|
974
964
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
975
965
|
* of <a href="http://en.wikipedia.org/wiki/Noon#Solar_noon">solar noon</a> for the given day at the given location
|
|
976
966
|
* on earth.
|
|
977
|
-
*
|
|
967
|
+
* @private
|
|
978
968
|
* @param julianCenturies
|
|
979
969
|
* the number of Julian centuries since J2000.0
|
|
980
970
|
* @param longitude
|
|
@@ -996,7 +986,7 @@ class NOAACalculator {
|
|
|
996
986
|
/**
|
|
997
987
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
998
988
|
* of sunset for the given day at the given location on earth
|
|
999
|
-
*
|
|
989
|
+
* @private
|
|
1000
990
|
* @param julianDay
|
|
1001
991
|
* the Julian day
|
|
1002
992
|
* @param latitude
|
|
@@ -1035,6 +1025,7 @@ class NOAACalculator {
|
|
|
1035
1025
|
exports.NOAACalculator = NOAACalculator;
|
|
1036
1026
|
/**
|
|
1037
1027
|
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
1028
|
+
* @private
|
|
1038
1029
|
*/
|
|
1039
1030
|
NOAACalculator.GEOMETRIC_ZENITH = 90;
|
|
1040
1031
|
/**
|
|
@@ -1057,9 +1048,11 @@ NOAACalculator.NAUTICAL_ZENITH = 102;
|
|
|
1057
1048
|
NOAACalculator.ASTRONOMICAL_ZENITH = 108;
|
|
1058
1049
|
/**
|
|
1059
1050
|
* The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
|
|
1051
|
+
* @private
|
|
1060
1052
|
*/
|
|
1061
1053
|
NOAACalculator.JULIAN_DAY_JAN_1_2000 = 2451545;
|
|
1062
1054
|
/**
|
|
1063
1055
|
* Julian days per century
|
|
1056
|
+
* @private
|
|
1064
1057
|
*/
|
|
1065
1058
|
NOAACalculator.JULIAN_DAYS_PER_CENTURY = 36525;
|
package/dist/esm/index.js
CHANGED
|
@@ -115,16 +115,19 @@ export class GeoLocation {
|
|
|
115
115
|
/**
|
|
116
116
|
* The commonly used average solar refraction. Calendrical Calculations lists a more accurate global average of
|
|
117
117
|
* 34.478885263888294
|
|
118
|
+
* @private
|
|
118
119
|
*/
|
|
119
120
|
const refraction = 34 / 60;
|
|
120
121
|
// private double refraction = 34.478885263888294 / 60d;
|
|
121
122
|
/**
|
|
122
123
|
* The commonly used average solar radius in minutes of a degree.
|
|
124
|
+
* @private
|
|
123
125
|
*/
|
|
124
126
|
const solarRadius = 16 / 60;
|
|
125
127
|
/**
|
|
126
128
|
* The commonly used average earth radius in KM. At this time, this only affects elevation adjustment and not the
|
|
127
129
|
* sunrise and sunset calculations. The value currently defaults to 6356.9 KM.
|
|
130
|
+
* @private
|
|
128
131
|
*/
|
|
129
132
|
const earthRadius = 6356.9; // in KM
|
|
130
133
|
/**
|
|
@@ -425,7 +428,7 @@ export class NOAACalculator {
|
|
|
425
428
|
}
|
|
426
429
|
/**
|
|
427
430
|
* Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the antimeridian.
|
|
428
|
-
*
|
|
431
|
+
* @private
|
|
429
432
|
* @see GeoLocation#getAntimeridianAdjustment()
|
|
430
433
|
* @return the adjusted Calendar
|
|
431
434
|
*/
|
|
@@ -590,7 +593,7 @@ export class NOAACalculator {
|
|
|
590
593
|
}
|
|
591
594
|
/**
|
|
592
595
|
* A method that returns a <code>Date</code> from the time passed in as a parameter.
|
|
593
|
-
*
|
|
596
|
+
* @protected
|
|
594
597
|
* @param time
|
|
595
598
|
* The time to be set as the time for the <code>Date</code>. The time expected is in the format: 18.75
|
|
596
599
|
* for 6:45:00 PM.
|
|
@@ -629,7 +632,7 @@ export class NOAACalculator {
|
|
|
629
632
|
}
|
|
630
633
|
/**
|
|
631
634
|
* Return the <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> from a Java Calendar
|
|
632
|
-
*
|
|
635
|
+
* @private
|
|
633
636
|
* @param calendar
|
|
634
637
|
* The Java Calendar
|
|
635
638
|
* @return the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days
|
|
@@ -652,7 +655,7 @@ export class NOAACalculator {
|
|
|
652
655
|
}
|
|
653
656
|
/**
|
|
654
657
|
* Convert <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> to centuries since J2000.0.
|
|
655
|
-
*
|
|
658
|
+
* @private
|
|
656
659
|
* @param julianDay
|
|
657
660
|
* the Julian Day to convert
|
|
658
661
|
* @return the centuries since 2000 Julian corresponding to the Julian Day
|
|
@@ -663,7 +666,7 @@ export class NOAACalculator {
|
|
|
663
666
|
}
|
|
664
667
|
/**
|
|
665
668
|
* Convert centuries since J2000.0 to <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a>.
|
|
666
|
-
*
|
|
669
|
+
* @private
|
|
667
670
|
* @param julianCenturies
|
|
668
671
|
* the number of Julian centuries since J2000.0
|
|
669
672
|
* @return the Julian Day corresponding to the Julian centuries passed in
|
|
@@ -674,7 +677,7 @@ export class NOAACalculator {
|
|
|
674
677
|
}
|
|
675
678
|
/**
|
|
676
679
|
* Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_longitude">Mean Longitude</a> of the Sun.
|
|
677
|
-
*
|
|
680
|
+
* @private
|
|
678
681
|
* @param julianCenturies
|
|
679
682
|
* the number of Julian centuries since J2000.0
|
|
680
683
|
* @return the Geometric Mean Longitude of the Sun in degrees
|
|
@@ -691,7 +694,7 @@ export class NOAACalculator {
|
|
|
691
694
|
}
|
|
692
695
|
/**
|
|
693
696
|
* Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_anomaly">Mean Anomaly</a> of the Sun.
|
|
694
|
-
*
|
|
697
|
+
* @private
|
|
695
698
|
* @param julianCenturies
|
|
696
699
|
* the number of Julian centuries since J2000.0
|
|
697
700
|
* @return the Geometric Mean Anomaly of the Sun in degrees
|
|
@@ -701,7 +704,7 @@ export class NOAACalculator {
|
|
|
701
704
|
}
|
|
702
705
|
/**
|
|
703
706
|
* Return the <a href="http://en.wikipedia.org/wiki/Eccentricity_%28orbit%29">eccentricity of earth's orbit</a>.
|
|
704
|
-
*
|
|
707
|
+
* @private
|
|
705
708
|
* @param julianCenturies
|
|
706
709
|
* the number of Julian centuries since J2000.0
|
|
707
710
|
* @return the unitless eccentricity
|
|
@@ -712,7 +715,7 @@ export class NOAACalculator {
|
|
|
712
715
|
}
|
|
713
716
|
/**
|
|
714
717
|
* Returns the <a href="http://en.wikipedia.org/wiki/Equation_of_the_center">equation of center</a> for the sun.
|
|
715
|
-
*
|
|
718
|
+
* @private
|
|
716
719
|
* @param julianCenturies
|
|
717
720
|
* the number of Julian centuries since J2000.0
|
|
718
721
|
* @return the equation of center for the sun in degrees
|
|
@@ -730,7 +733,7 @@ export class NOAACalculator {
|
|
|
730
733
|
}
|
|
731
734
|
/**
|
|
732
735
|
* Return the true longitude of the sun
|
|
733
|
-
*
|
|
736
|
+
* @private
|
|
734
737
|
* @param julianCenturies
|
|
735
738
|
* the number of Julian centuries since J2000.0
|
|
736
739
|
* @return the sun's true longitude in degrees
|
|
@@ -740,22 +743,9 @@ export class NOAACalculator {
|
|
|
740
743
|
const center = NOAACalculator.getSunEquationOfCenter(julianCenturies);
|
|
741
744
|
return sunLongitude + center; // in degrees
|
|
742
745
|
}
|
|
743
|
-
// /**
|
|
744
|
-
// * Returns the <a href="http://en.wikipedia.org/wiki/True_anomaly">true anamoly</a> of the sun.
|
|
745
|
-
// *
|
|
746
|
-
// * @param julianCenturies
|
|
747
|
-
// * the number of Julian centuries since J2000.0
|
|
748
|
-
// * @return the sun's true anamoly in degrees
|
|
749
|
-
// */
|
|
750
|
-
// private static double getSunTrueAnomaly(double julianCenturies) {
|
|
751
|
-
// double meanAnomaly = getSunGeometricMeanAnomaly(julianCenturies);
|
|
752
|
-
// double equationOfCenter = getSunEquationOfCenter(julianCenturies);
|
|
753
|
-
//
|
|
754
|
-
// return meanAnomaly + equationOfCenter; // in degrees
|
|
755
|
-
// }
|
|
756
746
|
/**
|
|
757
747
|
* Return the apparent longitude of the sun
|
|
758
|
-
*
|
|
748
|
+
* @private
|
|
759
749
|
* @param julianCenturies
|
|
760
750
|
* the number of Julian centuries since J2000.0
|
|
761
751
|
* @return sun's apparent longitude in degrees
|
|
@@ -768,7 +758,7 @@ export class NOAACalculator {
|
|
|
768
758
|
}
|
|
769
759
|
/**
|
|
770
760
|
* Returns the mean <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial tilt).
|
|
771
|
-
*
|
|
761
|
+
* @private
|
|
772
762
|
* @param julianCenturies
|
|
773
763
|
* the number of Julian centuries since J2000.0
|
|
774
764
|
* @return the mean obliquity in degrees
|
|
@@ -782,7 +772,7 @@ export class NOAACalculator {
|
|
|
782
772
|
/**
|
|
783
773
|
* Returns the corrected <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial
|
|
784
774
|
* tilt).
|
|
785
|
-
*
|
|
775
|
+
* @private
|
|
786
776
|
* @param julianCenturies
|
|
787
777
|
* the number of Julian centuries since J2000.0
|
|
788
778
|
* @return the corrected obliquity in degrees
|
|
@@ -794,7 +784,7 @@ export class NOAACalculator {
|
|
|
794
784
|
}
|
|
795
785
|
/**
|
|
796
786
|
* Return the <a href="http://en.wikipedia.org/wiki/Declination">declination</a> of the sun.
|
|
797
|
-
*
|
|
787
|
+
* @private
|
|
798
788
|
* @param julianCenturies
|
|
799
789
|
* the number of Julian centuries since J2000.0
|
|
800
790
|
* @return
|
|
@@ -811,7 +801,7 @@ export class NOAACalculator {
|
|
|
811
801
|
/**
|
|
812
802
|
* Return the <a href="http://en.wikipedia.org/wiki/Equation_of_time">Equation of Time</a> - the difference between
|
|
813
803
|
* true solar time and mean solar time
|
|
814
|
-
*
|
|
804
|
+
* @private
|
|
815
805
|
* @param julianCenturies
|
|
816
806
|
* the number of Julian centuries since J2000.0
|
|
817
807
|
* @return equation of time in minutes of time
|
|
@@ -838,7 +828,7 @@ export class NOAACalculator {
|
|
|
838
828
|
/**
|
|
839
829
|
* Return the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunrise for the
|
|
840
830
|
* latitude.
|
|
841
|
-
*
|
|
831
|
+
* @private
|
|
842
832
|
* @param lat
|
|
843
833
|
* , the latitude of observer in degrees
|
|
844
834
|
* @param solarDec
|
|
@@ -858,7 +848,7 @@ export class NOAACalculator {
|
|
|
858
848
|
* Returns the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunset for the
|
|
859
849
|
* latitude. TODO: use - {@link #getSunHourAngleAtSunrise(double, double, double)} implementation to avoid
|
|
860
850
|
* duplication of code.
|
|
861
|
-
*
|
|
851
|
+
* @private
|
|
862
852
|
* @param lat
|
|
863
853
|
* the latitude of observer in degrees
|
|
864
854
|
* @param solarDec
|
|
@@ -931,7 +921,7 @@ export class NOAACalculator {
|
|
|
931
921
|
/**
|
|
932
922
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
933
923
|
* of sunrise for the given day at the given location on earth
|
|
934
|
-
*
|
|
924
|
+
* @private
|
|
935
925
|
* @param julianDay
|
|
936
926
|
* the Julian day
|
|
937
927
|
* @param latitude
|
|
@@ -970,7 +960,7 @@ export class NOAACalculator {
|
|
|
970
960
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
971
961
|
* of <a href="http://en.wikipedia.org/wiki/Noon#Solar_noon">solar noon</a> for the given day at the given location
|
|
972
962
|
* on earth.
|
|
973
|
-
*
|
|
963
|
+
* @private
|
|
974
964
|
* @param julianCenturies
|
|
975
965
|
* the number of Julian centuries since J2000.0
|
|
976
966
|
* @param longitude
|
|
@@ -992,7 +982,7 @@ export class NOAACalculator {
|
|
|
992
982
|
/**
|
|
993
983
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
994
984
|
* of sunset for the given day at the given location on earth
|
|
995
|
-
*
|
|
985
|
+
* @private
|
|
996
986
|
* @param julianDay
|
|
997
987
|
* the Julian day
|
|
998
988
|
* @param latitude
|
|
@@ -1030,6 +1020,7 @@ export class NOAACalculator {
|
|
|
1030
1020
|
}
|
|
1031
1021
|
/**
|
|
1032
1022
|
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
1023
|
+
* @private
|
|
1033
1024
|
*/
|
|
1034
1025
|
NOAACalculator.GEOMETRIC_ZENITH = 90;
|
|
1035
1026
|
/**
|
|
@@ -1052,9 +1043,11 @@ NOAACalculator.NAUTICAL_ZENITH = 102;
|
|
|
1052
1043
|
NOAACalculator.ASTRONOMICAL_ZENITH = 108;
|
|
1053
1044
|
/**
|
|
1054
1045
|
* The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
|
|
1046
|
+
* @private
|
|
1055
1047
|
*/
|
|
1056
1048
|
NOAACalculator.JULIAN_DAY_JAN_1_2000 = 2451545;
|
|
1057
1049
|
/**
|
|
1058
1050
|
* Julian days per century
|
|
1051
|
+
* @private
|
|
1059
1052
|
*/
|
|
1060
1053
|
NOAACalculator.JULIAN_DAYS_PER_CENTURY = 36525;
|
package/dist/index.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export declare class GeoLocation {
|
|
|
122
122
|
export declare class NOAACalculator {
|
|
123
123
|
/**
|
|
124
124
|
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
125
|
+
* @private
|
|
125
126
|
*/
|
|
126
127
|
private static readonly GEOMETRIC_ZENITH;
|
|
127
128
|
/**
|
|
@@ -143,10 +144,12 @@ export declare class NOAACalculator {
|
|
|
143
144
|
static readonly ASTRONOMICAL_ZENITH: number;
|
|
144
145
|
/**
|
|
145
146
|
* The Java Calendar encapsulated by this class to track the current date used by the class
|
|
147
|
+
* @private
|
|
146
148
|
*/
|
|
147
149
|
private date;
|
|
148
150
|
/**
|
|
149
151
|
* the {@link GeoLocation} used for calculations.
|
|
152
|
+
* @private
|
|
150
153
|
*/
|
|
151
154
|
private geoLocation;
|
|
152
155
|
/**
|
|
@@ -375,7 +378,7 @@ export declare class NOAACalculator {
|
|
|
375
378
|
getUTCSeaLevelSunset(zenith: number): number;
|
|
376
379
|
/**
|
|
377
380
|
* Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the antimeridian.
|
|
378
|
-
*
|
|
381
|
+
* @private
|
|
379
382
|
* @see GeoLocation#getAntimeridianAdjustment()
|
|
380
383
|
* @return the adjusted Calendar
|
|
381
384
|
*/
|
|
@@ -442,10 +445,12 @@ export declare class NOAACalculator {
|
|
|
442
445
|
adjustZenith(zenith: number, elevation: number): number;
|
|
443
446
|
/**
|
|
444
447
|
* The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
|
|
448
|
+
* @private
|
|
445
449
|
*/
|
|
446
450
|
private static readonly JULIAN_DAY_JAN_1_2000;
|
|
447
451
|
/**
|
|
448
452
|
* Julian days per century
|
|
453
|
+
* @private
|
|
449
454
|
*/
|
|
450
455
|
private static readonly JULIAN_DAYS_PER_CENTURY;
|
|
451
456
|
/**
|
|
@@ -494,7 +499,7 @@ export declare class NOAACalculator {
|
|
|
494
499
|
getSunTransit(startOfDay?: Temporal.ZonedDateTime | null, endOfDay?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
|
|
495
500
|
/**
|
|
496
501
|
* A method that returns a <code>Date</code> from the time passed in as a parameter.
|
|
497
|
-
*
|
|
502
|
+
* @protected
|
|
498
503
|
* @param time
|
|
499
504
|
* The time to be set as the time for the <code>Date</code>. The time expected is in the format: 18.75
|
|
500
505
|
* for 6:45:00 PM.
|
|
@@ -504,7 +509,7 @@ export declare class NOAACalculator {
|
|
|
504
509
|
protected getDateFromTime(time: number, isSunrise: boolean): Temporal.ZonedDateTime | null;
|
|
505
510
|
/**
|
|
506
511
|
* Return the <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> from a Java Calendar
|
|
507
|
-
*
|
|
512
|
+
* @private
|
|
508
513
|
* @param calendar
|
|
509
514
|
* The Java Calendar
|
|
510
515
|
* @return the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days
|
|
@@ -513,7 +518,7 @@ export declare class NOAACalculator {
|
|
|
513
518
|
private static getJulianDay;
|
|
514
519
|
/**
|
|
515
520
|
* Convert <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> to centuries since J2000.0.
|
|
516
|
-
*
|
|
521
|
+
* @private
|
|
517
522
|
* @param julianDay
|
|
518
523
|
* the Julian Day to convert
|
|
519
524
|
* @return the centuries since 2000 Julian corresponding to the Julian Day
|
|
@@ -521,7 +526,7 @@ export declare class NOAACalculator {
|
|
|
521
526
|
private static getJulianCenturiesFromJulianDay;
|
|
522
527
|
/**
|
|
523
528
|
* Convert centuries since J2000.0 to <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a>.
|
|
524
|
-
*
|
|
529
|
+
* @private
|
|
525
530
|
* @param julianCenturies
|
|
526
531
|
* the number of Julian centuries since J2000.0
|
|
527
532
|
* @return the Julian Day corresponding to the Julian centuries passed in
|
|
@@ -529,7 +534,7 @@ export declare class NOAACalculator {
|
|
|
529
534
|
private static getJulianDayFromJulianCenturies;
|
|
530
535
|
/**
|
|
531
536
|
* Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_longitude">Mean Longitude</a> of the Sun.
|
|
532
|
-
*
|
|
537
|
+
* @private
|
|
533
538
|
* @param julianCenturies
|
|
534
539
|
* the number of Julian centuries since J2000.0
|
|
535
540
|
* @return the Geometric Mean Longitude of the Sun in degrees
|
|
@@ -537,7 +542,7 @@ export declare class NOAACalculator {
|
|
|
537
542
|
private static getSunGeometricMeanLongitude;
|
|
538
543
|
/**
|
|
539
544
|
* Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_anomaly">Mean Anomaly</a> of the Sun.
|
|
540
|
-
*
|
|
545
|
+
* @private
|
|
541
546
|
* @param julianCenturies
|
|
542
547
|
* the number of Julian centuries since J2000.0
|
|
543
548
|
* @return the Geometric Mean Anomaly of the Sun in degrees
|
|
@@ -545,7 +550,7 @@ export declare class NOAACalculator {
|
|
|
545
550
|
private static getSunGeometricMeanAnomaly;
|
|
546
551
|
/**
|
|
547
552
|
* Return the <a href="http://en.wikipedia.org/wiki/Eccentricity_%28orbit%29">eccentricity of earth's orbit</a>.
|
|
548
|
-
*
|
|
553
|
+
* @private
|
|
549
554
|
* @param julianCenturies
|
|
550
555
|
* the number of Julian centuries since J2000.0
|
|
551
556
|
* @return the unitless eccentricity
|
|
@@ -553,7 +558,7 @@ export declare class NOAACalculator {
|
|
|
553
558
|
private static getEarthOrbitEccentricity;
|
|
554
559
|
/**
|
|
555
560
|
* Returns the <a href="http://en.wikipedia.org/wiki/Equation_of_the_center">equation of center</a> for the sun.
|
|
556
|
-
*
|
|
561
|
+
* @private
|
|
557
562
|
* @param julianCenturies
|
|
558
563
|
* the number of Julian centuries since J2000.0
|
|
559
564
|
* @return the equation of center for the sun in degrees
|
|
@@ -561,7 +566,7 @@ export declare class NOAACalculator {
|
|
|
561
566
|
private static getSunEquationOfCenter;
|
|
562
567
|
/**
|
|
563
568
|
* Return the true longitude of the sun
|
|
564
|
-
*
|
|
569
|
+
* @private
|
|
565
570
|
* @param julianCenturies
|
|
566
571
|
* the number of Julian centuries since J2000.0
|
|
567
572
|
* @return the sun's true longitude in degrees
|
|
@@ -569,7 +574,7 @@ export declare class NOAACalculator {
|
|
|
569
574
|
private static getSunTrueLongitude;
|
|
570
575
|
/**
|
|
571
576
|
* Return the apparent longitude of the sun
|
|
572
|
-
*
|
|
577
|
+
* @private
|
|
573
578
|
* @param julianCenturies
|
|
574
579
|
* the number of Julian centuries since J2000.0
|
|
575
580
|
* @return sun's apparent longitude in degrees
|
|
@@ -577,7 +582,7 @@ export declare class NOAACalculator {
|
|
|
577
582
|
private static getSunApparentLongitude;
|
|
578
583
|
/**
|
|
579
584
|
* Returns the mean <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial tilt).
|
|
580
|
-
*
|
|
585
|
+
* @private
|
|
581
586
|
* @param julianCenturies
|
|
582
587
|
* the number of Julian centuries since J2000.0
|
|
583
588
|
* @return the mean obliquity in degrees
|
|
@@ -586,7 +591,7 @@ export declare class NOAACalculator {
|
|
|
586
591
|
/**
|
|
587
592
|
* Returns the corrected <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial
|
|
588
593
|
* tilt).
|
|
589
|
-
*
|
|
594
|
+
* @private
|
|
590
595
|
* @param julianCenturies
|
|
591
596
|
* the number of Julian centuries since J2000.0
|
|
592
597
|
* @return the corrected obliquity in degrees
|
|
@@ -594,7 +599,7 @@ export declare class NOAACalculator {
|
|
|
594
599
|
private static getObliquityCorrection;
|
|
595
600
|
/**
|
|
596
601
|
* Return the <a href="http://en.wikipedia.org/wiki/Declination">declination</a> of the sun.
|
|
597
|
-
*
|
|
602
|
+
* @private
|
|
598
603
|
* @param julianCenturies
|
|
599
604
|
* the number of Julian centuries since J2000.0
|
|
600
605
|
* @return
|
|
@@ -604,7 +609,7 @@ export declare class NOAACalculator {
|
|
|
604
609
|
/**
|
|
605
610
|
* Return the <a href="http://en.wikipedia.org/wiki/Equation_of_time">Equation of Time</a> - the difference between
|
|
606
611
|
* true solar time and mean solar time
|
|
607
|
-
*
|
|
612
|
+
* @private
|
|
608
613
|
* @param julianCenturies
|
|
609
614
|
* the number of Julian centuries since J2000.0
|
|
610
615
|
* @return equation of time in minutes of time
|
|
@@ -613,7 +618,7 @@ export declare class NOAACalculator {
|
|
|
613
618
|
/**
|
|
614
619
|
* Return the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunrise for the
|
|
615
620
|
* latitude.
|
|
616
|
-
*
|
|
621
|
+
* @private
|
|
617
622
|
* @param lat
|
|
618
623
|
* , the latitude of observer in degrees
|
|
619
624
|
* @param solarDec
|
|
@@ -627,7 +632,7 @@ export declare class NOAACalculator {
|
|
|
627
632
|
* Returns the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunset for the
|
|
628
633
|
* latitude. TODO: use - {@link #getSunHourAngleAtSunrise(double, double, double)} implementation to avoid
|
|
629
634
|
* duplication of code.
|
|
630
|
-
*
|
|
635
|
+
* @private
|
|
631
636
|
* @param lat
|
|
632
637
|
* the latitude of observer in degrees
|
|
633
638
|
* @param solarDec
|
|
@@ -668,7 +673,7 @@ export declare class NOAACalculator {
|
|
|
668
673
|
/**
|
|
669
674
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
670
675
|
* of sunrise for the given day at the given location on earth
|
|
671
|
-
*
|
|
676
|
+
* @private
|
|
672
677
|
* @param julianDay
|
|
673
678
|
* the Julian day
|
|
674
679
|
* @param latitude
|
|
@@ -684,7 +689,7 @@ export declare class NOAACalculator {
|
|
|
684
689
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
685
690
|
* of <a href="http://en.wikipedia.org/wiki/Noon#Solar_noon">solar noon</a> for the given day at the given location
|
|
686
691
|
* on earth.
|
|
687
|
-
*
|
|
692
|
+
* @private
|
|
688
693
|
* @param julianCenturies
|
|
689
694
|
* the number of Julian centuries since J2000.0
|
|
690
695
|
* @param longitude
|
|
@@ -695,7 +700,7 @@ export declare class NOAACalculator {
|
|
|
695
700
|
/**
|
|
696
701
|
* Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
|
|
697
702
|
* of sunset for the given day at the given location on earth
|
|
698
|
-
*
|
|
703
|
+
* @private
|
|
699
704
|
* @param julianDay
|
|
700
705
|
* the Julian day
|
|
701
706
|
* @param latitude
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/noaa",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "sunrise and sunset via NOAA algorithm with elevation, based on KosherJava",
|
|
5
5
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
6
6
|
"contributors": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "LGPL-3.0",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/hebcal/noaa.git"
|
|
13
|
+
"url": "git+https://github.com/hebcal/noaa.git"
|
|
14
14
|
},
|
|
15
15
|
"main": "dist/cjs/index.js",
|
|
16
16
|
"module": "dist/esm/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dist/*"
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@types/node": "20.9.
|
|
43
|
+
"@types/node": "20.9.3",
|
|
44
44
|
"gts": "^5.2.0",
|
|
45
45
|
"typescript": "^5.3.2"
|
|
46
46
|
},
|