import datetime as dt
import gdal

nasa_date_format = '%Y-%j'
nasa_dt_format = nasa_date_format + 'T%H:%M:%S'
standard_date_format = '%Y-%m-%d'
standard_dt_format = standard_date_format + 'T%H:%M:%S'


def nasa_date_to_iso(datestr):
    date = dt.datetime.strptime(datestr, nasa_date_format)
    return date.isoformat()


def iso_to_nasa_date(datestr):
    date = dt.datetime.strptime(datestr, standard_date_format)
    return date.strftime(nasa_date_format)


def nasa_datetime_to_iso(dtimestr):
    time = dt.datetime.strptime(dtimestr, nasa_dt_format)
    return time.isoformat()


def iso_to_nasa_datetime(dtimestr):
    date = dt.datetime.strptime(dtimestr, standard_dt_format)
    return date.strftime(nasa_dt_format)


def get_center_coords(imgpath):
    ds = gdal.Open(str(imgpath))
    xmean = ds.RasterXSize//2
    ymean = ds.RasterYSize//2
    return xmean, ymean

@@ -103,16 +103,64 @@
 :%25M:%25S'%0A
+nasa_dt_format_with_ms = nasa_dt_format + '.%25f'%0A
 standard
@@ -534,24 +534,139 @@
 (dtimestr):%0A
+    if dtimestr.split('.')%5B1%5D:%0A        tformat = nasa_dt_format_with_ms%0A    else:%0A        tformat = nasa_dt_format%0A
     time = d
@@ -695,24 +695,17 @@
 imestr, 
-nasa_dt_
+t
 format)%0A

improve time converter