use of ca.nrc.cadc.caom2.Polarization in project caom2db by opencadc.
the class AbstractObservationDAOTest method getTestPlane.
protected Plane getTestPlane(boolean full, String productID, int depth, boolean poly) throws Exception {
Plane p = new Plane(productID);
if (full) {
p.metaProducer = URI.create("test:plane/roundrip-1.0");
p.creatorID = URI.create("ivo://example.com/TEST?" + productID);
p.calibrationLevel = CalibrationLevel.CALIBRATED;
p.dataProductType = DataProductType.IMAGE;
p.metaRelease = TEST_DATE;
p.dataRelease = TEST_DATE;
p.provenance = new Provenance("doit");
p.provenance.lastExecuted = TEST_DATE;
p.provenance.producer = "MyProducer";
p.provenance.project = "MyProject";
p.provenance.reference = new URI("http://www.example.com/MyProject/doit");
p.provenance.runID = "RUNID123";
p.provenance.version = "0.1alpha4";
p.provenance.getKeywords().addAll(TEST_KEYWORDS);
p.provenance.getInputs().add(new PlaneURI(new ObservationURI("FOO", "bar"), "in1"));
p.provenance.getInputs().add(new PlaneURI(new ObservationURI("FOO", "bar"), "in2"));
p.metrics = new Metrics();
p.metrics.sourceNumberDensity = 100.0;
p.metrics.background = 2.7;
p.metrics.backgroundStddev = 0.3;
p.metrics.fluxDensityLimit = 1.0e-5;
p.metrics.magLimit = 28.5;
p.metrics.sampleSNR = 11.0;
p.quality = new DataQuality(Quality.JUNK);
// previously was computed metadata
p.energy = new Energy();
p.energy.bandpassName = "V";
p.energy.bounds = new SampledInterval(400e-6, 900e-6);
p.energy.bounds.getSamples().add(new Interval(400e-6, 500e-6));
p.energy.bounds.getSamples().add(new Interval(800e-6, 900e-6));
p.energy.dimension = 2L;
p.energy.getEnergyBands().add(EnergyBand.OPTICAL);
p.energy.resolvingPower = 2.0;
p.energy.resolvingPowerBounds = new Interval(1.8, 2.2);
p.energy.restwav = 600e-9;
p.energy.sampleSize = 100e-6;
p.energy.transition = new EnergyTransition("H", "alpha");
p.polarization = new Polarization();
p.polarization.dimension = 3L;
p.polarization.states = new TreeSet<>();
p.polarization.states.add(PolarizationState.I);
p.polarization.states.add(PolarizationState.Q);
p.polarization.states.add(PolarizationState.U);
p.position = new Position();
if (poly) {
MultiPolygon mp = new MultiPolygon();
mp.getVertices().add(new Vertex(2.0, 2.0, SegmentType.MOVE));
mp.getVertices().add(new Vertex(1.0, 4.0, SegmentType.LINE));
mp.getVertices().add(new Vertex(3.0, 3.0, SegmentType.LINE));
mp.getVertices().add(new Vertex(0.0, 0.0, SegmentType.CLOSE));
List<Point> points = new ArrayList<Point>();
for (Vertex v : mp.getVertices()) {
if (!SegmentType.CLOSE.equals(v.getType())) {
points.add(new Point(v.cval1, v.cval2));
}
}
p.position.bounds = new Polygon(points, mp);
} else {
p.position.bounds = new Circle(new Point(0.0, 89.0), 2.0);
}
p.position.dimension = new Dimension2D(1024, 2048);
p.position.resolution = 0.05;
p.position.resolutionBounds = new Interval(0.04, 0.06);
p.position.sampleSize = 0.025;
p.position.timeDependent = false;
p.time = new Time();
p.time.bounds = new SampledInterval(50000.25, 50000.75);
p.time.bounds.getSamples().add(new Interval(50000.25, 50000.40));
p.time.bounds.getSamples().add(new Interval(50000.50, 50000.75));
p.time.dimension = 2L;
p.time.exposure = 666.0;
p.time.resolution = 0.5;
p.time.resolutionBounds = new Interval(0.22, 0.88);
p.time.sampleSize = 0.15;
p.custom = new CustomAxis("FDEP");
p.custom.bounds = new SampledInterval(100.0, 200.0);
p.custom.bounds.getSamples().add(new Interval(100.0, 140.0));
p.custom.bounds.getSamples().add(new Interval(160.0, 200.0));
p.custom.bounds.validate();
p.custom.dimension = 1024L;
p.observable = new Observable("phot.flux");
p.getMetaReadGroups().add(URI.create("ivo://example.net/gms?GroupA"));
p.getMetaReadGroups().add(URI.create("ivo://example.net/gms?GroupB"));
p.getDataReadGroups().add(URI.create("ivo://example.net/gms?GroupC"));
p.getDataReadGroups().add(URI.create("ivo://example.net/gms?GroupD"));
}
if (depth <= 2)
return p;
p.getArtifacts().add(getTestArtifact(full, new URI("http://www.example.com/stuff/" + productID + "a"), depth));
p.getArtifacts().add(getTestArtifact(full, new URI("http://www.example.com/stuff/" + productID + "b"), depth));
Assert.assertEquals(2, p.getArtifacts().size());
return p;
}
Aggregations