示例#1
0
文件: i_plot.py 项目: preller/PanGaia
    def show_sky_coords(self,
                        font_size=16,
                        width=500,
                        height=500,
                        y_xaxis=-0.15,
                        x_yaxis=-0.2,
                        title=None,
                        margins=None,
                        **kwargs):
        """
        Interactive RA-DEC plot
        """
        self.set_marker(**kwargs)

        fig = FigureWidget(
            **{
                'data': [{
                    'x': self.cat.ra,
                    'y': self.cat.dec,
                    'marker': self.marker,
                    'mode': 'markers',
                    'type': 'scatter'
                }],
                'layout': {
                    'dragmode': 'pan',
                    'width': width,
                    'height': height,
                    'font_size': font_size
                }
            })

        xtit = text_annote(text='$\\text{R.A [}^\circ]$',
                           x=0.5,
                           y=y_xaxis,
                           font_size=font_size * 1.2)
        ytit = text_annote(text='$\\text{Dec [}^\circ]$',
                           x=x_yaxis,
                           y=0.5,
                           font_size=font_size * 1.2,
                           textangle=-90)
        fig = self.set_fig_show(
            fig,
            margins=margins,
            annotations=[xtit, ytit],
            title=title,
            new_xrange=[self.cat.ra.max(),
                        self.cat.ra.min()])

        if hasattr(self, 'control'):
            self.set_marker_control()
            fig.add_trace(
                go.Scatter(x=self.control.cat.ra,
                           y=self.control.cat.dec,
                           marker=self.marker_control,
                           mode='markers'))
            fig.update_layout(showlegend=False)
        self.fig_sky = fig
示例#2
0
文件: i_plot.py 项目: preller/PanGaia
    def show_properm(self,
                     font_size=16,
                     width=500,
                     height=500,
                     y_xaxis=-0.15,
                     x_yaxis=-0.2,
                     title=None,
                     margins=None,
                     **kwargs):
        """
        Interactive Proper-Motions plot
        """
        self.set_marker(**kwargs)

        fig = FigureWidget(
            **{
                'data': [{
                    'x': self.cat.pmra,
                    'y': self.cat.pmdec,
                    'marker': self.marker,
                    'mode': 'markers',
                    'type': 'scatter'
                }],
                'layout': {
                    'dragmode': 'pan',
                    'width': width,
                    'height': height,
                    'font_size': font_size
                }
            })

        xtit = text_annote(text='$\\text{pmra [mas yr}^{-1}]$',
                           x=0.5,
                           y=y_xaxis,
                           font_size=font_size * 1.2)
        ytit = text_annote(text='$\\text{pmdec [mas yr}^{-1}]$',
                           x=x_yaxis,
                           y=0.5,
                           font_size=font_size * 1.2,
                           textangle=-90)
        fig = self.set_fig_show(fig,
                                margins=margins,
                                annotations=[xtit, ytit],
                                title=title)
        if hasattr(self, 'control'):
            self.set_marker_control()
            fig.add_trace(
                go.Scatter(x=self.control.cat.pmra,
                           y=self.control.cat.pmdec,
                           marker=self.marker_control,
                           mode='markers'))
            fig.update_layout(showlegend=False)
        self.fig_properm = fig
示例#3
0
文件: i_plot.py 项目: preller/PanGaia
    def show_hist_dist(self,
                       font_size=16,
                       width=500,
                       height=500,
                       y_xaxis=-0.15,
                       x_yaxis=-0.2,
                       title=None,
                       margins=None,
                       **kwargs):
        """
        Interactive Histogram (distances) plot
        """
        self.set_marker(hist_marker=True, **kwargs)

        fig = FigureWidget(
            **{
                'data': [{
                    'x': self.cat.distance,
                    'marker': self.marker,
                    'type': 'histogram'
                }],
                'layout': {
                    'dragmode': 'pan',
                    'width': width,
                    'height': height,
                    'font_size': font_size
                }
            })

        xtit = text_annote(text='Distance [pc]',
                           x=0.5,
                           y=y_xaxis,
                           font_size=font_size * 1.2)
        ytit = text_annote(text='# Objects',
                           x=x_yaxis,
                           y=0.5,
                           font_size=font_size * 1.2,
                           textangle=-90)
        fig = self.set_fig_show(fig,
                                margins=margins,
                                annotations=[xtit, ytit],
                                title=title)
        if hasattr(self, 'control'):
            marker_control_hist = self.marker.copy()
            marker_control_hist['color'] = self.control.color
            fig.add_trace(
                go.Histogram(x=self.control.cat.distance,
                             marker=marker_control_hist))
            fig.update_layout(barmode='overlay', showlegend=False)
        self.fig_hist_dist = fig
示例#4
0
文件: i_plot.py 项目: preller/PanGaia
    def show_3D_space(self,
                      font_size=16,
                      width=1200,
                      height=800,
                      y_xaxis=-0.15,
                      x_yaxis=-0.2,
                      title=None,
                      margins=None,
                      **kwargs):
        """
        Interactive Proper-Motions plot
        """
        self.set_marker(**kwargs)

        fig = FigureWidget(
            **{
                'data': [{
                    'x': self.cat.X_gal,
                    'y': self.cat.Y_gal,
                    'z': self.cat.Z_gal,
                    'marker': self.marker,
                    'mode': 'markers',
                    'type': 'scatter3d'
                }],
                'layout': {
                    'dragmode': 'pan',
                    'width': width,
                    'height': height,
                    'font_size': font_size,
                    'showlegend': False
                }
            })

        if hasattr(self, 'control'):
            self.set_marker_control()
            fig.add_trace(
                go.Scatter3d({
                    'x': self.control.cat.X_gal,
                    'y': self.control.cat.Y_gal,
                    'z': self.control.cat.Z_gal,
                    'mode': 'markers',
                    'marker': self.marker_control
                }))

        if hasattr(self, 'cat_subsamp'):
            marker = self.marker
            marker['color'] = self.color_high
            fig.add_trace(
                go.Scatter3d({
                    'x': self.cat_subsamp.X_gal,
                    'y': self.cat_subsamp.Y_gal,
                    'z': self.cat_subsamp.Z_gal,
                    'mode': 'markers',
                    'marker': marker
                }))

        fig.update_layout(scene=dict(xaxis_title='X_Gal [pc]',
                                     yaxis_title='Y_Gal [pc]',
                                     zaxis_title='Z_Gal [pc]'))
        fig = self.set_fig_show(fig, margins=margins, title=title)
        self.fig_3D = fig