Commit 0e505d3b authored by CEVAER's avatar CEVAER

Fix attributes

parent f2cf3ac6
......@@ -260,6 +260,9 @@ def extract_write_cyclone_data(dataset, kept_track_points, filename, output_path
logger.info(f"Data has less than {min_pixel} pixel of data. Not writing to file.")
return
# Deleting all attributes
sel.attrs.clear()
# Extracting min and max time to set attributes on NetCDF
min_time, max_time = extract_start_stop_measure(sel, time_col_name)
if max_time - min_time > datetime.timedelta(minutes=30):
......@@ -282,9 +285,6 @@ def extract_write_cyclone_data(dataset, kept_track_points, filename, output_path
#sel.attrs["measurement_stop_date"] = str(file_date + max_time)
sel.attrs["measurementDate"] = (min_date + (max_date - min_date) / 2).strftime("%Y-%m-%d %H:%M:%S")
# Deleting all attributes
sel.attrs.clear()
# Setting new attributes
for attr in attrs:
if type(attrs[attr]) == dict:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment