-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Hi,
one last comment from my side, added touchstone export to postprocess.py/ function save_to_file
so that postprocessing in other engineering programs is easier
net = skrf.Network(frequency=self.frequencies, s=self.s_params.transpose(2, 0, 1))
file_path = 'export.sXp'
touchstone_path = os.path.join(RESULTS_DIR,file_path)
logger.debug("Saving touchstone file %s ", touchstone_path)
net.write_touchstone(filename=touchstone_path, write_z0=False, skrf_comment=True)
with open(touchstone_path, 'r') as touchstone_file:
touchstone_data = touchstone_file.read()
#replace as some touchstone readers are picky
touchstone_data = touchstone_data.replace(' 0 ', ' 0.0 ')
touchstone_data = touchstone_data.replace('nan', '0.0')
with open(touchstone_path, 'w') as touchstone_file:
touchstone_file.write(touchstone_data)
if required I could file a pull request
dan-gies and bvernoux
Metadata
Metadata
Assignees
Labels
No labels