Class SkyDensityPlotter

    • Field Detail

      • TILESIZE_REPKEY

        public static final ReportKey<java.lang.Double> TILESIZE_REPKEY
        Report key for HEALPix tile area in square degrees.
      • TRANSPARENCY_KEY

        public static final ConfigKey<java.lang.Double> TRANSPARENCY_KEY
        Config key for transparency.
      • COMBINER_KEY

        public static final ConfigKey<Combiner> COMBINER_KEY
        Config key for combination mode.
    • Constructor Detail

      • SkyDensityPlotter

        public SkyDensityPlotter​(boolean transparent,
                                 boolean hasWeight)
        Constructor.
        Parameters:
        transparent - if true, there will be a config option for setting the alpha value of the whole layer
        hasWeight - if true, an optional weight coordinate will be solicited alongside the positional coordinates
    • Method Detail

      • getPlotterDescription

        public java.lang.String getPlotterDescription()
        Description copied from interface: Plotter
        Returns an XML description of this plotter.

        Note: really this should appear at the LayerType level.

        Specified by:
        getPlotterDescription in interface Plotter<SkyDensityPlotter.SkyDenseStyle>
        Returns:
        one or more <p> elements
      • getRangeStyleKey

        public java.lang.Object getRangeStyleKey​(SkyDensityPlotter.SkyDenseStyle style)
        Description copied from interface: Plotter
        Returns an opaque object characterising the region of the plot surface covered when using a given plotter style. If this object changes between layers produced by this plotter, it provides a hint that it may be necessary to redetermine the axis ranges (using extendCoordinateRanges).

        In many cases, such as scatter-plot-like plotters, the range is determined only by the coordinate data (managed by DataSpec inputs) so a null value may be returned. This method is chiefly required by histogram-like plotters for which the region on the plot surface is not the union of the input positions.

        Specified by:
        getRangeStyleKey in interface Plotter<SkyDensityPlotter.SkyDenseStyle>
        Parameters:
        style - plot style to assess
        Returns:
        opaque object with equality semantics, or null if axis range is not a function of style
      • createLayer

        public PlotLayer createLayer​(DataGeom geom,
                                     DataSpec dataSpec,
                                     SkyDensityPlotter.SkyDenseStyle style)
        Description copied from interface: Plotter
        Creates a PlotLayer based on the given geometry, data and style.

        The style parameter is the result of a call to Plotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap).

        The dataSpec parameter must contain the coordinates defined by this plotter's CoordGroup.

        The pointDataGeom parameter is only used if the CoordGroup.getBasicPositionCount() or CoordGroup.getExtraPositionCount() method from this plotter's CoordGroup return a non-zero value, otherwise the plot does not have point positions.

        It is legal to supply null for any of the parameters; if insufficient data is supplied to generate a plot, then the method should return null.

        Creating a layer should be cheap; layers may be created and not used.

        Specified by:
        createLayer in interface Plotter<SkyDensityPlotter.SkyDenseStyle>
        Parameters:
        geom - indicates base position coordinates and their mapping to points in the data space
        dataSpec - specifies the data required for the plot
        style - data style as obtained from createStyle
        Returns:
        new plot layer, or null if no drawing will take place
      • getPixelLevel

        public static int getPixelLevel​(SkySurface surface)
        Calculates the HEALPix level whose pixels are of approximately the same size as the screen pixels for a given SkySurface. There is not an exact correspondance here. An attempt is made to return the result for the "largest" screen pixel (the one covering more of the sky than any other).
        Parameters:
        surface - plot surface
        Returns:
        approximately corresponding HEALPix level
      • vectorSeparation

        public static double vectorSeparation​(double[] p1,
                                              double[] p2)
        Angle in radians between two (not necessarily unit) vectors. The code follows that of SLA_SEPV from SLALIB. The straightforward thing to do would just be to use the cosine rule, but that may suffer numeric instabilities for small angles, so this more complicated approach is more robust.
        Parameters:
        p1 - first input vector
        p2 - second input vector
        Returns:
        angle between p1 and p2 in radians