use of ca.nrc.cadc.caom2.Telescope in project caom2db by opencadc.
the class AbstractObservationDAOTest method getTestObservation.
private Observation getTestObservation(boolean full, int depth, boolean comp, boolean sci) throws Exception {
Observation o;
if (comp) {
DerivedObservation obs = new DerivedObservation("TEST", "SimpleBar", new Algorithm("doit"));
if (full) {
obs.getMembers().add(new ObservationURI("TEST", "simple1"));
obs.getMembers().add(new ObservationURI("TEST", "simple2"));
obs.getMembers().add(new ObservationURI("TEST", "simple3"));
}
o = obs;
} else
o = new SimpleObservation("TEST", "SimpleBar");
if (full) {
o.metaProducer = URI.create("test:observation/roundrip-1.0");
if (sci)
o.intent = ObservationIntentType.SCIENCE;
else {
o.intent = ObservationIntentType.CALIBRATION;
o.type = "flat";
}
o.sequenceNumber = new Integer(123);
o.metaRelease = TEST_DATE;
o.proposal = new Proposal("MyFirstProposal");
o.proposal.getKeywords().addAll(TEST_KEYWORDS);
o.proposal.pi = "little old me";
o.proposal.title = "My Little Pony";
o.proposal.project = "Project 51";
o.target = new Target("Pony 51");
o.target.targetID = URI.create("naif:1701");
o.target.type = TargetType.OBJECT;
o.target.getKeywords().addAll(TEST_KEYWORDS);
o.target.standard = Boolean.TRUE;
o.target.redshift = new Double(0.0);
o.target.moving = Boolean.FALSE;
o.targetPosition = new TargetPosition("FK5", new Point(1.0, 2.0));
if (sci)
o.targetPosition.equinox = 2000.0;
o.requirements = new Requirements(Status.FAIL);
o.telescope = new Telescope("BothEyes");
o.telescope.getKeywords().addAll(TEST_KEYWORDS);
o.telescope.geoLocationX = 100.0;
o.telescope.geoLocationY = 200.0;
o.telescope.geoLocationZ = 300.0;
o.instrument = new Instrument("test-instrument");
o.instrument.getKeywords().addAll(TEST_KEYWORDS);
o.environment = new Environment();
o.environment.seeing = 0.08;
o.environment.photometric = Boolean.TRUE;
o.getMetaReadGroups().add(URI.create("ivo://example.net/gms?GroupA"));
o.getMetaReadGroups().add(URI.create("ivo://example.net/gms?GroupB"));
}
if (depth == 1)
return o;
o.getPlanes().add(getTestPlane(full, "thing1", depth, true));
o.getPlanes().add(getTestPlane(full, "thing2", depth, false));
Assert.assertEquals(2, o.getPlanes().size());
return o;
}
Aggregations