Class STILDataProvider
java.lang.Object
gaiasky.data.group.AbstractStarGroupDataProvider
gaiasky.data.group.STILDataProvider
- All Implemented Interfaces:
IParticleGroupDataProvider, IStarGroupDataProvider
Loads data in VOTable, CSV and FITS formats using the STIL library.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractStarGroupDataProvider
AbstractStarGroupDataProvider.AdditionalCols, AbstractStarGroupDataProvider.ColIdModifier and TypeClassDescriptionstatic classstatic enumRepresents a column type. -
Field Summary
Fields inherited from class AbstractStarGroupDataProvider
adaptiveParallax, additional, additionalFiles, colors, countsPerMag, distCap, fileNumberCap, indexMap, list, logger, magCorrections, mustLoadIds, parallaxErrorFactorBright, parallaxErrorFactorFaint, parallaxZeroPoint, parallelism, params, ruwe, sphericalPositions, starNumberCap, transformModifier 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 TypeMethodDescriptioncom.badlogic.gdx.utils.LongMap<float[]> List<uk.ac.starlink.table.ColumnInfo> protected booleanprotected intbooleanDo all particles in the group have the same epoch?loadData(InputStream is, double factor) Loads the data applying a factor.Loads the data applying a factor.loadData(uk.ac.starlink.util.DataSource ds, double factor) loadData(uk.ac.starlink.util.DataSource ds, double factor, Runnable preCallback, BiConsumer<Long, Long> updateCallback, Runnable postCallback) Loads a dataset (from a data source object) into a list of particle records.loadDataMapped(String file, double factor) Loads the data applying a factor using a memory mapped file for improved speed.voidsetDatasetOptions(DatasetOptions datasetOptions) 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.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.Methods inherited from class AbstractStarGroupDataProvider
acceptDistance, acceptParallax, colIdFromStr, countLines, countLines, dumpToDisk, dumpToDiskBin, dumpToDiskCsv, getAdditionalValue, getCountsPerMag, getGeoDistance, getRuweValue, hasAdditional, hasAdditionalColumn, initLists, initLists, initLists, loadData, mustLoad, setAdaptiveParallax, setAdditionalFiles, setColumns, setDistanceCap, setMustLoadIds, setOutputFormatVersion, setRUWECap, setStarNumberCap, setTransformMatrixModifier 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) 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 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.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.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.
-
Constructor Details
-
STILDataProvider
public STILDataProvider()
-
-
Method Details
-
setDatasetOptions
-
loadData
Description copied from interface:IStarGroupDataProviderLoads the data applying a factor.- Parameters:
file- The file to load.factor- Factor to apply to the positions.- Returns:
- The array of particle records.
-
loadData
-
loadData
public List<IParticleRecord> loadData(uk.ac.starlink.util.DataSource ds, double factor, Runnable preCallback, BiConsumer<Long, Long> updateCallback, Runnable postCallback) Loads a dataset (from a data source object) into a list of particle records.- Parameters:
ds- The data source.factor- Length factor.preCallback- A function that runs before.updateCallback- A function that runs after each object has loaded. Gets two longs, the first holds the current number of loaded objects and the second holds the total number of objects to load.postCallback- A function that runs after the data has been loaded.- Returns:
- The list of particle records.
-
hasCol
- Overrides:
hasColin classAbstractStarGroupDataProvider
-
idx
- Overrides:
idxin classAbstractStarGroupDataProvider
-
getColumnInfoList
-
loadData
Description copied from interface:IStarGroupDataProviderLoads the data applying a factor.- Parameters:
is- Input stream to load the data from.factor- Factor to apply to the positions.- Returns:
- The array of particle records.
-
loadDataMapped
Description copied from interface:IStarGroupDataProviderLoads the data applying a factor using a memory mapped file for improved speed.- Parameters:
file- The file to load.factor- Factor to apply to the positions.- Returns:
- The array of particle records.
-
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- Overrides:
setFileNumberCapin classAbstractStarGroupDataProvider- Parameters:
cap- The file cap number.
-
getColors
public com.badlogic.gdx.utils.LongMap<float[]> getColors()- Specified by:
getColorsin interfaceIStarGroupDataProvider- Overrides:
getColorsin classAbstractStarGroupDataProvider
-
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- Overrides:
setParallaxErrorFactorFaintin classAbstractStarGroupDataProvider- 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- Overrides:
setParallaxErrorFactorBrightin classAbstractStarGroupDataProvider- Parameters:
parallaxErrorFactor- The percentage value of parallax errors with respect to parallax.
-
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- Overrides:
setParallaxZeroPointin classAbstractStarGroupDataProvider- 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- Overrides:
setMagCorrectionsin classAbstractStarGroupDataProvider- Parameters:
magCorrections- Whether to apply the corrections.
-
setProviderParams
Description copied from interface:IParticleGroupDataProviderSet provider parameters as a map.- Specified by:
setProviderParamsin interfaceIParticleGroupDataProvider- Overrides:
setProviderParamsin classAbstractStarGroupDataProvider- Parameters:
params- The parameters map.
-
isUniformEpoch
public boolean isUniformEpoch()Description copied from interface:IParticleGroupDataProviderDo all particles in the group have the same epoch?- Returns:
- Whether all particles in the group have the same epoch;
-