// c) Main execution method of the Gog simulation.We split the execution process in the following subprocesses
// 1 - Gaia initialization
GogConfiguration gc = GogConfigurationMgr.getConfiguration();
// 2 - Generation of the list of sources according the universe model or user sources given as input
RunnableGogSimulation gogSimulation = new RunnableGogSimulation( gc.getSimulationReference() );
// 3 - Delegation to the subprocess that perform astrosourcelist analysis and MDBObject calculation and writting
// gogSimulation.run();
// start time
long t0 = System.currentTimeMillis();
// initialisation common to processSource and processSpectra : go
List<gaiasimu.universe.source.AstroSource> sourceList = gogSimulation.initSources();
// gogSimulation.processSourceList(sourceList);
int sourceListSize = sourceList.size();
// go
for (int i = 0; i < sourceListSize; i++) {
// write AstroSource in the universe model catalogue data
gaiasimu.universe.source.AstroSource as = sourceList.get(i);
Random random = new Random();
random.setSeed(i);
// gogsprocessSource(as, random);
Gaia gaia = GogSimulation.getGaia();
double sourceMagnitude = as.getPhotometry().getGaiaMag(GaiaPhotometrySystem.photometryG,
GogConstants.CATALOGUE_TIME, gc.isPhotometryFromSpectrum());
// AstroSource as= (AstroSource)aSourcesList.get(i).getComponents()[j];
gaia.cu1.tools.numeric.algebra.GVector3d positionICRS = as.getAstrometry().getICRSPosition(GogConstants.CATALOGUE_TIME);
// compute all possible transits for this source, using ScanningLaw.inverseScan
double halfAperture = GaiaParam.Satellite.FOV_AC * GaiaParam.Nature.DEGREE_RADIAN / 2;
// This method returns the list of all the transits
double t1 = System.currentTimeMillis();
List<gaiasimu.gaia.spacecraft.Transit> fovTransits = gaia.attitude.inverseScan(positionICRS, halfAperture, gaia
.getTelescope(FoV.FOV1));
List<gaiasimu.gaia.spacecraft.Transit> fovTransits2 = gaia.attitude.inverseScan(positionICRS, halfAperture, gaia
.getTelescope(FoV.FOV2));
// System.out.println("HA:" + halfAperture + "HA2:" +halfAperture2 + "ZA:" + zAngle + "ZA2:" + zAngle2);
fovTransits.addAll(fovTransits2);
// keep here only the number of transits that have been requested
if ((gc.getTransitNumber() > 0) && (gc.getTransitNumber() < fovTransits.size())) {
List<gaiasimu.gaia.spacecraft.Transit> fovTransitsSub = fovTransits.subList(0, gc.getTransitNumber());
fovTransits = fovTransitsSub;
}
// create and write MDBObject parameters as requested
long t2 = System.currentTimeMillis();
MDBObject mdbo = createMDBObject(as, fovTransits, random);