Ejemplo n.º 1
0
    def __init__(self, plot_path, plot_config_path):
        QFrame.__init__(self)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        self.plot_figure = PlotFigure()
        self.canvas = FigureCanvas(self.plot_figure.getFigure())
        self.canvas.setParent(self)
        self.canvas.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)

        size = QSize(297*2, 210*2) # A4 aspectratio
        self.canvas.setMaximumSize(size)
        self.canvas.setMinimumSize(size)
        self.setMaximumSize(size)
        self.setMinimumSize(size)

        self.popup = Popup(self)
        self.plot_config_loader = PlotSettingsLoader()
        self.plot_settings = PlotSettings()
        self.plot_settings.setPlotPath(plot_path)
        self.plot_settings.setPlotConfigPath(plot_config_path)
        self.connect(self.popup, SIGNAL('updateProgress(int)'), self.updateProgress)


        self.plot_context_data_fetcher = PlotContextDataFetcher()
        self.plot_context_data_fetcher.initialize(self.plot_context_data_fetcher.getModel())
        self.plot_data_fetcher = PlotDataFetcher()
        self.plot_data_fetcher.initialize(self.plot_data_fetcher.getModel())
Ejemplo n.º 2
0
    def __init__(self):
        """Create a PlotView instance"""
        QFrame.__init__(self)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        # setup some default data values
        self.data = PlotData()
        self.data.x_data_type = "number"
        self.data.setValid(False)

        self.plot_figure = PlotFigure()
        self.plot_settings = PlotSettings()

        self.canvas = FigureCanvas(self.plot_figure.getFigure())
        self.canvas.setParent(self)
        self.canvas.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        self.mouse_handler = MouseHandler(self)
Ejemplo n.º 3
0
# -*- coding: utf-8 -*-

import numpy
import astropy.units as u
from matplotlib import pyplot
from astroquery.vizier import Vizier

Vizier.ROW_LIMIT = None
from astropy.table import Table

from cosmology import CosmologyCalculator
from plotsettings import PlotSettings

style = PlotSettings()


def eat_arnaud2010():
    header = [ "name", "R500", "Yx", "Ysph(R2500)", "Ysph(R500)", \
                "P500", "P0", "c500", "alpha", "gamma", "chisq", "dof" ]
    data = {i: numpy.zeros(31) for i in range(len(header))}
    data[0] = numpy.zeros(31, dtype="|S16")
    # Table C.1. Cluster physical parameters from ArXiV source / tex file
    with open("Arnaud2010.tex", "r") as f:
        for n, line in enumerate(f):
            for i, col in enumerate(line.split("&")):
                value = col.replace("$", "")
                # Yx, Ysph(R2500), Ysph(R500)
                if "\pm" in value: value = value.split("\pm")[0]
                # chisq/dof
                if "/" in value:
                    chisq, dof = value.split("/")