BaseCalendar

class badidatetime.tests.test_base_calendar.TestBaseCalendar(name)[source]

Bases: TestCase

_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__AMOD()[source]

Test the _AMOD lambda.

test__ANGLE()[source]

Test the _ANGLE (angle) lambda.

test__HR()[source]

Test the _HR (hour) lambda.

test__MINS()[source]

Test the _MINS (minutes) lambda.

test__MN()[source]

Test the _MN (minute) lambda.

test__MOD3()[source]

Test the _MOD3 (modular three) lambda.

test__PARTIAL_DAY_TO_HOURS()[source]

Test that the _PARTIAL_DAY_TO_HOURS lambda returns the correct hours.

test__PARTIAL_HOUR_TO_MINUTE()[source]

Test that the _PARTIAL_HOUR_TO_MINUTE lambda returns the correct minutes.

test__PARTIAL_MINUTE_TO_SECOND()[source]

Test that the _PARTIAL_MINUTE_TO_SECOND lambda returns the correct seconds.

test__PARTIAL_SECOND_TO_MICROSECOND()[source]

Test that the _PARTIAL_SECOND_TO_MICROSECOND lambda returns the correct microseconds.

test__QUOTIENT()[source]

Test the _QUOTIENT (divid, floor, int) lambda,

test__SEC()[source]

Test the _SEC (second) lambda.

test__SECS()[source]

Test the _SECS (seconds) lambda.

test__US()[source]

Test the _US (microseconds) lambda.

test__aberration()[source]

Test that the _aberration method returns the correct aberration of the given date in degrees.

test__altitude()[source]

Test that the _altitude method returns the correct altitude in degrees.

test__apparent_sidereal_time_greenwich()[source]

Test that the apparent_sidereal_time_greenwich method returns the correct apparent sidereal time.

test__apparent_solar_latitude()[source]

Test that the _apparent_solar_latitudemethod returns the correct values.

test__apparent_solar_longitude()[source]

Test that the _apparent_solar_longitude method returns the longitude of sun at moment tee.

Equinox & Solstice Calculator: https://stellafane.org/misc/equinox.html

Solar Position Calculator: https://gml.noaa.gov/grad/solcalc/

Greenwich:
lat: 51, 29, 36.24 N (51.4934)
lon: 00, 00, 05.562 W (-0.001545)

Data from the book pages 225, 446 and 452

Name

Solar Longitude

Approximate Date

Season Length

Vernal (spring) equinox

0◦

March 20

92.76 days

Summer solstice

90◦

June 21

93.65 days

Autumnal (fall) equinox

180◦

September 22−23

89.84 days

Winter solstice

270◦

December 21−22

88.99 days

test__approx_julian_day_for_equinoxes_or_solstices()[source]

Test that the _approx_julian_day_for_equinoxes_or_solstices method returns a Julian day of the equinoxes or solstices.

test__approx_local_hour_angle()[source]

Test that the _approx_local_hour_angle method returns the correct angle based on the jde.

The variable ‘self.bc.latitude’ is the latitude in Tehran Iran.

test__cos_deg()[source]

Test that the _cos_deg method returns the cosine of theta (given in degrees).

test__coterminal_angle()[source]

Test that the _coterminal_angle method converts degrees greater or less that 360 degrees to a number between 0 and 360 degrees.

test__days_in_years()[source]

Test that the _days_in_years method returns the number of days including year one (Gregorian) to the given year.

test__decimal_day_from_hms()[source]

Test that the _decimal_day_from_hms method returns the correct decimal part of the day.

test__decimal_from_dms()[source]

Test that the method _decimal_from_dms correctly converts degrees, minutes, and seconds into a decimal number.

https://warble.com/blog/2017/11/05/virtually-hovering-over-holy-places/

The Shrine of Baha’u’llah: 32°56’36.86″N, 35°5’30.38″ E
The Shrine of The Bab: 32°48’52.49″N, 34°59’13.91″ E
The Guardian’s Resting Place: 51°37’21.85″N, 0°08’35.57″ W
test__degrees_from_hms()[source]

Test that the _degrees_from_hms method converts hours, minutes, and seconds into degrees properly.

test__delta_t()[source]

Test that the _delta_t method returns the correct delta T value for converting between UT and DT time.

To check for valid values see: https://planetcalc.com/9200/

test__dhms_from_seconds()[source]

Test that the _dhms_from_seconds method converts seconds into hours, minutes, and seconds properly.

test__dms_from_decimal()[source]

Test that the _dms_from_decimal method correctly converts a decimal representation of a latitude or longitude into degrees, minutes, and seconds.

test__eccentricity_earth_orbit()[source]

Test that the _eccentricity_earth_orbit method returns the correct values.

test__exact_from_meeus()[source]

Test that the _exact_from_meeus method returns the correct difference needed to compensate for the differences in the Meeus and the exact algorithms.

test__find_moment_of_equinoxes_or_solstices()[source]

Test that the _find_moment_of_equinoxes_or_solstices method returns the correct equinoxe and solstice R.D. moments for the given years.

test__heliocentric_ecliptical_latitude()[source]

Test that the _heliocentric_ecliptical_latitude method returns the correct values.

test__heliocentric_ecliptical_longitude()[source]

Test that the _heliocentric_ecliptical_longitude method returns the correct values.

test__hms_from_decimal_day()[source]

Test that the _hms_from_decimal_day method returns hours, minutes, and seconds deom a decimal number.

test__hms_from_degrees()[source]

Test that the _hms_from_degrees method converts degrees to hours, minutes, and seconds properly.

test__interpolation_from_three()[source]

Test that the _interpolation_from_three method interpolates from three values an estimate of a forth value.

See AA Example 3.a and 3.b

test__local_zone_correction()[source]

Test that the _local_zone_correction method converts a Julian Period day fraction to the without zone information to one with zone information.

test__mean_moon_elongation()[source]

Test that the _mean_moon_elongation method returns the correct values.

test__mean_sidereal_time_greenwich()[source]

Test that the _mean_sidereal_time_greenwich method returns the correct mean sidereal time.

test__meeus_from_exact()[source]

Test that the _meeus_from_exact method returns the correct difference needed to compensate for the differences in the exact and the Meeus algorithms.

test__moon_ascending_node_longitude()[source]

Test that the _moon_ascending_node_longitude method returns the correct values.

test__moon_latitude()[source]

Test that the _moon_latitude method returns the correct values.

test__moon_mean_anomaly()[source]

Test that the _moon_mean_anomaly method returns the correct values.

test__nutation_longitude()[source]

Test that the _nutation_longitude method returns the correct values.

test__nutation_obliquity()[source]

Test that the _nutation_obliquity method returns the correct values.

test__nutation_obliquity_longitude()[source]

Test that the _nutation_obliquity_longitude method returns the correct values.

test__poly()[source]

Test the poly (polynomial) lambda.

test__radius_vector()[source]

Test that the _radius_vector method returns the correct values.

test__rising_setting()[source]

https://www.timeanddate.com/sun/usa/boston?month=3&year=1988

rise=5.47 am, set=5.56 pm
lat 42.364506, lon -71.038887
(2447240.5, -71.0833, -5.0, 0),
test__sec_microsec_from_seconds()[source]

Test that the _sec_microsec_from_seconds method returns the seconds and microseconds from a second + partian as in 10.75 seconds.

test__seconds_from_dhms()[source]

Test that the _seconds_from_dhms method converts hours minutes, and seconds to seconds.

test__sigma()[source]

Test that the sigma method returns a sum of the provided lists wuth the given function (condition).

test__sin_deg()[source]

Test that the _sin_deg method returns the sine of theta (given in degrees).

test__sun_apparent_declination()[source]

Test that the _apparent_declination method returns the proper apparent declination measured (from 0° to 90°) from the equator, positive to the north, negative to the south.

test__sun_apparent_longitude()[source]

Test that the _sun_apparent_longitude returns the proper

test__sun_apparent_right_ascension()[source]

Test that the _sun_apparent_right_ascension method returns the correct angle based on the jde.

test__sun_earth_mean_anomaly()[source]

Test that the _sun_earth_mean_anomaly method returns the correct values.

test__sun_equation_of_center()[source]

Test that the _sun_equation_of_center method returns the correct values.

test__sun_mean_longitude()[source]

Test that the _sun_mean_longitude returns the proper angle from the sun.

test__sun_rising()[source]

Test that the _sun_rising method returns the correct sunrise.

test__sun_setting()[source]

Test that the _sun_setting method returns the correct sunset for a given date represented by a Julian Period day.

https://gml.noaa.gov/grad/solcalc/

test__sun_transit()[source]

Test that the _sun_transit method returns the correct transition based on the jde.

test__sun_true_longitude()[source]

Test that the _sun_true_longitude returns the proper

test__true_obliquity_of_ecliptic()[source]

Test that the _true_obliquity_of_ecliptic method returns the correct true obliquity of the ecliptic.

test__truncate_decimal()[source]

Test that the _truncate_decimal method correctly truncates a decimal value.

test__tz_decimal_from_dhms()[source]

Test that the _tz_decimal_from_dhms method converts hours, minutes, and seconds of a time zone to a decimal number representing degrees.

test__tz_dhms_from_decimal()[source]

Test that the _tz_dhms_from_decimal method returns converts a decimal number to hours, minutes, and seconds.

test__xor_boolean()[source]

Test that the _xor_boolean tests that any number of booleans can all be False or only one True.