Class BinaryDataProvider
java.lang.Object
gaiasky.data.group.AbstractStarGroupDataProvider
gaiasky.data.group.BinaryDataProvider
- All Implemented Interfaces:
IParticleGroupDataProvider, IStarGroupDataProvider
Reads binary files using the infrastructure under
BinaryIO. The format includes a header token
and a version number. Depending on the version number a different loader is activated.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractStarGroupDataProvider
AbstractStarGroupDataProvider.AdditionalCols, AbstractStarGroupDataProvider.ColId -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe default output format version to use for writingstatic intstatic intFields inherited from class AbstractStarGroupDataProvider
adaptiveParallax, additional, additionalFiles, colors, countsPerMag, distCap, fileNumberCap, indexMap, list, logger, magCorrections, mustLoadIds, parallaxErrorFactorBright, parallaxErrorFactorFaint, parallaxZeroPoint, parallelism, params, ruwe, sphericalPositions, starNumberCap, transform -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadData(InputStream is, double factor) Loads the data applying a factor.Loads the data applying a factor.loadDataMapped(String file, double factor) Loads the data applying a factor using a memory mapped file for improved speed.loadDataMapped(String file, double factor, int versionHint) Loads data mapped with a version hint.readData(InputStream in, double factor) voidsetOutputFormatVersion(int version) Set the preferred output format version, if applicable.voidwriteData(List<IParticleRecord> data, OutputStream out) voidwriteData(List<IParticleRecord> data, OutputStream out, int version) Methods inherited from class AbstractStarGroupDataProvider
acceptDistance, acceptParallax, colIdFromStr, countLines, countLines, dumpToDisk, dumpToDiskBin, dumpToDiskCsv, getAdditionalValue, getColors, getCountsPerMag, getGeoDistance, getRuweValue, hasAdditional, hasAdditionalColumn, hasCol, idx, initLists, initLists, initLists, loadData, mustLoad, setAdaptiveParallax, setAdditionalFiles, setColumns, setDistanceCap, setFileNumberCap, setMagCorrections, setMustLoadIds, setParallaxErrorFactorBright, setParallaxErrorFactorFaint, setParallaxZeroPoint, setProviderParams, setRUWECap, setStarNumberCap, setTransformMatrix
-
Field Details
-
DEFAULT_OUTPUT_VERSION
public static int DEFAULT_OUTPUT_VERSIONThe default output format version to use for writing -
MIN_OUTPUT_VERSION
public static int MIN_OUTPUT_VERSION -
MAX_OUTPUT_VERSION
public static int MAX_OUTPUT_VERSION
-
-
Constructor Details
-
BinaryDataProvider
public BinaryDataProvider()
-
-
Method Details
-
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
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.
-
writeData
-
writeData
-
readData
-
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.
-
loadDataMapped
Loads data mapped with a version hint.- Parameters:
file- The file to loadfactor- Distance factor, if anyversionHint- Data version number, in case of version 0 or 1, since these formats were not annotated. If version >=2, the version number is read from the file header- Returns:
- The list of particle records.
-
setOutputFormatVersion
public void setOutputFormatVersion(int version) Description copied from interface:IStarGroupDataProviderSet the preferred output format version, if applicable.- Specified by:
setOutputFormatVersionin interfaceIStarGroupDataProvider- Overrides:
setOutputFormatVersionin classAbstractStarGroupDataProvider- Parameters:
version- The version number.
-