logger.log("No planet template provided! Model not created.");
return null;
}
// Create clean reference astrometry
StellarAstrometry refAstro = null;
refAstro = astTemp.createAstrometry();
AstrometryTemplate astTempErr = astTemp.clone();
// Introduce systematic errors if requested
if(makeErrors) {
// Random setup
ErrorModel errorModel = new ErrorModel(stTemp.getMagMv(), stTemp.getVMinusI(), sim.isFaintCutOff());
Random random = new Random();
// Randomize astrometry
double SUBCORR = 1.0;
if (sim.getSubCatalogue() < 5.0)
SUBCORR = Math.sqrt(5.0/sim.getSubCatalogue());
astTempErr.setAlpha(astTempErr.getAlpha() + SUBCORR*random.nextGaussian() * errorModel.alphaStarError() / Math.cos(astTempErr.getDelta()));
astTempErr.setDelta(astTempErr.getDelta() + SUBCORR*random.nextGaussian() * errorModel.deltaError());
astTempErr.setMuAlphaStar(astTempErr.getMuAlphaStar() + SUBCORR*random.nextGaussian() * errorModel.muAlphaStarError());
astTempErr.setMuDelta(astTempErr.getMuDelta() + SUBCORR*random.nextGaussian() * errorModel.muDeltaError());
astTempErr.setParallax(astTempErr.getParallax() + SUBCORR*random.nextGaussian() * errorModel.parallaxError());
// Randomize orbital geometry
if(randGeo) {
plTemps.get(0).setNodeAngle(random.nextDouble()*2.0*Math.PI);
plTemps.get(0).setOmega2(random.nextDouble()*2.0*Math.PI);
plTemps.get(0).setTimePeriastron(random.nextDouble()*plTemps.get(0).getPeriod());
}
}
// Create model from templates
Model model = new Model ( sim );
StellarAstrometry astro = astTempErr.createAstrometry();
model.setAstrometry ( astro );
model.setRefAstro ( refAstro );
Star star = stTemp.createStar ( astro );
model.setStar ( star );
for ( PlanetTemplate plTemp: plTemps )