-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compress test fits spectra and create script to unzip them.
- Loading branch information
1 parent
2d454a5
commit 137cc89
Showing
15 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+3.5 MB
data/test_data/PHOENIX-raw/WAVE_PHOENIX-ACES-AGSS-COND-2011.fits.tar.gz
Binary file not shown.
Binary file removed
BIN
-6 MB
data/test_data/PHOENIX-raw/Z-0.0/lte02600-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits
Binary file not shown.
Binary file added
BIN
+5.23 MB
...st_data/PHOENIX-raw/Z-0.0/lte02600-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits.tar.gz
Binary file not shown.
Binary file removed
BIN
-6 MB
data/test_data/PHOENIX-raw/Z-0.0/lte02800-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits
Binary file not shown.
Binary file added
BIN
+5.19 MB
...st_data/PHOENIX-raw/Z-0.0/lte02800-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits.tar.gz
Binary file not shown.
Binary file removed
BIN
-6 MB
data/test_data/PHOENIX-raw/Z-0.0/lte03500-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits
Binary file not shown.
Binary file added
BIN
+5.05 MB
...st_data/PHOENIX-raw/Z-0.0/lte03500-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits.tar.gz
Binary file not shown.
Binary file removed
BIN
-6 MB
data/test_data/PHOENIX-raw/Z-0.0/lte03900-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits
Binary file not shown.
Binary file added
BIN
+4.94 MB
...st_data/PHOENIX-raw/Z-0.0/lte03900-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits.tar.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""This extracts the test data compressed fits.tar.gz files. | ||
May not be needed if Starfish is able to handle .tar.gz files. | ||
""" | ||
import eniric | ||
import tarfile | ||
from os.path import exists, join | ||
|
||
|
||
def unzip(dir: str, filename: str, overwrite: bool = False): | ||
joint_name = join(dir, filename) | ||
|
||
if (not exists(joint_name)) or (overwrite is True): | ||
with tarfile.open(join(joint_name + ".tar.gz"), "r") as tar: | ||
tar.extractall(dir) | ||
else: | ||
print("Did not overwrite file: {0}".format(joint_name)) | ||
|
||
if __name__ == "__main__": | ||
path = eniric.paths["phoenix_raw"] | ||
|
||
unzip(path, "WAVE_PHOENIX-ACES-AGSS-COND-2011.fits") | ||
|
||
aces_spec = [ | ||
"lte02600-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits", | ||
"lte02800-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits", | ||
"lte03500-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits", | ||
"lte03900-4.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits", | ||
] | ||
for aces in aces_spec: | ||
unzip(join(path, "Z-0.0"), aces) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters