Package gaiasky.data.group
Class BinaryDataProvider
- java.lang.Object
-
- gaiasky.data.group.AbstractStarGroupDataProvider
-
- gaiasky.data.group.BinaryDataProvider
-
- All Implemented Interfaces:
IParticleGroupDataProvider
,IStarGroupDataProvider
public class BinaryDataProvider extends AbstractStarGroupDataProvider
Reads arrays of star beans from binary files, usually to go in an octree.
-
-
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, logger, magCorrections, mustLoadIds, NEGATIVE_DIST, parallaxErrorFactorBright, parallaxErrorFactorFaint, parallaxZeroPoint, ruwe, sphericalPositions
-
-
Constructor Summary
Constructors Constructor Description BinaryDataProvider()
-
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 compatibility)
Loads the data applying a factor.java.util.List<ParticleGroup.ParticleBean>
loadData(java.lang.String file, double factor, boolean compatibility)
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>
readData(java.io.InputStream in)
java.util.List<ParticleGroup.ParticleBean>
readData(java.io.InputStream in, boolean compat)
protected StarGroup.StarBean
readStarBean(java.io.DataInputStream in)
protected StarGroup.StarBean
readStarBean(java.io.DataInputStream in, boolean compat)
Read a star bean from input streamStarGroup.StarBean
readStarBean(java.nio.MappedByteBuffer mem, double factor, boolean compat)
void
writeData(java.util.List<? extends ParticleGroup.ParticleBean> data, java.io.OutputStream out)
void
writeData(java.util.List<? extends ParticleGroup.ParticleBean> data, java.io.OutputStream out, boolean compat)
protected void
writeStarBean(StarGroup.StarBean sb, java.io.DataOutputStream out)
protected void
writeStarBean(StarGroup.StarBean sb, java.io.DataOutputStream out, boolean compat)
Write the star bean to the output stream-
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, loadData, loadDataMapped, mustLoad, setAdaptiveParallax, setAdditionalFiles, setColumns, setDistanceCap, setFileNumberCap, setMagCorrections, setMustLoadIds, setParallaxErrorFactorBright, setParallaxErrorFactorFaint, setParallaxZeroPoint, setRUWECap
-
-
-
-
Method Detail
-
loadData
public java.util.List<ParticleGroup.ParticleBean> loadData(java.lang.String file, double factor, boolean compatibility)
Description copied from interface:IStarGroupDataProvider
Loads the data applying a factor.- Parameters:
file
- The file to loadfactor
- Factor to apply to the positionscompatibility
- 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 compatibility)
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 positionscompatibility
- Use compatibility mode (DR1/DR2)- Returns:
- Array of particle beans
-
writeData
public void writeData(java.util.List<? extends ParticleGroup.ParticleBean> data, java.io.OutputStream out)
-
writeData
public void writeData(java.util.List<? extends ParticleGroup.ParticleBean> data, java.io.OutputStream out, boolean compat)
-
writeStarBean
protected void writeStarBean(StarGroup.StarBean sb, java.io.DataOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
writeStarBean
protected void writeStarBean(StarGroup.StarBean sb, java.io.DataOutputStream out, boolean compat) throws java.io.IOException
Write the star bean to the output stream- Parameters:
sb
- The star beanout
- The output streamcompat
- Use compatibility with DR1/DR2 model (with tycho ids)- Throws:
java.io.IOException
-
readData
public java.util.List<ParticleGroup.ParticleBean> readData(java.io.InputStream in)
-
readData
public java.util.List<ParticleGroup.ParticleBean> readData(java.io.InputStream in, boolean compat)
-
readStarBean
protected StarGroup.StarBean readStarBean(java.io.DataInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
readStarBean
protected StarGroup.StarBean readStarBean(java.io.DataInputStream in, boolean compat) throws java.io.IOException
Read a star bean from input stream- Parameters:
in
- Input streamcompat
- Use compatibility with DR1/DR2 model (with tycho ids)- Returns:
- The star bean
- Throws:
java.io.IOException
-
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
-
readStarBean
public StarGroup.StarBean readStarBean(java.nio.MappedByteBuffer mem, double factor, boolean compat)
-
-