Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alice Donini
lst-analysis
Commits
0df4a512
Commit
0df4a512
authored
May 19, 2022
by
Alice Donini
Browse files
update tree script
parent
66cb0a27
Changes
1
Hide whitespace changes
Inline
Side-by-side
create_analysis_tree.py
View file @
0df4a512
...
...
@@ -37,7 +37,7 @@ def makedir(name):
# Create target Directory if don't exist
if
not
os
.
path
.
exists
(
name
):
os
.
makedirs
(
name
)
print
(
"Directory "
,
name
,
"
C
reated "
)
print
(
"Directory "
,
name
,
"
c
reated "
)
else
:
print
(
"Directory "
,
name
,
" already exists"
)
return
None
...
...
@@ -64,31 +64,33 @@ def main():
)
parser
.
add_argument
(
'--night'
,
type
=
str
,
required
=
True
,
dest
=
'night'
,
'--night'
,
nargs
=
'+'
,
type
=
int
,
required
=
True
,
dest
=
'night'
,
help
=
'Night date'
)
parser
.
add_argument
(
'--version'
,
type
=
str
,
required
=
False
,
dest
=
'version'
,
default
=
'v0.9.2'
,
help
=
'lstchain version'
default
=
'v0.9.2'
,
help
=
'lstchain version
(default: %(default)s)
'
)
parser
.
add_argument
(
'--cleaning'
,
type
=
str
,
required
=
False
,
dest
=
'cleaning'
,
default
=
'tailcut84'
,
help
=
'Cleaning type'
default
=
'tailcut84'
,
help
=
'Cleaning type
(default: %(default)s)
'
)
args
=
parser
.
parse_args
()
# Define analysis directories and subdirectories
data_dir
=
[
'DL1'
,
'DL2'
,
'DL3'
]
structure
=
f
'
{
args
.
source
}
/
{
args
.
night
}
/
{
args
.
version
}
/
{
args
.
cleaning
}
'
nights
=
args
.
night
for
folder
in
data_dir
:
dirName
=
os
.
path
.
join
(
f
'
{
args
.
main_dir
}
'
,
str
(
folder
),
structure
)
makedir
(
dirName
)
for
night
in
nights
:
structure
=
f
'
{
args
.
source
}
/
{
night
}
/
{
args
.
version
}
/
{
args
.
cleaning
}
'
for
folder
in
data_dir
:
dirName
=
os
.
path
.
join
(
f
'
{
args
.
main_dir
}
'
,
str
(
folder
),
structure
)
makedir
(
dirName
)
print
(
f
'Directory structure
ready
for analysis on
{
args
.
source
}
.'
)
print
(
f
'Directory structure for analysis on
{
args
.
source
}
was created
.'
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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