Stellarium  1.2
Public Slots | Public Member Functions
MayaHaabCalendar Class Reference

The Maya Haab was a 365-day Solar calendar without intercalation. More...

#include <MayaHaabCalendar.hpp>

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (QVector< int > parts) override
 set date from a vector of calendar date elements sorted from the largest to the smallest. More...
 
QStringList getDateStrings () const override
 get a stringlist of calendar date elements sorted from the largest to the smallest. More...
 
QString getFormattedDateString () const override
 get a formatted complete string for a date
 
static int mayanYearBearerFromFixed (int rd)
 get tzolkin name index of Haab year bearer (name of 0 Pop) from Haab date This must be one of 2, 7, 12, 17. More...
 
static int mayanCalendarRoundOnOrBefore (QVector< int >haab, QVector< int >tzolkin, int rd)
 get RD of a given calendar round date on or before rd. They repeat every 18980 days.
 
static int mayanHaabOrdinal (QVector< int > haab)
 
static int mayanHaabOnOrBefore (QVector< int > haab, int rd)
 
static QVector< int > mayanHaabFromFixed (int rd)
 
- Public Slots inherited from Calendar
virtual void retranslate ()
 Translate e.g. stringlists of part names.
 
virtual void setJD (double JD)
 Set a calendar date from the Julian day number Subclasses set JD and compute the parts and possibly other data This triggers the partsChanged() signal.
 
virtual double getJD () const
 Get Julian day number from a calendar date.
 
virtual void setDate (QVector< int > parts)
 set date from a vector of calendar date elements sorted from the largest to the smallest. More...
 
virtual QVector< int > getDate () const
 get a vector of calendar date elements sorted from the largest to the smallest. More...
 
virtual QStringList getDateStrings () const
 get a stringlist of calendar date elements sorted from the largest to the smallest. More...
 
virtual QString getFormattedDateString () const
 get a formatted complete string for a date. The default implementation just concatenates all strings from getDateStrings() with a space in between.
 
static QString getFormattedDateString (QVector< int > date, QString sep=" ")
 get a formatted complete string for a date. This implementation just converts and concatenates all ints with sep in between.
 
static double rdNow ()
 Mostly for testing: return RD of current time.
 
static double rdJ2000 ()
 
static double momentFromJD (double jd, bool respectUTCoffset)
 Interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a "moment" in RD that represents JD. More...
 
static int fixedFromMoment (double rd)
 
static double timeFromMoment (double rd)
 
static int fixedFromJD (double jd, bool respectUTCoffset)
 Interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a fixed date in RD that represents noon of JD. More...
 
static double momentFromMJD (double mjd)
 
static double jdFromMoment (double rd, bool respectUTCoffset)
 interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a JD from an RD "moment" (including fractions of day) Stellarium extension: optionally includes local time zone offset. More...
 
static double jdFromFixed (double rd, bool respectUTCoffset)
 interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a JD from an RD "moment" (including fractions of day) Stellarium extension: optionally includes local time zone offset. More...
 
static double mjdFromFixed (double rd)
 
static int dayOfWeekFromFixed (int rd)
 weekday from RD date. CC.UE(1.60).
 
static int kdayOnOrBefore (const Calendar::Day k, const int rd)
 @Returns the R.D. of the nearest weekday k on or before rd
 
static int kdayOnOrAfter (const Calendar::Day k, const int rd)
 @Returns the R.D. of the nearest weekday k on or after rd
 
static int kdayNearest (const Calendar::Day k, const int rd)
 @Returns the R.D. of the nearest weekday k around rd
 
static int kdayBefore (const Calendar::Day k, const int rd)
 @Returns the R.D. of the nearest weekday k before rd
 
static int kdayAfter (const Calendar::Day k, const int rd)
 @Returns the R.D. of the nearest weekday k after rd
 
static double modInterval (double x, double a, double b)
 Interval modulus, CC.UE 1.24. More...
 
static int modInterval (int x, int a, int b)
 Interval modulus, CC.UE 1.24: This EXCLUDES the upper limit! Use StelUtils::amod(x, b) for CC's (x)mod[1..b].
 
static int rdCorrSum (QVector< int >parts, QVector< int >factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, QVector< int >radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (QVector< int >cand, QVector< int >range)
 Intersect a collection of candidates against a range of values. More...
 
static StelLocation location (const QString &name)
 retrieve a StelLocation from our database based on its name There is no check! Returned location may be default/empty.
 
static double direction (const StelLocation &locFrom, const StelLocation &locTo)
 Return azimuth direction (degrees from North) from locFrom to locTo.
 
static double direction (const QString &locFrom, const QString &locTo)
 
static double zoneFromLongitude (double lngDeg)
 
static double universalFromLocal (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double universalFromLocal (double rd_loc, const QString &loc)
 
static double localFromUniversal (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localFromUniversal (double rd_ut, const QString &loc)
 
static double standardFromUniversal (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double standardFromUniversal (double rd_ut, const QString &loc)
 
static double universalFromStandard (double rd_zone, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double universalFromStandard (double rd_zone, const QString &loc)
 
static double standardFromLocal (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double standardFromLocal (double rd_loc, const QString &loc)
 
static double localFromStandard (double rd_zone, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localFromStandard (double rd_zone, const QString &loc)
 
static double ephemerisCorrection (double rd)
 
static double dynamicalFromUniversal (double rd_ut)
 Correct rd_ut to Dynamical time.
 
static double universalFromDynamical (double rd_dt)
 Correct rd_dt to Universal time.
 
static double julianCenturies (double rd_ut)
 
static double equationOfTime (double rd_ut)
 
static double apparentFromLocal (double rd_local_mean, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double apparentFromLocal (double rd_local_mean, const QString &loc)
 
static double localFromApparent (double rd_local_app, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localFromApparent (double rd_local_app, const QString &loc)
 
static double apparentFromUniversal (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double apparentFromUniversal (double rd_ut, const QString &loc)
 
static double universalFromApparent (double rd_local_app, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double universalFromApparent (double rd_local_app, const QString &loc)
 
static double midnight (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double midnight (int rd, const QString &loc)
 
static double midday (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double midday (int rd, const QString &loc)
 
static double middayTehran (int rd)
 
static double siderealFromMoment (double rd_ut)
 
static double obliquity (double rd_ut)
 
static double declination (double rd_ut, double eclLat, double eclLong)
 
static double rightAscension (double rd_ut, double eclLat, double eclLong)
 
static double solarLongitude (double rd_ut)
 
static double nutation (double rd_ut)
 
static double aberration (double rd_ut)
 
static double solarLongitudeInv (double lng, double rdA, double rdB)
 binary search for the moment when solar longitude reaches lng in the time between rdA and rdB (used in CC:UE 14.36)
 
static double solarLongitudeAfter (double lng, double rd_ut)
 
static double seasonInGregorian (Calendar::Season season, int gYear)
 
static double urbanaWinter (int gYear)
 
static double precession (double rd_dt)
 
static double solarAltitude (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double solarAltitude (double rd_ut, const QString &loc)
 
static double estimatePriorSolarLongitude (double lambda, double rd_ut)
 
static double nthNewMoon (int n)
 
static double newMoonBefore (double rd_ut)
 
static double newMoonAtOrAfter (double rd_ut)
 
static double lunarLongitude (double rd_ut)
 
static double lunarLatitude (double rd_ut)
 
static double lunarDistance (double rd_ut)
 
static double meanLunarLongitude (double c)
 
static double lunarElongation (double c)
 
static double solarAnomaly (double c)
 
static double lunarAnomaly (double c)
 
static double moonNode (double c)
 
static double lunarNode (double rd_ut)
 
static double siderealLunarLongitude (double rd_ut, double siderealStart)
 
static double lunarPhase (double rd_ut)
 
static double lunarPhaseInv (double phi, double rdA, double rdB)
 binary search for the moment when lunar phase reaches phi in the time between rdA and rdB (CC:UE 14.57)
 
static double lunarPhaseAtOrBefore (double phi, double rd_ut)
 
static double lunarPhaseAtOrAfter (double phi, double rd_ut)
 
static double lunarAltitude (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double lunarAltitude (double rd_ut, const QString &loc)
 
static double lunarParallax (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double lunarParallax (double rd_ut, const QString &loc)
 
static double topocentricLunarAltitude (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double topocentricLunarAltitude (double rd_ut, const QString &loc)
 
static double approxMomentOfDepression (double rd_loc, double alpha, bool early, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double sineOffset (double rd_ut, double alpha, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double momentOfDepression (double rd_approx, double alpha, bool early, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double dawn (int rd, double alpha, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double dawn (int rd, double alpha, const QString &loc)
 
static double dusk (int rd, double alpha, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double dusk (int rd, double alpha, const QString &loc)
 
static double refraction (const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double refraction (const QString &loc)
 
static double sunrise (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double sunrise (int rd, const QString &loc)
 
static double sunset (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double sunset (int rd, const QString &loc)
 
static double dawnParis (int rd)
 For testing only: More...
 
static double sunsetJerusalem (int rd)
 
static double jewishSabbathEnds (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double jewishSabbathEnds (int rd, const QString &loc)
 
static double jewishDusk (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double jewishDusk (int rd, const QString &loc)
 
static double observedLunarAltitude (double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double observedLunarAltitude (double rd_ut, const QString &loc)
 
static double moonrise (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double moonrise (int rd, const QString &loc)
 
static double moonset (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double moonset (int rd, const QString &loc)
 
static double moonriseMecca (int rd)
 For testing only: Delivers local standard time.
 
static double moonsetMecca (int rd)
 
static double localZeroItalianHour (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localZeroItalianHour (double rd_loc, const QString &loc)
 
static double localZeroSunsetHour (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localZeroSunsetHour (double rd_loc, const QString &loc)
 
static double localZeroBabylonianHour (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localZeroBabylonianHour (double rd_loc, const QString &loc)
 
static double localFromItalian (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localFromItalian (double rd_loc, const QString &loc)
 
static double localFromSunsetHour (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localFromSunsetHour (double rd_loc, const QString &loc)
 
static double localFromBabylonian (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double localFromBabylonian (double rd_loc, const QString &loc)
 
static double italianFromLocal (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double italianFromLocal (double rd_loc, const QString &loc)
 
static double sunsetHourFromLocal (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double sunsetHourFromLocal (double rd_loc, const QString &loc)
 
static double babylonianFromLocal (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double babylonianFromLocal (double rd_loc, const QString &loc)
 
static double daytimeTemporalHour (const int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double daytimeTemporalHour (const int rd, const QString &loc)
 
static double nighttimeTemporalHour (const int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double nighttimeTemporalHour (const int rd, const QString &loc)
 
static double standardFromSundial (const double rd_ut, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double standardFromSundial (const double rd_ut, const QString &loc)
 
static double arcOfLight (double rd_loc)
 
static double simpleBestView (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double simpleBestView (int rd, const QString &loc)
 
static bool shaukatCriterion (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static bool shaukatCriterion (int rd, const QString &loc)
 
static double arcOfVision (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double arcOfVision (double rd_loc, const QString &loc)
 
static double bruinBestView (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double bruinBestView (int rd, const QString &loc)
 
static bool yallopCriterion (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static bool yallopCriterion (int rd, const QString &loc)
 
static double lunarSemiDiameter (double rd_loc, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double lunarSemiDiameter (double rd_loc, const QString &loc)
 
static double lunarDiameter (double rd_ut)
 
static bool visibleCrescent (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static bool visibleCrescent (int rd, const QString &loc)
 
static int phasisOnOrBefore (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static int phasisOnOrBefore (int rd, const QString &loc)
 
static int phasisOnOrAfter (int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static int phasisOnOrAfter (int rd, const QString &loc)
 

Public Member Functions

 MayaHaabCalendar (double jd)
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 

Additional Inherited Members

- Public Types inherited from Calendar
enum  Day {
  sunday = 0, monday, tuesday, wednesday,
  thursday, friday, saturday
}
 enum from CC.UE-ch1.12.
 
enum  Season { spring = 0, summer = 90, autumn = 180, winter = 270 }
 
enum  Phase { newMoon = 0, firstQuarter = 90, fullMoon = 180, lastQuarter = 270 }
 
- Signals inherited from Calendar
void partsChanged (QVector< int > parts)
 
void jdChanged (double jd)
 
- Static Public Attributes inherited from Calendar
constexpr static const double j2000 =730120.5
 RD of J2000.0 (CC:UE 14.19)
 
constexpr static const double jdEpoch =-1721424.5
 
constexpr static const double mjdEpoch =678576.0
 
constexpr static const int bogus =-1000000
 
static const StelLocation urbana
 
static const StelLocation greenwich
 
static const StelLocation mecca
 
static const StelLocation tehran
 
static const StelLocation paris
 
static const StelLocation jerusalem
 
static const StelLocation acre
 
static const StelLocation padua
 
- Protected Attributes inherited from Calendar
double JD
 
QVector< int > parts
 date expressed as JD(UT), including day fraction (ready to interact with the main application)
 
- Static Protected Attributes inherited from Calendar
static constexpr double meanTropicalYear =365.242189
 date expressed in the numerical parts of the calendar (usually the smallest part represents a day count) More...
 
static constexpr double meanSiderealYear =365.25636
 (CC:UE 14.32)
 
static constexpr double meanSynodicMonth =29.530588861
 (CC:UE 14.44)
 
static constexpr bool morning =true
 CC:UE 14.71.
 
static constexpr bool evening =false
 CC:UE 14.73.
 

Detailed Description

Similar to the Egyptian calendar, after 18 months of 20 days there was a short "month" of 5 extra days. The implementation follows CC.

Member Function Documentation

◆ getDateStrings

QStringList MayaHaabCalendar::getDateStrings ( ) const
overrideslot

monthName-day[0..19]

◆ mayanYearBearerFromFixed

static int MayaHaabCalendar::mayanYearBearerFromFixed ( int  rd)
staticslot

(TODO: write a test!)

◆ setDate

void MayaHaabCalendar::setDate ( QVector< int >  parts)
overrideslot

month[1..19]-day[0..19] We face a problem as the year is not counted. We can only find the date before current JD which matches the parts.