def shuffleCoords(Param_Dict): """The coordinates may need to be shuffled if the user doesn't have the z-axis as normal vector. """ starts = ["XLStart", "YLStart", "ZLStart"] ends = ["XLEnd", "YLEnd", "ZLEnd"] # save the values for shuffling svalues = [Param_Dict[key] for key in starts] evalues = [Param_Dict[key] for key in ends] if Param_Dict["NAxis"] == "x": # This shuffles the list in a cyclic way: [1, 2, 3] -> [2, 3, 1] svalues.append(svalues.pop(0)) evalues.append(evalues.pop(0)) # and once more svalues.append(svalues.pop(0)) evalues.append(evalues.pop(0)) elif Param_Dict["NAxis"] == "y": svalues.append(svalues.pop(0)) evalues.append(evalues.pop(0)) elif Param_Dict["NAxis"] == "z": # no shuffling needed pass else: GUILogger.error( "Something went wrong when transferring the coordinates to LinePlot" ) for i in range(3): Param_Dict[starts[i]] = svalues[i] Param_Dict[ends[i]] = evalues[i]
def openPlotAllDialog(self): """Handles the plotting for several files in a series at once.""" if not self.Param_Dict["isValidSeries"]: GUILogger.error("Evaluation stopped. Please open valid directory " "first and enter valid series name.") return self.CheckBox_Dict["TimeSeriesProf"].setChecked(False) self.plotAllDialog = PlotAllDialog(self.Param_Dict) self.plotAllDialog.accepted.connect(lambda: self.evaluateMultiple(self.plotAllDialog.Request_Dict))
def issueAnnoWarning(plot, anno): """Unfortunately, grids are not annotated if the center is 0, 0 for a plot. Issue an error to the GUILogger if that is the case. Parameters: plot: yt slice/projection plot instance anno: String denoting the kind of annotation""" center = plot.center if not all(center): # non-zero values are interpreted as True GUILogger.error( f"{anno} could not properly be drawn. This bug occurs if" " one of the center coordinates is 0. Try setting them " "to 1e-100 au or another very low value.")
def evaluateSingle(self): """Passes the evaluation of data to a ProgressDialog""" if self.Param_Dict["EvalMode"] == "Single" and not self.Param_Dict["isValidFile"]: GUILogger.error("Evaluation stopped. Please open valid file first.") return if self.Param_Dict["EvalMode"] == "Series" and not self.Param_Dict["isValidSeries"]: GUILogger.error("Evaluation stopped. Please open valid directory " "first and enter valid series name.") return GUILogger.info("Evaluation started. Checking for missing extrema...") sut.checkExtremaForPlot(self.Param_Dict) self.progressDialog = ProgressDialog(self.Param_Dict, self, mode="PlotSingle") self.progressWorker.finished.connect(self.giveSingleFeedback)