Stellarium  24.4
Data Structures
Calendars Plug-in

Data Structures

class  CalendarsDialog
 Main window of the Calendars plug-in. More...
 
class  CalendarsInfoPanel
 A screen widget similar to InfoPanel. More...
 
class  AstroHinduLunarCalendar
 Functions for the Hindu Lunisolar calendar based on hindu-astronomical functions described in CC:UE chapter 20. More...
 
class  AstroHinduSolarCalendar
 Functions for the Hindu Solar calendar based on hindu-astronomical functions described in CC:UE chapter 20. More...
 
class  BahaiArithmeticCalendar
 Functions for the Bahá´á Arithmetic calendar. More...
 
class  BahaiAstronomicalCalendar
 Functions for the Bahá´á Astronomical calendar. More...
 
class  Calendar
 Superclass for all calendars, capable of a multitude of astronomical calculations. More...
 
class  Calendars
 StelModule plugin which provides display and a scripting interface to a multitude of calendrical functions. More...
 
class  ChineseCalendar
 Functions for the Chinese calendar (1645 Qing dynasty version) More...
 
class  GregorianCalendar
 Functions for the Gregorian calendar. More...
 
class  JapaneseCalendar
 Functions for the Japanese calendar (as derived from the Chinese calendar) More...
 
class  JulianCalendar
 Functions for the Julian calendar. More...
 
class  KoreanCalendar
 Functions for the Korean calendar (as derived from the Chinese calendar) More...
 
class  NewHinduCalendar
 Functions for the New Hindu calendars described in CC:UE chapter 20. More...
 
class  NewHinduLunarCalendar
 New Hindu Lunar dates in the overridden interfacing methods from Calendar. More...
 
class  OldHinduLuniSolarCalendar
 Functions for the Old Hindu Lunisolar calendars described in CC:UE chapter 10. More...
 
class  OldHinduSolarCalendar
 Functions for the Old Hindu Solar calendar described in CC:UE chapter 10. More...
 
class  TibetanCalendar
 Functions for the Tibetan (Phuglugs) calendar. More...
 
class  VietnameseCalendar
 Functions for the Vietnamese calendar (as derived from the Chinese calendar) More...
 

Detailed Description

The Calendars plugin provides an interface to various calendars

The primary source of this plugin is the book "Calendrical Calculations: The Ultimate Edition" by Edward M. Reingold and Nachum Dershowitz (2018). It contains algorithmic descriptions of dozens of calendars and auxiliary functions, most of which should make their way into this plugin.

This book describes data conversion from and to calendars, using not the commonly used Julian Day number, but an intermediate number called Rata Die (R.D.; easily remembered by the authors' names), days counted from midnight of (proleptic) 1.1. of year 1 AD (Gregorian).

For the user, a simple selection GUI allows choosing which calendars should be displayed in the lower-right screen corner. Some more GUI tabs allow interaction with selected calendars.

A potentially great feature for owners of the book is that most functions from the book are available as scripting functions for the respective calendars. Just call objects by their classnames.

Examples:

core.output(JulianCalendar.isLeap(1700)); core.output(GregorianCalendar.isLeap(1700)); rd=GregorianCalendar.fixedFromGregorian{[2021, 3, 14]);

Take care that some data arguments are internally stored as QVector<int>, and translated to Arrays in ECMAscript. The various calendars may have array lengths of elements, which are not always checked. When a StelLocation argument is used in the internal function, a scripting function is available which allows specifying a location name in format "city, region". This also works with user-specified locations. Time zones only work correctly when specified (in the location database) as full specification like "Europe/Madrid", or in a generic offset spelling like "UTC+04:00" (but not "UT+4"). For use of "calendar locations" that have been used before timezones were introduced, we must work out longitude-dependent UTC offset that must be rounded to the nearest minute.

Occasionally, the time zone support will provide different results between Windows and other operating systems, esp. for historical data. See Qt documentation on QtTimeZone.


Data Structure Documentation

◆ CalendarsDialog

class CalendarsDialog

Main window of the Calendars plug-in.

Public Slots

void retranslate () override
 
- Public Slots inherited from StelDialog
virtual void styleChanged (const QString &style)
 Apply application style change.
 
virtual void retranslate ()=0
 Retranslate the content of the dialog. More...
 
virtual void setVisible (bool)
 On the first call with "true" populates the window contents.
 
virtual void close ()
 Closes the window (the window widget is not deleted, just not visible).
 
void handleMovedTo (QPoint newPos)
 Adds dialog location to config.ini; should be connected in createDialogContent()
 
virtual void handleDialogSizeChanged (QSizeF size)
 Stores dialog sizes into config.ini; should be connected from the proxy. More...
 

Protected Member Functions

void createDialogContent () override
 Initialize the dialog widgets and connect the signals/slots.
 

Additional Inherited Members

- Signals inherited from StelDialog
void visibleChanged (bool)
 
- Public Member Functions inherited from StelDialog
 StelDialog (const QString &dialogName=QString("Default"), QObject *parent=nullptr)
 
bool visible () const
 Returns true if the dialog contents have been constructed and are currently shown.
 
QString getDialogName () const
 
- Protected Slots inherited from StelDialog
bool askConfirmation (const QString &message=q_("Are you sure? This will delete your customized data."))
 
void messageBox (const QString &title, const QString &message)
 
void enableKineticScrolling (bool b)
 enable kinetic scrolling. This should be connected to StelApp's StelGui signal flagUseKineticScrollingChanged.
 
void handleFontChanged ()
 connect from StelApp to handle font and font size changes.
 
void handleColorSchemeChanged ()
 connect from StelApp to handle CSS style changes
 
virtual void updateNightModeProperty (bool n)
 
- Static Protected Member Functions inherited from StelDialog
static void connectCheckBox (QAbstractButton *checkBox, const QString &actionName)
 Helper function to connect a checkbox to the StelAction with the specified name.
 
static void connectCheckBox (QAbstractButton *checkBox, StelAction *action)
 Helper function to connect a checkbox to the given StelAction.
 
static void connectIntProperty (QLineEdit *lineEdit, const QString &propName)
 Helper function to connect a QLineEdit to an integer StelProperty. More...
 
static void connectIntProperty (QSpinBox *spinBox, const QString &propName)
 Helper function to connect a QSpinBox to an integer StelProperty. More...
 
static void connectIntProperty (QComboBox *comboBox, const QString &propName)
 Helper function to connect a QComboBox to an integer StelProperty. More...
 
static void connectIntProperty (QSlider *slider, const QString &propName, int minValue, int maxValue)
 Helper function to connect a QSlider to an double or float StelProperty. More...
 
static void connectDoubleProperty (QDoubleSpinBox *spinBox, const QString &propName)
 Helper function to connect a QDoubleSpinBox to an double or float StelProperty. More...
 
static void connectDoubleProperty (AngleSpinBox *spinBox, const QString &propName)
 Helper function to connect an AngleSpinBox to a double or float StelProperty representing decimal degrees. More...
 
static void connectDoubleProperty (QSlider *slider, const QString &propName, double minValue, double maxValue)
 Helper function to connect a QSlider to an double or float StelProperty. More...
 
static void connectStringProperty (QComboBox *comboBox, const QString &propName)
 Helper function to connect a QComboBox to a QString StelProperty. More...
 
static void connectStringProperty (QLineEdit *lineEdit, const QString &propName)
 Helper function to connect a QLineEdit to a QString StelProperty. More...
 
static void connectBoolProperty (QAbstractButton *checkBox, const QString &propName)
 Helper function to connect a checkbox to a bool StelProperty. More...
 
static void connectBoolProperty (QGroupBox *checkBox, const QString &propName)
 Helper function to connect a groupbox to a bool StelProperty. More...
 
- Protected Attributes inherited from StelDialog
QWidget * dialog
 The main dialog.
 
class CustomProxyproxy
 
QString dialogName
 The name should be set in derived classes' constructors and can be used to store and retrieve the panel locations.
 
QList< QWidget * > kineticScrollingList
 A list of widgets where kinetic scrolling can be activated or deactivated The list must be filled once, in the constructor or init() of fillDialog() etc. More...
 
- Properties inherited from StelDialog
bool visible
 

◆ CalendarsInfoPanel

class CalendarsInfoPanel

A screen widget similar to InfoPanel.

Contains output for selected calendars.

Public Slots

void updatePosition (bool resetPos=false)
 Update the position of the widget within the parent. More...
 

Public Member Functions

 CalendarsInfoPanel (Calendars *plugin, QGraphicsWidget *parent=nullptr)
 

Member Function Documentation

◆ updatePosition

void CalendarsInfoPanel::updatePosition ( bool  resetPos = false)
slot

Update the position of the widget within the parent.

Tied to the parent's geometryChanged() signal.

  • resetPos true to reset position into the lower right corner

◆ AstroHinduLunarCalendar

class AstroHinduLunarCalendar

Functions for the Hindu Lunisolar calendar based on hindu-astronomical functions described in CC:UE chapter 20.

Astro Hindu Lunar dates in the overridden interfacing methods from Calendar.

Author
Georg Zotti
Note
This class contains only the Calendar interfacing methods for the Hindu "Astro-Lunar" dates from CC:UE chapter 20. For scripting, you may use the methods found in class NewHinduCalendar directly.

Public Slots

void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts) override
 set RD 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 getFormattedPanchangString () override
 get a formatted string for displaying the "panchang", a set of tithi (lunar day), day of week, nakshatra, yoga, karana.
 
- Public Slots inherited from NewHinduLunarCalendar
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts) override
 set RD 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
 
virtual QString getFormattedPanchangString ()
 get a formatted string for displaying the "panchang", a set of tithi (lunar day), day of week, nakshatra, yoga, karana.
 
- Public Slots inherited from NewHinduCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 for the New Hindu Solar calendar sorted from the largest to the smallest. More...
 
QString getFormattedDateString () const override
 get a formatted complete string for the date in the New Hindu Solar calendar
 
static double hinduSineTable (const int entry)
 
static double hinduSine (const double theta)
 
static double hinduArcsin (const double amp)
 
static double hinduMeanPosition (const double rd_ut, const double period)
 
static double hinduTruePosition (const double rd_ut, const double period, const double size, const double anomalistic, const double change)
 
static double hinduSolarLongitude (const double rd_ut)
 
static int hinduZodiac (const double rd_ut)
 
static double hinduLunarLongitude (const double rd_ut)
 
static double hinduLunarPhase (const double rd_ut)
 
static int hinduLunarDayFromMoment (const double rd_ut)
 
static double hinduNewMoonBefore (const double rd_ut)
 
static int hinduCalendarYear (const double rd_ut)
 
static QVector< int > hinduSolarFromFixed (int rd)
 
static int fixedFromHinduSolar (const QVector< int > &parts)
 
static QVector< int > hinduLunarFromFixed (int rd)
 
static int fixedFromHinduLunar (const QVector< int > &parts)
 
static double hinduAscensionalDifference (const int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double hinduAscensionalDifference (const int rd, const QString &loc)
 
static double hinduTropicalLongitude (const double rd_ut)
 
static double hinduSolarSiderealDifference (const double rd_ut)
 
static double hinduDailyMotion (const double rd_ut)
 
static double hinduRisingSign (const double rd_ut)
 
static double hinduEquationOfTime (const double rd_ut)
 
static double hinduSunrise (const int rd)
 
static double hinduSunset (const int rd)
 
static double hinduStandardFromSundial (const int rd_ut)
 
static QVector< int > hinduFullMoonFromFixed (int rd)
 Alternative Lunar calendar counted from full moon to full moon. More...
 
static int fixedFromHinduFullMoon (const QVector< int > &parts)
 
static bool hinduExpunged (const int lYear, const int lMonth)
 test for expunged month (CC:UE 20.38)
 
static double altHinduSunrise (const int rd)
 Alternative sunrise formula (CC:UE 20.39)
 
static double siderealSolarLongitude (const double rd_ut)
 
static double ayanamsha (const double rd_ut)
 
static double siderealStart ()
 
static double astroHinduSunset (const int rd)
 
static int siderealZodiac (const double rd_ut)
 
static int astroHinduCalendarYear (const double rd_ut)
 
static QVector< int > astroHinduSolarFromFixed (const int rd)
 
static int fixedFromAstroHinduSolar (const QVector< int > &date)
 
static int astroLunarDayFromMoment (const double rd_ut)
 (CC:UE 20.47)
 
static QVector< int > astroHinduLunarFromFixed (const int rd)
 
static int fixedFromAstroHinduLunar (const QVector< int > &parts)
 
static double hinduSolarLongitudeInv (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 20.50)
 
static double hinduSolarLongitudeAtOrAfter (const double lambda, const double rd_ut)
 
static double meshaSamkranti (const int gYear)
 
static double hinduLunarPhaseInv (double phase, double rdA, double rdB)
 binary search for the moment when lunar phase reaches phi in the time between rdA and rdB (used in CC:UE 20.52)
 
static double hinduLunarDayAtOrAfter (const double k, const double rd_ut)
 
static double hinduLunarNewYear (const int gYear)
 
static bool hinduLunarOnOrBefore (const QVector< int > &date1, const QVector< int > &date2)
 
static int hinduDateOccur (const int lYear, const int lMonth, const int lDay)
 
static QVector< int > hinduLunarHoliday (const int lMonth, const int lDay, const int gYear)
 
static QVector< int > diwali (const int gYear)
 
static int hinduTithiOccur (const int lMonth, const int tithi, const double rd_ut, const int lYear)
 
static QVector< int > hinduLunarEvent (const int lMonth, const int tithi, const double rd_ut, const int gYear)
 
static QVector< int > shiva (const int gYear)
 
static QVector< int > rama (const int gYear)
 
static int hinduLunarStation (const int rd)
 
static int karana (const int n)
 
static int karanaForDay (const int rd)
 
static int yoga (const int rd)
 
static QVector< int > sacredWednesdays (const int gYear)
 
static QVector< int > sacredWednesdaysInRange (const QVector< int > &range)
 
- Public Slots inherited from OldHinduLuniSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromOldHinduLunar (const QVector< int > &parts)
 compute RD date from an Old Hindu Lunisolar date parts={ year, month, leap, day}
 
static QVector< int > oldHinduLunarFromFixed (int rd)
 return { year, month, leap, day}
 
static bool isLeap (int lYear)
 called old-hindu-lunar-leap-year?() in the CC.UE book.
 
- Public Slots inherited from OldHinduSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 hinduDayCount (int rd)
 Return Hindu day count from RD.
 
static int jovianYear (int rd)
 
static int fixedFromOldHinduSolar (const QVector< int > &parts)
 year index in Jovian cycle [1..60]
 
static QVector< int > oldHinduSolarFromFixed (int rd)
 
void setWeekdayStyle (int style)
 configure details for future output. More...
 
void setMonthStyle (int style)
 configure details for future output. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 AstroHinduLunarCalendar (double jd)
 
- Public Member Functions inherited from NewHinduLunarCalendar
 NewHinduLunarCalendar (double jd)
 
- Public Member Functions inherited from NewHinduCalendar
 NewHinduCalendar (double jd)
 
- Public Member Functions inherited from OldHinduLuniSolarCalendar
 OldHinduLuniSolarCalendar (double jd)
 
- Public Member Functions inherited from OldHinduSolarCalendar
 OldHinduSolarCalendar (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 NewHinduCalendar
constexpr static const double hinduSiderealYear =365.+279457./1080000.
 (CC:UE 20.1)
 
constexpr static const double hinduSiderealMonth =27.+4644439./14438334.
 (CC:UE 20.2)
 
constexpr static const double hinduSynodicMonth =29.+7087771./13358334.
 (CC:UE 20.3)
 
constexpr static const int hinduEpoch =-1132959
 
constexpr static const double hinduCreation =hinduEpoch-1955880000.*hinduSiderealYear
 (CC:UE 20.8)
 
constexpr static const double hinduAnomalisticYear =1577917828000./(4320000000.-387.)
 (CC:UE 20.9)
 
constexpr static const double hinduAnomalisticMonth =1577917828./(57753336.-488199.)
 (CC:UE 20.10)
 
constexpr static const int hinduSolarEra = 3179
 Saka era (CC:UE 20.19)
 
constexpr static const int hinduLunarEra = 3044
 Vikrama era (CC:UE 20.22)
 
static const StelLocation ujjain
 Sacred city in India to which we relate the calendar. (CC:UE 20.25)
 
static const StelLocation ujjainUTC
 Sacred city in India to which we relate the calendar, with timezone set to UTC. More...
 
static const StelLocation hinduLocation
 convention to one site to which we relate the calendar. More...
 
static QMap< int, QString > lunarStations
 
static QMap< int, QString > yogas
 
static QMap< int, QString > karanas
 
- Static Protected Attributes inherited from OldHinduLuniSolarCalendar
constexpr static const double aryaLunarMonth = 1577917500./53433336.0
 
constexpr static const double aryaLunarDay = aryaLunarMonth/30.0
 
static QMap< int, QString > monthNames
 
- Static Protected Attributes inherited from OldHinduSolarCalendar
static const int hinduEpoch
 
constexpr static const double aryaSolarYear = 1577917500./4320000.0
 
constexpr static const double aryaSolarMonth = aryaSolarYear/12.0
 
constexpr static const double aryaJovianPeriod = 1577917500./364224.0
 
static QMap< int, QString > weekDayNames
 
static QMap< int, QString > monthNames
 
static QMap< int, QString > jovianNames
 
- 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.
 

Member Function Documentation

◆ getDateStrings

QStringList AstroHinduLunarCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

Returns
{Year, Month, MonthName, leap[0|1], Day, DayName}

◆ setDate

void AstroHinduLunarCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set RD date from a vector of calendar date elements sorted from the largest to the smallest.

parts = {Year, Month[1...12], leapMonth[0|1], Day[1...30], leapDay[0|1] }

◆ AstroHinduSolarCalendar

class AstroHinduSolarCalendar

Functions for the Hindu Solar calendar based on hindu-astronomical functions described in CC:UE chapter 20.

Astro Hindu Solar dates in the overridden interfacing methods from Calendar.

Author
Georg Zotti
Note
This class contains only the Calendar interfacing methods for the Hindu "Astro-Solar" dates from CC:UE chapter 20. For scripting, you may use the methods found in class NewHinduCalendar directly.

Public Slots

void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts) override
 set RD 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 for the Hindu Astro Solar calendar sorted from the largest to the smallest. More...
 
- Public Slots inherited from NewHinduCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 for the New Hindu Solar calendar sorted from the largest to the smallest. More...
 
QString getFormattedDateString () const override
 get a formatted complete string for the date in the New Hindu Solar calendar
 
static double hinduSineTable (const int entry)
 
static double hinduSine (const double theta)
 
static double hinduArcsin (const double amp)
 
static double hinduMeanPosition (const double rd_ut, const double period)
 
static double hinduTruePosition (const double rd_ut, const double period, const double size, const double anomalistic, const double change)
 
static double hinduSolarLongitude (const double rd_ut)
 
static int hinduZodiac (const double rd_ut)
 
static double hinduLunarLongitude (const double rd_ut)
 
static double hinduLunarPhase (const double rd_ut)
 
static int hinduLunarDayFromMoment (const double rd_ut)
 
static double hinduNewMoonBefore (const double rd_ut)
 
static int hinduCalendarYear (const double rd_ut)
 
static QVector< int > hinduSolarFromFixed (int rd)
 
static int fixedFromHinduSolar (const QVector< int > &parts)
 
static QVector< int > hinduLunarFromFixed (int rd)
 
static int fixedFromHinduLunar (const QVector< int > &parts)
 
static double hinduAscensionalDifference (const int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double hinduAscensionalDifference (const int rd, const QString &loc)
 
static double hinduTropicalLongitude (const double rd_ut)
 
static double hinduSolarSiderealDifference (const double rd_ut)
 
static double hinduDailyMotion (const double rd_ut)
 
static double hinduRisingSign (const double rd_ut)
 
static double hinduEquationOfTime (const double rd_ut)
 
static double hinduSunrise (const int rd)
 
static double hinduSunset (const int rd)
 
static double hinduStandardFromSundial (const int rd_ut)
 
static QVector< int > hinduFullMoonFromFixed (int rd)
 Alternative Lunar calendar counted from full moon to full moon. More...
 
static int fixedFromHinduFullMoon (const QVector< int > &parts)
 
static bool hinduExpunged (const int lYear, const int lMonth)
 test for expunged month (CC:UE 20.38)
 
static double altHinduSunrise (const int rd)
 Alternative sunrise formula (CC:UE 20.39)
 
static double siderealSolarLongitude (const double rd_ut)
 
static double ayanamsha (const double rd_ut)
 
static double siderealStart ()
 
static double astroHinduSunset (const int rd)
 
static int siderealZodiac (const double rd_ut)
 
static int astroHinduCalendarYear (const double rd_ut)
 
static QVector< int > astroHinduSolarFromFixed (const int rd)
 
static int fixedFromAstroHinduSolar (const QVector< int > &date)
 
static int astroLunarDayFromMoment (const double rd_ut)
 (CC:UE 20.47)
 
static QVector< int > astroHinduLunarFromFixed (const int rd)
 
static int fixedFromAstroHinduLunar (const QVector< int > &parts)
 
static double hinduSolarLongitudeInv (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 20.50)
 
static double hinduSolarLongitudeAtOrAfter (const double lambda, const double rd_ut)
 
static double meshaSamkranti (const int gYear)
 
static double hinduLunarPhaseInv (double phase, double rdA, double rdB)
 binary search for the moment when lunar phase reaches phi in the time between rdA and rdB (used in CC:UE 20.52)
 
static double hinduLunarDayAtOrAfter (const double k, const double rd_ut)
 
static double hinduLunarNewYear (const int gYear)
 
static bool hinduLunarOnOrBefore (const QVector< int > &date1, const QVector< int > &date2)
 
static int hinduDateOccur (const int lYear, const int lMonth, const int lDay)
 
static QVector< int > hinduLunarHoliday (const int lMonth, const int lDay, const int gYear)
 
static QVector< int > diwali (const int gYear)
 
static int hinduTithiOccur (const int lMonth, const int tithi, const double rd_ut, const int lYear)
 
static QVector< int > hinduLunarEvent (const int lMonth, const int tithi, const double rd_ut, const int gYear)
 
static QVector< int > shiva (const int gYear)
 
static QVector< int > rama (const int gYear)
 
static int hinduLunarStation (const int rd)
 
static int karana (const int n)
 
static int karanaForDay (const int rd)
 
static int yoga (const int rd)
 
static QVector< int > sacredWednesdays (const int gYear)
 
static QVector< int > sacredWednesdaysInRange (const QVector< int > &range)
 
- Public Slots inherited from OldHinduLuniSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromOldHinduLunar (const QVector< int > &parts)
 compute RD date from an Old Hindu Lunisolar date parts={ year, month, leap, day}
 
static QVector< int > oldHinduLunarFromFixed (int rd)
 return { year, month, leap, day}
 
static bool isLeap (int lYear)
 called old-hindu-lunar-leap-year?() in the CC.UE book.
 
- Public Slots inherited from OldHinduSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 hinduDayCount (int rd)
 Return Hindu day count from RD.
 
static int jovianYear (int rd)
 
static int fixedFromOldHinduSolar (const QVector< int > &parts)
 year index in Jovian cycle [1..60]
 
static QVector< int > oldHinduSolarFromFixed (int rd)
 
void setWeekdayStyle (int style)
 configure details for future output. More...
 
void setMonthStyle (int style)
 configure details for future output. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 AstroHinduSolarCalendar (double jd)
 
- Public Member Functions inherited from NewHinduCalendar
 NewHinduCalendar (double jd)
 
- Public Member Functions inherited from OldHinduLuniSolarCalendar
 OldHinduLuniSolarCalendar (double jd)
 
- Public Member Functions inherited from OldHinduSolarCalendar
 OldHinduSolarCalendar (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 NewHinduCalendar
constexpr static const double hinduSiderealYear =365.+279457./1080000.
 (CC:UE 20.1)
 
constexpr static const double hinduSiderealMonth =27.+4644439./14438334.
 (CC:UE 20.2)
 
constexpr static const double hinduSynodicMonth =29.+7087771./13358334.
 (CC:UE 20.3)
 
constexpr static const int hinduEpoch =-1132959
 
constexpr static const double hinduCreation =hinduEpoch-1955880000.*hinduSiderealYear
 (CC:UE 20.8)
 
constexpr static const double hinduAnomalisticYear =1577917828000./(4320000000.-387.)
 (CC:UE 20.9)
 
constexpr static const double hinduAnomalisticMonth =1577917828./(57753336.-488199.)
 (CC:UE 20.10)
 
constexpr static const int hinduSolarEra = 3179
 Saka era (CC:UE 20.19)
 
constexpr static const int hinduLunarEra = 3044
 Vikrama era (CC:UE 20.22)
 
static const StelLocation ujjain
 Sacred city in India to which we relate the calendar. (CC:UE 20.25)
 
static const StelLocation ujjainUTC
 Sacred city in India to which we relate the calendar, with timezone set to UTC. More...
 
static const StelLocation hinduLocation
 convention to one site to which we relate the calendar. More...
 
static QMap< int, QString > lunarStations
 
static QMap< int, QString > yogas
 
static QMap< int, QString > karanas
 
- Static Protected Attributes inherited from OldHinduLuniSolarCalendar
constexpr static const double aryaLunarMonth = 1577917500./53433336.0
 
constexpr static const double aryaLunarDay = aryaLunarMonth/30.0
 
static QMap< int, QString > monthNames
 
- Static Protected Attributes inherited from OldHinduSolarCalendar
static const int hinduEpoch
 
constexpr static const double aryaSolarYear = 1577917500./4320000.0
 
constexpr static const double aryaSolarMonth = aryaSolarYear/12.0
 
constexpr static const double aryaJovianPeriod = 1577917500./364224.0
 
static QMap< int, QString > weekDayNames
 
static QMap< int, QString > monthNames
 
static QMap< int, QString > jovianNames
 
- 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.
 

Member Function Documentation

◆ getDateStrings

QStringList AstroHinduSolarCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements for the Hindu Astro Solar calendar sorted from the largest to the smallest.

{Year, Month, MonthName, Day, WeekDayName}

◆ setDate

void AstroHinduSolarCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set RD date from a vector of calendar date elements sorted from the largest to the smallest.

parts = {Year, Month[1...12], leapMonth[0|1], Day[1...30], leapDay[0|1] }

◆ BahaiArithmeticCalendar

class BahaiArithmeticCalendar

Functions for the Bahá´á Arithmetic calendar.

Author
Georg Zotti

The Bahá´í faith, founded in 1844, uses its own calendar, based on the number 19. Until 2015 the calendar was based on the Gregorian calendar. This is the version implemented here.

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromBahaiArithmetic (const QVector< int > &bahai5)
 Return R.D. of date given in the Bahai Arithmetic calendar. (CC:UE 16.3)
 
static QVector< int > bahaiArithmeticFromFixed (int rd)
 Return R.D. More...
 
static int bahaiNewYear (int gYear)
 Return R.D. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

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

Static Public Attributes

static const int bahaiEpoch
 
constexpr static const int ayyam_i_Ha = 0
 
- 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
 

Static Protected Attributes

static QMap< int, QString > weekDayNames
 
static QMap< int, QString > cycleNames
 
static QMap< int, QString > yearNames
 
- 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.
 

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)
 
- 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)
 

Member Function Documentation

◆ bahaiArithmeticFromFixed

static QVector<int> BahaiArithmeticCalendar::bahaiArithmeticFromFixed ( int  rd)
staticslot

Return R.D.

of date given in the Bahai Arithmetic calendar. (CC:UE 16.4) return major-cycle-year-month-day for RD date

◆ bahaiNewYear

static int BahaiArithmeticCalendar::bahaiNewYear ( int  gYear)
staticslot

Return R.D.

of new year date in the Bahai Arithmetic for the given Gregorian year. (CC:UE 16.10) return RD date

◆ getDateStrings

QStringList BahaiArithmeticCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

Year, Month, MonthName, Day, DayName

◆ setDate

void BahaiArithmeticCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

Year-Month[1...12]-Day[1...31]

◆ BahaiAstronomicalCalendar

class BahaiAstronomicalCalendar

Functions for the Bahá´á Astronomical calendar.

Author
Georg Zotti

The Bahá´í faith, founded in 1844, uses its own calendar, based on the number 19. Until 2015 the calendar was based on the Gregorian calendar, then a more accurate astronomical calendar was decreed. This is the version implemented here.

Public Slots

void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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...
 
static double bahaiSunset (int rd)
 Return moment of sunset in Tehran as defined by Bahai astronomical calendar rules. (CC:UE 16.6)
 
static int astroBahaiNewYearOnOrBefore (int rd)
 Return RD of New year (CC:UE 16.7)
 
static int fixedFromBahaiAstronomical (const QVector< int > &bahai5)
 Return R.D. of date given in the Bahai Astronomical calendar. (CC:UE 16.8)
 
static QVector< int > bahaiAstronomicalFromFixed (int rd)
 Return R.D. More...
 
static int nawRuz (int gYear)
 Return R.D. of new year date in the Bahai Astronomical calendar for the given Gregorian year. (CC:UE 16.11)
 
static int feastOfRidvan (int gYear)
 Return R.D. of Ridvan in the Bahai Astronomical calendar for the given Gregorian year. (CC:UE 16.12)
 
static int birthOfTheBab (int gYear)
 Return R.D. of the birth of the Bab in the Bahai Astronomical calendar for the given Gregorian year. (CC:UE 16.13)
 
- Public Slots inherited from BahaiArithmeticCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromBahaiArithmetic (const QVector< int > &bahai5)
 Return R.D. of date given in the Bahai Arithmetic calendar. (CC:UE 16.3)
 
static QVector< int > bahaiArithmeticFromFixed (int rd)
 Return R.D. More...
 
static int bahaiNewYear (int gYear)
 Return R.D. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 BahaiAstronomicalCalendar (double jd)
 
- Public Member Functions inherited from BahaiArithmeticCalendar
 BahaiArithmeticCalendar (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 BahaiArithmeticCalendar
static const int bahaiEpoch
 
constexpr static const int ayyam_i_Ha = 0
 
- 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 BahaiArithmeticCalendar
static QMap< int, QString > weekDayNames
 
static QMap< int, QString > cycleNames
 
static QMap< int, QString > yearNames
 
- 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.
 

Member Function Documentation

◆ bahaiAstronomicalFromFixed

static QVector<int> BahaiAstronomicalCalendar::bahaiAstronomicalFromFixed ( int  rd)
staticslot

Return R.D.

of date given in the Bahai Astronomical calendar. (CC:UE 16.9) return major-cycle-year-month-day for RD date

◆ getDateStrings

QStringList BahaiAstronomicalCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

Year, Month, MonthName, Day, DayName

◆ setDate

void BahaiAstronomicalCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

Year-Month[1...12]-Day[1...31]

◆ Calendar

class Calendar

Superclass for all calendars, capable of a multitude of astronomical calculations.

Author
Georg Zotti

Stellarium uses Julian Day numbers internally, and the conventional approach of using the Gregorian calendar for dates after 1582-10-15. For dates before that, the Julian calendar is used, in the form finalized by Augustus and running unchanged since 8 A.D. Astronomical year counting implies having a year 0, while some calendars adhere to historical counting where 1 B.C. immediately precedes 1 A.D. Some European countries, especially the Protestant countries, delayed the calendar switch well into the 18th century. Other cultures have various other calendar schemes. All calendars implemented here have a numerical vector of integer time elements and may have individual string lists for names of elements like "week days" and "months". If the pattern of weeks and months does not apply, the names may refer to other structural elements.

The most important source used here is: Edward M. Reingold, Nachum Dershowitz: Calendrical Calculations in various editions (1997-2018), referred to as CC. In particular CC:ME=2nd "Millennium edition", CC:UE=4th "Ultimate Edition", with amendments published until January 2022. It describes the Gregorian calendar with year zero, and the Julian without. In this plugin only, we adhere to this convention to finally have all possible variations of dates. It does not use JD directly but a number called Rata Die (RD=JD-1721424.5), a day count starting at midnight of January 1st, 1 AD (Proleptic Gregorian). with functions including "fixed" in their names. Our calendar subclasses can use Calendar::fixedFromJD(jd) / Calendar::jdFromFixed(rd). Other functions with "moment" in their names use double arguments which are RD with fractions of day. Argument names with "_ut" added indicate the RD is given in UT, not local time.

Most functions are static, with names derived from the functions given in Lisp in CC:UE. Most calendars have dates which can be described in lists of integers. Some functions require a StelLocation argument. For accessibility as Stellarium scripting functions, argument order was changed to place the location argument as last and declare it with a default value of the current location, so that it can be used in scripting. Currently, other, non-default StelLocation arguments cannot be used with scripting.

Note
The astronomical functions in parts make use of Stellarium's built-in astronomy instead of the algorithms given in CC. A notable difference consists already around DeltaT, where Stellarium uses a special correction for the Lunar theory which other software titles don't use, therefore testing the results in the book's appendix will provide slight deviations.

Public Types

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 }
 

Public Slots

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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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)
 

Signals

void partsChanged (QVector< int > parts)
 
void jdChanged (double jd)
 

Public Member Functions

 Calendar (double jd)
 

Static Public Attributes

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

double JD
 
QVector< int > parts
 date expressed as JD(UT), including day fraction (ready to interact with the main application)
 

Static Protected Attributes

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.
 

Member Function Documentation

◆ aberration

static double Calendar::aberration ( double  rd_ut)
staticslot
Returns
aberration in degrees for moment rd_ut (CC:UE 14.35)

◆ apparentFromLocal

static double Calendar::apparentFromLocal ( double  rd_local_mean,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
moment (RD in local mean solar time) corrected by equation of time (CC:UE 14.21)

◆ apparentFromUniversal

static double Calendar::apparentFromUniversal ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
moment (RD in UT) corrected into apparent time by equation of time and location (CC:UE 14.23)

◆ approxMomentOfDepression

static double Calendar::approxMomentOfDepression ( double  rd_loc,
double  alpha,
bool  early,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd of local mean solar time when sun is alpha degrees below math. horizon. (CC:UE 14.68)
Note
argument order is different from CC:UE
not available to scripting.

◆ arcOfLight

static double Calendar::arcOfLight ( double  rd_loc)
staticslot
Returns
elongation of the Moon (CC:UE 14.95)

◆ babylonianFromLocal

static double Calendar::babylonianFromLocal ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
Babylonian time from local time (extending idea from CC:UE 14.88)

◆ dawn

static double Calendar::dawn ( int  rd,
double  alpha,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
fraction of day (Zone Time!) of when sun is alpha degrees below horizon in the morning (or bogus when the sun does not reach it) (CC:UE 14.72)
Note
The angle argument alpha must be positive for negative solar elevations!
argument order is different from CC:UE

◆ dawnParis

static double Calendar::dawnParis ( int  rd)
inlinestaticslot

For testing only:

Returns
Standard (Zone) time of Paris dawn (-18°)

◆ daytimeTemporalHour

static double Calendar::daytimeTemporalHour ( const int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
length of a temporal day hour at date rd and location loc. (CC:UE 14.89)

◆ declination

static double Calendar::declination ( double  rd_ut,
double  eclLat,
double  eclLong 
)
staticslot
Returns
declination for time-dependent ecliptical coordinates degrees

◆ dusk

static double Calendar::dusk ( int  rd,
double  alpha,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
fraction of day (Zone Time!) of when sun is alpha degrees below horizon in the evening (or bogus when the sun does not reach it) (CC:UE 14.74)
Note
The angle argument alpha must be positive for negative solar elevations!
argument order is different from CC:UE

◆ ephemerisCorrection

static double Calendar::ephemerisCorrection ( double  rd)
staticslot
Returns
DeltaT in fractions of day. This utilizes Stellarium's solution.

◆ equationOfTime

static double Calendar::equationOfTime ( double  rd_ut)
staticslot
Returns
equation of time in fractions of a day
Note
We use functions from Stellarium instead of the functions from CC:UE 14.20.

◆ estimatePriorSolarLongitude

static double Calendar::estimatePriorSolarLongitude ( double  lambda,
double  rd_ut 
)
staticslot
Returns
an estimate for the moment (RD_UT) before rd_ut when sun has reached lambda (CC:UE 14.42)

◆ fixedFromJD

static int Calendar::fixedFromJD ( double  jd,
bool  respectUTCoffset 
)
inlinestaticslot

Interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a fixed date in RD that represents noon of JD.

Stellarium extension: optionally includes local time zone offset. In most calendar interfacing functions, respectUTCoffset should be true.

◆ getDate

virtual QVector<int> Calendar::getDate ( ) const
inlinevirtualslot

get a vector of calendar date elements sorted from the largest to the smallest.

The order depends on the actual calendar

Note
this also works with scripting. The result can be further processed. E.g. core.output("Baktun: " + MayaLongCountCalendar.getDateL()[0]);

◆ getDateStrings

virtual QStringList Calendar::getDateStrings ( ) const
inlinevirtualslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

The order depends on the actual calendar For scripting use, you can extract single elements, like: core.output("Tzolkin name: " + MayaTzolkinCalendar.getDateStrings()[1]);

◆ intersectWithRange

static QVector<int> Calendar::intersectWithRange ( const QVector< int > &  cand,
const QVector< int > &  range 
)
staticslot

Intersect a collection of candidates against a range of values.

Returns
a new QVector<int> with all elements from candidates which lie in range

◆ italianFromLocal

static double Calendar::italianFromLocal ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
Italian time from local time (CC:UE 14.88)

◆ jdFromFixed

static double Calendar::jdFromFixed ( double  rd,
bool  respectUTCoffset 
)
inlinestaticslot

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.

In most calendar interfacing functions, respectUTCoffset should be true.

◆ jdFromMoment

static double Calendar::jdFromMoment ( double  rd,
bool  respectUTCoffset 
)
staticslot

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.

In most calendar interfacing functions, respectUTCoffset should be true.

◆ jewishDusk

static double Calendar::jewishDusk ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore()->getCurrentLocation() 
)
inlinestaticslot
Returns
fraction of day (Zone Time!) of when sun is 4°40' degrees below horizon in the evening (or bogus when the sun does not reach it) (CC:UE 14.81)
Note
this may be the criterium for other days.

◆ jewishSabbathEnds

static double Calendar::jewishSabbathEnds ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore()->getCurrentLocation() 
)
inlinestaticslot
Returns
fraction of day (Zone Time!) of when sun is 7.5 degrees below horizon in the evening (or bogus when the sun does not reach it) (CC:UE 14.80)
Note
this is a criterium for some Jews only.

◆ julianCenturies

static double Calendar::julianCenturies ( double  rd_ut)
staticslot
Returns
Julian centuries since j2000 in dynamical time (for ephemeris calculations) CC:UE 14.18

◆ localFromApparent

static double Calendar::localFromApparent ( double  rd_local_app,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
moment (RD in local apparent solar time) corrected by equation of time into local mean solar time (CC:UE 14.22)

◆ localFromBabylonian

static double Calendar::localFromBabylonian ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
local time from Babylonian time (extending idea from CC:UE 14.87)

◆ localFromItalian

static double Calendar::localFromItalian ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
local time from Italian time (CC:UE 14.87)

◆ localFromStandard

static double Calendar::localFromStandard ( double  rd_zone,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd or fractions of day in local mean time (longitude dependent) from local zone time

◆ localFromSunsetHour

static double Calendar::localFromSunsetHour ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
local time from Sunset time (extending idea from CC:UE 14.87)

◆ localFromUniversal

static double Calendar::localFromUniversal ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd or fractions of day augmented from UT to local mean time (longitude dependent)

◆ localZeroBabylonianHour

static double Calendar::localZeroBabylonianHour ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
local time of the start of Babylonian hour counting with sunrise (fraction of day)
Note
This extends CC:UE 14.86 by allowing another location and showing the reverse counting.

◆ localZeroItalianHour

static double Calendar::localZeroItalianHour ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
local time of the start of Italian hour counting, a half hour after sunset (fraction of day)
Note
This extends CC:UE 14.86 by allowing another location. Use Calendar::padua for the default solution

◆ localZeroSunsetHour

static double Calendar::localZeroSunsetHour ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
local time of the start of Italian-style hour counting, but starting at sunset (fraction of day)
Note
This extends CC:UE 14.86 by allowing another location and keeping the sunset time.

◆ lunarAltitude

static double Calendar::lunarAltitude ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
altitude of the moon at loc, degrees. (CC:UE 14.64)
Note
The result has not been corrected for parallax or refraction

◆ lunarAnomaly

static double Calendar::lunarAnomaly ( double  c)
staticslot
Returns
lunar anomaly at Julian century c (CC:UE 14.52)

◆ lunarDistance

static double Calendar::lunarDistance ( double  rd_ut)
staticslot
Returns
lunar distance [metres] at rd_ut (CC:UE 14.65, actually Meeus AA2 ch.47)

◆ lunarElongation

static double Calendar::lunarElongation ( double  c)
staticslot
Returns
lunar elongation at Julian century c (CC:UE 14.50)

◆ lunarLatitude

static double Calendar::lunarLatitude ( double  rd_ut)
staticslot
Returns
lunar latitude at rd_ut (CC:UE 14.63, actually Meeus AA2 ch.47)

◆ lunarLongitude

static double Calendar::lunarLongitude ( double  rd_ut)
staticslot
Returns
lunar longitude at rd_ut (CC:UE 14.48, actually Meeus AA2 ch.47)

◆ lunarNode

static double Calendar::lunarNode ( double  rd_ut)
staticslot
Returns
longitude of lunar node at moment rd_ut (CC:UE 14.54)
Note
this is shifted into [-180...180)

◆ lunarParallax

static double Calendar::lunarParallax ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
lunar parallax [degrees] at RD rd_ut. (CC:UE 14.66)

◆ lunarPhase

static double Calendar::lunarPhase ( double  rd_ut)
staticslot
Returns
lunar phase (angular difference in ecliptical longitude from the sun) at moment rd_ut (CC:UE 14.56)

◆ lunarPhaseAtOrAfter

static double Calendar::lunarPhaseAtOrAfter ( double  phi,
double  rd_ut 
)
staticslot
Returns
rd of moment when phase will next be phi [degrees] after rd_ut (CC:UE 14.58)

◆ lunarPhaseAtOrBefore

static double Calendar::lunarPhaseAtOrBefore ( double  phi,
double  rd_ut 
)
staticslot
Returns
rd of moment when phase was phi [degrees] before rd_ut (CC:UE 14.57)

◆ meanLunarLongitude

static double Calendar::meanLunarLongitude ( double  c)
staticslot
Returns
mean lunar longitude at Julian century c (CC:UE 14.49)

◆ midday

static double Calendar::midday ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
RD (UT) of True (Solar) Noon from RD and location (CC:UE 14.26)

◆ middayTehran

static double Calendar::middayTehran ( int  rd)
inlinestaticslot
Returns
RD (Tehran zone time) of meridian transit.
Note
for testing only

◆ midnight

static double Calendar::midnight ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
RD (UT) of True (solar) Midnight from RD and location (CC:UE 14.25)

◆ modInterval

static double Calendar::modInterval ( double  x,
double  a,
double  b 
)
staticslot

Interval modulus, CC.UE 1.24.

Returns
x shifted to lie inside [a...b), EXCLUDING b.

◆ momentFromJD

static double Calendar::momentFromJD ( double  jd,
bool  respectUTCoffset 
)
staticslot

Interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a "moment" in RD that represents JD.

Stellarium extension: include local time zone offset. In most calendar interfacing functions, respectUTCoffset should be true.

◆ momentOfDepression

static double Calendar::momentOfDepression ( double  rd_approx,
double  alpha,
bool  early,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd of , rd. (CC:UE 14.70)
Note
argument order is different from CC:UE
not available to scripting.

◆ moonNode

static double Calendar::moonNode ( double  c)
staticslot
Returns
longitude of lunar node at Julian century c (CC:UE 14.53)

◆ moonrise

static double Calendar::moonrise ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
moment of moonrise in RD (Universal Time) (CC:UE 14.83)

◆ moonset

static double Calendar::moonset ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
moment of moonset in RD (Universal Time) (CC:UE 14.84)

◆ newMoonAtOrAfter

static double Calendar::newMoonAtOrAfter ( double  rd_ut)
staticslot
Returns
RD of New Moon on or after rd_ut (CC:UE 14.47)

◆ newMoonBefore

static double Calendar::newMoonBefore ( double  rd_ut)
staticslot
Returns
RD of New Moon before rd_ut (CC:UE 14.46)

◆ nighttimeTemporalHour

static double Calendar::nighttimeTemporalHour ( const int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
length of a temporal night hour at date rd and location loc. (CC:UE 14.90)

◆ nthNewMoon

static double Calendar::nthNewMoon ( int  n)
staticslot
Returns
RD of n-th new moon after RD0. (CC:UE 14.45, following Meeus AA2, ch.49)

◆ nutation

static double Calendar::nutation ( double  rd_ut)
staticslot
Returns
nutation in degrees for moment rd_ut (CC:UE 14.34, but we use our own solution)

◆ obliquity

static double Calendar::obliquity ( double  rd_ut)
staticslot
Returns
obliquity of the ecliptic, degrees (CC:UE 14.28, but we use our own solution)

◆ observedLunarAltitude

static double Calendar::observedLunarAltitude ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
apparent altitude of moon (CC:UE 14.83)

◆ phasisOnOrAfter

static int Calendar::phasisOnOrAfter ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
next date of first crescent (CC:UE 14.105)

◆ phasisOnOrBefore

static int Calendar::phasisOnOrBefore ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
previous date (RD) of first crescent (CC:UE 14.104)

◆ precession

static double Calendar::precession ( double  rd_dt)
staticslot
Returns
precession in ecliptical longitude since moment rd_dt (CC:UE 14.39, which is from Meeus AA 21.6/21.7.)

◆ refraction

static double Calendar::refraction ( const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation())
staticslot
Returns
refraction at the mathematical horizon of location loc, taking into account dip correction for altitude (CC:UE 14.75)
Note
in the book a first argument t is specified but unused.

◆ rightAscension

static double Calendar::rightAscension ( double  rd_ut,
double  eclLat,
double  eclLong 
)
staticslot
Returns
right ascension for time-dependent ecliptical coordinates degrees

◆ seasonInGregorian

static double Calendar::seasonInGregorian ( Calendar::Season  season,
int  gYear 
)
staticslot
Returns
rd_ut of season begin (CC:UE 14.37)

◆ setDate

virtual void Calendar::setDate ( const QVector< int > &  parts)
inlinevirtualslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

This triggers the jdChanged() signal Note that this must not change the time of day! You must retrieve the time from the current JD before recomputing a new JD. You can also use this with scripting by calling the actual calendars, like GregorianCalendar.setDate([2023, 3, 4]); // This changes the date in the program! MayaLongCountCalendar.setDate([13, 0, 0, 0, 1]); // This changes the date in the program!

Note
No check is made for the number of elements, which depends on the actual calendar.

◆ shaukatCriterion

static bool Calendar::shaukatCriterion ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
true or false according to Shaukat (CC:UE 14.97)

◆ siderealFromMoment

static double Calendar::siderealFromMoment ( double  rd_ut)
staticslot
Returns
sidereal time (at Greenwich) at moment rd_ut (CC:UE 14.27, but we use our own solution)
Note
this does not take location into account, it's sidereal time at Greenwich.

◆ siderealLunarLongitude

static double Calendar::siderealLunarLongitude ( double  rd_ut,
double  siderealStart 
)
staticslot
Returns
sidereal lunar longitude counted from some other point. (CC:UE 14.55)

◆ simpleBestView

static double Calendar::simpleBestView ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd_ut of good lunar visibility (CC:UE 14.96)

◆ sineOffset

static double Calendar::sineOffset ( double  rd_ut,
double  alpha,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
sine of the angle alpha between where the sun is at rd_ut and where it is at its position of interest (CC:UE 14.69)
Note
argument order is different from CC:UE
not available to scripting.

◆ solarAltitude

static double Calendar::solarAltitude ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
altitude of the sun at loc, degrees. (CC:UE 14.41)

◆ solarAnomaly

static double Calendar::solarAnomaly ( double  c)
staticslot
Returns
solar anomaly at Julian century c (CC:UE 14.51)

◆ solarLongitude

static double Calendar::solarLongitude ( double  rd_ut)
staticslot
Returns
solar longitude [degrees] for moment RD_UT (CC:UE 14.33, but we use our own solution)

◆ solarLongitudeAfter

static double Calendar::solarLongitudeAfter ( double  lng,
double  rd_ut 
)
staticslot
Returns
moment (RD_UT) of when the sun first reaches lng [degrees] after rd_ut (CC:UE 14.36)

◆ standardFromLocal

static double Calendar::standardFromLocal ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd or fractions of day in local zone time from local mean time

◆ standardFromSundial

static double Calendar::standardFromSundial ( const double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
standard time from "temporal" sundial time (CC:UE 14.91)

◆ standardFromUniversal

static double Calendar::standardFromUniversal ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd or fractions of day augmented from UT to local zone time

◆ sunrise

static double Calendar::sunrise ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
fraction of day for the moment of sunrise in loc's standard (Zone) time (CC:UE 14.76)

◆ sunset

static double Calendar::sunset ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
fraction of day for the moment of sunset in loc's standard (Zone) time (CC:UE 14.77)

◆ sunsetHourFromLocal

static double Calendar::sunsetHourFromLocal ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
Sunset time from local time (extending idea from CC:UE 14.88)

◆ sunsetJerusalem

static double Calendar::sunsetJerusalem ( int  rd)
inlinestaticslot
Returns
Standard (Zone) time of Jerusalem sunset

◆ topocentricLunarAltitude

static double Calendar::topocentricLunarAltitude ( double  rd_ut,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
altitude of the moon at loc, degrees. (CC:UE 14.67)

◆ universalFromApparent

static double Calendar::universalFromApparent ( double  rd_local_app,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
moment (RD in local apparent solar time) corrected by equation of time into UT (CC:UE 14.24)

◆ universalFromLocal

static double Calendar::universalFromLocal ( double  rd_loc,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd or fractions of day reduced from local mean (longitude dependent) time to UT

◆ universalFromStandard

static double Calendar::universalFromStandard ( double  rd_zone,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
rd or fractions of day reduced from local zone time to UT

◆ urbanaWinter

static double Calendar::urbanaWinter ( int  gYear)
staticslot
Returns
merely a test (CC:UE 14.38)

◆ visibleCrescent

static bool Calendar::visibleCrescent ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore()->getCurrentLocation() 
)
inlinestaticslot
Returns
whichever criterion is set. CC:UE 14.103 uses Shaukat's criterion.

◆ yallopCriterion

static bool Calendar::yallopCriterion ( int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
true or false according to Yallop (CC:UE 14.100)

◆ zoneFromLongitude

static double Calendar::zoneFromLongitude ( double  lngDeg)
inlinestaticslot
Returns
longitude-dependent time offset in fractions of day.

Field Documentation

◆ meanTropicalYear

constexpr double Calendar::meanTropicalYear =365.242189
staticconstexprprotected

date expressed in the numerical parts of the calendar (usually the smallest part represents a day count)

(CC:UE 14.31)

◆ Calendars

class Calendars

StelModule plugin which provides display and a scripting interface to a multitude of calendrical functions.

Author
Georg Zotti

Public Slots

bool isEnabled () const
 is display of calendars overlay active?
 
bool getFlagTextColorOverride () const
 
void setFlagTextColorOverride (bool b)
 
Vec3f getTextColor () const
 Get the current color of the text (when override flag is active).
 
void setTextColor (const Vec3f &newColor)
 
void enable (bool b)
 enable display of calendars overlay
 
bool isJulianDisplayed () const
 display Julian Calendar?
 
void showJulian (bool b)
 activate display of Julian Calendar
 
bool isRevisedJulianDisplayed () const
 display Revised Julian Calendar?
 
void showRevisedJulian (bool b)
 activate display of Revised Julian Calendar
 
bool isGregorianDisplayed () const
 display Gregorian Calendar?
 
void showGregorian (bool b)
 activate display of Gregorian Calendar
 
bool isISODisplayed () const
 display ISO Calendar?
 
void showISO (bool b)
 activate display of ISO Calendar
 
bool isIcelandicDisplayed () const
 display Icelandic Calendar?
 
void showIcelandic (bool b)
 activate display of Icelandic Calendar
 
bool isRomanDisplayed () const
 display Roman Calendar?
 
void showRoman (bool b)
 activate display of Roman Calendar
 
bool isOlympicDisplayed () const
 display Olympic Calendar?
 
void showOlympic (bool b)
 activate display of Olympic Calendar
 
bool isEgyptianDisplayed () const
 display Egyptian Calendar?
 
void showEgyptian (bool b)
 activate display of Egyptian Calendar
 
bool isArmenianDisplayed () const
 display Armenian Calendar?
 
void showArmenian (bool b)
 activate display of Armenian Calendar
 
bool isZoroastrianDisplayed () const
 display Zoroastrian Calendar?
 
void showZoroastrian (bool b)
 activate display of Zoroastrian Calendar
 
bool isCopticDisplayed () const
 display Coptic Calendar?
 
void showCoptic (bool b)
 activate display of Coptic Calendar
 
bool isEthiopicDisplayed () const
 display Ethiopic Calendar?
 
void showEthiopic (bool b)
 activate display of Ethiopic Calendar
 
bool isChineseDisplayed () const
 display Chinese Calendar?
 
void showChinese (bool b)
 activate display of Chinese Calendar
 
bool isJapaneseDisplayed () const
 display Japanese Calendar?
 
void showJapanese (bool b)
 activate display of Japanese Calendar
 
bool isKoreanDisplayed () const
 display Korean Calendar?
 
void showKorean (bool b)
 activate display of Korean Calendar
 
bool isVietnameseDisplayed () const
 display Vietnamese Calendar?
 
void showVietnamese (bool b)
 activate display of Vietnamese Calendar
 
bool isIslamicDisplayed () const
 display Islamic Calendar?
 
void showIslamic (bool b)
 activate display of Islamic Calendar
 
bool isHebrewDisplayed () const
 display Hebrew Calendar?
 
void showHebrew (bool b)
 activate display of Hebrew Calendar
 
bool isOldHinduSolarDisplayed () const
 display Old Hindu Solar?
 
void showOldHinduSolar (bool b)
 activate display of Old Hindu Solar
 
bool isOldHinduLunarDisplayed () const
 display Old Hindu Lunar?
 
void showOldHinduLunar (bool b)
 activate display of Old Hindu Lunar
 
bool isNewHinduSolarDisplayed () const
 display New Hindu Solar?
 
void showNewHinduSolar (bool b)
 activate display of New Hindu Solar
 
bool isNewHinduLunarDisplayed () const
 display New Hindu Lunisolar?
 
void showNewHinduLunar (bool b)
 activate display of New Hindu Lunisolar
 
bool isAstroHinduSolarDisplayed () const
 display Astro Hindu Solar?
 
void showAstroHinduSolar (bool b)
 activate display of Astro Hindu Solar
 
bool isAstroHinduLunarDisplayed () const
 display Astro Hindu Lunisolar?
 
void showAstroHinduLunar (bool b)
 activate display of Astro Hindu Lunisolar
 
bool isMayaLongCountDisplayed () const
 display Maya Long Count?
 
void showMayaLongCount (bool b)
 activate display of Maya Long Count
 
bool isMayaHaabDisplayed () const
 display Maya Haab?
 
void showMayaHaab (bool b)
 activate display of Maya Haab
 
bool isMayaTzolkinDisplayed () const
 display Maya Tzolkin?
 
void showMayaTzolkin (bool b)
 activate display of Maya Tzolkin
 
bool isAztecXihuitlDisplayed () const
 display Aztec Xihuitl?
 
void showAztecXihuitl (bool b)
 activate display of Aztec Xihuitl
 
bool isAztecTonalpohualliDisplayed () const
 display Aztec Tonalpohualli?
 
void showAztecTonalpohualli (bool b)
 activate display of Aztec Tonalpohualli
 
bool isBalineseDisplayed () const
 display Balinese Pawukon?
 
void showBalinese (bool b)
 activate display of Balinese Pawukon
 
bool isFrenchAstronomicalDisplayed () const
 display French Astronomical?
 
void showFrenchAstronomical (bool b)
 activate display of French Astronomical
 
bool isFrenchArithmeticDisplayed () const
 display French Arithmetic?
 
void showFrenchArithmetic (bool b)
 activate display of French Arithmetic
 
bool isPersianArithmeticDisplayed () const
 display Persian Arithmetic?
 
void showPersianArithmetic (bool b)
 activate display of Persian Arithmetic
 
bool isPersianAstronomicalDisplayed () const
 display Persian Astronomical?
 
void showPersianAstronomical (bool b)
 activate display of Persian Astronomical
 
bool isBahaiArithmeticDisplayed () const
 display Bahai Arithmetic?
 
void showBahaiArithmetic (bool b)
 activate display of Bahai Arithmetic
 
bool isBahaiAstronomicalDisplayed () const
 display Bahai Astronomical?
 
void showBahaiAstronomical (bool b)
 activate display of Bahai Astronomical
 
bool isTibetanDisplayed () const
 display Tibetan?
 
void showTibetan (bool b)
 activate display of Tibetan
 

Signals

void enabledChanged (bool b)
 
void flagTextColorOverrideChanged (bool b)
 
void textColorChanged (Vec3f &color)
 
void showJulianChanged (bool b)
 
void showRevisedJulianChanged (bool b)
 
void showGregorianChanged (bool b)
 
void showISOChanged (bool b)
 
void showIcelandicChanged (bool b)
 
void showRomanChanged (bool b)
 
void showOlympicChanged (bool b)
 
void showEgyptianChanged (bool b)
 
void showArmenianChanged (bool b)
 
void showZoroastrianChanged (bool b)
 
void showCopticChanged (bool b)
 
void showEthiopicChanged (bool b)
 
void showChineseChanged (bool b)
 
void showJapaneseChanged (bool b)
 
void showKoreanChanged (bool b)
 
void showVietnameseChanged (bool b)
 
void showIslamicChanged (bool b)
 
void showHebrewChanged (bool b)
 
void showOldHinduSolarChanged (bool b)
 
void showOldHinduLunarChanged (bool b)
 
void showNewHinduSolarChanged (bool b)
 
void showNewHinduLunarChanged (bool b)
 
void showAstroHinduSolarChanged (bool b)
 
void showAstroHinduLunarChanged (bool b)
 
void showMayaLongCountChanged (bool b)
 
void showMayaHaabChanged (bool b)
 
void showMayaTzolkinChanged (bool b)
 
void showAztecXihuitlChanged (bool b)
 
void showAztecTonalpohualliChanged (bool b)
 
void showBalineseChanged (bool b)
 
void showFrenchAstronomicalChanged (bool b)
 
void showFrenchArithmeticChanged (bool b)
 
void showPersianArithmeticChanged (bool b)
 
void showPersianAstronomicalChanged (bool b)
 
void showBahaiArithmeticChanged (bool b)
 
void showBahaiAstronomicalChanged (bool b)
 
void showTibetanChanged (bool b)
 

Public Member Functions

void init () override
 Initialize itself. More...
 
void update (double) override
 Set all calendars to the Core's JD.
 
void draw (StelCore *core) override
 if enabled, provide a table of calendars on screen.
 
double getCallOrder (StelModuleActionName actionName) const override
 Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations. More...
 
bool configureGui (bool show=true) override
 Detect or show the configuration GUI elements for the module. More...
 
void restoreDefaultSettings ()
 Restore the plug-in's settings to the default state. More...
 
void loadSettings ()
 Load the plug-in's settings from the configuration file. More...
 
CalendargetCal (const QString &name)
 Get a pointer to the respective Calendar. More...
 
- Public Member Functions inherited from StelModule
 StelModule ()
 Constructor. Every derived class MUST call setObjectName(className) in its constructor.
 
virtual void deinit ()
 Called before the module will be deleted, and before the OpenGL context is suppressed. More...
 
virtual QSettings * getSettings ()
 Return module-specific settings. More...
 
virtual QString getModuleVersion () const
 Get the version of the module, default is stellarium main version.
 
virtual QString getAuthorName () const
 Get the name of the module author.
 
virtual QString getAuthorEmail () const
 Get the email address of the module author.
 
virtual void handleMouseClicks (class QMouseEvent *)
 Handle mouse clicks. More...
 
virtual void handleMouseWheel (class QWheelEvent *)
 Handle mouse wheel. More...
 
virtual bool handleMouseMoves (int x, int y, Qt::MouseButtons b)
 Handle mouse moves. More...
 
virtual void handleKeys (class QKeyEvent *e)
 Handle key events. More...
 
virtual bool handlePinch (qreal scale, bool started)
 Handle pinch gesture events. More...
 

Properties

bool enabled
 
bool flagTextColorOverride
 
Vec3f textColor
 
bool flagShowJulian
 
bool flagShowRevisedJulian
 
bool flagShowGregorian
 
bool flagShowISO
 
bool flagShowIcelandic
 
bool flagShowRoman
 
bool flagShowOlympic
 
bool flagShowEgyptian
 
bool flagShowArmenian
 
bool flagShowZoroastrian
 
bool flagShowCoptic
 
bool flagShowEthiopic
 
bool flagShowChinese
 
bool flagShowJapanese
 
bool flagShowKorean
 
bool flagShowVietnamese
 
bool flagShowIslamic
 
bool flagShowHebrew
 
bool flagShowOldHinduSolar
 
bool flagShowOldHinduLunar
 
bool flagShowNewHinduSolar
 
bool flagShowNewHinduLunar
 
bool flagShowAstroHinduSolar
 
bool flagShowAstroHinduLunar
 
bool flagShowMayaLongCount
 
bool flagShowMayaHaab
 
bool flagShowMayaTzolkin
 
bool flagShowAztecXihuitl
 
bool flagShowAztecTonalpohualli
 
bool flagShowBalinese
 
bool flagShowFrenchAstronomical
 
bool flagShowFrenchArithmetic
 
bool flagShowPersianArithmetic
 
bool flagShowPersianAstronomical
 
bool flagShowBahaiArithmetic
 
bool flagShowBahaiAstronomical
 
bool flagShowTibetan
 

Additional Inherited Members

- Public Types inherited from StelModule
enum  StelModuleSelectAction { AddToSelection , ReplaceSelection , RemoveFromSelection }
 Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list. More...
 
enum  StelModuleActionName {
  ActionDraw , ActionUpdate , ActionHandleMouseClicks , ActionHandleMouseMoves ,
  ActionHandleKeys
}
 Define the possible action for which an order is defined. More...
 
- Protected Member Functions inherited from StelModule
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to slot) to the StelActionMgr object. More...
 
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to own slot) to the StelActionMgr object. More...
 
StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *contextObject, std::function< void()> lambda, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to Lambda functor) to the StelActionMgr object. More...
 

Member Function Documentation

◆ configureGui()

bool Calendars::configureGui ( bool  show = true)
overridevirtual

Detect or show the configuration GUI elements for the module.

This is to be used with plugins to display a configuration dialog from the plugin list window.

Parameters
showif true, make the configuration GUI visible. If false, hide the config GUI if there is one.
Returns
true if the module has a configuration GUI, else false.

Reimplemented from StelModule.

◆ getCal()

Calendar* Calendars::getCal ( const QString &  name)

Get a pointer to the respective Calendar.

Returns nullptr if not found. Valid names: Julian, RevisedJulian, Gregorian, ISO, Icelandic, Roman, Olympic, Egyptian, Armenian, Zoroastrian, Coptic, Ethiopic, Islamic, Hebrew, OldHinduSolar, OldHinduLunar, NewHinduSolar, NewHinduLunar, Balinese, Tibetan, BahaiArithmetic, BahaiAstronomical, MayaLongCount, MayaHaab, MayaTzolkin, AztecXihuitl, AztecTonalpohualli TODO: ADD HERE: Chinese, ...

◆ getCallOrder()

double Calendars::getCallOrder ( StelModuleActionName  actionName) const
overridevirtual

Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.

Parameters
actionNamethe name of the action for which we want the call order
Returns
the value defining the order. The closer to 0 the earlier the module's action will be called

Reimplemented from StelModule.

◆ init()

void Calendars::init ( )
overridevirtual

Initialize itself.

If the initialization takes significant time, the progress should be displayed on the loading bar.

Implements StelModule.

◆ loadSettings()

void Calendars::loadSettings ( )

Load the plug-in's settings from the configuration file.

Settings are kept in the "Calendars" section in Stellarium's configuration file. If no such section exists, it will load default values.

See also
restoreDefaultSettings()

◆ restoreDefaultSettings()

void Calendars::restoreDefaultSettings ( )

Restore the plug-in's settings to the default state.

Replace the plug-in's settings in Stellarium's configuration file with the default values and re-load them. Uses internally loadSettings().

◆ ChineseCalendar

class ChineseCalendar

Functions for the Chinese calendar (1645 Qing dynasty version)

Author
Georg Zotti

The Chinese calendar (and related Japanese, Korean and Vietnamese) is a Lunisolar calendar based on astronomical events. The calendar's location for astronomical computations is Beijing. Days begin at midnight. Lunar months begin on the day of New Moon.

Our implementation uses a 5-part QVector<int> {cycle, year, month, leap-month, day}

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts5) 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
 
virtual QPair< QString, QString > getSolarTermStrings () const
 get a pair of strings for the Solar Terms for a date
 
virtual QString getFormattedSolarTermsString () const
 get a formatted string of the Solar Terms for a date
 
static int fixedFromChinese (const QVector< int > &parts5)
 find RD number for date in the Chinese calendar (CC:UE 19.17) More...
 
static QVector< int > chineseFromFixed (int rd)
 find date in the Chinese calendar from RD number (CC:UE 19.16) More...
 
static int currentMajorSolarTerm (int rd)
 
static StelLocation chineseLocation (double rd_t)
 Return location of Chinese calendar computations (Beijing). Before 1929, this used LMST. CC:UE 19.2.
 
static double solarLongitudeOnOrAfter (double lambda, double rd_t)
 Return the moment when solar longitude reaches lambda (CC:UE 19.3) More...
 
static int majorSolarTermOnOrAfter (int rd)
 
static int currentMinorSolarTerm (int rd)
 Return current minor solar term for rd (CC:UE 19.5)
 
static int minorSolarTermOnOrAfter (int rd)
 Return minor solar term (CC:UE 19.6)
 
static double midnightInChina (int rd)
 Return rd moment of midnight (CC:UE 19.7)
 
static int winterSolsticeOnOrBefore (int rd)
 Return Chinese Winter Solstice date (CC:UE 19.8) More...
 
static int newMoonOnOrAfter (int rd)
 Return Chinese New Moon (CC:UE 19.9) More...
 
static int newMoonBefore (int rd)
 Return Chinese New Moon (CC:UE 19.10) More...
 
static bool noMajorSolarTerm (int rd)
 Auxiliary function (CC:UE 19.11) More...
 
static bool priorLeapMonth (int mP, int m)
 Auxiliary function (CC:UE 19.12) More...
 
static int newYearInSui (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13) More...
 
static int newYearOnOrBefore (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14) More...
 
static QPair< int, int > sexagesimalNumbers (int n)
 Retrieve numerical components from the cycle number [1..60]. (following CC:UE 19.18)
 
static QPair< QString, QString > sexagesimalNames (int n)
 Retrieve name components from the cycle number [1..60]. More...
 
static int chineseNameDifference (const QPair< int, int > &stemBranch1, const QPair< int, int > &stemBranch2)
 Retrieve year difference between name pairs. [1..60]. (CC:UE 19.19)
 
static QPair< QString, QString > yearName (int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese year year (CC:UE 19.20) More...
 
static QPair< QString, QString > monthName (int month, int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese month within a year (CC:UE 19.22) More...
 
static int dayNumber (int rd)
 Retrieve one number (1...60) for Chinese day (after CC:UE 19.24) More...
 
static QPair< int, int > dayNumbers (int rd)
 Retrieve pair of index numbers (stem, branch) for Chinese day (after CC:UE 19.24) More...
 
static QPair< QString, QString > dayName (int rd)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese day (CC:UE 19.24) More...
 
static int dayNumberOnOrBefore (const QPair< int, int > &stemBranch, int rd)
 Retrieve RD of day number (1...60) on or before rd. More...
 
static int ChineseNewYearInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE before 19.27)
 
static int DragonFestivalInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE 19.27)
 
static int qingMing (int gYear)
 Return RD of Winter minor term of Gregorian year gYear (CC:UE 19.28)
 
static int chineseAge (const QVector< int > &birthdate, int rd)
 Return age of someone born on birthdate on date rd as expressed by Chinese (CC:UE 19.29) A new-born is aged 1. More...
 
static int chineseYearMarriageAugury (int cycle, int year)
 Determine marriage augury based on year number within a cycle. widows are worst, double-bright are best years.
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

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

Static Public Attributes

static const int chineseEpoch
 
- 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
 

Static Protected Attributes

static QMap< int, QString > majorSolarTerms
 RD of Gregorian {-2636, february, 15}. CC:UE 19.15.
 
static QMap< int, QString > minorSolarTerms
 
static QMap< int, QString > celestialStems
 
static QMap< int, QString > celestialStemsElements
 
static QMap< int, QString > terrestrialBranches
 
static QMap< int, QString > terrestrialBranchesAnimalTotems
 
constexpr static const int chineseMonthNameEpoch =57
 
constexpr static const int chineseDayNameEpoch =45
 CC:UE 19.21.
 
constexpr static const int doubleBright =3
 CC:UE 19.23.
 
constexpr static const int bright =2
 CC:UE 19.30.
 
constexpr static const int blind =1
 CC:UE 19.31.
 
constexpr static const int widow =0
 CC:UE 19.32.
 
- 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.
 

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)
 
- 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)
 

Member Function Documentation

◆ chineseAge

static int ChineseCalendar::chineseAge ( const QVector< int > &  birthdate,
int  rd 
)
staticslot

Return age of someone born on birthdate on date rd as expressed by Chinese (CC:UE 19.29) A new-born is aged 1.

Age increases at Chinese New Year. Returns bogus on error

◆ chineseFromFixed

static QVector<int> ChineseCalendar::chineseFromFixed ( int  rd)
staticslot

find date in the Chinese calendar from RD number (CC:UE 19.16)

Returns
{cycle, year, month, leap, day}

◆ dayName

static QPair<QString, QString> ChineseCalendar::dayName ( int  rd)
staticslot

Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese day (CC:UE 19.24)

Note
this is called chinese-day-name in the CC:UE book, but we overwrite this name in the derived classes.

◆ dayNumber

static int ChineseCalendar::dayNumber ( int  rd)
staticslot

Retrieve one number (1...60) for Chinese day (after CC:UE 19.24)

Note
this should be called chinese-day-number following the CC:UE book strictly, but we use this name in favour of the derived classes.

◆ dayNumberOnOrBefore

static int ChineseCalendar::dayNumberOnOrBefore ( const QPair< int, int > &  stemBranch,
int  rd 
)
staticslot

Retrieve RD of day number (1...60) on or before rd.

(after CC:UE 19.25)

Note
this is called chinese-day-number-on-or-before in the CC:UE book, but we use this name in favour of the derived classes.

◆ dayNumbers

static QPair<int, int> ChineseCalendar::dayNumbers ( int  rd)
staticslot

Retrieve pair of index numbers (stem, branch) for Chinese day (after CC:UE 19.24)

Note
this is called chinese-day-numbers in the CC:UE book, but we use this name in favour of the derived classes.

◆ fixedFromChinese

static int ChineseCalendar::fixedFromChinese ( const QVector< int > &  parts5)
staticslot

find RD number for date in the Chinese calendar (CC:UE 19.17)

  • parts5={cycle, year, month, leap, day}

◆ getDateStrings

QStringList ChineseCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

{Cycle, Year, Month, MonthName, "leap"|"", Day, WeekDayName} The words "leap" (translated) are only given if the respective month is leap. Else an empty string is given.

◆ monthName

static QPair<QString, QString> ChineseCalendar::monthName ( int  month,
int  year 
)
staticslot

Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese month within a year (CC:UE 19.22)

Note
this is called chinese-month-name in the CC:UE book, but we overwrite this name in the derived classes.

◆ newMoonBefore

static int ChineseCalendar::newMoonBefore ( int  rd)
staticslot

Return Chinese New Moon (CC:UE 19.10)

Note
This is called chinese-new-moon-before in the book, but we use overwrites in the derived calendars, making the name without "chinese" better.

◆ newMoonOnOrAfter

static int ChineseCalendar::newMoonOnOrAfter ( int  rd)
staticslot

Return Chinese New Moon (CC:UE 19.9)

Note
This is called chinese-new-moon-on-or-after in the book, but we use overwrites in the derived calendars, making the name without "chinese" better.

◆ newYearInSui

static int ChineseCalendar::newYearInSui ( int  rd)
staticslot

Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13)

Note
This is called chinese-new-year-in-sui, but we override this in the derived calendars.

◆ newYearOnOrBefore

static int ChineseCalendar::newYearOnOrBefore ( int  rd)
staticslot

Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14)

Note
This is called chinese-new-year-on-or-before, but we override this in the derived calendars.

◆ noMajorSolarTerm

static bool ChineseCalendar::noMajorSolarTerm ( int  rd)
staticslot

Auxiliary function (CC:UE 19.11)

Note
This is called chinese-no-major-solar-term, but we override this in the derived calendars.

◆ priorLeapMonth

static bool ChineseCalendar::priorLeapMonth ( int  mP,
int  m 
)
staticslot

Auxiliary function (CC:UE 19.12)

Note
This is called chinese-prior-leap-month, but we override this in the derived calendars.

◆ setDate

void ChineseCalendar::setDate ( const QVector< int > &  parts5)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

{year, month, leap-month, day, leap-day}

◆ sexagesimalNames

static QPair<QString, QString> ChineseCalendar::sexagesimalNames ( int  n)
staticslot

Retrieve name components from the cycle number [1..60].

(CC:UE 19.18) In contrast to chineseSexagesimalNumbers, this provides the pair (chinese double-name, translated double-name)

Note
this is named chinese-sexagesimal-names in the CC:UE book, but we use this name also in derived classes

◆ solarLongitudeOnOrAfter

static double ChineseCalendar::solarLongitudeOnOrAfter ( double  lambda,
double  rd_t 
)
staticslot

Return the moment when solar longitude reaches lambda (CC:UE 19.3)

  • rd_t moment.
    Returns
    valid for chineseLocation
    Note
    This is called chinese-solar-longitude-on-or-after in the book, but we use overwrites in the derived calendars, making the name without "chinese" better.

◆ winterSolsticeOnOrBefore

static int ChineseCalendar::winterSolsticeOnOrBefore ( int  rd)
staticslot

Return Chinese Winter Solstice date (CC:UE 19.8)

Note
This is called chinese-winter-solstice-on-or-before, but we override it in derived calendars

◆ yearName

static QPair<QString, QString> ChineseCalendar::yearName ( int  year)
staticslot

Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese year year (CC:UE 19.20)

Note
this is called chinese-year-name in the CC:UE book, but we overwrite this name in the derived classes.

◆ GregorianCalendar

class GregorianCalendar

Functions for the Gregorian calendar.

Author
Georg Zotti

Stellarium uses Julian Day numbers internally, and the conventional approach of using the Gregorian calendar for dates after 1582-10-15. For dates before that, the Julian calendar is used, in the form finalized by Augustus and running unchanged since 8AD. Some European countries, especially the Protestant countries, delayed the calendar switch well into the 18th century. This implementation strictly follows CC. It provides the "Proleptic Gregorian Calendar" for dates before 1582-10-15. This may be helpful for a better estimate of seasons' beginnings in prehistory. However, also the Gregorian calendar is not perfect, and Neolithic and even earlier dates will still show deviations from the dates well-known from today.

Public Slots

void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 bool isLeap (int year)
 returns true for leap years
 
static int fixedFromGregorian (const QVector< int > &gregorian)
 auxiliary functions from CC.UE ch2.5 Return R.D. More...
 
static int orthodoxEaster (int gYear)
 Orthodox Easter sunday (RD) from chapter 9.1.
 
static int easter (int gYear)
 Gregorian Easter sunday (RD) from chapter 9.2.
 
static int pentecost (int gYear)
 Return RD of Pentecost in Gregorian calendar.
 
static int gregorianNewYear (int year)
 
static int gregorianYearEnd (int gYear)
 
static QVector< int > gregorianYearRange (int gYear)
 
static int gregorianYearFromFixed (int rd)
 
static QVector< int > gregorianFromFixed (int rd)
 return year-month-day for RD date
 
static int nthKday (const int n, const Calendar::Day k, const int gYear, const int gMonth, const int gDay)
 
- Public Slots inherited from JulianCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 QString weekday (double jd)
 return name of week day. This is actually independent from any calendar, just a modulo of JD.
 
static bool isLeap (int year)
 returns true for leap years
 
static int fixedFromJulian (const QVector< int > &julian)
 find RD number for date in the Julian calendar (may be used in other calendars!)
 
static QVector< int > julianFromFixed (int rd)
 find date in the Julian calendar from RD number (may be used in other calendars!)
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 GregorianCalendar (double jd)
 
- Public Member Functions inherited from JulianCalendar
 JulianCalendar (double jd)
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 

Static Public Attributes

constexpr static const int gregorianEpoch =1
 
- Static Public Attributes inherited from JulianCalendar
constexpr static const int julianEpoch =-1
 
- 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
 

Additional Inherited Members

- Public Types inherited from JulianCalendar
enum  month {
  january =1 , february , march , april ,
  may , june , july , august ,
  september , october , november , december
}
 
- 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)
 
- 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 JulianCalendar
static QMap< int, QString > weekDayNames
 RD of January 1, AD1 (jul.).
 
static QMap< int, QString > monthNames
 
- 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.
 

Member Function Documentation

◆ fixedFromGregorian

static int GregorianCalendar::fixedFromGregorian ( const QVector< int > &  gregorian)
staticslot

auxiliary functions from CC.UE ch2.5 Return R.D.

of date in the Gregorian calendar.

◆ getDateStrings

QStringList GregorianCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

Year, Month, MonthName, Day, DayName

◆ gregorianNewYear

static int GregorianCalendar::gregorianNewYear ( int  year)
inlinestaticslot
Returns
RD of Gregorian new year

◆ gregorianYearEnd

static int GregorianCalendar::gregorianYearEnd ( int  gYear)
inlinestaticslot
Returns
RD of December 31 of gYear

◆ gregorianYearRange

static QVector<int> GregorianCalendar::gregorianYearRange ( int  gYear)
inlinestaticslot
Returns
a QVector<int> with two elements: RD of Jan 1 and December 31 of gYear

◆ nthKday

static int GregorianCalendar::nthKday ( const int  n,
const Calendar::Day  k,
const int  gYear,
const int  gMonth,
const int  gDay 
)
staticslot
Returns
RD date of the n-th k-day

◆ setDate

void GregorianCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

Year-Month[1...12]-Day[1...31]

◆ JapaneseCalendar

class JapaneseCalendar

Functions for the Japanese calendar (as derived from the Chinese calendar)

Author
Georg Zotti

The Japanese calendar is derived from the Chinese calendar (like Korean and Vietnamese). The calendar's location for astronomical computations is Tokyo. Days begin at midnight. Lunar months begin on the day of New Moon. In difference to the CC:UE book, we must introduce function names which replace "chinese" by "japanese", to take the changed location into account or where the culture name is omitted, so that function overrides work.

Our implementation uses the 5-part QVector<int> {cycle, year, month, leap-month, day} inherited from the Chinese calendar. The years are given in Japanese eras.

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts5) 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
 
QPair< QString, QString > getSolarTermStrings () const override
 get a pair of strings for the Solar Terms for a date
 
QString getFormattedSolarTermsString () const override
 get a formatted string of the Solar Terms for a date
 
static int fixedFromJapanese (const QVector< int > &parts5)
 find RD number for date in the Japanese calendar (CC:UE 19.17) More...
 
static QVector< int > japaneseFromFixed (int rd)
 find date in the Japanese calendar from RD number (CC:UE 19.16) More...
 
static int currentMajorSolarTerm (int rd)
 
static StelLocation japaneseLocation (double rd_t)
 Return location of Japanese calendar computations (Tokyo). Before 1888, this used LMST. CC:UE 19.35.
 
static double solarLongitudeOnOrAfter (double lambda, double rd_t)
 Return the moment when solar longitude reaches lambda (CC:UE 19.3) More...
 
static int majorSolarTermOnOrAfter (int rd)
 
static int currentMinorSolarTerm (int rd)
 Return current minor solar term for rd (CC:UE 19.5)
 
static int minorSolarTermOnOrAfter (int rd)
 Return minor solar term (CC:UE 19.6)
 
static double midnightInJapan (int rd)
 Return rd moment of midnight (CC:UE 19.7) This replaces midnight-in-china in the Chinese calendar functions used in Japan.
 
static int winterSolsticeOnOrBefore (int rd)
 Return Korean Winter Solstice date (CC:UE 19.8)
 
static int newMoonOnOrAfter (int rd)
 Return Korean New Moon (CC:UE 19.9)
 
static int newMoonBefore (int rd)
 Return Korean New Moon (CC:UE 19.10)
 
static bool noMajorSolarTerm (int rd)
 Auxiliary function (CC:UE 19.11)
 
static bool priorLeapMonth (int mP, int m)
 Auxiliary function (CC:UE 19.12)
 
static int newYearInSui (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13)
 
static int newYearOnOrBefore (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14)
 
static int japaneseYear (int cycle, int year)
 Return Japanese Year in the Tenno system, counting from XXX BCE. (CC:UE 19.37)
 
- Public Slots inherited from ChineseCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts5) 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
 
virtual QPair< QString, QString > getSolarTermStrings () const
 get a pair of strings for the Solar Terms for a date
 
virtual QString getFormattedSolarTermsString () const
 get a formatted string of the Solar Terms for a date
 
static int fixedFromChinese (const QVector< int > &parts5)
 find RD number for date in the Chinese calendar (CC:UE 19.17) More...
 
static QVector< int > chineseFromFixed (int rd)
 find date in the Chinese calendar from RD number (CC:UE 19.16) More...
 
static int currentMajorSolarTerm (int rd)
 
static StelLocation chineseLocation (double rd_t)
 Return location of Chinese calendar computations (Beijing). Before 1929, this used LMST. CC:UE 19.2.
 
static double solarLongitudeOnOrAfter (double lambda, double rd_t)
 Return the moment when solar longitude reaches lambda (CC:UE 19.3) More...
 
static int majorSolarTermOnOrAfter (int rd)
 
static int currentMinorSolarTerm (int rd)
 Return current minor solar term for rd (CC:UE 19.5)
 
static int minorSolarTermOnOrAfter (int rd)
 Return minor solar term (CC:UE 19.6)
 
static double midnightInChina (int rd)
 Return rd moment of midnight (CC:UE 19.7)
 
static int winterSolsticeOnOrBefore (int rd)
 Return Chinese Winter Solstice date (CC:UE 19.8) More...
 
static int newMoonOnOrAfter (int rd)
 Return Chinese New Moon (CC:UE 19.9) More...
 
static int newMoonBefore (int rd)
 Return Chinese New Moon (CC:UE 19.10) More...
 
static bool noMajorSolarTerm (int rd)
 Auxiliary function (CC:UE 19.11) More...
 
static bool priorLeapMonth (int mP, int m)
 Auxiliary function (CC:UE 19.12) More...
 
static int newYearInSui (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13) More...
 
static int newYearOnOrBefore (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14) More...
 
static QPair< int, int > sexagesimalNumbers (int n)
 Retrieve numerical components from the cycle number [1..60]. (following CC:UE 19.18)
 
static QPair< QString, QString > sexagesimalNames (int n)
 Retrieve name components from the cycle number [1..60]. More...
 
static int chineseNameDifference (const QPair< int, int > &stemBranch1, const QPair< int, int > &stemBranch2)
 Retrieve year difference between name pairs. [1..60]. (CC:UE 19.19)
 
static QPair< QString, QString > yearName (int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese year year (CC:UE 19.20) More...
 
static QPair< QString, QString > monthName (int month, int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese month within a year (CC:UE 19.22) More...
 
static int dayNumber (int rd)
 Retrieve one number (1...60) for Chinese day (after CC:UE 19.24) More...
 
static QPair< int, int > dayNumbers (int rd)
 Retrieve pair of index numbers (stem, branch) for Chinese day (after CC:UE 19.24) More...
 
static QPair< QString, QString > dayName (int rd)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese day (CC:UE 19.24) More...
 
static int dayNumberOnOrBefore (const QPair< int, int > &stemBranch, int rd)
 Retrieve RD of day number (1...60) on or before rd. More...
 
static int ChineseNewYearInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE before 19.27)
 
static int DragonFestivalInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE 19.27)
 
static int qingMing (int gYear)
 Return RD of Winter minor term of Gregorian year gYear (CC:UE 19.28)
 
static int chineseAge (const QVector< int > &birthdate, int rd)
 Return age of someone born on birthdate on date rd as expressed by Chinese (CC:UE 19.29) A new-born is aged 1. More...
 
static int chineseYearMarriageAugury (int cycle, int year)
 Determine marriage augury based on year number within a cycle. widows are worst, double-bright are best years.
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 JapaneseCalendar (double jd)
 
- Public Member Functions inherited from ChineseCalendar
 ChineseCalendar (double jd)
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 

Static Protected Attributes

static QMap< int, QString > majorSolarTerms
 
static QMap< int, QString > minorSolarTerms
 
- Static Protected Attributes inherited from ChineseCalendar
static QMap< int, QString > majorSolarTerms
 RD of Gregorian {-2636, february, 15}. CC:UE 19.15.
 
static QMap< int, QString > minorSolarTerms
 
static QMap< int, QString > celestialStems
 
static QMap< int, QString > celestialStemsElements
 
static QMap< int, QString > terrestrialBranches
 
static QMap< int, QString > terrestrialBranchesAnimalTotems
 
constexpr static const int chineseMonthNameEpoch =57
 
constexpr static const int chineseDayNameEpoch =45
 CC:UE 19.21.
 
constexpr static const int doubleBright =3
 CC:UE 19.23.
 
constexpr static const int bright =2
 CC:UE 19.30.
 
constexpr static const int blind =1
 CC:UE 19.31.
 
constexpr static const int widow =0
 CC:UE 19.32.
 
- 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.
 

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 ChineseCalendar
static const int chineseEpoch
 
- 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)
 

Member Function Documentation

◆ fixedFromJapanese

static int JapaneseCalendar::fixedFromJapanese ( const QVector< int > &  parts5)
staticslot

find RD number for date in the Japanese calendar (CC:UE 19.17)

  • parts5={cycle, year, month, leap, day}

◆ getDateStrings

QStringList JapaneseCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

{Cycle, Year, Month, MonthName, "leap"|"", Day, WeekDayName} The words "leap" (translated) are only given if the respective month is leap. Else an empty string is given.

◆ japaneseFromFixed

static QVector<int> JapaneseCalendar::japaneseFromFixed ( int  rd)
staticslot

find date in the Japanese calendar from RD number (CC:UE 19.16)

Returns
{cycle, year, month, leap, day}

◆ setDate

void JapaneseCalendar::setDate ( const QVector< int > &  parts5)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

{year, month, leap-month, day, leap-day}

◆ solarLongitudeOnOrAfter

static double JapaneseCalendar::solarLongitudeOnOrAfter ( double  lambda,
double  rd_t 
)
staticslot

Return the moment when solar longitude reaches lambda (CC:UE 19.3)

  • rd_t moment.
    Returns
    valid for koreanLocation
    Note
    This would be called korean-solar-longitude-on-or-after in the book, but we use overwrites in the derived calendars, making the name without "korean" better.

◆ JulianCalendar

class JulianCalendar

Functions for the Julian calendar.

Author
Georg Zotti

Stellarium uses Julian Day numbers internally, and the conventional approach of using the Gregorian calendar for dates after 1582-10-15. For dates before that, the Julian calendar is used, in the form finalized by Augustus and running unchanged since 8AD. Some European countries, especially the Protestant countries, delayed the calendar switch well into the 18th century.

Note
The implementation does not correctly represent the Roman Julian calendar valid from introduction by Julius Caesar to the reform by Augustus.
this implementation adheres to Calendrical Calculation's style of omitting a year zero. Negative years represent years B.C.E. This is very much in contrast to Stellarium's usual behaviour, and also different from a year zero in CC's implementation of the Gregorian calendar.

Public Types

enum  month {
  january =1 , february , march , april ,
  may , june , july , august ,
  september , october , november , december
}
 
- 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 }
 

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 QString weekday (double jd)
 return name of week day. This is actually independent from any calendar, just a modulo of JD.
 
static bool isLeap (int year)
 returns true for leap years
 
static int fixedFromJulian (const QVector< int > &julian)
 find RD number for date in the Julian calendar (may be used in other calendars!)
 
static QVector< int > julianFromFixed (int rd)
 find date in the Julian calendar from RD number (may be used in other calendars!)
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

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

Static Public Attributes

constexpr static const int julianEpoch =-1
 
- 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
 

Static Protected Attributes

static QMap< int, QString > weekDayNames
 RD of January 1, AD1 (jul.).
 
static QMap< int, QString > monthNames
 
- 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.
 

Additional Inherited Members

- Signals inherited from Calendar
void partsChanged (QVector< int > parts)
 
void jdChanged (double jd)
 
- 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)
 

Member Function Documentation

◆ getDateStrings

QStringList JulianCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

Year, Month, MonthName, Day, DayName

◆ setDate

void JulianCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

Year-Month[1...12]-Day[1...31]

◆ KoreanCalendar

class KoreanCalendar

Functions for the Korean calendar (as derived from the Chinese calendar)

Author
Georg Zotti

The Korean calendar is derived from the Chinese calendar (like Japanese and Vietnamese). The calendar's location for astronomical computations is Seoul. Days begin at midnight. Lunar months begin on the day of New Moon. In difference to the CC:UE book, we must introduce function names which replace "chinese" by "korean" to take the changed location into account.

Our implementation uses the 5-part QVector<int> {cycle, year, month, leap-month, day} inherited from the Chinese calendar. From {cycle, year} the Korean year counted from 2333BCE can be found using koreanYear(cycle, year) which we show in the Calendars output.

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts5) 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
 
QPair< QString, QString > getSolarTermStrings () const override
 get a pair of strings for the Solar Terms for a date
 
QString getFormattedSolarTermsString () const override
 get a formatted string of the Solar Terms for a date
 
static int fixedFromKorean (const QVector< int > &parts5)
 find RD number for date in the Chinese calendar (CC:UE 19.17) More...
 
static QVector< int > koreanFromFixed (int rd)
 find date in the Chinese calendar from RD number (CC:UE 19.16) More...
 
static int currentMajorSolarTerm (int rd)
 
static StelLocation koreanLocation (double rd_t)
 Return location of Korean calendar computations (Seoul City Hall). Before April 1, 1908, this used LMST. CC:UE 19.36.
 
static double solarLongitudeOnOrAfter (double lambda, double rd_t)
 Return the moment when solar longitude reaches lambda (CC:UE 19.3) More...
 
static int majorSolarTermOnOrAfter (int rd)
 
static int currentMinorSolarTerm (int rd)
 Return current minor solar term for rd (CC:UE 19.5)
 
static int minorSolarTermOnOrAfter (int rd)
 Return minor solar term (CC:UE 19.6)
 
static double midnightInKorea (int rd)
 Return rd moment of midnight (CC:UE 19.7) This replaces midnight-in-china in the Chinese calendar functions used in Korea.
 
static int winterSolsticeOnOrBefore (int rd)
 Return Korean Winter Solstice date (CC:UE 19.8)
 
static int newMoonOnOrAfter (int rd)
 Return Korean New Moon (CC:UE 19.9)
 
static int newMoonBefore (int rd)
 Return Korean New Moon (CC:UE 19.10)
 
static bool noMajorSolarTerm (int rd)
 Auxiliary function (CC:UE 19.11)
 
static bool priorLeapMonth (int mP, int m)
 Auxiliary function (CC:UE 19.12)
 
static int newYearInSui (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13)
 
static int newYearOnOrBefore (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14)
 
static QPair< QString, QString > sexagesimalNames (int n)
 Retrieve name components from the cycle number [1..60]. More...
 
static QPair< QString, QString > yearName (int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese year year (CC:UE 19.20)
 
static QPair< QString, QString > monthName (int month, int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese month within a year (CC:UE 19.22)
 
static QPair< QString, QString > dayName (int rd)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese day (CC:UE 19.24)
 
static int koreanNewYearInGregorianYear (int gYear)
 Return Korean year number beginning in Winter of Gregorian year gYear (after CC:UE before 19.27, but with Korean year number)
 
static int koreanAge (const QVector< int > &birthdate, int rd)
 Return age of someone born on birthdate on date rd as expressed by the Korean calendar. More...
 
static int koreanYear (int cycle, int year)
 Return Korean Year in the Danki system, counting from 2333BCE. (CC:UE 19.37)
 
- Public Slots inherited from ChineseCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts5) 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
 
virtual QPair< QString, QString > getSolarTermStrings () const
 get a pair of strings for the Solar Terms for a date
 
virtual QString getFormattedSolarTermsString () const
 get a formatted string of the Solar Terms for a date
 
static int fixedFromChinese (const QVector< int > &parts5)
 find RD number for date in the Chinese calendar (CC:UE 19.17) More...
 
static QVector< int > chineseFromFixed (int rd)
 find date in the Chinese calendar from RD number (CC:UE 19.16) More...
 
static int currentMajorSolarTerm (int rd)
 
static StelLocation chineseLocation (double rd_t)
 Return location of Chinese calendar computations (Beijing). Before 1929, this used LMST. CC:UE 19.2.
 
static double solarLongitudeOnOrAfter (double lambda, double rd_t)
 Return the moment when solar longitude reaches lambda (CC:UE 19.3) More...
 
static int majorSolarTermOnOrAfter (int rd)
 
static int currentMinorSolarTerm (int rd)
 Return current minor solar term for rd (CC:UE 19.5)
 
static int minorSolarTermOnOrAfter (int rd)
 Return minor solar term (CC:UE 19.6)
 
static double midnightInChina (int rd)
 Return rd moment of midnight (CC:UE 19.7)
 
static int winterSolsticeOnOrBefore (int rd)
 Return Chinese Winter Solstice date (CC:UE 19.8) More...
 
static int newMoonOnOrAfter (int rd)
 Return Chinese New Moon (CC:UE 19.9) More...
 
static int newMoonBefore (int rd)
 Return Chinese New Moon (CC:UE 19.10) More...
 
static bool noMajorSolarTerm (int rd)
 Auxiliary function (CC:UE 19.11) More...
 
static bool priorLeapMonth (int mP, int m)
 Auxiliary function (CC:UE 19.12) More...
 
static int newYearInSui (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13) More...
 
static int newYearOnOrBefore (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14) More...
 
static QPair< int, int > sexagesimalNumbers (int n)
 Retrieve numerical components from the cycle number [1..60]. (following CC:UE 19.18)
 
static QPair< QString, QString > sexagesimalNames (int n)
 Retrieve name components from the cycle number [1..60]. More...
 
static int chineseNameDifference (const QPair< int, int > &stemBranch1, const QPair< int, int > &stemBranch2)
 Retrieve year difference between name pairs. [1..60]. (CC:UE 19.19)
 
static QPair< QString, QString > yearName (int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese year year (CC:UE 19.20) More...
 
static QPair< QString, QString > monthName (int month, int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese month within a year (CC:UE 19.22) More...
 
static int dayNumber (int rd)
 Retrieve one number (1...60) for Chinese day (after CC:UE 19.24) More...
 
static QPair< int, int > dayNumbers (int rd)
 Retrieve pair of index numbers (stem, branch) for Chinese day (after CC:UE 19.24) More...
 
static QPair< QString, QString > dayName (int rd)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese day (CC:UE 19.24) More...
 
static int dayNumberOnOrBefore (const QPair< int, int > &stemBranch, int rd)
 Retrieve RD of day number (1...60) on or before rd. More...
 
static int ChineseNewYearInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE before 19.27)
 
static int DragonFestivalInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE 19.27)
 
static int qingMing (int gYear)
 Return RD of Winter minor term of Gregorian year gYear (CC:UE 19.28)
 
static int chineseAge (const QVector< int > &birthdate, int rd)
 Return age of someone born on birthdate on date rd as expressed by Chinese (CC:UE 19.29) A new-born is aged 1. More...
 
static int chineseYearMarriageAugury (int cycle, int year)
 Determine marriage augury based on year number within a cycle. widows are worst, double-bright are best years.
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 KoreanCalendar (double jd)
 
- Public Member Functions inherited from ChineseCalendar
 ChineseCalendar (double jd)
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 

Static Protected Attributes

static QMap< int, QString > majorSolarTerms
 
static QMap< int, QString > minorSolarTerms
 
static QMap< int, QString > celestialStems
 
static QMap< int, QString > celestialStemsElements
 
static QMap< int, QString > terrestrialBranches
 
static QMap< int, QString > terrestrialBranchesAnimalTotems
 
constexpr static const int chineseMonthNameEpoch =57
 
constexpr static const int chineseDayNameEpoch =45
 CC:UE 19.21.
 
constexpr static const int doubleBright =3
 CC:UE 19.23.
 
constexpr static const int bright =2
 CC:UE 19.30.
 
constexpr static const int blind =1
 CC:UE 19.31.
 
constexpr static const int widow =0
 CC:UE 19.32.
 
- Static Protected Attributes inherited from ChineseCalendar
static QMap< int, QString > majorSolarTerms
 RD of Gregorian {-2636, february, 15}. CC:UE 19.15.
 
static QMap< int, QString > minorSolarTerms
 
static QMap< int, QString > celestialStems
 
static QMap< int, QString > celestialStemsElements
 
static QMap< int, QString > terrestrialBranches
 
static QMap< int, QString > terrestrialBranchesAnimalTotems
 
constexpr static const int chineseMonthNameEpoch =57
 
constexpr static const int chineseDayNameEpoch =45
 CC:UE 19.21.
 
constexpr static const int doubleBright =3
 CC:UE 19.23.
 
constexpr static const int bright =2
 CC:UE 19.30.
 
constexpr static const int blind =1
 CC:UE 19.31.
 
constexpr static const int widow =0
 CC:UE 19.32.
 
- 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.
 

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 ChineseCalendar
static const int chineseEpoch
 
- 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)
 

Member Function Documentation

◆ fixedFromKorean

static int KoreanCalendar::fixedFromKorean ( const QVector< int > &  parts5)
staticslot

find RD number for date in the Chinese calendar (CC:UE 19.17)

  • parts5={cycle, year, month, leap, day}

◆ getDateStrings

QStringList KoreanCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

{Cycle, Year, Month, MonthName, "leap"|"", Day, WeekDayName} The words "leap" (translated) are only given if the respective month is leap. Else an empty string is given.

◆ koreanAge

static int KoreanCalendar::koreanAge ( const QVector< int > &  birthdate,
int  rd 
)
staticslot

Return age of someone born on birthdate on date rd as expressed by the Korean calendar.

This is a mix of Chinese Age and Western calendar, as Koreans consider January 1 as turn of the Year in this calculation (https://www.90daykorean.com/korean-age-all-about-age-in-korea/) Therefore: A new-born is aged 1. Age increases at Gregorian New Year. Returns 0 for dates before birth. According to various sources, the time in the womb is countedc as first year, so it's unclear whether this is strictly correct. A use in scripting would probably be:

◆ koreanFromFixed

static QVector<int> KoreanCalendar::koreanFromFixed ( int  rd)
staticslot

find date in the Chinese calendar from RD number (CC:UE 19.16)

Returns
{cycle, year, month, leap, day}

◆ setDate

void KoreanCalendar::setDate ( const QVector< int > &  parts5)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

{year, month, leap-month, day, leap-day}

◆ sexagesimalNames

static QPair<QString, QString> KoreanCalendar::sexagesimalNames ( int  n)
staticslot

Retrieve name components from the cycle number [1..60].

(CC:UE 19.18) In contrast to chineseSexagesimalNumbers, this provides the pair (chinese double-name, translated double-name)

◆ solarLongitudeOnOrAfter

static double KoreanCalendar::solarLongitudeOnOrAfter ( double  lambda,
double  rd_t 
)
staticslot

Return the moment when solar longitude reaches lambda (CC:UE 19.3)

  • rd_t moment.
    Returns
    valid for koreanLocation
    Note
    This would be called korean-solar-longitude-on-or-after in the book, but we use overwrites in the derived calendars, making the name without "korean" better.

◆ NewHinduCalendar

class NewHinduCalendar

Functions for the New Hindu calendars described in CC:UE chapter 20.

Author
Georg Zotti

The new Hindu calendar as given in CC.UE is an astronomical Lunisolar calendar with Solar and Lunar months. The name of a lunar month depends on the solar month that begins during that lunar month. A (Lunar) month is leap and takes the following month’s name when no solar month begins within it. This also may lead to skipped Lunar months. There are two schemes for counting months. In the "amanta" scheme used here months begin and end at New Moon. The other scheme, "purnimanta", has a few peculiarities for counting the leap month, described in CC:UE. In this lunisolar calendar, there are leap months and expunged months. The phase of the moon at sunrise governs day numbers.

Note
This class contains all relevant functions from CC:UE chapter 20. They are also scriptable. The Calendar interfacing functions deal with New Hindu Solar dates.

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 for the New Hindu Solar calendar sorted from the largest to the smallest. More...
 
QString getFormattedDateString () const override
 get a formatted complete string for the date in the New Hindu Solar calendar
 
static double hinduSineTable (const int entry)
 
static double hinduSine (const double theta)
 
static double hinduArcsin (const double amp)
 
static double hinduMeanPosition (const double rd_ut, const double period)
 
static double hinduTruePosition (const double rd_ut, const double period, const double size, const double anomalistic, const double change)
 
static double hinduSolarLongitude (const double rd_ut)
 
static int hinduZodiac (const double rd_ut)
 
static double hinduLunarLongitude (const double rd_ut)
 
static double hinduLunarPhase (const double rd_ut)
 
static int hinduLunarDayFromMoment (const double rd_ut)
 
static double hinduNewMoonBefore (const double rd_ut)
 
static int hinduCalendarYear (const double rd_ut)
 
static QVector< int > hinduSolarFromFixed (int rd)
 
static int fixedFromHinduSolar (const QVector< int > &parts)
 
static QVector< int > hinduLunarFromFixed (int rd)
 
static int fixedFromHinduLunar (const QVector< int > &parts)
 
static double hinduAscensionalDifference (const int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double hinduAscensionalDifference (const int rd, const QString &loc)
 
static double hinduTropicalLongitude (const double rd_ut)
 
static double hinduSolarSiderealDifference (const double rd_ut)
 
static double hinduDailyMotion (const double rd_ut)
 
static double hinduRisingSign (const double rd_ut)
 
static double hinduEquationOfTime (const double rd_ut)
 
static double hinduSunrise (const int rd)
 
static double hinduSunset (const int rd)
 
static double hinduStandardFromSundial (const int rd_ut)
 
static QVector< int > hinduFullMoonFromFixed (int rd)
 Alternative Lunar calendar counted from full moon to full moon. More...
 
static int fixedFromHinduFullMoon (const QVector< int > &parts)
 
static bool hinduExpunged (const int lYear, const int lMonth)
 test for expunged month (CC:UE 20.38)
 
static double altHinduSunrise (const int rd)
 Alternative sunrise formula (CC:UE 20.39)
 
static double siderealSolarLongitude (const double rd_ut)
 
static double ayanamsha (const double rd_ut)
 
static double siderealStart ()
 
static double astroHinduSunset (const int rd)
 
static int siderealZodiac (const double rd_ut)
 
static int astroHinduCalendarYear (const double rd_ut)
 
static QVector< int > astroHinduSolarFromFixed (const int rd)
 
static int fixedFromAstroHinduSolar (const QVector< int > &date)
 
static int astroLunarDayFromMoment (const double rd_ut)
 (CC:UE 20.47)
 
static QVector< int > astroHinduLunarFromFixed (const int rd)
 
static int fixedFromAstroHinduLunar (const QVector< int > &parts)
 
static double hinduSolarLongitudeInv (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 20.50)
 
static double hinduSolarLongitudeAtOrAfter (const double lambda, const double rd_ut)
 
static double meshaSamkranti (const int gYear)
 
static double hinduLunarPhaseInv (double phase, double rdA, double rdB)
 binary search for the moment when lunar phase reaches phi in the time between rdA and rdB (used in CC:UE 20.52)
 
static double hinduLunarDayAtOrAfter (const double k, const double rd_ut)
 
static double hinduLunarNewYear (const int gYear)
 
static bool hinduLunarOnOrBefore (const QVector< int > &date1, const QVector< int > &date2)
 
static int hinduDateOccur (const int lYear, const int lMonth, const int lDay)
 
static QVector< int > hinduLunarHoliday (const int lMonth, const int lDay, const int gYear)
 
static QVector< int > diwali (const int gYear)
 
static int hinduTithiOccur (const int lMonth, const int tithi, const double rd_ut, const int lYear)
 
static QVector< int > hinduLunarEvent (const int lMonth, const int tithi, const double rd_ut, const int gYear)
 
static QVector< int > shiva (const int gYear)
 
static QVector< int > rama (const int gYear)
 
static int hinduLunarStation (const int rd)
 
static int karana (const int n)
 
static int karanaForDay (const int rd)
 
static int yoga (const int rd)
 
static QVector< int > sacredWednesdays (const int gYear)
 
static QVector< int > sacredWednesdaysInRange (const QVector< int > &range)
 
- Public Slots inherited from OldHinduLuniSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromOldHinduLunar (const QVector< int > &parts)
 compute RD date from an Old Hindu Lunisolar date parts={ year, month, leap, day}
 
static QVector< int > oldHinduLunarFromFixed (int rd)
 return { year, month, leap, day}
 
static bool isLeap (int lYear)
 called old-hindu-lunar-leap-year?() in the CC.UE book.
 
- Public Slots inherited from OldHinduSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 hinduDayCount (int rd)
 Return Hindu day count from RD.
 
static int jovianYear (int rd)
 
static int fixedFromOldHinduSolar (const QVector< int > &parts)
 year index in Jovian cycle [1..60]
 
static QVector< int > oldHinduSolarFromFixed (int rd)
 
void setWeekdayStyle (int style)
 configure details for future output. More...
 
void setMonthStyle (int style)
 configure details for future output. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 NewHinduCalendar (double jd)
 
- Public Member Functions inherited from OldHinduLuniSolarCalendar
 OldHinduLuniSolarCalendar (double jd)
 
- Public Member Functions inherited from OldHinduSolarCalendar
 OldHinduSolarCalendar (double jd)
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 

Static Protected Attributes

constexpr static const double hinduSiderealYear =365.+279457./1080000.
 (CC:UE 20.1)
 
constexpr static const double hinduSiderealMonth =27.+4644439./14438334.
 (CC:UE 20.2)
 
constexpr static const double hinduSynodicMonth =29.+7087771./13358334.
 (CC:UE 20.3)
 
constexpr static const int hinduEpoch =-1132959
 
constexpr static const double hinduCreation =hinduEpoch-1955880000.*hinduSiderealYear
 (CC:UE 20.8)
 
constexpr static const double hinduAnomalisticYear =1577917828000./(4320000000.-387.)
 (CC:UE 20.9)
 
constexpr static const double hinduAnomalisticMonth =1577917828./(57753336.-488199.)
 (CC:UE 20.10)
 
constexpr static const int hinduSolarEra = 3179
 Saka era (CC:UE 20.19)
 
constexpr static const int hinduLunarEra = 3044
 Vikrama era (CC:UE 20.22)
 
static const StelLocation ujjain
 Sacred city in India to which we relate the calendar. (CC:UE 20.25)
 
static const StelLocation ujjainUTC
 Sacred city in India to which we relate the calendar, with timezone set to UTC. More...
 
static const StelLocation hinduLocation
 convention to one site to which we relate the calendar. More...
 
static QMap< int, QString > lunarStations
 
static QMap< int, QString > yogas
 
static QMap< int, QString > karanas
 
- Static Protected Attributes inherited from OldHinduLuniSolarCalendar
constexpr static const double aryaLunarMonth = 1577917500./53433336.0
 
constexpr static const double aryaLunarDay = aryaLunarMonth/30.0
 
static QMap< int, QString > monthNames
 
- Static Protected Attributes inherited from OldHinduSolarCalendar
static const int hinduEpoch
 
constexpr static const double aryaSolarYear = 1577917500./4320000.0
 
constexpr static const double aryaSolarMonth = aryaSolarYear/12.0
 
constexpr static const double aryaJovianPeriod = 1577917500./364224.0
 
static QMap< int, QString > weekDayNames
 
static QMap< int, QString > monthNames
 
static QMap< int, QString > jovianNames
 
- 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.
 

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)
 

Member Function Documentation

◆ astroHinduCalendarYear

static int NewHinduCalendar::astroHinduCalendarYear ( const double  rd_ut)
staticslot
Returns
astronomically defined calendar year (CC:UE 20.44)

◆ astroHinduLunarFromFixed

static QVector<int> NewHinduCalendar::astroHinduLunarFromFixed ( const int  rd)
staticslot
Returns
{ year, month, leapMonth, day, leapDay } in an astronomically defined Lunar calendar (CC:UE 20.48)

◆ astroHinduSolarFromFixed

static QVector<int> NewHinduCalendar::astroHinduSolarFromFixed ( const int  rd)
staticslot
Returns
astronomically defined date in the Solar calendar (CC:UE 20.45) result is { year, month, day}

◆ astroHinduSunset

static double NewHinduCalendar::astroHinduSunset ( const int  rd)
staticslot
Returns
astronomical definition of hindu sunset (CC:UE 20.42)

◆ ayanamsha

static double NewHinduCalendar::ayanamsha ( const double  rd_ut)
staticslot
Returns
Lahiri value of ayanamsha (CC:UE 20.40)

◆ diwali

static QVector<int> NewHinduCalendar::diwali ( const int  gYear)
staticslot
Returns
a QVector<int> of RDs of actually occurring Diwali dates in a Gregorian year (CC:UE 20.57)

◆ fixedFromAstroHinduLunar

static int NewHinduCalendar::fixedFromAstroHinduLunar ( const QVector< int > &  parts)
staticslot
Returns
RD date from an astronomically defined New Hindu Lunar date (CC:UE 20.49) parts={ year, month, leapMonth, day, leapDay }

◆ fixedFromAstroHinduSolar

static int NewHinduCalendar::fixedFromAstroHinduSolar ( const QVector< int > &  date)
staticslot
Returns
RD from astronomically defined date in the Solar calendar (CC:UE 20.46)
  • is { year, month, day}

◆ fixedFromHinduFullMoon

static int NewHinduCalendar::fixedFromHinduFullMoon ( const QVector< int > &  parts)
staticslot
Returns
RD date from a New Hindu Lunar date counted from full to full moon (CC:UE 20.37) parts={ year, month, leapMonth, day, leapDay }

◆ fixedFromHinduLunar

static int NewHinduCalendar::fixedFromHinduLunar ( const QVector< int > &  parts)
staticslot
Returns
RD date from a New Hindu Lunar date (CC:UE 20.24) parts={ year, month, leapMonth, day, leapDay }

◆ fixedFromHinduSolar

static int NewHinduCalendar::fixedFromHinduSolar ( const QVector< int > &  parts)
staticslot
Returns
RD date from a New Hindu Solar date (CC:UE 20.21) parts={ year, month, day}

◆ getDateStrings

QStringList NewHinduCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements for the New Hindu Solar calendar sorted from the largest to the smallest.

{Year, Month, MonthName, Day, WeekDayName}

◆ hinduArcsin

static double NewHinduCalendar::hinduArcsin ( const double  amp)
staticslot
Returns
arcsine value within [0...1] for the sine of an angle theta (CC:UE 20.6)

◆ hinduAscensionalDifference

static double NewHinduCalendar::hinduAscensionalDifference ( const int  rd,
const StelLocation loc = StelApp::getInstance().getCore() ->getCurrentLocation() 
)
staticslot
Returns
the ascensional difference (CC:UE 20.27)

◆ hinduCalendarYear

static int NewHinduCalendar::hinduCalendarYear ( const double  rd_ut)
staticslot
Returns
calendar year from RD (CC:UE 20.18)

◆ hinduDailyMotion

static double NewHinduCalendar::hinduDailyMotion ( const double  rd_ut)
staticslot
Returns
daily motion (CC:UE 20.30)

◆ hinduDateOccur

static int NewHinduCalendar::hinduDateOccur ( const int  lYear,
const int  lMonth,
const int  lDay 
)
staticslot
Returns
RD of actually occurring date { lYear, lMonth, lDay} (CC:UE 20.55)

◆ hinduEquationOfTime

static double NewHinduCalendar::hinduEquationOfTime ( const double  rd_ut)
staticslot
Returns
the Hindu equation of time (CC:UE 20.32)

◆ hinduFullMoonFromFixed

static QVector<int> NewHinduCalendar::hinduFullMoonFromFixed ( int  rd)
staticslot

Alternative Lunar calendar counted from full moon to full moon.

Returns
{ year, month, leapMonth, day, leapDay } (CC:UE 20.36)

◆ hinduLunarDayAtOrAfter

static double NewHinduCalendar::hinduLunarDayAtOrAfter ( const double  k,
const double  rd_ut 
)
staticslot
Returns
moment of kth Lunar day (CC:UE 20.52)

◆ hinduLunarDayFromMoment

static int NewHinduCalendar::hinduLunarDayFromMoment ( const double  rd_ut)
staticslot
Returns
lunar day at RD (CC:UE 20.16)

◆ hinduLunarEvent

static QVector<int> NewHinduCalendar::hinduLunarEvent ( const int  lMonth,
const int  tithi,
const double  rd_ut,
const int  gYear 
)
staticslot
Returns
a QVector<int> of RDs of actually occurring tithis in a Gregorian year (CC:UE 20.59)

◆ hinduLunarFromFixed

static QVector<int> NewHinduCalendar::hinduLunarFromFixed ( int  rd)
staticslot
Returns
{ year, month, leapMonth, day, leapDay } (CC:UE 20.23)

◆ hinduLunarHoliday

static QVector<int> NewHinduCalendar::hinduLunarHoliday ( const int  lMonth,
const int  lDay,
const int  gYear 
)
staticslot
Returns
a QVector<int> of RDs of actually occurring dates in a Gregorian year (CC:UE 20.56)

◆ hinduLunarLongitude

static double NewHinduCalendar::hinduLunarLongitude ( const double  rd_ut)
staticslot
Returns
lunar longitude at RD (CC:UE 20.14)

◆ hinduLunarNewYear

static double NewHinduCalendar::hinduLunarNewYear ( const int  gYear)
staticslot
Returns
moment of Lunar new year in Gregorian year gYear (CC:UE 20.53)

◆ hinduLunarOnOrBefore

static bool NewHinduCalendar::hinduLunarOnOrBefore ( const QVector< int > &  date1,
const QVector< int > &  date2 
)
staticslot
Returns
comparison of two lunar dates (CC:UE 20.54)
  • date1 and date2 are {year, month, leapMonth, day, leapDay}

◆ hinduLunarPhase

static double NewHinduCalendar::hinduLunarPhase ( const double  rd_ut)
staticslot
Returns
lunar phase at RD 0..360

◆ hinduLunarStation

static int NewHinduCalendar::hinduLunarStation ( const int  rd)
staticslot
Returns
return nakshatra for the day (CC:UE 20.62)

◆ hinduMeanPosition

static double NewHinduCalendar::hinduMeanPosition ( const double  rd_ut,
const double  period 
)
staticslot
Returns
a mean position at RD of an object with period (CC:UE 20.7)

◆ hinduNewMoonBefore

static double NewHinduCalendar::hinduNewMoonBefore ( const double  rd_ut)
staticslot
Returns
RD of New Moon before RD (CC:UE 20.17) The value is determined by binary search which terminates as soon as the solar zodiacal sign has been determined.

◆ hinduRisingSign

static double NewHinduCalendar::hinduRisingSign ( const double  rd_ut)
staticslot
Returns
the rising sign (CC:UE 20.31)

◆ hinduSine

static double NewHinduCalendar::hinduSine ( const double  theta)
staticslot
Returns
sine value within [0...1] for the sine of an angle theta, interpolated from the 25-entry sine table (CC:UE 20.5)

◆ hinduSineTable

static double NewHinduCalendar::hinduSineTable ( const int  entry)
staticslot
Returns
table value within [0...3438]/3438 for the sine of an angle (CC:UE 20.4) within 0..90 degrees specified as integral number of steps of 225'.

◆ hinduSolarFromFixed

static QVector<int> NewHinduCalendar::hinduSolarFromFixed ( int  rd)
staticslot
Returns
{ year, month, day} (CC:UE 20.20)

◆ hinduSolarLongitude

static double NewHinduCalendar::hinduSolarLongitude ( const double  rd_ut)
staticslot
Returns
solar longitude at RD (CC:UE 20.12)

◆ hinduSolarLongitudeAtOrAfter

static double NewHinduCalendar::hinduSolarLongitudeAtOrAfter ( const double  lambda,
const double  rd_ut 
)
staticslot
Returns
moment of entry into Zodiacal sign (CC:UE 20.50)

◆ hinduSolarSiderealDifference

static double NewHinduCalendar::hinduSolarSiderealDifference ( const double  rd_ut)
staticslot
Returns
solar sidereal difference (CC:UE 20.29)

◆ hinduStandardFromSundial

static double NewHinduCalendar::hinduStandardFromSundial ( const int  rd_ut)
staticslot
Returns
hindu time (CC:UE 20.35)

◆ hinduSunrise

static double NewHinduCalendar::hinduSunrise ( const int  rd)
staticslot
Returns
hindu time of sunrise (CC:UE 20.33)

◆ hinduSunset

static double NewHinduCalendar::hinduSunset ( const int  rd)
staticslot
Returns
hindu time of sunset (CC:UE 20.34)

◆ hinduTithiOccur

static int NewHinduCalendar::hinduTithiOccur ( const int  lMonth,
const int  tithi,
const double  rd_ut,
const int  lYear 
)
staticslot
Returns
RD of when a tithi occurs (CC:UE 20.58)

◆ hinduTropicalLongitude

static double NewHinduCalendar::hinduTropicalLongitude ( const double  rd_ut)
staticslot
Returns
tropical longitude (CC:UE 20.28)

◆ hinduTruePosition

static double NewHinduCalendar::hinduTruePosition ( const double  rd_ut,
const double  period,
const double  size,
const double  anomalistic,
const double  change 
)
staticslot
Returns
a true position at RD of an object with period, ... (CC:UE 20.11)

◆ hinduZodiac

static int NewHinduCalendar::hinduZodiac ( const double  rd_ut)
staticslot
Returns
solar Zodiac sign at RD (CC:UE 20.13)

◆ karana

static int NewHinduCalendar::karana ( const int  n)
staticslot
Returns
karana index (CC:UE 20.63)

◆ karanaForDay

static int NewHinduCalendar::karanaForDay ( const int  rd)
staticslot
Returns
karana [1...60] for day rd. According to Wikipedia (https://en.wikipedia.org/wiki/Hindu_calendar#Kara%E1%B9%87a), the karana at sunrise prevails for the day, but this has yet to be confirmed.

◆ meshaSamkranti

static double NewHinduCalendar::meshaSamkranti ( const int  gYear)
staticslot
Returns
moment of zero longitude in Gregorian year gYear (CC:UE 20.51)

◆ rama

static QVector<int> NewHinduCalendar::rama ( const int  gYear)
staticslot
Returns
dates of rama in Gregorian year (CC:UE 20.61)

◆ sacredWednesdays

static QVector<int> NewHinduCalendar::sacredWednesdays ( const int  gYear)
staticslot
Returns
the sacred Wednesdays in a Gregorian year. (CC:UE 20.65)

◆ sacredWednesdaysInRange

static QVector<int> NewHinduCalendar::sacredWednesdaysInRange ( const QVector< int > &  range)
staticslot
Returns
the sacred Wednesdays in a certain range of RDs. (CC:UE 20.66)

◆ setDate

void NewHinduCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

Year-Month[1...12]-leap[0|1]-Day[1...30]

◆ shiva

static QVector<int> NewHinduCalendar::shiva ( const int  gYear)
staticslot
Returns
dates of shiva in Gregorian year (CC:UE 20.60)

◆ siderealStart

static double NewHinduCalendar::siderealStart ( )
staticslot
Returns
start of sidereal count (CC:UE 20.41)

◆ siderealZodiac

static int NewHinduCalendar::siderealZodiac ( const double  rd_ut)
staticslot
Returns
sidereal zodiac sign (CC:UE 20.43)

◆ yoga

static int NewHinduCalendar::yoga ( const int  rd)
staticslot
Returns
yoga (CC:UE 20.64)

Field Documentation

◆ hinduLocation

const StelLocation NewHinduCalendar::hinduLocation
staticprotected

convention to one site to which we relate the calendar.

(CC:UE 20.26)

◆ ujjainUTC

const StelLocation NewHinduCalendar::ujjainUTC
staticprotected

Sacred city in India to which we relate the calendar, with timezone set to UTC.

(CC:UE 20.25)

◆ NewHinduLunarCalendar

class NewHinduLunarCalendar

New Hindu Lunar dates in the overridden interfacing methods from Calendar.

Functions for the New Hindu Lunisolar calendar described in CC:UE chapter 20.

Author
Georg Zotti
Note
This class contains only the Calendar interfacing methods for the New Hindu "Lunar" dates from CC:UE chapter 20. For scripting, you may use the methods found in class NewHinduCalendar directly.

Public Slots

void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts) override
 set RD 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
 
virtual QString getFormattedPanchangString ()
 get a formatted string for displaying the "panchang", a set of tithi (lunar day), day of week, nakshatra, yoga, karana.
 
- Public Slots inherited from NewHinduCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 for the New Hindu Solar calendar sorted from the largest to the smallest. More...
 
QString getFormattedDateString () const override
 get a formatted complete string for the date in the New Hindu Solar calendar
 
static double hinduSineTable (const int entry)
 
static double hinduSine (const double theta)
 
static double hinduArcsin (const double amp)
 
static double hinduMeanPosition (const double rd_ut, const double period)
 
static double hinduTruePosition (const double rd_ut, const double period, const double size, const double anomalistic, const double change)
 
static double hinduSolarLongitude (const double rd_ut)
 
static int hinduZodiac (const double rd_ut)
 
static double hinduLunarLongitude (const double rd_ut)
 
static double hinduLunarPhase (const double rd_ut)
 
static int hinduLunarDayFromMoment (const double rd_ut)
 
static double hinduNewMoonBefore (const double rd_ut)
 
static int hinduCalendarYear (const double rd_ut)
 
static QVector< int > hinduSolarFromFixed (int rd)
 
static int fixedFromHinduSolar (const QVector< int > &parts)
 
static QVector< int > hinduLunarFromFixed (int rd)
 
static int fixedFromHinduLunar (const QVector< int > &parts)
 
static double hinduAscensionalDifference (const int rd, const StelLocation &loc=StelApp::getInstance().getCore() ->getCurrentLocation())
 
static double hinduAscensionalDifference (const int rd, const QString &loc)
 
static double hinduTropicalLongitude (const double rd_ut)
 
static double hinduSolarSiderealDifference (const double rd_ut)
 
static double hinduDailyMotion (const double rd_ut)
 
static double hinduRisingSign (const double rd_ut)
 
static double hinduEquationOfTime (const double rd_ut)
 
static double hinduSunrise (const int rd)
 
static double hinduSunset (const int rd)
 
static double hinduStandardFromSundial (const int rd_ut)
 
static QVector< int > hinduFullMoonFromFixed (int rd)
 Alternative Lunar calendar counted from full moon to full moon. More...
 
static int fixedFromHinduFullMoon (const QVector< int > &parts)
 
static bool hinduExpunged (const int lYear, const int lMonth)
 test for expunged month (CC:UE 20.38)
 
static double altHinduSunrise (const int rd)
 Alternative sunrise formula (CC:UE 20.39)
 
static double siderealSolarLongitude (const double rd_ut)
 
static double ayanamsha (const double rd_ut)
 
static double siderealStart ()
 
static double astroHinduSunset (const int rd)
 
static int siderealZodiac (const double rd_ut)
 
static int astroHinduCalendarYear (const double rd_ut)
 
static QVector< int > astroHinduSolarFromFixed (const int rd)
 
static int fixedFromAstroHinduSolar (const QVector< int > &date)
 
static int astroLunarDayFromMoment (const double rd_ut)
 (CC:UE 20.47)
 
static QVector< int > astroHinduLunarFromFixed (const int rd)
 
static int fixedFromAstroHinduLunar (const QVector< int > &parts)
 
static double hinduSolarLongitudeInv (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 20.50)
 
static double hinduSolarLongitudeAtOrAfter (const double lambda, const double rd_ut)
 
static double meshaSamkranti (const int gYear)
 
static double hinduLunarPhaseInv (double phase, double rdA, double rdB)
 binary search for the moment when lunar phase reaches phi in the time between rdA and rdB (used in CC:UE 20.52)
 
static double hinduLunarDayAtOrAfter (const double k, const double rd_ut)
 
static double hinduLunarNewYear (const int gYear)
 
static bool hinduLunarOnOrBefore (const QVector< int > &date1, const QVector< int > &date2)
 
static int hinduDateOccur (const int lYear, const int lMonth, const int lDay)
 
static QVector< int > hinduLunarHoliday (const int lMonth, const int lDay, const int gYear)
 
static QVector< int > diwali (const int gYear)
 
static int hinduTithiOccur (const int lMonth, const int tithi, const double rd_ut, const int lYear)
 
static QVector< int > hinduLunarEvent (const int lMonth, const int tithi, const double rd_ut, const int gYear)
 
static QVector< int > shiva (const int gYear)
 
static QVector< int > rama (const int gYear)
 
static int hinduLunarStation (const int rd)
 
static int karana (const int n)
 
static int karanaForDay (const int rd)
 
static int yoga (const int rd)
 
static QVector< int > sacredWednesdays (const int gYear)
 
static QVector< int > sacredWednesdaysInRange (const QVector< int > &range)
 
- Public Slots inherited from OldHinduLuniSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromOldHinduLunar (const QVector< int > &parts)
 compute RD date from an Old Hindu Lunisolar date parts={ year, month, leap, day}
 
static QVector< int > oldHinduLunarFromFixed (int rd)
 return { year, month, leap, day}
 
static bool isLeap (int lYear)
 called old-hindu-lunar-leap-year?() in the CC.UE book.
 
- Public Slots inherited from OldHinduSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 hinduDayCount (int rd)
 Return Hindu day count from RD.
 
static int jovianYear (int rd)
 
static int fixedFromOldHinduSolar (const QVector< int > &parts)
 year index in Jovian cycle [1..60]
 
static QVector< int > oldHinduSolarFromFixed (int rd)
 
void setWeekdayStyle (int style)
 configure details for future output. More...
 
void setMonthStyle (int style)
 configure details for future output. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 NewHinduLunarCalendar (double jd)
 
- Public Member Functions inherited from NewHinduCalendar
 NewHinduCalendar (double jd)
 
- Public Member Functions inherited from OldHinduLuniSolarCalendar
 OldHinduLuniSolarCalendar (double jd)
 
- Public Member Functions inherited from OldHinduSolarCalendar
 OldHinduSolarCalendar (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 NewHinduCalendar
constexpr static const double hinduSiderealYear =365.+279457./1080000.
 (CC:UE 20.1)
 
constexpr static const double hinduSiderealMonth =27.+4644439./14438334.
 (CC:UE 20.2)
 
constexpr static const double hinduSynodicMonth =29.+7087771./13358334.
 (CC:UE 20.3)
 
constexpr static const int hinduEpoch =-1132959
 
constexpr static const double hinduCreation =hinduEpoch-1955880000.*hinduSiderealYear
 (CC:UE 20.8)
 
constexpr static const double hinduAnomalisticYear =1577917828000./(4320000000.-387.)
 (CC:UE 20.9)
 
constexpr static const double hinduAnomalisticMonth =1577917828./(57753336.-488199.)
 (CC:UE 20.10)
 
constexpr static const int hinduSolarEra = 3179
 Saka era (CC:UE 20.19)
 
constexpr static const int hinduLunarEra = 3044
 Vikrama era (CC:UE 20.22)
 
static const StelLocation ujjain
 Sacred city in India to which we relate the calendar. (CC:UE 20.25)
 
static const StelLocation ujjainUTC
 Sacred city in India to which we relate the calendar, with timezone set to UTC. More...
 
static const StelLocation hinduLocation
 convention to one site to which we relate the calendar. More...
 
static QMap< int, QString > lunarStations
 
static QMap< int, QString > yogas
 
static QMap< int, QString > karanas
 
- Static Protected Attributes inherited from OldHinduLuniSolarCalendar
constexpr static const double aryaLunarMonth = 1577917500./53433336.0
 
constexpr static const double aryaLunarDay = aryaLunarMonth/30.0
 
static QMap< int, QString > monthNames
 
- Static Protected Attributes inherited from OldHinduSolarCalendar
static const int hinduEpoch
 
constexpr static const double aryaSolarYear = 1577917500./4320000.0
 
constexpr static const double aryaSolarMonth = aryaSolarYear/12.0
 
constexpr static const double aryaJovianPeriod = 1577917500./364224.0
 
static QMap< int, QString > weekDayNames
 
static QMap< int, QString > monthNames
 
static QMap< int, QString > jovianNames
 
- 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.
 

Member Function Documentation

◆ getDateStrings

QStringList NewHinduLunarCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

Returns
{Year, Month, MonthName, leap[0|1], Day, DayName}

◆ setDate

void NewHinduLunarCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set RD date from a vector of calendar date elements sorted from the largest to the smallest.

parts = {Year, Month[1...12], leapMonth[0|1], Day[1...30], leapDay[0|1] }

◆ OldHinduLuniSolarCalendar

class OldHinduLuniSolarCalendar

Functions for the Old Hindu Lunisolar calendars described in CC:UE chapter 10.

Author
Georg Zotti

The old Hindu Lunisolar calendar as given in CC.UE describes the South Indian version where months begin at New Moon (amanta scheme). The name of a lunar month depends on the solar month that begins during that lunar month. A month is leap and takes the following month’s name when no solar month begins within it. The calendar repeats after 180.000 years.

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromOldHinduLunar (const QVector< int > &parts)
 compute RD date from an Old Hindu Lunisolar date parts={ year, month, leap, day}
 
static QVector< int > oldHinduLunarFromFixed (int rd)
 return { year, month, leap, day}
 
static bool isLeap (int lYear)
 called old-hindu-lunar-leap-year?() in the CC.UE book.
 
- Public Slots inherited from OldHinduSolarCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 hinduDayCount (int rd)
 Return Hindu day count from RD.
 
static int jovianYear (int rd)
 
static int fixedFromOldHinduSolar (const QVector< int > &parts)
 year index in Jovian cycle [1..60]
 
static QVector< int > oldHinduSolarFromFixed (int rd)
 
void setWeekdayStyle (int style)
 configure details for future output. More...
 
void setMonthStyle (int style)
 configure details for future output. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 OldHinduLuniSolarCalendar (double jd)
 
- Public Member Functions inherited from OldHinduSolarCalendar
 OldHinduSolarCalendar (double jd)
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 

Static Protected Attributes

constexpr static const double aryaLunarMonth = 1577917500./53433336.0
 
constexpr static const double aryaLunarDay = aryaLunarMonth/30.0
 
static QMap< int, QString > monthNames
 
- Static Protected Attributes inherited from OldHinduSolarCalendar
static const int hinduEpoch
 
constexpr static const double aryaSolarYear = 1577917500./4320000.0
 
constexpr static const double aryaSolarMonth = aryaSolarYear/12.0
 
constexpr static const double aryaJovianPeriod = 1577917500./364224.0
 
static QMap< int, QString > weekDayNames
 
static QMap< int, QString > monthNames
 
static QMap< int, QString > jovianNames
 
- 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.
 

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)
 

Member Function Documentation

◆ getDateStrings

QStringList OldHinduLuniSolarCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

{Year, Month, MonthName, leap[0|1], Day, DayName}

◆ setDate

void OldHinduLuniSolarCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

Year-Month[1...12]-leap[0|1]-Day[1...30]

◆ OldHinduSolarCalendar

class OldHinduSolarCalendar

Functions for the Old Hindu Solar calendar described in CC:UE chapter 10.

Author
Georg Zotti

The old hindu Solar calendar as given in CC.UE describes the one given in the (First) Arya Siddhanta of Aryabhata (499 C.E.), as amended by Lalla (ca. 720-790 C.E.). There are many variations which are not described in CC.UE and therefore not handled in this implementation.

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 hinduDayCount (int rd)
 Return Hindu day count from RD.
 
static int jovianYear (int rd)
 
static int fixedFromOldHinduSolar (const QVector< int > &parts)
 year index in Jovian cycle [1..60]
 
static QVector< int > oldHinduSolarFromFixed (int rd)
 
void setWeekdayStyle (int style)
 configure details for future output. More...
 
void setMonthStyle (int style)
 configure details for future output. More...
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

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

Static Protected Attributes

static const int hinduEpoch
 
constexpr static const double aryaSolarYear = 1577917500./4320000.0
 
constexpr static const double aryaSolarMonth = aryaSolarYear/12.0
 
constexpr static const double aryaJovianPeriod = 1577917500./364224.0
 
static QMap< int, QString > weekDayNames
 
static QMap< int, QString > monthNames
 
static QMap< int, QString > jovianNames
 
- 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.
 

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)
 

Member Function Documentation

◆ getDateStrings

QStringList OldHinduSolarCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

{Year, JovianCycleNr, JovianCycleName, Month, MonthName, Day, DayName}

◆ setDate

void OldHinduSolarCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

Year-Month[1...12]-Day[1...30]

◆ setMonthStyle

void OldHinduSolarCalendar::setMonthStyle ( int  style)
slot

configure details for future output.

This could be used in a startup script. valid styles: 0=Vedic or 1=Sanskrit or 2=Zodiacal

◆ setWeekdayStyle

void OldHinduSolarCalendar::setWeekdayStyle ( int  style)
slot

configure details for future output.

This could be used in a startup script. valid styles: 0|1 (real difference not documented in CC.UE!)

◆ TibetanCalendar

class TibetanCalendar

Functions for the Tibetan (Phuglugs) calendar.

Author
Georg Zotti

The Tibetan Phuglugs/Phug-pa version of the Kalacakra (Wheel of Time) calendar is similar to the Hindu Lunisolar calendars, described as between the arithmetic simplicity of the old Hindu and the astronomical complexity of the modern Hindu. Astronomical events are calculated in local time which may lead to regional deviations. Bhutan, Mongolian and Sherpa calendars are very similar. Months are lunar with lengths of 29 or 30 days. Leap months precede their "ordinary" months, but leap days follow the "ordinary".

Our implementation uses a 5-part QVector<int> {year, month, leap-month, day, leap-day}

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const 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 fixedFromTibetan (const QVector< int > &tibetan)
 find RD number for date in the Tibetan calendar (CC:UE 21.4) More...
 
static QVector< int > tibetanFromFixed (int rd)
 find date in the Tibetan calendar from RD number (CC:UE 21.5)
 
static double tibetanSunEquation (double alpha)
 
static double tibetanMoonEquation (double alpha)
 
static bool tibetanLeapMonth (const QVector< int > &tYM)
 
static bool tibetanLeapDay (const QVector< int > &tYMD)
 
static int losar (const int tYear)
 
static QVector< int > tibetanNewYear (const int gYear)
 
static QString tibetanSexagesimalYear (const int tYear)
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

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

Static Public Attributes

static const int tibetanEpoch
 
- 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
 

Static Protected Attributes

static QMap< int, QString > weekDayNames
 RD of Gregorian {-127, december, 7}. CC:UE 21.1.
 
static QMap< int, QString > monthNames
 
static QMap< int, QString > animals
 
static QMap< int, QString > elements
 
static QMap< int, QString > yogas
 
static QMap< int, QString > naksatras
 
static QMap< int, QString > karanas
 
- 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.
 

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)
 
- 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)
 

Member Function Documentation

◆ fixedFromTibetan

static int TibetanCalendar::fixedFromTibetan ( const QVector< int > &  tibetan)
staticslot

find RD number for date in the Tibetan calendar (CC:UE 21.4)

  • tibetan={year, month, leapMonth, day, leapDay}

◆ getDateStrings

QStringList TibetanCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

{Year, Month, MonthName, "leap"|"", Day, "leap"|"", WeekDayName} The words "leap" (translated) are only given if the respective element before (month or day) are leap. Else an empty string is given.

◆ losar

static int TibetanCalendar::losar ( const int  tYear)
staticslot
Returns
RD of Losar (New Year) with year number in Tibetan calendar (CC:UE 21.8)

◆ setDate

void TibetanCalendar::setDate ( const QVector< int > &  parts)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

{year, month, leap-month, day, leap-day}

◆ tibetanLeapDay

static bool TibetanCalendar::tibetanLeapDay ( const QVector< int > &  tYMD)
staticslot
Returns
true for a Tibetan leap day (CC:UE 21.7)

◆ tibetanLeapMonth

static bool TibetanCalendar::tibetanLeapMonth ( const QVector< int > &  tYM)
staticslot
Returns
true for a Tibetan leap month (CC:UE 21.6)

◆ tibetanMoonEquation

static double TibetanCalendar::tibetanMoonEquation ( double  alpha)
staticslot
Returns
Tibetan Moon Equation, one of 128 discrete values (CC:UE 21.3)

◆ tibetanNewYear

static QVector<int> TibetanCalendar::tibetanNewYear ( const int  gYear)
staticslot
Returns
a QVector<int> of possible Losar (New Year) dates in a Gregorian year (CC:UE 21.9)
Note
the QVector usually contains one element, but in 719 had zero, in 718 and 12698 two.

◆ tibetanSexagesimalYear

static QString TibetanCalendar::tibetanSexagesimalYear ( const int  tYear)
staticslot
Returns
the year name in the 60-year cycle
Note
modelled after CC:UE 19.18

◆ tibetanSunEquation

static double TibetanCalendar::tibetanSunEquation ( double  alpha)
staticslot
Returns
Tibetan Sun Equation, one of 12 discrete values (CC:UE 21.2)

◆ VietnameseCalendar

class VietnameseCalendar

Functions for the Vietnamese calendar (as derived from the Chinese calendar)

Author
Georg Zotti

The Vietnamese calendar is derived from the Chinese calendar (like Japanese and Korean). The calendar's location for astronomical computations is Saigon. Days begin at midnight. Lunar months begin on the day of New Moon. In difference to the CC:UE book, we must introduce function names which replace "chinese" by "vietnamese" to take the changed location into account, or use methods without the culture name.

Our implementation uses the 5-part QVector<int> {cycle, year, month, leap-month, day} inherited from the Chinese calendar. The years are not counted, only named in its 60-year cycle. The book does not indicate whether Solar Terms are used in this calendar and does not provide names. The respective functions have however been been implemented for the calendar's location.

Public Slots

void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts5) 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
 
QPair< QString, QString > getSolarTermStrings () const override
 get a pair of strings for the Solar Terms for a date More...
 
QString getFormattedSolarTermsString () const override
 get a formatted string of the Solar Terms for a date More...
 
static int fixedFromVietnamese (const QVector< int > &parts5)
 find RD number for date in the Chinese calendar (CC:UE 19.17) More...
 
static QVector< int > vietnameseFromFixed (int rd)
 find date in the Vietnamese calendar from RD number (CC:UE 19.16) More...
 
static int currentMajorSolarTerm (int rd)
 Return current major solar term for rd (CC:UE 19.5) This seems however unused in this calendar.
 
static StelLocation vietnameseLocation (double rd_t)
 Return location of Vietnamese calendar computations (Saigon). Before 1968, this used UT+8, now UT+7. CC:UE 19.38.
 
static double solarLongitudeOnOrAfter (double lambda, double rd_t)
 Return the moment when solar longitude reaches lambda (CC:UE 19.3) More...
 
static int majorSolarTermOnOrAfter (int rd)
 
static int currentMinorSolarTerm (int rd)
 Return current minor solar term for rd (CC:UE 19.5) This seems however unused in this calendar.
 
static int minorSolarTermOnOrAfter (int rd)
 Return minor solar term (CC:UE 19.6)
 
static double midnightInVietnam (int rd)
 Return rd moment of midnight (CC:UE 19.7) This replaces midnight-in-vietnam in the Chinese calendar functions used in Vietnam.
 
static int winterSolsticeOnOrBefore (int rd)
 Return Vietnamese Winter Solstice date (CC:UE 19.8)
 
static int newMoonOnOrAfter (int rd)
 Return Vietnamese New Moon (CC:UE 19.9)
 
static int newMoonBefore (int rd)
 Return Vietnamese New Moon (CC:UE 19.10)
 
static bool noMajorSolarTerm (int rd)
 Auxiliary function (CC:UE 19.11)
 
static bool priorLeapMonth (int mP, int m)
 Auxiliary function (CC:UE 19.12)
 
static int newYearInSui (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13)
 
static int newYearOnOrBefore (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14)
 
static QPair< QString, QString > sexagesimalNames (int n)
 Retrieve name components from the cycle number [1..60]. More...
 
static QPair< QString, QString > yearName (int year)
 Retrieve pair of names (vietnamese stem_branch, translated stem_branch) for Vietnamese year year (CC:UE 19.20)
 
static QPair< QString, QString > monthName (int month, int year)
 Retrieve pair of names (vietnamese stem_branch, translated stem_branch) for Vietnamese month within a year (CC:UE 19.22)
 
static QPair< QString, QString > dayName (int rd)
 Retrieve pair of names (vietnamese stem_branch, translated stem_branch) for Vietnamese day (CC:UE 19.24)
 
- Public Slots inherited from ChineseCalendar
void retranslate () override
 
void setJD (double JD) override
 Set a calendar date from the Julian day number.
 
void setDate (const QVector< int > &parts5) 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
 
virtual QPair< QString, QString > getSolarTermStrings () const
 get a pair of strings for the Solar Terms for a date
 
virtual QString getFormattedSolarTermsString () const
 get a formatted string of the Solar Terms for a date
 
static int fixedFromChinese (const QVector< int > &parts5)
 find RD number for date in the Chinese calendar (CC:UE 19.17) More...
 
static QVector< int > chineseFromFixed (int rd)
 find date in the Chinese calendar from RD number (CC:UE 19.16) More...
 
static int currentMajorSolarTerm (int rd)
 
static StelLocation chineseLocation (double rd_t)
 Return location of Chinese calendar computations (Beijing). Before 1929, this used LMST. CC:UE 19.2.
 
static double solarLongitudeOnOrAfter (double lambda, double rd_t)
 Return the moment when solar longitude reaches lambda (CC:UE 19.3) More...
 
static int majorSolarTermOnOrAfter (int rd)
 
static int currentMinorSolarTerm (int rd)
 Return current minor solar term for rd (CC:UE 19.5)
 
static int minorSolarTermOnOrAfter (int rd)
 Return minor solar term (CC:UE 19.6)
 
static double midnightInChina (int rd)
 Return rd moment of midnight (CC:UE 19.7)
 
static int winterSolsticeOnOrBefore (int rd)
 Return Chinese Winter Solstice date (CC:UE 19.8) More...
 
static int newMoonOnOrAfter (int rd)
 Return Chinese New Moon (CC:UE 19.9) More...
 
static int newMoonBefore (int rd)
 Return Chinese New Moon (CC:UE 19.10) More...
 
static bool noMajorSolarTerm (int rd)
 Auxiliary function (CC:UE 19.11) More...
 
static bool priorLeapMonth (int mP, int m)
 Auxiliary function (CC:UE 19.12) More...
 
static int newYearInSui (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.13) More...
 
static int newYearOnOrBefore (int rd)
 Return RD date of Chinese New Year in the Sui (year) of rd (CC:UE 19.14) More...
 
static QPair< int, int > sexagesimalNumbers (int n)
 Retrieve numerical components from the cycle number [1..60]. (following CC:UE 19.18)
 
static QPair< QString, QString > sexagesimalNames (int n)
 Retrieve name components from the cycle number [1..60]. More...
 
static int chineseNameDifference (const QPair< int, int > &stemBranch1, const QPair< int, int > &stemBranch2)
 Retrieve year difference between name pairs. [1..60]. (CC:UE 19.19)
 
static QPair< QString, QString > yearName (int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese year year (CC:UE 19.20) More...
 
static QPair< QString, QString > monthName (int month, int year)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese month within a year (CC:UE 19.22) More...
 
static int dayNumber (int rd)
 Retrieve one number (1...60) for Chinese day (after CC:UE 19.24) More...
 
static QPair< int, int > dayNumbers (int rd)
 Retrieve pair of index numbers (stem, branch) for Chinese day (after CC:UE 19.24) More...
 
static QPair< QString, QString > dayName (int rd)
 Retrieve pair of names (chinese stem_branch, translated stem_branch) for Chinese day (CC:UE 19.24) More...
 
static int dayNumberOnOrBefore (const QPair< int, int > &stemBranch, int rd)
 Retrieve RD of day number (1...60) on or before rd. More...
 
static int ChineseNewYearInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE before 19.27)
 
static int DragonFestivalInGregorianYear (int gYear)
 Return Chinese year number beginning in Winter of Gregorian year gYear (CC:UE 19.27)
 
static int qingMing (int gYear)
 Return RD of Winter minor term of Gregorian year gYear (CC:UE 19.28)
 
static int chineseAge (const QVector< int > &birthdate, int rd)
 Return age of someone born on birthdate on date rd as expressed by Chinese (CC:UE 19.29) A new-born is aged 1. More...
 
static int chineseYearMarriageAugury (int cycle, int year)
 Determine marriage augury based on year number within a cycle. widows are worst, double-bright are best years.
 
- 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 (const 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 (const 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 (const QVector< int > &parts, const QVector< int > &factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
int rdCorrSum (QVector< int >factors, int corr)
 
static QVector< int > toRadix (int num, const QVector< int > &radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 
static QVector< int > intersectWithRange (const QVector< int > &cand, const 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

 VietnameseCalendar (double jd)
 
- Public Member Functions inherited from ChineseCalendar
 ChineseCalendar (double jd)
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 

Static Protected Attributes

static QMap< int, QString > countedMonthNames
 
static QMap< int, QString > majorSolarTerms
 
static QMap< int, QString > minorSolarTerms
 
static QMap< int, QString > celestialStems
 
static QMap< int, QString > celestialStemsElements
 
static QMap< int, QString > terrestrialBranches
 
static QMap< int, QString > terrestrialBranchesAnimalTotems
 
- Static Protected Attributes inherited from ChineseCalendar
static QMap< int, QString > majorSolarTerms
 RD of Gregorian {-2636, february, 15}. CC:UE 19.15.
 
static QMap< int, QString > minorSolarTerms
 
static QMap< int, QString > celestialStems
 
static QMap< int, QString > celestialStemsElements
 
static QMap< int, QString > terrestrialBranches
 
static QMap< int, QString > terrestrialBranchesAnimalTotems
 
constexpr static const int chineseMonthNameEpoch =57
 
constexpr static const int chineseDayNameEpoch =45
 CC:UE 19.21.
 
constexpr static const int doubleBright =3
 CC:UE 19.23.
 
constexpr static const int bright =2
 CC:UE 19.30.
 
constexpr static const int blind =1
 CC:UE 19.31.
 
constexpr static const int widow =0
 CC:UE 19.32.
 
- 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.
 

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 ChineseCalendar
static const int chineseEpoch
 
- 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)
 

Member Function Documentation

◆ fixedFromVietnamese

static int VietnameseCalendar::fixedFromVietnamese ( const QVector< int > &  parts5)
staticslot

find RD number for date in the Chinese calendar (CC:UE 19.17)

  • parts5={cycle, year, month, leap, day}

◆ getDateStrings

QStringList VietnameseCalendar::getDateStrings ( ) const
overrideslot

get a stringlist of calendar date elements sorted from the largest to the smallest.

{Cycle, Year, Month, MonthName, "leap"|"", Day, WeekDayName} The words "leap" (translated) are only given if the respective month is leap. Else an empty string is given.

◆ getFormattedSolarTermsString

QString VietnameseCalendar::getFormattedSolarTermsString ( ) const
overrideslot

get a formatted string of the Solar Terms for a date

Note
Source: https://en.wikipedia.org/wiki/Solar_term (retrieved 2022-12-11)

◆ getSolarTermStrings

QPair<QString,QString> VietnameseCalendar::getSolarTermStrings ( ) const
overrideslot

get a pair of strings for the Solar Terms for a date

Note
Source: https://en.wikipedia.org/wiki/Solar_term (retrieved 2022-12-11)

◆ setDate

void VietnameseCalendar::setDate ( const QVector< int > &  parts5)
overrideslot

set date from a vector of calendar date elements sorted from the largest to the smallest.

{year, month, leap-month, day, leap-day}

◆ sexagesimalNames

static QPair<QString, QString> VietnameseCalendar::sexagesimalNames ( int  n)
staticslot

Retrieve name components from the cycle number [1..60].

(CC:UE 19.18) In contrast to sexagesimalNumbers, this provides the pair (vietnamese double-name, translated double-name)

◆ solarLongitudeOnOrAfter

static double VietnameseCalendar::solarLongitudeOnOrAfter ( double  lambda,
double  rd_t 
)
staticslot

Return the moment when solar longitude reaches lambda (CC:UE 19.3)

  • rd_t moment.
    Returns
    valid for vietnameseLocation
    Note
    This would be called vietnamese-solar-longitude-on-or-after in the book, but we use overwrites in the derived calendars, making the name without "vietnamese" better.

◆ vietnameseFromFixed

static QVector<int> VietnameseCalendar::vietnameseFromFixed ( int  rd)
staticslot

find date in the Vietnamese calendar from RD number (CC:UE 19.16)

Returns
{cycle, year, month, leap, day}