Skip to content

Commit e3a8460

Browse files
committed
fix docstring
1 parent ffe9bd9 commit e3a8460

1 file changed

Lines changed: 28 additions & 21 deletions

File tree

kessler/util.py

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -441,30 +441,37 @@ def progress_bar_end(message=None):
441441
print(message)
442442

443443
def get_ccsds_time_format(time_string):
444-
'''
445-
Adapted by Andrew Ng, 18/3/2022.
446-
Original MATLAB source code found at: https://github.com/nasa/CARA_Analysis_Tools/blob/master/two-dimension_Pc/Main/TransformationCode/TimeTransformations/getCcsdsTimeFormat.m
447-
get_ccsds_time_format - process and outputs the format of the time string extracted from the CDM.
448-
The CCSDS time format is required to be of the general form
449-
yyyy-[mm-dd|ddd]THH:MM:SS[.F*][Z]
450-
(1) The date and time fields are separated by a "T".
451-
(2) The date field has a four digit year followed by either a two digit
452-
month and two digit day, or a three digit day-of-year.
453-
(3) The year, month, day, and day-of-year fields are separated by a dash.
454-
(4) The hours, minutes and seconds fields are each two digits separated
455-
by colons.
456-
(5) The fraction of seconds is optional and can have any number of
457-
digits.
458-
(6) If a fraction of seconds is provided, it is separated from the two
459-
digit seconds by a period.
460-
(7) The time string can end with an optional "Z" time zone indicator
444+
"""
445+
Adapted by Andrew Ng, 18/3/2022.
446+
Original MATLAB source code:
447+
`NASA CARA Analysis Tools <https://github.com/nasa/CARA_Analysis_Tools/blob/master/two-dimension_Pc/Main/TransformationCode/TimeTransformations/getCcsdsTimeFormat.m>`_
448+
449+
Processes and outputs the format of the time string extracted from the CDM.
450+
The CCSDS time format is required to be of the general form:
451+
452+
.. code-block:: none
453+
454+
yyyy-[mm-dd|ddd]THH:MM:SS[.F*][Z]
455+
456+
Format Rules:
457+
1. The date and time fields are separated by a **"T"**.
458+
2. The date field consists of a **four-digit year**, followed by either:
459+
- A two-digit month and a two-digit day, or
460+
- A three-digit day-of-year.
461+
3. The year, month, day, and day-of-year fields are separated by a **dash ("-")**.
462+
4. The hours, minutes, and seconds fields are **two-digit values** separated by **colons (":")**.
463+
5. The fraction of seconds is optional and can have **any number of digits**.
464+
6. If a fraction of seconds is provided, it is separated from the two-digit seconds by a **period (".")**.
465+
7. The time string can end with an optional **"Z"** time zone indicator.
461466
462467
Args:
463-
- time_string(``str``): Original time string stored in CDM.
464-
Returns:
465-
- time_format(``str``): Outputs the format of the time string. It must be of the form yyyy-[mm-dd|ddd]THH:MM:SS[.F*][Z], otherwise it is invalid and a RuntimeError is raised.
468+
time_string (str): Original time string stored in CDM.
469+
470+
Returns:
471+
str: Outputs the format of the time string.
472+
Must be of the form **yyyy-[mm-dd|ddd]THH:MM:SS[.F*][Z]**, otherwise a `RuntimeError` is raised.
473+
"""
466474

467-
'''
468475
time_format = []
469476
numT = time_string.count('T')
470477
if numT == -1:

0 commit comments

Comments
 (0)