Class SkySimData


  • public class SkySimData
    extends java.lang.Object
    Stores information required to simulate a sky catalogue. It contains data for a number of rows, each row representing a region of the sky with the capability to generate representative catalogue quantities in that region. The current implementation uses HEALPix tiles.

    The data is held in arrays in memory, so that access including concurrent access will be fast. It is therefore only intended to hold information for a modest number of sky areas.

    Since:
    6 Aug 2020
    Author:
    Mark Taylor
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SkySimData.Col
      Defines an object that can return a sample value for a given region.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SkySimData.Col createCoordColumn​(boolean isLat)
      Returns a column object that can give simulated sky positions.
      SkySimData.Col[] createQuantityColumns()
      Returns an array of column objects that can report statistically defined quantities.
      uk.ac.starlink.table.HealpixTableInfo getHealpixInfo()
      Returns the HEALPix setup of the statistics file on which this simulation data is based.
      int getRandomRowIndex​(long seed)
      Returns a sky area at random.
      int getRowCount()
      Returns the number of sky areas represented.
      static SkySimData readData​(uk.ac.starlink.table.StarTable table, uk.ac.starlink.table.HealpixTableInfo hpxInfo, java.lang.String cnameWeight, java.lang.String stdevSuffix)
      Assembles a SkySimData instance by using statistical information in a given HEALPix table (one with a row for each healpix tile).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRowCount

        public int getRowCount()
        Returns the number of sky areas represented.
        Returns:
        row count
      • getHealpixInfo

        public uk.ac.starlink.table.HealpixTableInfo getHealpixInfo()
        Returns the HEALPix setup of the statistics file on which this simulation data is based.
        Returns:
        healpix info
      • getRandomRowIndex

        public int getRandomRowIndex​(long seed)
        Returns a sky area at random. The returned value is weighted by the number of objects in the original data set, so that the sky distribution of the original data set can be replicated
        Parameters:
        seed - random seed
        Returns:
        weighted random row index in this data set
      • createCoordColumn

        public SkySimData.Col createCoordColumn​(boolean isLat)
        Returns a column object that can give simulated sky positions.
        Parameters:
        isLat - true for latitude, false for longitude
      • createQuantityColumns

        public SkySimData.Col[] createQuantityColumns()
        Returns an array of column objects that can report statistically defined quantities.
        Returns:
        columns for quantities that can generate numeric values
      • readData

        public static SkySimData readData​(uk.ac.starlink.table.StarTable table,
                                          uk.ac.starlink.table.HealpixTableInfo hpxInfo,
                                          java.lang.String cnameWeight,
                                          java.lang.String stdevSuffix)
                                   throws java.io.IOException
        Assembles a SkySimData instance by using statistical information in a given HEALPix table (one with a row for each healpix tile). As well as a column containing the healpix index (as characterised by the HealpixTableInfo parameter), it can have pairs of column X, X<stdevSuffix> containing respectively the mean and sample standard deviation respectively of quantities per region.
        Parameters:
        table - table containing statistical information
        hpxInfo - HEALPix characterisation of the table
        cnameWeight - name of the table column containing region weight (for instance a source count)
        stdevSuffix - column name suffix indicating sample standard deviation
        Returns:
        SkySimData instance
        Throws:
        java.io.IOException