casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtProfile.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 #ifndef QtProfile_H
27 #define QtProfile_H
28 
29 #include <QPrinter>
30 #include <casa/aips.h>
31 #include <casa/BasicSL/String.h>
32 #include <casa/Containers/Record.h>
33 #include <casa/Arrays/Array.h>
34 #include <casa/Arrays/ArrayMath.h>
35 #include <casa/Arrays/Vector.h>
36 #include <casa/Arrays/Matrix.h>
37 #include <casa/Inputs/Input.h>
38 #include <casa/Arrays/IPosition.h>
43 
46 
52 
54 
55 #include <graphics/X11/X_enter.h>
56 #include <QDir>
57 #include <QColor>
58 #include <QHash>
59 #include <QMainWindow>
60 #include <QMouseEvent>
61 #include <QToolButton>
62 #include <QDialog>
63 #include <QCheckBox>
64 #include <QPixmap>
65 #include <QLineEdit>
66 #include <QComboBox>
67 #include <map>
68 #include <vector>
69 #include <QHash>
70 #include <QHashIterator>
71 #include <graphics/X11/X_exit.h>
72 #include <display/QtPlotter/QtProfileGUI.ui.h>
73 
74 inline void initPlotterResource() {
75  Q_INIT_RESOURCE(QtPlotter);
76 }
77 
78 
79 namespace casa {
80 
81  class QtProfilePrefs;
82  class ColorSummaryWidget;
83  class LegendPreferences;
84  class SmoothPreferences;
85  class QtCanvas;
86 
87 //Note: The purpose of the SpecFitMonitor interface is to provide
88 //a communications interface between the class doing spectral line
89 //fitting and this class. By using an interface, we can decouple
90 //this class and the class doing the work of spectral fitting as
91 //much as possible.
92 
93  class QtProfile : public QMainWindow, Ui::QtProfileGUI, public ProfileTaskMonitor {
94  Q_OBJECT
95 
96  public:
97  enum ExtrType {
107  };
108 
109  enum PlotType {
113  //PVRMSE,
115  };
116 
117  enum ErrorType {
121  };
122 
123 
124 
125  QtProfile(std::shared_ptr<casacore::ImageInterface<float> > img, const char *name = 0,
126  QWidget *parent = 0, std::string rcstr="prf");
127 
128  ~QtProfile();
129  casacore::MFrequency::Types determineRefFrame(std::shared_ptr<casacore::ImageInterface<float> > img, bool check_native_frame = false );
130 
131  virtual std::string rcid( ) const {
132  return rcid_;
133  }
134  void setPath( QString filePath ) {
135  imagePath = filePath;
136  }
137 
138  //Allows the profiler to come up specialized to do spectroscopy
139  //or another task.
140  void setPurpose( ProfileTaskMonitor::PURPOSE purpose );
141 
142  //These methods are from the ProfileTaskMoniter interface.
143  //Their purpose is to provide the class doing the spectral
144  //profile fitting with initial input values, to inform
145  //this class of status and log messages indicated the result
146  //of a spectral fit, and to perform moments/collapsing.
147  void postStatus( casacore::String status );
153  QString getYUnit() const;
154  QString getYUnitPrefix() const;
156  QString getFileName() const;
157  QString getImagePath() const;
159  std::shared_ptr<const casacore::ImageInterface<float> > getImage( const QString& imageName="") const;
160  virtual bool getBeamInfo( const QString& curveName, double& beamAngle, double& beamArea ) const;
162  void persist( const QString& key, const QString& value );
163  QString read( const QString & key ) const;
165  bool autoRegister, bool tmpData, std::shared_ptr<casacore::ImageInterface<float> > img);
166  void setPosition( const QList<double>& xValues, const QList<double>& yValues );
167  void processTrackRecord( const casacore::String& dataName, const casacore::String& positionInfo );
169  QString getBrightnessUnit( std::shared_ptr<casacore::ImageInterface<float> > img ) const;
170  typedef std::pair<QString, std::shared_ptr<casacore::ImageInterface<float> > > OverplotInterface;
171 
172  static const casacore::String &SHAPE_ELLIPSE( ) {
173  static casacore::String result("ellipse");
174  return result;
175  }
177  static casacore::String result("rectangle");
178  return result;
179  }
180  static const casacore::String &SHAPE_POINT( ) {
181  static casacore::String result("point");
182  return result;
183  }
184  static const casacore::String &SHAPE_POLY( ) {
185  static casacore::String result("polygon");
186  return result;
187  }
188  static const QString &FREQUENCY( ) {
189  static QString result("frequency");
190  return result;
191  }
192  static const QString &CHANNEL( ) {
193  static QString result("channel");
194  return result;
195  }
196 
197  public slots:
198  void zoomIn();
199  void zoomOut();
200  void zoomNeutral();
201  void print();
202  void saveGraphic();
203  void printExp();
204  void saveExp();
205  void exportProfile();
206  void up();
207  void down();
208  void left();
209  void right();
210  void preferences();
211  void frameChanged( int );
212  void setPreferences(bool stateAutoX, bool stateAutoY, int showGrid,
213  int stateMProf, int stateRel, bool showToolTips, bool showTopAxis,
214  bool displayStepFunction, bool opticalFitter,
215  bool showChannelLine, bool singleChannelImage );
216  void curveColorPreferences();
217  void legendPreferences();
218  void togglePalette( int modeIndex );
219 
220  void setPlotError(int);
221  void changeCoordinate(const QString &text);
222  void changeFrame(const QString &text);
223 
224  void changeCoordinateType( const QString & text );
225 
226  void changeTopAxisCoordinateType( const QString & text );
227  virtual void closeEvent ( QCloseEvent *);
228  void resetProfile(std::shared_ptr<casacore::ImageInterface<float> > img, const char *name = 0);
229  void wcChanged( const casacore::String,
232  const ProfileType);
233  void redraw( );
234  void changePlotType(const QString &text);
235  void changeErrorType(const QString &text);
236 
237  void changeAxis(casacore::String xa, casacore::String ya, casacore::String za, std::vector<int>);
238  void changeSpectrum(casacore::String spcTypeUnit, casacore::String spcRval, casacore::String spcSys);
239 
240  void plotMainCurve();
241  void clearPlots();
242  void setCollapseRange(double xmin, double xmax);
243 
244  void overplot(QList<OverplotInterface>);
245 
246  void newRegion( int, const QString &shape, const QString &name,
247  const QList<double> &world_x, const QList<double> &world_y,
248  const QList<int> &pixel_x, const QList<int> &pixel_y,
249  const QString &linecolor, const QString &text, const QString &font, int fontsize, int fontstyle );
250 
252  const QList<double> &world_x, const QList<double> &world_y,
253  const QList<int> &pixel_x, const QList<int> &pixel_y );
254  void pixelsChanged(int, int );
255  void clearPaletteModes();
256 
260  bool isImageSupported(std::shared_ptr<casacore::ImageInterface<float> > img );
261 
262  signals:
263  void hideProfile();
264  void coordinateChange(const casacore::String&);
266  bool autoRegister, bool tmpData, std::shared_ptr<casacore::ImageInterface<float> > img);
267  void channelSelect( int channelIndex );
268  void adjustPosition( double tlcx, double tlcy, double brcx, double brcy );
269  void movieChannel( int startChannel, int endChannel );
270  void reloadImages();
271 
272  private:
273  void stringToPlotType(const QString &text, QtProfile::PlotType &pType);
274  void stringToErrorType(const QString &text, QtProfile::ErrorType &eType);
275  void fillPlotTypes(const std::shared_ptr<casacore::ImageInterface<float> > img);
276  void getcoordTypeUnit(casacore::String &ctypeUnitStr, casacore::String &cTypeStr, casacore::String &unitStr);
277  void printIt(QPrinter*);
278  bool exportASCIISpectrum(QString &fn);
279  bool exportFITSSpectrum(QString &fn);
280  void messageFromProfile(QString &msg);
281  void setUnitsText( casacore::String unitStr );
282  void resetYUnits( const QString& units);
283  void outputCurve( int k, QTextStream& ts, float scaleFactor );
284  int getFreqProfileTabularIndex(std::shared_ptr<const casacore::ImageInterface<float> > img);
285  casacore::SpectralCoordinate resetTabularConversion(std::shared_ptr< const casacore::ImageInterface<float> > imagePtr, bool& valid);
286  bool isSpectralAxis() const;
288  casacore::SpectralCoordinate getSpectralAxis( std::shared_ptr<const casacore::ImageInterface<float> > imagePtr, bool& valid );
289  void resetXUnits( bool spectralAxis);
291 
292  int computeCB( const casacore::String& xa, const casacore::String& ya, const casacore::String& za );
293  void getBeamInfo( std::shared_ptr<const casacore::ImageInterface<float> > imagePtr, double& beamArea, double& beamSolidAngle) const;
294  casacore::SpectralCoordinate getSpectralCoordinate( std::shared_ptr<const casacore::ImageInterface<float> > imagePtr, bool& valid );
295  bool parseRestFrequency( const casacore::String& restStr, casacore::Quantity& result ) const;
296 
297  bool generateProfile( casacore::Vector<float>& resultXValues, casacore::Vector<float>& resultYValues,
298  std::shared_ptr<casacore::ImageInterface<float> > imagePtr,
300  QtProfile::ExtrType combineType, casacore::String& unit, const casacore::String& coordinateType,
301  int qualityAxis, casacore::String restFreq="", const casacore::String& frame="");
302 
303  pair<casacore::Vector<float>, casacore::Vector<float> > convertIntensity( const casacore::Vector<float>& sourceXVals, const casacore::Vector<float>& sourceYVals,
304  std::shared_ptr<casacore::ImageInterface<float> > imagePtr, const QString& xUnits,
305  const QString& yUnitsOld, const QString& yUnitsNew );
306  void saveAsPDF( const QString& fileName );
311  bool isAxisAscending(const casacore::Vector<float>& axisValues ) const;
312  bool isVelocityUnit( const QString& unit ) const;
313  bool isFrequencyUnit( const QString& unit ) const;
314  bool isWavelengthUnit( const QString& unit ) const;
315  void setTitle( const QString& shape );
316  void setTitle(const ProfileType ptype);
318  const casacore::Vector<double> &py,
319  const casacore::Vector<double> &wx,
320  const casacore::Vector<double> &wy );
321  void setPlotType( int wcArraySize );
322  bool checkCube();
323  void assignCoordinate(const casacore::String& c);
328  const casacore::Vector<double> &wxv, const casacore::Vector<double> &wyv );
329  /*bool getFrequencyProfileWrapper( std::shared_ptr<casacore::ImageInterface<float> >& img, const casacore::Vector<double> &wxv, const casacore::Vector<double> &wyv,
330  casacore::Vector<float> &z_xval, casacore::Vector<float> &z_yval,
331  const casacore::String& xytype, const casacore::String& specaxis,
332  const int& whichStokes, const int& whichTabular,
333  const int& whichLinear, casacore::String& xunits,
334  const casacore::String& specFrame, QtProfile::ExtrType combineType,
335  const int& whichQuality, const casacore::String& restValue,
336  const casacore::String& shape);*/
338  const casacore::String& coordinateType, casacore::String& xAxisUnit,
342  const casacore::Vector<double> wxv, const casacore::Vector<double> wyv );
343  void addCanvasMainCurve( const casacore::Vector<float>& xVals, const casacore::Vector<float>& yVals,
344  const QString& label, double beamAngle, double beamArea,
346  bool adjustTopAxisSettings();
347  void initializeXAxisUnits();
348  void setXAxisUnits();
349  void initSmoothing();
350  void setPixelCanvasYUnits( const QString& yUnitPrefix, const QString& yUnit );
351  void toggleAction( QAction* action );
352  int scaleAxis();
353  void addImageAnalysisGraph( const casacore::Vector<double> &wxv, const casacore::Vector<double> &wyv, int ordersOfM );
354  void initializeSolidAngle() const;
355  //Conversion
356  QString getRaDec(double x, double y);
357 
358  //Finds the channel index closest to the passed in value.
359  int findNearestChannel( float xval ) const;
360  void initPreferences();
361  void updateAxisUnitCombo( const QString& textToMatch, QComboBox* axisUnitCombo );
362  void setYUnitConversionVisibility( bool visible );
363  std::shared_ptr<casacore::ImageInterface<float> > image;
364 
365  //For deciding whether or not it makes sense to show the top axis when
366  //multiple images are loaded.
367  bool isXUnitsMatch(const QString& matchUnits);
368  bool isFrequencyMatch();
369  bool isVelocityMatch();
370  int getChannelCount( std::shared_ptr<casacore::ImageInterface<float> >& img);
371  std::shared_ptr<casacore::ImageInterface<float> > findImageWithMaximumChannels();
372  void restrictTopAxisOptions( bool restrictOptions, const QString& bottomUnits, bool allowFrequency = true,
373  bool allowVelocity=true );
374  double getUnitsPerChannel( std::shared_ptr<casacore::ImageInterface<float> > img , bool* ok, const QString& matchUnits );
375  QString readTopAxis() const;
376  void persistTopAxis( const QString& units );
377  void assignProfileType( const casacore::String& shape, int regionPointCount );
378  void addOverplotToCanvas( std::shared_ptr<casacore::ImageInterface<float> > imagePtr, const casacore::Vector<float>& xVals, const
379  casacore::Vector<float>& yVals, const QString& ky );
382  const ProfileType pType );
383 
384  bool _generateProfile( casacore::Vector<float>& resultXValues, casacore::Vector<float>& resultYValues,
385  std::shared_ptr<const casacore::ImageInterface<float> > imagePtr,
387  QtProfile::ExtrType combineType, casacore::String& unit, const casacore::String& coordinateType,
388  casacore::String restFreq, const casacore::String& frame);
389 
390  //Handle custom spectral reference frames such as REST and Undefined
391  //for which conversions are not possible.
392  bool customizeSpectralReferenceFrame( const QString& specialType );
393  QList<OverplotInterface> *over;
400 
401  //Rest frequency quantity and unit.
403 
404  QString fileName;
405  QString imagePath;
406  QString position;
407  QString yUnit;
408  QString yUnitPrefix;
409  //Holds the available x-axis units
410  QStringList xUnitsList;
411  QString xpos;
412  QString ypos;
413  int cube;
414 
415  int npoints;
417 
419  int stateRel;
420 
426  QString region;
427 
431 
432  // connection to rc file
434  // rc id for this panel type
435  std::string rcid_;
436 
439 
440 
446  static bool topAxisDefaultSet;
447 
448  static const QString &PLOT_TYPE_FLUX( ) {
449  static QString result("Flux Density");
450  return result;
451  }
452  static const QString &PLOT_TYPE_MEAN( ) {
453  static QString result("Mean");
454  return result;
455  }
456  static const QString &PLOT_TYPE_MEDIAN( ) {
457  static QString result("Median");
458  return result;
459  }
460  static const QString &PLOT_TYPE_SUM( ) {
461  static QString result("Sum");
462  return result;
463  }
464 
465  static const QString &VELOCITY( ) {
466  static QString result("velocity");
467  return result;
468  }
469  static const QString &OPTICAL( ) {
470  static QString result("optical");
471  return result;
472  }
473  static const QString &AIR( ) {
474  static QString result("air");
475  return result;
476  }
477  static const QString &FRAME_REST( ) {
478  static QString result("REST");
479  return result;
480  }
481  static const QString &FRAME_NONE( ) {
482  static QString result("Undefined");
483  return result;
484  }
485  static const QString &PERSIST_FREQUENCY_BOTTOM( ) {
486  static QString result(".freqcoord.type");
487  return result;
488  }
489  static const QString &PERSIST_FREQUENCY_TOP( ) {
490  static QString result(".freqcoordTop.type");
491  return result;
492  }
493  static const QString &IMAGE_MISSING_ERROR( ) {
494  static QString result("No profile available for the given data.");
495  return result;
496  }
497  static const QString &MISSING_REGION_ERROR( ) {
498  static QString result("Assign a mouse button to\n"
499  "'crosshair' or 'rectangle' or 'polygon';\n"
500  "click/press+drag the assigned button on\n"
501  "the image to get a spectral profile.");
502  return result;
503  }
504  static const QString &NO_PROFILE_ERROR( ) {
505  static QString result("No profile available for the "
506  "display axes orientation");
507  return result;
508  }
509  static const QString &REGION_ELLIPSE( ) {
510  static QString result("Ellipse");
511  return result;
512  }
513  static const QString &REGION_RECTANGLE( ) {
514  static QString result("Rectangle");
515  return result;
516  }
517  static const QString &REGION_POINT( ) {
518  static QString result("Point");
519  return result;
520  }
521  static const QString &REGION_POLY( ) {
522  static QString result("Polygon");
523  return result;
524  }
525 
526 
527  class spectra_info {
528  public:
530  spectra_info( const QString &s ) : shape_(s) { }
531  spectra_info( const spectra_info &other ) : shape_(other.shape_) { }
532  const spectra_info &operator=( const spectra_info &other ) {
533  shape_ = other.shape_;
534  return *this;
535  }
536  const QString &shape( ) {
537  return shape_;
538  }
539  private:
540  QString shape_;
541  };
542 
543 
544  typedef std::map<int,spectra_info> SpectraInfoMap;
545  const int NO_REGION_ID;
550 
558  pair<double,double> getMaximumTemperature();
559  void postConversionWarning( QString unitStr);
560  void adjustPlotUnits( );
561  private slots:
562  void changeTopAxis();
563  void updateXAxisLabel( const QString &text, QtPlotSettings::AxisIndex axisIndex );
564  void setDisplayYUnits( const QString& unitStr );
565  void channelSelect(float xval);
566  void channelRangeSelect( float channelStart, float channelEnd );
568  void replotCurves();
569  };
570 
571 }
572 #endif
573 
void getPixelBounds(casacore::Vector< double > &pixelX, casacore::Vector< double > &pixelY) const
void channelRangeSelect(float channelStart, float channelEnd)
void setPreferences(bool stateAutoX, bool stateAutoY, int showGrid, int stateMProf, int stateRel, bool showToolTips, bool showTopAxis, bool displayStepFunction, bool opticalFitter, bool showChannelLine, bool singleChannelImage)
const int NO_REGION_ID
Definition: QtProfile.qo.h:545
bool exportASCIISpectrum(QString &fn)
void imageCollapsed(casacore::String path, casacore::String dataType, casacore::String displayType, bool autoRegister, bool tmpData, std::shared_ptr< casacore::ImageInterface< float > > img)
void setTitle(const QString &shape)
casacore::Vector< double > last_event_wx
Definition: QtProfile.qo.h:430
void coordinateChange(const casacore::String &)
void setUnitsText(casacore::String unitStr)
bool isVelocityMatch()
void changeCoordinate(const QString &text)
spectra_info(const spectra_info &other)
Definition: QtProfile.qo.h:531
void stringToPlotType(const QString &text, QtProfile::PlotType &pType)
void initPreferences()
the square root of the sum divided by the number of pixels per beam, sqrt(sum)/(beam_area/pixel_area)...
virtual std::string rcid() const
Definition: QtProfile.qo.h:131
const spectra_info & operator=(const spectra_info &other)
Definition: QtProfile.qo.h:532
void postConversionWarning(QString unitStr)
bool isFrequencyMatch()
void resetXUnits(bool spectralAxis)
void changeAxis(casacore::String xa, casacore::String ya, casacore::String za, std::vector< int >)
QtProfilePrefs * profilePrefs
Definition: QtProfile.qo.h:554
void initializeSolidAngle() const
void showCollapsedImg(casacore::String path, casacore::String dataType, casacore::String displayType, bool autoRegister, bool tmpData, std::shared_ptr< casacore::ImageInterface< float > > img)
casacore::Vector< float > getXValues() const
std::string rcid_
rc id for this panel type
Definition: QtProfile.qo.h:435
QtProfile::ErrorType itsErrorType
Definition: QtProfile.qo.h:438
void changeCoordinateType(const QString &text)
bool isSpectralAxis() const
QtCanvas * pixelCanvas
Definition: QtProfile.qo.h:553
casacore::Vector< float > z_yval
Definition: QtProfile.qo.h:422
QString readTopAxis() const
void initializeSpectralProperties()
bool isFrequencyUnit(const QString &unit) const
casacore::Vector< double > lastPX
Definition: QtProfile.qo.h:423
void restrictTopAxisOptions(bool restrictOptions, const QString &bottomUnits, bool allowFrequency=true, bool allowVelocity=true)
static const QString & PERSIST_FREQUENCY_TOP()
Definition: QtProfile.qo.h:489
casacore::MFrequency::Types determineRefFrame(std::shared_ptr< casacore::ImageInterface< float > > img, bool check_native_frame=false)
void setPurpose(ProfileTaskMonitor::PURPOSE purpose)
Allows the profiler to come up specialized to do spectroscopy or another task.
casacore::String coordinateType_p
Definition: QtProfile.qo.h:396
void setPlotType(int wcArraySize)
void persistTopAxis(const QString &units)
casacore::Vector< double > last_event_px
Definition: QtProfile.qo.h:429
static const casacore::String & SHAPE_ELLIPSE()
Definition: QtProfile.qo.h:172
std::shared_ptr< const casacore::ImageInterface< float > > getImage(const QString &imageName="") const
casacore::Vector< float > getYValues() const
void addOverplotToCanvas(std::shared_ptr< casacore::ImageInterface< float > > imagePtr, const casacore::Vector< float > &xVals, const casacore::Vector< float > &yVals, const QString &ky)
static const QString & NO_PROFILE_ERROR()
Definition: QtProfile.qo.h:504
void togglePalette(int modeIndex)
static const QString & REGION_POINT()
Definition: QtProfile.qo.h:517
QString read(const QString &key) const
QList< OverplotInterface > * over
Definition: QtProfile.qo.h:393
spectra_info(const QString &s)
Definition: QtProfile.qo.h:530
QString yUnitPrefix
Definition: QtProfile.qo.h:408
casacore::Vector< float > z_xval
Definition: QtProfile.qo.h:421
SpectraInfoMap spectra_info_map
Definition: QtProfile.qo.h:547
casacore::String coordinate
Definition: QtProfile.qo.h:395
void setYUnitConversionVisibility(bool visible)
void showSmoothingPreferences()
std::map< int, spectra_info > SpectraInfoMap
Definition: QtProfile.qo.h:544
static const casacore::String & SHAPE_RECTANGLE()
Definition: QtProfile.qo.h:176
void updateXAxisLabel(const QString &text, QtPlotSettings::AxisIndex axisIndex)
ostream-like interface to creating log messages.
Definition: LogIO.h:167
static const casacore::String & SHAPE_POLY()
Definition: QtProfile.qo.h:184
casacore::Vector< double > lastWX
Definition: QtProfile.qo.h:424
const casacore::String WORLD_COORDINATES
Definition: QtProfile.qo.h:394
void updateSpectralReferenceFrame()
casacore::String getXAxisUnit() const
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void messageFromProfile(QString &msg)
void channelSelect(int channelIndex)
static const QString & AIR()
Definition: QtProfile.qo.h:473
void storeCoordinates(const casacore::Vector< double > pxv, const casacore::Vector< double > pyv, const casacore::Vector< double > wxv, const casacore::Vector< double > wyv)
void stringToErrorType(const QString &text, QtProfile::ErrorType &eType)
void setCollapseRange(double xmin, double xmax)
QStringList xUnitsList
Holds the available x-axis units.
Definition: QtProfile.qo.h:410
void setPath(QString filePath)
Definition: QtProfile.qo.h:134
void setDisplayYUnits(const QString &unitStr)
void postStatus(casacore::String status)
These methods are from the ProfileTaskMoniter interface.
static const casacore::String & SHAPE_POINT()
Definition: QtProfile.qo.h:180
virtual bool getBeamInfo(const QString &curveName, double &beamAngle, double &beamArea) const
bool showSingleChannelImage
Definition: QtProfile.qo.h:445
bool generateProfile(casacore::Vector< float > &resultXValues, casacore::Vector< float > &resultYValues, std::shared_ptr< casacore::ImageInterface< float > > imagePtr, const casacore::Vector< double > &regionX, const casacore::Vector< double > &regionY, casacore::String shape, QtProfile::ExtrType combineType, casacore::String &unit, const casacore::String &coordinateType, int qualityAxis, casacore::String restFreq="", const casacore::String &frame="")
casacore::Vector< double > lastWY
Definition: QtProfile.qo.h:424
virtual void closeEvent(QCloseEvent *)
bool assignFrequencyProfile(const casacore::Vector< double > &wxv, const casacore::Vector< double > &wyv, const casacore::String &coordinateType, casacore::String &xAxisUnit, casacore::Vector< float > &z_xval, casacore::Vector< float > &z_yval, const casacore::String &shape)
static const QString & FREQUENCY()
Definition: QtProfile.qo.h:188
void fillPlotTypes(const std::shared_ptr< casacore::ImageInterface< float > > img)
casacore::SpectralCoordinate resetTabularConversion(std::shared_ptr< const casacore::ImageInterface< float > > imagePtr, bool &valid)
void addCanvasMainCurve(const casacore::Vector< float > &xVals, const casacore::Vector< float > &yVals, const QString &label, double beamAngle, double beamArea, casacore::SpectralCoordinate coord)
bool customizeSpectralReferenceFrame(const QString &specialType)
Handle custom spectral reference frames such as REST and Undefined for which conversions are not poss...
QString getYUnit() const
void overplot(QList< OverplotInterface >)
static const QString & CHANNEL()
Definition: QtProfile.qo.h:192
void legendPreferences()
void updateAxisUnitCombo(const QString &textToMatch, QComboBox *axisUnitCombo)
casacore::Vector< double > last_event_py
Definition: QtProfile.qo.h:429
static const QString & PLOT_TYPE_SUM()
Definition: QtProfile.qo.h:460
casacore::Casarc & rc
connection to rc file
Definition: QtProfile.qo.h:433
bool isAxisAscending(const casacore::Vector< float > &axisValues) const
Returns false if first vector value is greater than the last vector value; otherwise returns true...
bool adjustTopAxisSettings()
void setPlotError(int)
bool exportFITSSpectrum(QString &fn)
SQRTSUM and MEANSQRT are bizarre statistics, but ImageAnalysis::getFreqProfile() supported this for t...
void assignCoordinate(const casacore::String &c)
casacore::String cSysRval
Rest frequency quantity and unit.
Definition: QtProfile.qo.h:402
static const QString & VELOCITY()
Definition: QtProfile.qo.h:465
SmoothPreferences * smoothWidget
Definition: QtProfile.qo.h:555
int getFreqProfileTabularIndex(std::shared_ptr< const casacore::ImageInterface< float > > img)
bool isVelocityUnit(const QString &unit) const
ProfileType profileType
Definition: QtProfile.qo.h:548
casacore::SpectralCoordinate getSpectralAxis(std::shared_ptr< const casacore::ImageInterface< float > > imagePtr, bool &valid)
casacore::Vector< double > lastPY
Definition: QtProfile.qo.h:423
QString getYUnitPrefix() const
void pixelsChanged(int, int)
the square root of the sum divided by the number of pixels, sqrt(sum)/npix
void changeSpectrum(casacore::String spcTypeUnit, casacore::String spcRval, casacore::String spcSys)
casacore::String lastShape
Definition: QtProfile.qo.h:549
std::string path(const std::string &name)
QString getRaDec(double x, double y)
Conversion.
casacore::String getRegionShape() const
void setPosition(const QList< double > &xValues, const QList< double > &yValues)
Specific to Spectrum Position setting.
double getUnitsPerChannel(std::shared_ptr< casacore::ImageInterface< float > > img, bool *ok, const QString &matchUnits)
void exportProfile()
void processTrackRecord(const casacore::String &dataName, const casacore::String &positionInfo)
bool isImageSupported(std::shared_ptr< casacore::ImageInterface< float > > img)
Returns whether or not the image can be profiled.
ColorSummaryWidget * colorSummaryWidget
Definition: QtProfile.qo.h:551
pair< double, double > getMaximumTemperature()
static const QString & IMAGE_MISSING_ERROR()
Definition: QtProfile.qo.h:493
void changeTopAxis()
void printIt(QPrinter *)
bool isXUnitsMatch(const QString &matchUnits)
For deciding whether or not it makes sense to show the top axis when multiple images are loaded...
static const QString & PLOT_TYPE_MEAN()
Definition: QtProfile.qo.h:452
void persist(const QString &key, const QString &value)
Specific to Moments.
void curveColorPreferences()
void initializeCoordinateVectors(const casacore::Vector< double > &px, const casacore::Vector< double > &py, const casacore::Vector< double > &wx, const casacore::Vector< double > &wy, casacore::Vector< double > &pxv, casacore::Vector< double > &pyv, casacore::Vector< double > &wxv, casacore::Vector< double > &wyv) const
static const QString & OPTICAL()
Definition: QtProfile.qo.h:469
void resetProfile(std::shared_ptr< casacore::ImageInterface< float > > img, const char *name=0)
pair< casacore::Vector< float >, casacore::Vector< float > > convertIntensity(const casacore::Vector< float > &sourceXVals, const casacore::Vector< float > &sourceYVals, std::shared_ptr< casacore::ImageInterface< float > > imagePtr, const QString &xUnits, const QString &yUnitsOld, const QString &yUnitsNew)
casacore::Vector< double > getRegionYValues() const
Note: The purpose of the SpecFitMonitor interface is to provide a communications interface between th...
Definition: QtProfile.qo.h:93
bool setErrorPlotting(const casacore::Vector< double > &wxv, const casacore::Vector< double > &wyv)
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
void clearPaletteModes()
casacore::Vector< double > last_event_wy
Definition: QtProfile.qo.h:430
void wcChanged(const casacore::String, const casacore::Vector< double >, const casacore::Vector< double >, const casacore::Vector< double >, const casacore::Vector< double >, const ProfileType)
int findNearestChannel(float xval) const
Finds the channel index closest to the passed in value.
bool _generateProfile(casacore::Vector< float > &resultXValues, casacore::Vector< float > &resultYValues, std::shared_ptr< const casacore::ImageInterface< float > > imagePtr, const casacore::Vector< double > &regionX, const casacore::Vector< double > &regionY, casacore::String shape, QtProfile::ExtrType combineType, casacore::String &unit, const casacore::String &coordinateType, casacore::String restFreq, const casacore::String &frame)
Interconvert pixel and frequency values.
void setPixelCanvasYUnits(const QString &yUnitPrefix, const QString &yUnit)
static const QString & FRAME_REST()
Definition: QtProfile.qo.h:477
casacore::String last_event_cs
Definition: QtProfile.qo.h:428
void changePlotType(const QString &text)
LegendPreferences * legendPreferencesDialog
Definition: QtProfile.qo.h:552
static const QString & PLOT_TYPE_FLUX()
Definition: QtProfile.qo.h:448
void adjustPlotUnits()
void initPlotterResource()
Definition: QtPlotter.qo.h:56
void outputCurve(int k, QTextStream &ts, float scaleFactor)
QString getImagePath() const
void frameChanged(int)
bool isProfileChanged(const casacore::String &c, const casacore::Vector< double > &px, const casacore::Vector< double > &py, const casacore::Vector< double > &wx, const casacore::Vector< double > &wy, const ProfileType pType)
static const QString & REGION_RECTANGLE()
Definition: QtProfile.qo.h:513
void setXAxisUnits()
static bool topAxisDefaultSet
Definition: QtProfile.qo.h:446
void plotMainCurve()
static const QString & PLOT_TYPE_MEDIAN()
Definition: QtProfile.qo.h:456
void initSmoothing()
QString getFileName() const
void changeTopAxisCoordinateType(const QString &text)
casacore::Vector< float > getZValues() const
void setPositionStatus(const casacore::Vector< double > &pxv, const casacore::Vector< double > &pyv, const casacore::Vector< double > &wxv, const casacore::Vector< double > &wyv)
std::pair< QString, std::shared_ptr< casacore::ImageInterface< float > > > OverplotInterface
Definition: QtProfile.qo.h:170
std::shared_ptr< casacore::ImageInterface< float > > image
Definition: QtProfile.qo.h:363
const Double c
Fundamental physical constants (SI units):
casacore::Vector< float > z_eval
Definition: QtProfile.qo.h:425
QString getBrightnessUnit(std::shared_ptr< casacore::ImageInterface< float > > img) const
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void addImageAnalysisGraph(const casacore::Vector< double > &wxv, const casacore::Vector< double > &wyv, int ordersOfM)
void changeFrame(const QString &text)
void updateRegion(int, viewer::region::RegionChanges, const QList< double > &world_x, const QList< double > &world_y, const QList< int > &pixel_x, const QList< int > &pixel_y)
casacore::String spcRefFrame
Definition: QtProfile.qo.h:399
void initializeXAxisUnits()
virtual casacore::MFrequency::Types getReferenceFrame() const
void saveAsPDF(const QString &fileName)
casacore::String ctypeUnit
Definition: QtProfile.qo.h:398
void changeErrorType(const QString &text)
casacore::Vector< double > getRegionXValues() const
static const QString & PERSIST_FREQUENCY_BOTTOM()
Definition: QtProfile.qo.h:485
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
void assignProfileType(const casacore::String &shape, int regionPointCount)
int getChannelCount(std::shared_ptr< casacore::ImageInterface< float > > &img)
casacore::LogIO * itsLog
Definition: QtProfile.qo.h:441
casacore::SpectralCoordinate getSpectralCoordinate(std::shared_ptr< const casacore::ImageInterface< float > > imagePtr, bool &valid)
bool isWavelengthUnit(const QString &unit) const
Allows the user to customize properties of the spectral profile legend.
void movieChannel(int startChannel, int endChannel)
QtProfile::PlotType itsPlotType
Definition: QtProfile.qo.h:437
void adjustPosition(double tlcx, double tlcy, double brcx, double brcy)
void copyToLastEvent(const casacore::String &c, const casacore::Vector< double > &px, const casacore::Vector< double > &py, const casacore::Vector< double > &wx, const casacore::Vector< double > &wy)
void resetYUnits(const QString &units)
void toggleAction(QAction *action)
QtProfile(std::shared_ptr< casacore::ImageInterface< float > > img, const char *name=0, QWidget *parent=0, std::string rcstr="prf")
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
std::shared_ptr< casacore::ImageInterface< float > > findImageWithMaximumChannels()
static const QString & MISSING_REGION_ERROR()
Definition: QtProfile.qo.h:497
casacore::String xaxisUnit
Definition: QtProfile.qo.h:397
static const QString & REGION_POLY()
Definition: QtProfile.qo.h:521
static const QString & FRAME_NONE()
Definition: QtProfile.qo.h:481
void newRegion(int, const QString &shape, const QString &name, const QList< double > &world_x, const QList< double > &world_y, const QList< int > &pixel_x, const QList< int > &pixel_y, const QString &linecolor, const QString &text, const QString &font, int fontsize, int fontstyle)
int computeCB(const casacore::String &xa, const casacore::String &ya, const casacore::String &za)
bool parseRestFrequency(const casacore::String &restStr, casacore::Quantity &result) const
void getcoordTypeUnit(casacore::String &ctypeUnitStr, casacore::String &cTypeStr, casacore::String &unitStr)
static const QString & REGION_ELLIPSE()
Definition: QtProfile.qo.h:509