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
cbcd1ef6
Commit
cbcd1ef6
authored
Oct 23, 2025
by
BO ZHANG
🏀
Browse files
add support for fits: write test FITS file in setUp
parent
c3da557f
Pipeline
#10808
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/test_fits.py
View file @
cbcd1ef6
...
...
@@ -12,6 +12,7 @@ Modified-History:
import
os
import
unittest
import
numpy
as
np
from
csst_common
import
fits
test_fits_file
=
os
.
path
.
join
(
...
...
@@ -22,6 +23,15 @@ test_fits_file = os.path.join(
class
TestFitsHeaderOps
(
unittest
.
TestCase
):
def
setUp
(
self
):
hl
=
fits
.
HDUList
(
[
fits
.
PrimaryHDU
(),
fits
.
ImageHDU
(
data
=
np
.
random
.
randn
(
5
,
5
)),
]
)
hl
.
writeto
(
test_fits_file
)
def
test_fits_open
(
self
):
hl
=
fits
.
open
(
test_fits_file
)
self
.
assertIsInstance
(
hl
,
fits
.
HDUList
)
...
...
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