spacepy.time.leapyear

spacepy.time.leapyear(year, numdays=False)[source]

return an array of boolean leap year, a lot faster than the mod method that is normally seen

Parameters:
yeararray_like

array of years

numdaysboolean (optional)

optionally return the number of days in the year

Returns:
outnumpy array

an array of boolean leap year, or array of number of days

Examples

>>> import numpy
>>> import spacepy.time
>>> spacepy.time.leapyear(numpy.arange(15)+1998)
[False, False,  True, False, False, False,  True, False, False,
      False,  True, False, False, False,  True]