sot/Chandra.Time — pull request #7 by taldcroft (2013-03-18 00:46:30+00:00)
Title: Problem converting greta format times with zero hrs mins secs

Entering a time in greta format works great, except when the digits to the right of the decimal place are zero, where an error is raised: ChandraTimeError: Invalid input format 'greta'

Here is an example:

In [1]: from Chandra.Time import DateTime

In [2]: sometime = DateTime(2013055.121212123,format='greta')

In [3]: print sometime.date
2013:055:12:12:12.123

In [4]: sometime = DateTime(2013055.000000000,format='greta')

In [5]: print sometime.date
---------------------------------------------------------------------------
ChandraTimeError Traceback (most recent call last)
in ()
----> 1 print sometime.date

C:\Users\mbaski\Documents\Baski_Data\Chandra\MATLAB\FOT_Tools\Python\python_Windows_64bit\lib\site-packages\chandra.time-1.14-py2.7-win-amd64.egg\Chandra\Time.pyc in __getattr__(self, fmt_out)
579 return convert(self.time_in,
580 fmt_in=self.format,
--> 581 fmt_out=fmt_out,
582 )
583

C:\Users\mbaski\Documents\Baski_Data\Chandra\MATLAB\FOT_Tools\Python\python_Windows_64bit\lib\site-packages\chandra.time-1.14-py2.7-win-amd64.egg\Chandra\Time.pyc in convert(time_in, sys_in, fmt_in, sys_out, fmt_out)
500 return [_convert(x, sys_in, fmt_in, sys_out, fmt_out) for x in time_in]
501 except TypeError:
--> 502 return _convert(time_in, sys_in, fmt_in, sys_out, fmt_out)
503
504 def _convert(time_in, sys_in, fmt_in, sys_out, fmt_out):

C:\Users\mbaski\Documents\Baski_Data\Chandra\MATLAB\FOT_Tools\Python\python_Windows_64bit\lib\site-packages\chandra.time-1.14-py2.7-win-amd64.egg\Chandra\Time.pyc in _convert(time_in, sys_in, fmt_in, sys_out, fmt_out)
524 break
525 else:
--> 526 raise ChandraTimeError, "Invalid input format '%s'" % fmt_in
527
528 if sys_in:

ChandraTimeError: Invalid input format 'greta'