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
csst-pipeline
csst_common
Commits
20053b69
Commit
20053b69
authored
May 18, 2023
by
BO ZHANG
🏀
Browse files
raise FileNotFoundError when dm cannot find files
parent
e9027b53
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
20053b69
...
...
@@ -463,7 +463,8 @@ class CsstMsDataManager:
assert
detector
in
self
.
available_detectors
fn
=
f
"
{
self
.
instrument
}
_
{
self
.
obs_id
}
_chip_
{
detector
:
02
d
}
_filt_
{
self
.
detector2filter
[
detector
]
}
.cat"
fp
=
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
assert
os
.
path
.
exists
(
fp
)
if
not
os
.
path
.
exists
(
fp
):
raise
FileNotFoundError
(
f
"File not found:
{
fp
}
"
)
return
fp
def
l0_log
(
self
,
detector
=
6
):
...
...
@@ -471,7 +472,8 @@ class CsstMsDataManager:
assert
detector
in
self
.
available_detectors
fn
=
f
"
{
self
.
instrument
}
_
{
self
.
obs_id
}
_chip_
{
detector
:
02
d
}
_filt_
{
self
.
detector2filter
[
detector
]
}
.log"
fp
=
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
assert
os
.
path
.
exists
(
fp
)
if
not
os
.
path
.
exists
(
fp
):
raise
FileNotFoundError
(
f
"File not found:
{
fp
}
"
)
return
fp
def
l0_detector
(
self
,
detector
=
6
):
...
...
@@ -484,8 +486,9 @@ class CsstMsDataManager:
fn
=
f
"
{
self
.
telescope
}
_
{
self
.
instrument
}
_
{
self
.
project
}
_
{
self
.
obs_type
}
_
{
self
.
exp_start
}
_"
\
f
"
{
self
.
exp_stop
}
_
{
self
.
obs_id
}
_
{
detector
:
02
d
}
_L
{
self
.
level
}
_V
{
self
.
version
}
.
{
self
.
ext
}
"
fp
=
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
assert
os
.
path
.
exists
(
fp
)
return
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
if
not
os
.
path
.
exists
(
fp
):
raise
FileNotFoundError
(
f
"File not found:
{
fp
}
"
)
return
fp
def
l0_crs
(
self
,
detector
=
6
):
""" L0 cosmic ray file path """
...
...
@@ -497,8 +500,9 @@ class CsstMsDataManager:
fn
=
f
"
{
self
.
telescope
}
_
{
self
.
instrument
}
_
{
self
.
project
}
_CRS_
{
self
.
exp_start
}
_"
\
f
"
{
self
.
exp_stop
}
_
{
self
.
obs_id
}
_
{
detector
:
02
d
}
_L
{
self
.
level
}
_V
{
self
.
version
}
.
{
self
.
ext
}
"
fp
=
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
assert
os
.
path
.
exists
(
fp
)
return
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
if
not
os
.
path
.
exists
(
fp
):
raise
FileNotFoundError
(
f
"File not found:
{
fp
}
"
)
return
fp
def
l1_detector
(
self
,
detector
=
6
,
post
=
"IMG.fits"
):
""" generate L1 file path
...
...
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