Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Samuel William Maddrell-Mander
RICHmirrorD0
Commits
22e312f1
Commit
22e312f1
authored
Jun 10, 2021
by
Lakshan Ram Madhan Mohan
Browse files
Option to rename distance to mirrors from filename.
parent
c7d3e261
Changes
1
Hide whitespace changes
Inline
Side-by-side
RICHmirrorD0.py
View file @
22e312f1
...
...
@@ -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
(
'.'
,
','
))
print
(
new_filepath
)
elif
self
.
_file_name
.
find
(
'DTOMmm-'
)
is
not
-
1
:
new_filepath
=
self
.
_file_path
.
replace
(
str
(
self
.
_dist_to_mirr
*
1000
),
str
(
new_dist_to_mirror_in_m
*
1000
))
print
(
new_filepath
)
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment