def METHOD_NAME(self, nr_params: int = 1):
    if len(self.app.data.s11) == 0:
        QtWidgets.QMessageBox.warning(
            self, "No data to save", "There is no data to save."
        )
        return
    if nr_params > 2 and len(self.app.data.s21) == 0:
        QtWidgets.QMessageBox.warning(
            self, "No S21 data to save", "There is no S21 data to save."
        )
        return
    filedialog = QtWidgets.QFileDialog(self)
    if nr_params == 1:
        filedialog.setDefaultSuffix("s1p")
        filedialog.setNameFilter(
            "Touchstone 1-Port Files (*.s1p);;All files (*.*)"
        )
    else:
        filedialog.setDefaultSuffix("s2p")
        filedialog.setNameFilter(
            "Touchstone 2-Port Files (*.s2p);;All files (*.*)"
        )
    filedialog.setAcceptMode(QtWidgets.QFileDialog.AcceptMode.AcceptSave)
    selected = filedialog.exec()
    if not selected:
        return
    filename = filedialog.selectedFiles()[0]
    if filename == "":
        logger.debug("No file name selected.")
        return
    ts = Touchstone(filename)
    ts.sdata[0] = self.app.data.s11
    if nr_params > 1:
        ts.sdata[1] = self.app.data.s21
        for dp in self.app.data.s11:
            ts.sdata[2].append(Datapoint(dp.freq, 0, 0))
            ts.sdata[3].append(Datapoint(dp.freq, 0, 0))
    try:
        ts.save(nr_params)
    except IOError as e:
        logger.exception("Error during file export: %s", e)
        return