-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompression.py
34 lines (28 loc) · 1.08 KB
/
compression.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from glob import glob
import os
weights_cubes = glob('/mnt/data/mos_S*/*weights.fits')
noise_cubes = glob('/mnt/data/mos_S*/*noise.fits')
mask_cubes = glob('/mnt/data/mos_S*/*mask.fits')
#print(weights_cubes[:5])
#print(mask_cubes[:5])
for w in weights_cubes:
if not os.path.isfile(w + '.fz') & os.path.isfile(w):
os.system('fpack {}'.format(w))
print('fpack {}'.format(w))
if os.path.isfile(w + '.fz') & os.path.isfile(w):
os.system('rm -r {}'.format(w))
print('rm -r {}'.format(w))
for n in noise_cubes:
if not os.path.isfile(n + '.fz') & os.path.isfile(n):
os.system('fpack {}'.format(n))
print('fpack {}'.format(n))
if os.path.isfile(n + '.fz') & os.path.isfile(n):
os.system('rm -r {}'.format(n))
print('rm -r {}'.format(n))
#for m in mask_cubes:
# if not os.path.isfile(m + '.fz') & os.path.isfile(m):
# os.system('fpack {}'.format(m))
# print('fpack {}'.format(m))
# if os.path.isfile(m + '.fz') & os.path.isfile(m):
# os.system('rm -r {}'.format(m))
# print('rm -r {}'.format(m))