@@ -390,9 +390,9 @@ def get_ccsds_time_format(time_string):
390390 raise RuntimeError (f"*** Error -- Invalid CCSDS time string: { time_string } \n Date format not one of yyyy-mm-dd or yyyy-DDD.\n " )
391391 # % Check if 'Z' time zone indicator appended to the string
392392 if time_string [- 1 ]== 'Z' :
393- zOpt = True
393+ z_opt = True
394394 else :
395- zOpt = False
395+ z_opt = False
396396 # % Find location of the fraction of seconds decimal separator
397397 num_decimal = time_string .count ('.' )
398398 if num_decimal > 1 :
@@ -401,37 +401,37 @@ def get_ccsds_time_format(time_string):
401401 idx_decimal = time_string .find ('.' )
402402 nfrac = 0
403403 if num_decimal != 0 :
404- if zOpt :
404+ if z_opt :
405405 nfrac = len (time_string ) - 1 - idx_decimal - 1
406406 else :
407407 nfrac = len (time_string ) - 1 - idx_decimal
408408 if nfrac > 0 :
409409 frac_str = '.' + ('F' * nfrac )
410410 else :
411411 frac_str = ""
412- if zOpt :
412+ if z_opt :
413413 frac_str = frac_str + 'Z'
414414 time_format = time_format + frac_str
415415 return time_format
416416
417- def DOY_2_date (value , DOY , YEAR , idx ):
417+ def doy_2_date (value , doy , year , idx ):
418418 '''
419419 Written by Andrew Ng, 18/03/2022,
420420 Based on source code @ https://github.com/nasa/CARA_Analysis_Tools/blob/master/two-dimension_Pc/Main/TransformationCode/TimeTransformations/DOY2Date.m
421421 Use the datetime python package.
422- DOY_2_date - Converts Day of Year (DOY) date format to date format.
422+ doy_2_date - Converts Day of Year (DOY) date format to date format.
423423
424424 Args:
425425 - value(``str``): Original date time string with day of year format "YYYY-DDDTHH:MM:SS.ff"
426- - DOY (``str``): The day of year in the DOY format.
427- - YEAR (``str``): The year.
426+ - doy (``str``): The day of year in the DOY format.
427+ - year (``str``): The year.
428428 - idx (``int``): Index of the start of the original "value" string at which characters 'DDD' are found.
429429 Returns:
430430 -value (``str``): Transformed date in traditional date format. i.e.: "YYYY-mm-ddTHH:MM:SS.ff"
431431
432432 '''
433433 # Calculate datetime format
434- date_num = datetime .datetime (int (YEAR ), 1 , 1 ) + datetime .timedelta (int (DOY ) - 1 )
434+ date_num = datetime .datetime (int (year ), 1 , 1 ) + datetime .timedelta (int (doy ) - 1 )
435435 # Split datetime object into a date list
436436 date_vec = [date_num .year , date_num .month , date_num .day , date_num .hour , date_num .minute ]
437437 value = str (date_vec [0 ]) + '-' + str (date_vec [1 ]) + '-' + str (date_vec [2 ]) + 'T' + value [idx + 4 :- 1 ]
0 commit comments