Class AbstractStarGroupDataProvider
- All Implemented Interfaces:
IParticleGroupDataProvider, IStarGroupDataProvider
- Direct Known Subclasses:
BinaryDataProvider, SerializedDataProvider, STILDataProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumRepresents a column type. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether to use an adaptive threshold which lets more bright stars in to avoid artifacts.protected List<AbstractStarGroupDataProvider.AdditionalCols> protected String[]Files or folders with optionally gzipped CSVs containing additional columns to be matched by sourceId with the main catalog.protected com.badlogic.gdx.utils.LongMap<float[]> protected long[]protected doubleDistance cap in parsecsprotected intMaximum number of files to load.protected Map<AbstractStarGroupDataProvider.ColId, Integer> protected List<IParticleRecord> protected static Logger.Logprotected booleanApply magnitude/color corrections for extinction/reddeningprotected doubleThe loader will only load stars for which the parallax error is at most the percentage given here, in [0..1].protected doubleThe loader will only load stars for which the parallax error is at most the percentage given here, in [0..1].protected doubleThe zero point for the parallaxes in mas.protected final intParallelism valueprotected DoubleRUWE cap value.protected com.badlogic.gdx.utils.LongMap<double[]> protected intMaximum number of files to load per fileprotected Matrix4D -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanacceptDistance(double distance) Checks whether to accept the distanceprotected booleanacceptParallax(double appMag, double parallax, double parallaxError) Checks whether the parallax is accepted or not.colIdFromStr(String name) protected intcountLines(com.badlogic.gdx.files.FileHandle f) protected intCounts the lines on this input streamprotected voiddumpToDisk(List<IParticleRecord> data, String filename, String format) protected voiddumpToDiskBin(List<IParticleRecord> data, String filename) protected voiddumpToDiskCsv(List<IParticleRecord> data, String filename) protected DoublegetAdditionalValue(AbstractStarGroupDataProvider.ColId col, Long sourceId) com.badlogic.gdx.utils.LongMap<float[]> long[]Gets the star counts per magnitude.protected doublegetGeoDistance(long sourceId) Gets the distance in parsecs to the star from the additional columns map, if it exists.protected floatgetRuweValue(long sourceId, String[] tokens) protected booleanhasAdditional(AbstractStarGroupDataProvider.ColId col, Long sourceId) protected booleanprotected booleanprotected intprotected voidprotected voidinitLists(int elems) Initialises the lists and structures given number of elementsprotected voidinitLists(com.badlogic.gdx.files.FileHandle f) Initialises the lists and structures given a file by counting the number of linesLoads the data as it is.protected booleanmustLoad(long id) Returns whether the star must be loaded or notvoidsetAdaptiveParallax(boolean adaptive) Whether to use an adaptive threshold, relaxing it for bright (appmag ≥ 13) stars to let more bright stars in.voidsetAdditionalFiles(String additionalFiles) Set location of additional columns file or directory.voidsetColumns(String columns) List of column names, separated by commas, indicating the position of each field to load.voidsetDistanceCap(double distCap) Sets a distance cap.voidsetFileNumberCap(int cap) Sets a cap on the number of files to load.voidsetMagCorrections(boolean magCorrections) Sets the flag to apply magnitude and color corrections for extinction and reddening.voidsetMustLoadIds(Set<Long> ids) Adds a set with all the ids which will be loaded regardless of any other conditions (i.e.voidsetOutputFormatVersion(int version) Set the preferred output format version, if applicable.voidsetParallaxErrorFactorBright(double parallaxErrorFactor) The loader will only load stars for which the parallax error is at most the percentage given here, in [0..1].voidsetParallaxErrorFactorFaint(double parallaxErrorFactor) The loader will only load stars for which the parallax error is at most the percentage given here, in [0..1].voidsetParallaxZeroPoint(double parallaxZeroPoint) Sets the zero point of the parallax as an addition to the parallax values, in [mas].voidsetProviderParams(Map<String, Object> params) Set provider parameters as a map.voidsetRUWECap(double RUWE) Sets the RUWE criteria.voidsetStarNumberCap(int starNumberCap) Sets the maximum number of stars to be processed per file.voidsetTransformMatrix(Matrix4D transform) Sets a transform matrix to apply to all data points.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IStarGroupDataProvider
loadData, loadData, loadDataMapped
-
Field Details
-
logger
-
parallelism
protected final int parallelismParallelism value -
params
-
indexMap
-
list
-
sphericalPositions
protected com.badlogic.gdx.utils.LongMap<double[]> sphericalPositions -
colors
protected com.badlogic.gdx.utils.LongMap<float[]> colors -
countsPerMag
protected long[] countsPerMag -
transform
-
mustLoadIds
-
additional
-
additionalFiles
Files or folders with optionally gzipped CSVs containing additional columns to be matched by sourceId with the main catalog. Column names must comport toAbstractStarGroupDataProvider.ColId. -
ruwe
RUWE cap value. Will accept all stars with star_ruwe ≤ ruwe -
distCap
protected double distCapDistance cap in parsecs -
parallaxErrorFactorFaint
protected double parallaxErrorFactorFaintThe loader will only load stars for which the parallax error is at most the percentage given here, in [0..1]. Faint stars (gmag ≥ 13.1) More specifically, the following must be met:
pllx_err < pllx * pllxErrFactor -
parallaxErrorFactorBright
protected double parallaxErrorFactorBrightThe loader will only load stars for which the parallax error is at most the percentage given here, in [0..1]. Bright stars (gmag < 13.1) More specifically, the following must be met:
pllx_err < pllx * pllxErrFactor -
adaptiveParallax
protected boolean adaptiveParallaxWhether to use an adaptive threshold which lets more bright stars in to avoid artifacts. -
parallaxZeroPoint
protected double parallaxZeroPointThe zero point for the parallaxes in mas. Gets added to all loaded parallax values -
magCorrections
protected boolean magCorrectionsApply magnitude/color corrections for extinction/reddening -
fileNumberCap
protected int fileNumberCapMaximum number of files to load. Negative for unlimited -
starNumberCap
protected int starNumberCapMaximum number of files to load per file
-
-
Constructor Details
-
AbstractStarGroupDataProvider
public AbstractStarGroupDataProvider()
-
-
Method Details
-
colIdFromStr
-
idx
-
hasCol
-
hasAdditional
-
hasAdditionalColumn
-
getAdditionalValue
-
initLists
protected void initLists(com.badlogic.gdx.files.FileHandle f) Initialises the lists and structures given a file by counting the number of lines- Parameters:
f- The file handle to count the lines
-
initLists
protected void initLists(int elems) Initialises the lists and structures given number of elements -
initLists
protected void initLists() -
loadData
Description copied from interface:IParticleGroupDataProviderLoads the data as it is.- Specified by:
loadDatain interfaceIParticleGroupDataProvider- Parameters:
file- The file to load.- Returns:
- The array of particle records.
-
mustLoad
protected boolean mustLoad(long id) Returns whether the star must be loaded or not- Parameters:
id- The star ID- Returns:
- Whether the star with the given ID must be loaded
-
acceptParallax
protected boolean acceptParallax(double appMag, double parallax, double parallaxError) Checks whether the parallax is accepted or not. If adaptive is not enabled:accepted = pllx > 0 && pllx_err < pllx * pllx_err_factor && pllx_err ≤ 1
If adaptive is enabled:
accepted = pllx > 0 && pllx_err < pllx * max(0.5, pllx_err_factor) && pllx_err ≤ 1, if apparent_magnitude < 13.2 accepted = pllx > 0 && pllx_err < pllx * pllx_err_factor && pllx_err ≤ 1, otherwise
- Parameters:
appMag- Apparent magnitude of star.parallax- Parallax of star.parallaxError- Parallax error of star.- Returns:
- True if parallax is accepted, false otherwise
-
getRuweValue
-
getGeoDistance
protected double getGeoDistance(long sourceId) Gets the distance in parsecs to the star from the additional columns map, if it exists. Otherwise, it returns a negative value.- Parameters:
sourceId- The source id of the source- Returns:
- The geometric distance in parsecs if it exists, -1 otherwise.
-
acceptDistance
protected boolean acceptDistance(double distance) Checks whether to accept the distance- Parameters:
distance- Distance in parsecs- Returns:
- Whether to accept the distance or not
-
countLines
- Throws:
IOException
-
setColumns
Description copied from interface:IStarGroupDataProviderList of column names, separated by commas, indicating the position of each field to load.- Specified by:
setColumnsin interfaceIStarGroupDataProvider- Parameters:
columns- The column name list.
-
setMustLoadIds
Description copied from interface:IStarGroupDataProviderAdds a set with all the ids which will be loaded regardless of any other conditions (i.e. parallax error thresholds).- Specified by:
setMustLoadIdsin interfaceIStarGroupDataProvider- Parameters:
ids- The ids that must be loaded.
-
countLines
Counts the lines on this input stream- Parameters:
is- The input stream- Returns:
- The number of lines
- Throws:
IOException
-
dumpToDisk
-
dumpToDiskBin
-
dumpToDiskCsv
-
getColors
public com.badlogic.gdx.utils.LongMap<float[]> getColors()- Specified by:
getColorsin interfaceIStarGroupDataProvider
-
setParallaxErrorFactorFaint
public void setParallaxErrorFactorFaint(double parallaxErrorFactor) Description copied from interface:IStarGroupDataProviderThe loader will only load stars for which the parallax error is at most the percentage given here, in [0..1]. This applies to faint stars (gmag ≥ 13.1) More specifically, the following must be met:
pllx_err < pllx * pllxErrFactor- Specified by:
setParallaxErrorFactorFaintin interfaceIStarGroupDataProvider- Parameters:
parallaxErrorFactor- The percentage value of parallax errors with respect to parallax.
-
setParallaxErrorFactorBright
public void setParallaxErrorFactorBright(double parallaxErrorFactor) Description copied from interface:IStarGroupDataProviderThe loader will only load stars for which the parallax error is at most the percentage given here, in [0..1]. This applies to bright stars (gmag < 13.1) More specifically, the following must be met:
pllx_err < pllx * pllxErrFactor- Specified by:
setParallaxErrorFactorBrightin interfaceIStarGroupDataProvider- Parameters:
parallaxErrorFactor- The percentage value of parallax errors with respect to parallax.
-
setAdaptiveParallax
public void setAdaptiveParallax(boolean adaptive) Description copied from interface:IStarGroupDataProviderWhether to use an adaptive threshold, relaxing it for bright (appmag ≥ 13) stars to let more bright stars in.- Specified by:
setAdaptiveParallaxin interfaceIStarGroupDataProvider
-
setParallaxZeroPoint
public void setParallaxZeroPoint(double parallaxZeroPoint) Description copied from interface:IStarGroupDataProviderSets the zero point of the parallax as an addition to the parallax values, in [mas].- Specified by:
setParallaxZeroPointin interfaceIStarGroupDataProvider- Parameters:
parallaxZeroPoint- The parallax zero point.
-
setMagCorrections
public void setMagCorrections(boolean magCorrections) Description copied from interface:IStarGroupDataProviderSets the flag to apply magnitude and color corrections for extinction and reddening.- Specified by:
setMagCorrectionsin interfaceIStarGroupDataProvider- Parameters:
magCorrections- Whether to apply the corrections.
-
getCountsPerMag
public long[] getCountsPerMag()Description copied from interface:IStarGroupDataProviderGets the star counts per magnitude.- Specified by:
getCountsPerMagin interfaceIStarGroupDataProvider
-
setAdditionalFiles
Description copied from interface:IStarGroupDataProviderSet location of additional columns file or directory.- Specified by:
setAdditionalFilesin interfaceIStarGroupDataProvider- Parameters:
additionalFiles- File or directory with additional columns per sourceId.
-
setDistanceCap
public void setDistanceCap(double distCap) Description copied from interface:IStarGroupDataProviderSets a distance cap. Stars beyond this distance will not be loaded.- Specified by:
setDistanceCapin interfaceIStarGroupDataProvider- Parameters:
distCap- The distance cap, in parsecs.
-
setRUWECap
public void setRUWECap(double RUWE) Description copied from interface:IStarGroupDataProviderSets the RUWE criteria. RUWE file must have been set.- Specified by:
setRUWECapin interfaceIStarGroupDataProvider- Parameters:
RUWE- The criteria (usually 1.4).
-
setFileNumberCap
public void setFileNumberCap(int cap) Description copied from interface:IParticleGroupDataProviderSets a cap on the number of files to load. Set to negative for unlimited.- Specified by:
setFileNumberCapin interfaceIParticleGroupDataProvider- Parameters:
cap- The file cap number.
-
setStarNumberCap
public void setStarNumberCap(int starNumberCap) Description copied from interface:IParticleGroupDataProviderSets the maximum number of stars to be processed per file. Set to negative for unlimited.- Specified by:
setStarNumberCapin interfaceIParticleGroupDataProvider- Parameters:
starNumberCap- The star cap number.
-
setOutputFormatVersion
public void setOutputFormatVersion(int version) Description copied from interface:IStarGroupDataProviderSet the preferred output format version, if applicable.- Specified by:
setOutputFormatVersionin interfaceIStarGroupDataProvider- Parameters:
version- The version number.
-
setProviderParams
Description copied from interface:IParticleGroupDataProviderSet provider parameters as a map.- Specified by:
setProviderParamsin interfaceIParticleGroupDataProvider- Parameters:
params- The parameters map.
-
setTransformMatrix
Description copied from interface:IParticleGroupDataProviderSets a transform matrix to apply to all data points.- Specified by:
setTransformMatrixin interfaceIParticleGroupDataProvider- Parameters:
transform- The transform matrix.
-