Package gaiasky.data.group
Class CsvCatalogDataProvider
- java.lang.Object
-
- gaiasky.data.group.AbstractStarGroupDataProvider
-
- gaiasky.data.group.CsvCatalogDataProvider
-
- All Implemented Interfaces:
IParticleGroupDataProvider
,IStarGroupDataProvider
public class CsvCatalogDataProvider extends AbstractStarGroupDataProvider
Loads star catalogs in CSV formatSource position and corresponding errors are in radians, parallax in mas and proper motion in mas/yr.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gaiasky.data.group.AbstractStarGroupDataProvider
AbstractStarGroupDataProvider.AdditionalCols, AbstractStarGroupDataProvider.ColId
-
-
Field Summary
-
Fields inherited from class gaiasky.data.group.AbstractStarGroupDataProvider
adaptiveParallax, additional, additionalFiles, colors, countsPerMag, distCap, indexMap, list, magCorrections, mustLoadIds, NEGATIVE_DIST, parallaxErrorFactorBright, parallaxErrorFactorFaint, parallaxZeroPoint, ruwe, sphericalPositions
-
-
Constructor Summary
Constructors Constructor Description CsvCatalogDataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ParticleGroup.ParticleBean>
loadData(java.io.InputStream is, double factor, boolean compat)
Loads the data applying a factor.java.util.List<ParticleGroup.ParticleBean>
loadData(java.lang.String file)
Loads the data as it is.java.util.List<ParticleGroup.ParticleBean>
loadData(java.lang.String file, double factor, boolean compat)
Loads the data applying a factor.java.util.List<ParticleGroup.ParticleBean>
loadDataMapped(java.lang.String file, double factor, boolean compat)
Loads the data applying a factor using a memory mapped file for improved speed.java.util.List<ParticleGroup.ParticleBean>
loadDataMapped(java.lang.String file, double factor, int fileNumber, long totalFiles)
Uses memory mapped files to load catalog files.void
loadFileIs(java.io.InputStream is, double factor, java.util.concurrent.atomic.AtomicLong addedStars, java.util.concurrent.atomic.AtomicLong discardedStars)
void
setColumns(java.lang.String columns)
Set the CSV columns to work out the indices, as a comma-separated stringvoid
setColumns(java.lang.String... cols)
Set the CSV columns to work out the indices, as a comma-separated stringvoid
setDR2Columns()
Default columns for DR2void
setFileNumberCap(int cap)
Sets a cap on the number of files to load.void
setParallel(boolean parallel)
void
setParallelBufferSize(int size)
-
Methods inherited from class gaiasky.data.group.AbstractStarGroupDataProvider
acceptDistance, acceptParallax, countLines, countLines, dumpToDisk, dumpToDiskBin, dumpToDiskCsv, getAdditionalValue, getColors, getCountsPerMag, getGeoDistance, getRuweValue, hasAdditional, hasAdditionalColumn, hasCol, idx, initLists, initLists, initLists, loadData, loadData, loadDataMapped, mustLoad, setAdaptiveParallax, setAdditionalFiles, setDistanceCap, setMagCorrections, setMustLoadIds, setParallaxErrorFactorBright, setParallaxErrorFactorFaint, setParallaxZeroPoint, setRUWECap
-
-
-
-
Method Detail
-
setDR2Columns
public void setDR2Columns()
Default columns for DR2
-
setColumns
public void setColumns(java.lang.String columns)
Set the CSV columns to work out the indices, as a comma-separated string- Specified by:
setColumns
in interfaceIStarGroupDataProvider
- Overrides:
setColumns
in classAbstractStarGroupDataProvider
- Parameters:
columns
- Columns
-
setColumns
public void setColumns(java.lang.String... cols)
Set the CSV columns to work out the indices, as a comma-separated string- Parameters:
cols
- The columns
-
setFileNumberCap
public void setFileNumberCap(int cap)
Description copied from interface:IParticleGroupDataProvider
Sets a cap on the number of files to load. Set to 0 or negative for unlimited- Specified by:
setFileNumberCap
in interfaceIParticleGroupDataProvider
- Overrides:
setFileNumberCap
in classAbstractStarGroupDataProvider
- Parameters:
cap
- The cap number
-
loadData
public java.util.List<ParticleGroup.ParticleBean> loadData(java.lang.String file)
Description copied from interface:IParticleGroupDataProvider
Loads the data as it is.- Specified by:
loadData
in interfaceIParticleGroupDataProvider
- Overrides:
loadData
in classAbstractStarGroupDataProvider
- Parameters:
file
- The file to load- Returns:
- Array of particle beans
-
loadData
public java.util.List<ParticleGroup.ParticleBean> loadData(java.lang.String file, double factor, boolean compat)
Description copied from interface:IStarGroupDataProvider
Loads the data applying a factor.- Parameters:
file
- The file to loadfactor
- Factor to apply to the positionscompat
- Use compatibility mode (DR1/DR2)- Returns:
- Array of particle beans
-
loadData
public java.util.List<ParticleGroup.ParticleBean> loadData(java.io.InputStream is, double factor, boolean compat)
Description copied from interface:IStarGroupDataProvider
Loads the data applying a factor.- Parameters:
is
- Input stream to load the data fromfactor
- Factor to apply to the positionscompat
- Use compatibility mode (DR1/DR2)- Returns:
- Array of particle beans
-
loadFileIs
public void loadFileIs(java.io.InputStream is, double factor, java.util.concurrent.atomic.AtomicLong addedStars, java.util.concurrent.atomic.AtomicLong discardedStars)
-
loadDataMapped
public java.util.List<ParticleGroup.ParticleBean> loadDataMapped(java.lang.String file, double factor, boolean compat)
Description copied from interface:IStarGroupDataProvider
Loads the data applying a factor using a memory mapped file for improved speed.- Parameters:
file
- The file to loadfactor
- Factor to apply to the positionscompat
- Use compatibility mode (DR1/DR2)- Returns:
- Array of particle beans
-
loadDataMapped
public java.util.List<ParticleGroup.ParticleBean> loadDataMapped(java.lang.String file, double factor, int fileNumber, long totalFiles)
Uses memory mapped files to load catalog files.- Parameters:
file
- The file to loadfactor
- Position factorfileNumber
- File numbertotalFiles
- Total number of files- Returns:
-
setParallel
public void setParallel(boolean parallel)
-
setParallelBufferSize
public void setParallelBufferSize(int size)
-
-