Commit 22e312f1 authored by Lakshan Ram Madhan Mohan's avatar Lakshan Ram Madhan Mohan
Browse files

Option to rename distance to mirrors from filename.

parent c7d3e261
......@@ -115,6 +115,24 @@ class ImageInfo(object):
def get_dist_to_mirr_in_m(self):
return self._dist_to_mirr
def change_dist_to_mirror_in_m(self, new_dist_to_mirror_in_m):
if self._file_name.find('DTOMm-') is not -1:
new_filepath = self._file_path.replace(str(self._dist_to_mirr).replace('.', ','),
str(new_dist_to_mirror_in_m).replace('.', ','))
elif self._file_name.find('DTOMmm-') is not -1:
new_filepath = self._file_path.replace(str(self._dist_to_mirr*1000),
print(f'Distance to mirror changed from {self._dist_to_mirr} to {new_dist_to_mirror_in_m} m')
# self._dist_to_mirr = new_dist_to_mirror_in_m
os.rename(self._file_path, new_filepath)
self._file_path = new_filepath
self._dist_to_mirr = new_dist_to_mirror_in_m
def get_identifier(self):
return self._identifier
Supports Markdown
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