Skip to content

Commit 3956d61

Browse files
committed
RWZ: remove load_m0 option, added mmin. Check on path's existance
1 parent 147fd51 commit 3956d61

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

PyART/catalogs/rwz.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,29 @@ class Waveform_RWZ(Waveform):
1515

1616
def __init__(self,
1717
path,
18-
r_ext = None,
18+
r_ext = None,
1919
ellmax = 4,
20+
mmin = 1,
2021
cut_u = None,
21-
load_m0 = False,
2222
par_rel_path = None,
2323
parfile_tokens = []):
2424

2525
super().__init__()
26+
27+
if not os.path.exists(path):
28+
raise RuntimeError(f'Path not found: {path}')
29+
2630
self.path = path
2731
self.ellmax = ellmax
32+
self.mmin = mmin
2833
self.cut_u = cut_u
2934
self._kind = "RWZ"
3035
self.domain = "Time"
3136
self.par_rel_path = par_rel_path
32-
37+
3338
self.load_metadata(tokens=parfile_tokens)
3439
self.load_dynamics()
35-
self.load_hlm(load_m0=load_m0, r_ext=r_ext)
40+
self.load_hlm(r_ext=r_ext)
3641

3742
pass
3843

@@ -48,7 +53,7 @@ def load_metadata(self, tokens=[]):
4853
parfile = glob(os.path.join(self.path, self.par_rel_path, pattern))
4954

5055
if len(parfile) == 0:
51-
raise RuntimeError("No parfile found!")
56+
raise FileNotFoundError("No parfile found!")
5257
if len(parfile) > 1:
5358
raise RuntimeError("Multiple parfiles found!")
5459

@@ -125,7 +130,7 @@ def load_dynamics(self):
125130

126131
pass
127132

128-
def load_hlm(self, r_ext=None, ellmax=None, load_m0=False):
133+
def load_hlm(self, r_ext=None, ellmax=None):
129134

130135
if not hasattr(self, 'metadata'):
131136
raise RuntimeError('Load metadata before loading the hlm!')
@@ -143,9 +148,8 @@ def load_hlm(self, r_ext=None, ellmax=None, load_m0=False):
143148
ellmax = self.ellmax
144149

145150
modes = []
146-
mmin = 0 if load_m0 else 1
147151
for l in range(2,ellmax+1):
148-
for m in range(mmin,l+1):
152+
for m in range(self.mmin,l+1):
149153
modes.append( (l,m) )
150154

151155
# cut the waveform to the desired time interval

0 commit comments

Comments
 (0)