PKG-INFO 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. Metadata-Version: 1.0
  2. Name: jdcal
  3. Version: 1.0
  4. Summary: Julian dates from proleptic Gregorian and Julian calendars.
  5. Home-page: http://github.com/phn/jdcal
  6. Author: Prasanth Nair
  7. Author-email: prasanthhn@gmail.com
  8. License: BSD
  9. Description: jdcal
  10. =====
  11. .. _TPM: http://www.sal.wisc.edu/~jwp/astro/tpm/tpm.html
  12. .. _Jeffrey W. Percival: http://www.sal.wisc.edu/~jwp/
  13. .. _IAU SOFA: http://www.iausofa.org/
  14. .. _pip: http://pypi.python.org/pypi/pip
  15. .. _easy_install: packages.python.org/distribute/easy_install.html
  16. This module contains functions for converting between Julian dates and
  17. calendar dates.
  18. A function for converting Gregorian calendar dates to Julian dates, and
  19. another function for converting Julian calendar dates to Julian dates
  20. are defined. Two functions for the reverse calculations are also
  21. defined.
  22. Different regions of the world switched to Gregorian calendar from
  23. Julian calendar on different dates. Having separate functions for Julian
  24. and Gregorian calendars allow maximum flexibility in choosing the
  25. relevant calendar.
  26. Julian dates are stored in two floating point numbers (double). Julian
  27. dates, and Modified Julian dates, are large numbers. If only one number
  28. is used, then the precision of the time stored is limited. Using two
  29. numbers, time can be split in a manner that will allow maximum
  30. precision. For example, the first number could be the Julian date for
  31. the beginning of a day and the second number could be the fractional
  32. day. Calculations that need the latter part can now work with maximum
  33. precision.
  34. All the above functions are "proleptic". This means that they work for
  35. dates on which the concerned calendar is not valid. For example,
  36. Gregorian calendar was not used prior to around October 1582.
  37. A function to test if a given Gregorian calendar year is a leap year is
  38. also defined.
  39. Zero point of Modified Julian Date (MJD) and the MJD of 2000/1/1
  40. 12:00:00 are also given as module level constants.
  41. Examples
  42. --------
  43. Some examples are given below. For more information see
  44. http://oneau.wordpress.com/jdcal/.
  45. Gregorian calendar::
  46. >>> gcal2jd(2000,1,1)
  47. (2400000.5, 51544.0)
  48. >>> 2400000.5 + 51544.0 + 0.5
  49. 2451545.0
  50. >>> gcal2jd(2000,2,30)
  51. (2400000.5, 51604.0)
  52. >>> gcal2jd(2000,3,1)
  53. (2400000.5, 51604.0)
  54. >>> gcal2jd(2001,2,30)
  55. (2400000.5, 51970.0)
  56. >>> gcal2jd(2001,3,2)
  57. (2400000.5, 51970.0)
  58. >>> jd2gcal(*gcal2jd(2000,1,1))
  59. (2000, 1, 1, 0.0)
  60. >>> jd2gcal(*gcal2jd(1950,1,1))
  61. (1950, 1, 1, 0.0)
  62. >>> gcal2jd(2000,1,1)
  63. (2400000.5, 51544.0)
  64. >>> jd2gcal(2400000.5, 51544.0)
  65. (2000, 1, 1, 0.0)
  66. >>> jd2gcal(2400000.5, 51544.5)
  67. (2000, 1, 1, 0.5)
  68. >>> jd2gcal(2400000.5, 51544.245)
  69. (2000, 1, 1, 0.24500000000261934)
  70. >>> jd2gcal(2400000.5, 51544.1)
  71. (2000, 1, 1, 0.099999999998544808)
  72. >>> jd2gcal(2400000.5, 51544.75)
  73. (2000, 1, 1, 0.75)
  74. Julian calendar::
  75. >>> jd2jcal(*jcal2jd(2000, 1, 1))
  76. (2000, 1, 1, 0.0)
  77. >>> jd2jcal(*jcal2jd(-4000, 10, 11))
  78. (-4000, 10, 11, 0.0)
  79. Gregorian leap year::
  80. >>> is_leap(2000)
  81. True
  82. >>> is_leap(2100)
  83. False
  84. JD for zero point of MJD, and MJD for JD2000.0::
  85. >>> print MJD_0
  86. 2400000.5
  87. >>> print MJD_JD2000
  88. 51544.5
  89. Installation
  90. ------------
  91. The module can be installed using `pip`_ or `easy_install`_::
  92. $ pip install jdcal
  93. or,
  94. ::
  95. $ easy_install jdcal
  96. Credits
  97. --------
  98. 1. A good amount of the code is based on the excellent `TPM`_ C library
  99. by `Jeffrey W. Percival`_. A Python interface to this C library is
  100. available at http://github.com/phn/pytpm.
  101. 2. The inspiration to split Julian dates into two numbers came from the
  102. `IAU SOFA`_ C library. No code or algorithm from the SOFA library is
  103. used in `jdcal`.
  104. License
  105. -------
  106. Released under BSD; see
  107. http://www.opensource.org/licenses/bsd-license.php.
  108. For comments and suggestions, email to user `prasanthhn` in the `gmail.com`
  109. domain.
  110. Platform: UNKNOWN
  111. Classifier: Development Status :: 6 - Mature
  112. Classifier: Intended Audience :: Science/Research
  113. Classifier: Operating System :: OS Independent
  114. Classifier: License :: OSI Approved :: BSD License
  115. Classifier: Topic :: Scientific/Engineering :: Astronomy
  116. Classifier: Programming Language :: Python