forked from IPKM/nmreval
Reviewed-on: IPKM/nmreval#196
This commit is contained in:
commit
5ad6456b16
@ -697,17 +697,20 @@ class Points:
|
|||||||
np.savetxt(path, self.toarray(err=err), header=header, fmt='%.10e')
|
np.savetxt(path, self.toarray(err=err), header=header, fmt='%.10e')
|
||||||
else:
|
else:
|
||||||
with path.open('w') as f:
|
with path.open('w') as f:
|
||||||
f.write(header)
|
f.write('# ' + '\n# '.join(header.split('\n')))
|
||||||
|
f.write('\n')
|
||||||
for i, l in enumerate(self.toarray(err=err)):
|
for i, l in enumerate(self.toarray(err=err)):
|
||||||
if self.mask[i]:
|
if self.mask[i]:
|
||||||
f.write('\t'.join(map(lambda _x: f'{_x:.10e}', l.tolist())) + '\n')
|
f.write('\t'.join(map(lambda _x: f'{_x:.10e}', l.tolist())) + '\n')
|
||||||
else:
|
else:
|
||||||
f.write('#' + '\t'.join(map(lambda _x: f'{_x:.10e}', l.tolist())) + '\n')
|
f.write('# ' + '\t'.join(map(lambda _x: f'{_x:.10e}', l.tolist())) + '\n')
|
||||||
|
|
||||||
def get_state(self) -> dict:
|
def get_state(self) -> dict:
|
||||||
ret_dic = {'x': self._x.tolist(),
|
ret_dic = {
|
||||||
'y': self._y.tolist(),
|
'x': self._x.tolist(),
|
||||||
'mask': (np.where(~self.mask)[0]).tolist()}
|
'y': self._y.tolist(),
|
||||||
|
'mask': (np.where(~self.mask)[0]).tolist()
|
||||||
|
}
|
||||||
|
|
||||||
if np.all(self._y_err == 0):
|
if np.all(self._y_err == 0):
|
||||||
ret_dic['y_err'] = 0.0
|
ret_dic['y_err'] = 0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user