Search in sources :

Example 1 with Telescope

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;
}
Also used : ObservationURI(ca.nrc.cadc.caom2.ObservationURI) Telescope(ca.nrc.cadc.caom2.Telescope) Point(ca.nrc.cadc.caom2.types.Point) Algorithm(ca.nrc.cadc.caom2.Algorithm) TargetPosition(ca.nrc.cadc.caom2.TargetPosition) Requirements(ca.nrc.cadc.caom2.Requirements) DerivedObservation(ca.nrc.cadc.caom2.DerivedObservation) Target(ca.nrc.cadc.caom2.Target) SimpleObservation(ca.nrc.cadc.caom2.SimpleObservation) DerivedObservation(ca.nrc.cadc.caom2.DerivedObservation) Observation(ca.nrc.cadc.caom2.Observation) DeletedObservation(ca.nrc.cadc.caom2.DeletedObservation) SimpleObservation(ca.nrc.cadc.caom2.SimpleObservation) Instrument(ca.nrc.cadc.caom2.Instrument) Environment(ca.nrc.cadc.caom2.Environment) Proposal(ca.nrc.cadc.caom2.Proposal)

Aggregations

Algorithm (ca.nrc.cadc.caom2.Algorithm)1 DeletedObservation (ca.nrc.cadc.caom2.DeletedObservation)1 DerivedObservation (ca.nrc.cadc.caom2.DerivedObservation)1 Environment (ca.nrc.cadc.caom2.Environment)1 Instrument (ca.nrc.cadc.caom2.Instrument)1 Observation (ca.nrc.cadc.caom2.Observation)1 ObservationURI (ca.nrc.cadc.caom2.ObservationURI)1 Proposal (ca.nrc.cadc.caom2.Proposal)1 Requirements (ca.nrc.cadc.caom2.Requirements)1 SimpleObservation (ca.nrc.cadc.caom2.SimpleObservation)1 Target (ca.nrc.cadc.caom2.Target)1 TargetPosition (ca.nrc.cadc.caom2.TargetPosition)1 Telescope (ca.nrc.cadc.caom2.Telescope)1 Point (ca.nrc.cadc.caom2.types.Point)1