// Read stellar GBin file
// Parse data to ArrayList
ArrayList<GaiaRoot> stellarArrayList = new ArrayList<GaiaRoot>();
GbinReaderV2 stellarReader = new GbinReaderV2 (GBIN_STELLAR);
stellarReader.readAllToList( stellarArrayList );
stellarReader.close();
// Stellar data: terminal output
for (GaiaRoot element : stellarArrayList){
// Parse object into UMStellarSource
UMStellarSource stellarSource = (UMStellarSource)element;
// Source ID
System.out.printf( "SourceId:" + stellarSource.getSourceId() + "\n");
outputFile.printf( "SourceId:" + stellarSource.getSourceId() + "\n");
// Basic astrometry
UMAstroRoot stellarAstrometry = stellarSource.getAstrometry();
double alpha = stellarAstrometry.getAlpha();
double delta = stellarAstrometry.getDelta();
double distance = stellarAstrometry.getDistance();
System.out.printf("RA (deg): %15.5f; DEC (deg): %15.5f, distance (pc): %15.5e\n", alpha, delta, distance);
outputFile.printf("RA (deg): %15.5f; DEC (deg): %15.5f, distance (pc): %15.5e\n", alpha, delta, distance);
// Basic photometry
UMPhotoRoot photometry = stellarSource.getPhotometry();
double magG = photometry.getMagG();
double magGBp = photometry.getMagGBp();
double magGRp = photometry.getMagGRp();
double magGRvs = photometry.getMagGRvs();
System.out.printf("G: %6.2f; GBp: %6.2f; GRp: %6.2f; GRvs: %6.2f\n", magG, magGBp, magGRp, magGRvs);
outputFile.printf("G: %6.2f; GBp: %6.2f; GRp: %6.2f; GRvs: %6.2f\n", magG, magGBp, magGRp, magGRvs);
};
// Read combined astrometry GBin file
// Parse data to ArrayList
ArrayList<GaiaRoot> combinedAstrometryArrayList = new ArrayList<GaiaRoot>();
GbinReaderV2 combinedAstrometry = new GbinReaderV2 (GBIN_COMBINED_ASTROMETRY);
combinedAstrometry.readAllToList( combinedAstrometryArrayList );
combinedAstrometry.close();
// Combined astrometry data: terminal output
for (GaiaRoot element : combinedAstrometryArrayList){
// Parse object into Source
Source combinedAstrometryData = (Source)element;
// Parse source data
long sourceId = combinedAstrometryData.getSourceId();
int nObs = combinedAstrometryData.getNObs()[0];
double alpha = combinedAstrometryData.getAlpha();
double alphaError = combinedAstrometryData.getAlphaError();
double delta = combinedAstrometryData.getDelta();
double deltaError = combinedAstrometryData.getDeltaError();
double varpi = combinedAstrometryData.getVarpi();
double varpiError = combinedAstrometryData.getVarpiError();
System.out.printf( "SourceId:" + sourceId + "\n");
outputFile.printf( "SourceId:" + sourceId + "\n");
// Terminal output
System.out.printf("Source ID: %20d; N obs: %4d;" +
" alpha: %15.5e +- %15.5e;" +
" delta: %15.5e +- %15.5e;" +
" parallax: %15.5e +- %15.5e\n",
sourceId, nObs, alpha, alphaError, delta, deltaError, varpi, varpiError);
outputFile.printf("Source ID: %20d; N obs: %4d;" +
" alpha: %15.5e +- %15.5e;" +
" delta: %15.5e +- %15.5e;" +
" parallax: %15.5e +- %15.5e\n",
sourceId, nObs, alpha, alphaError, delta, deltaError, varpi, varpiError);
};
// Read epoch astrometry GBin file
// Parse data to ArrayList
ArrayList<GaiaRoot> epochAstrometryArrayList = new ArrayList<GaiaRoot>();
GbinReaderV2 epochAstrometry = new GbinReaderV2 (GBIN_EPOCH_ASTROMETRY);
epochAstrometry.readAllToList( epochAstrometryArrayList );
epochAstrometry.close();
System.out.printf("\n" + "Epoch astrometry\n");
outputFile.printf("\n" + "Epoch astrometry\n");
// Combined astrometry data: terminal output
for (GaiaRoot element : epochAstrometryArrayList){