From 167861b5226190548af5d391aff91935b8c27bf7 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Fri, 13 Mar 2026 12:24:19 +0000 Subject: [PATCH 1/2] drop ivoa COORDS model dependency and replace with simpler definitions at the same time attempt to use the ADQL geom point type as the main implementation of position. --- build.gradle.kts | 6 +- mkdocs_template.yml | 1 + src/main/vo-dml/proposalManagement.vo-dml.xml | 14 +- src/main/vo-dml/proposaldm.vo-dml.xml | 236 ++++++++++++------ src/main/vodsl/proposalManagement.vodsl | 6 +- src/main/vodsl/proposaldm.vodsl | 51 ++-- .../proposal/prop/AbstractProposalTest.java | 3 +- .../ivoa/dm/proposal/prop/BaseExample.java | 16 +- .../ivoa/dm/proposal/prop/BaseGenerator.java | 5 +- .../ivoa/dm/proposal/prop/EmerlinExample.java | 4 +- .../dm/proposal/prop/EmerlinExampleTest.java | 4 +- .../dm/proposal/prop/ExampleGenerator.java | 7 +- .../dm/proposal/prop/ExampleProposal.java | 18 +- .../org/ivoa/dm/proposal/prop/NOTexample.java | 4 +- 14 files changed, 233 insertions(+), 142 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cee30bd..537113d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("net.ivoa.vo-dml.vodmltools") version "0.5.28" + id("net.ivoa.vo-dml.vodmltools") version "0.5.30" `maven-publish` // id("io.github.gradle-nexus.publish-plugin") version "1.3.0" signing @@ -8,7 +8,7 @@ plugins { } group = "org.javastro.ivoa.dm" -version = "0.6.6" +version = "0.7.0-SNAPSHOT" vodml { @@ -111,7 +111,7 @@ tasks.withType { duplicatesStrategy = DuplicatesStrategy.INCLUDE } //IMPL b dependencies { api("net.ivoa.vo-dml:ivoa-base:1.1-SNAPSHOT") - api("net.ivoa.dm:coordinateDM:1.1-SNAPSHOT") + api("net.ivoa.dm:ADQLGeomDM:0.9-SNAPSHOT") // implementation("org.javastro:ivoa-entities:0.9.3-SNAPSHOT") // annotationProcessor ("org.hibernate.orm:hibernate-processor:7.0.8.Final") diff --git a/mkdocs_template.yml b/mkdocs_template.yml index 27b6297..983095a 100644 --- a/mkdocs_template.yml +++ b/mkdocs_template.yml @@ -1,5 +1,6 @@ site_name: ProposalDM repo_url: 'https://github.com/ivoa/ProposalDM' +docs_dir: docs/ theme: name: material features: diff --git a/src/main/vo-dml/proposalManagement.vo-dml.xml b/src/main/vo-dml/proposalManagement.vo-dml.xml index 358b531..4348a65 100644 --- a/src/main/vo-dml/proposalManagement.vo-dml.xml +++ b/src/main/vo-dml/proposalManagement.vo-dml.xml @@ -8,8 +8,8 @@ Proposal Management Paul Harrison - 0.6 - 2025-07-28T16:57:00Z + 0.7 + 2026-03-13T11:34:58Z ivoa 1.1 @@ -17,14 +17,14 @@ not known - coords - 1.1 - Coords-v1.0.vo-dml.xml + adqlgeom + 1.0 + ADQLGeomDM-v1.vo-dml.xml not known proposal - 0.6 + 0.7 proposaldm.vo-dml.xml not known @@ -172,7 +172,7 @@ location the location of the telescope - coords:CartesianPoint + proposal:coords.CartesianPoint 1 diff --git a/src/main/vo-dml/proposaldm.vo-dml.xml b/src/main/vo-dml/proposaldm.vo-dml.xml index c58cc8d..d01cd52 100644 --- a/src/main/vo-dml/proposaldm.vo-dml.xml +++ b/src/main/vo-dml/proposaldm.vo-dml.xml @@ -11,8 +11,8 @@ Proposal Paul Harrison - 0.6 - 2025-07-28T17:06:31Z + 0.7 + 2026-03-13T12:14:29Z ivoa 1.1 @@ -20,9 +20,9 @@ not known - coords - 1.1 - Coords-v1.0.vo-dml.xml + adqlgeom + 1.0 + ADQLGeomDM-v1.vo-dml.xml not known @@ -133,6 +133,50 @@ + + CelestialPosition + CelestialPosition + a point on the celestial sphere + + CelestialPosition.sourceCoordinates + sourceCoordinates + + + adqlgeom:Point + + + 1 + 1 + + + + CelestialPosition.referenceFrame + referenceFrame + the reference frame + + ivoa:string + + + 1 + 1 + + + http://www.ivoa.net/rdf/refframe + + + + CelestialPosition.equinox + equinox + the equinox when needed - not for modern reference frames + + proposal:coords.mjd + + + 0 + 1 + + + SpectralWindowSetup SpectralWindowSetup @@ -190,7 +234,7 @@ polarization desired polarization - coords:PolStateEnum + proposal:coords.Polarization 1 @@ -607,11 +651,23 @@ proposal:Target - CelestialTarget.sourceCoordinates - sourceCoordinates - + CelestialTarget.coord + coord + the coordinates - coords:EquatorialPoint + proposal:CelestialPosition + + + 1 + 1 + + + + CelestialTarget.coordUnit + coordUnit + the unit for the coordinates + + ivoa:Unit 1 @@ -623,7 +679,7 @@ positionEpoch the epoch at which the position was measured - coords:Epoch + proposal:coords.mjd 1 @@ -713,82 +769,18 @@ - Point - Point + SinglePointing + SinglePointing Single point on the sky proposal:Field - Point.centre + SinglePointing.centre centre - - - coords:Point - - - 1 - 1 - - - - - Polygon - Polygon - Polygonal map - - proposal:Field - - - Polygon.points - points - an array of points.... - - coords:EquatorialPoint - - - 0 - -1 - - - - - Ellipse - Ellipse - Specialization of a Field for an elliptical map. - - proposal:Field - - - Ellipse.semiMajor - semiMajor - + Where to point - ivoa:RealQuantity - - - 1 - 1 - - - - Ellipse.semiMinor - semiMinor - - - ivoa:RealQuantity - - - 1 - 1 - - - - Ellipse.pAMajor - pAMajor - - - ivoa:RealQuantity + proposal:CelestialPosition 1 @@ -1141,4 +1133,88 @@ true + + coords + coords + + + coords.mjd + mjd + modified julian date + + ivoa:real + + + + coords.Polarization + Polarization + description of polarization + + coords.Polarization.Linear + Linear + linear + + + coords.Polarization.Circular + Circular + circular + + + + coords.CartesianPoint + CartesianPoint + + + coords.CartesianPoint.x + x + x coord + + ivoa:RealQuantity + + + 1 + 1 + + + + coords.CartesianPoint.y + y + y coord + + ivoa:RealQuantity + + + 1 + 1 + + + + coords.CartesianPoint.z + z + z coord + + ivoa:RealQuantity + + + 1 + 1 + + + + coords.CartesianPoint.refpos + refpos + The reference position for this coordinate system + + ivoa:string + + + 1 + 1 + + + http://www.ivoa.net/rdf/refposition + + + + diff --git a/src/main/vodsl/proposalManagement.vodsl b/src/main/vodsl/proposalManagement.vodsl index 3e18634..90331c2 100644 --- a/src/main/vodsl/proposalManagement.vodsl +++ b/src/main/vodsl/proposalManagement.vodsl @@ -2,12 +2,12 @@ * created on 20 Oct 2021 // The review side of the proposal. */ - model proposalManagement (0.6) "The data model for managing the proposal review process. This is the observatories' view of the proposal process, intended to work for phase 1 only" + model proposalManagement (0.7) "The data model for managing the proposal review process. This is the observatories' view of the proposal process, intended to work for phase 1 only" author "Paul Harrison" title "Proposal Management" include "../../../build/tmp/IVOA-v1.0.vodsl" // note that this is auto generated from dependencies during build - include "../../../build/tmp/Coords-v1.0.vodsl" // this is a case where recursive import would be better - https://github.com/ivoa/vo-dml/issues/7 - here stc is really only used in the proposaldm + include "../../../build/tmp/ADQLGeomDM-v1.vodsl" // this is a case where recursive import would be better - https://github.com/ivoa/vo-dml/issues/7 - here stc is really only used in the proposaldm include "proposaldm.vodsl" @@ -30,7 +30,7 @@ name : ivoa:string "telescope name"; wikiId : proposal:WikiDataId @? "the wikidata id for the Telescope"; //IMPL this is just an idea to have a reference outside this database - location : coords:CartesianPoint "the location of the telescope" ; + location : proposal:coords.CartesianPoint "the location of the telescope" ; } otype TelescopeArrayMember "" { diff --git a/src/main/vodsl/proposaldm.vodsl b/src/main/vodsl/proposaldm.vodsl index cd89f27..c219815 100644 --- a/src/main/vodsl/proposaldm.vodsl +++ b/src/main/vodsl/proposaldm.vodsl @@ -2,7 +2,7 @@ * created on 09-Jul-2021 */ - model proposal (0.6) "A model to represent an application for observing time. The model is intended to express all + model proposal (0.7) "A model to represent an application for observing time. The model is intended to express all of the concepts required to specify the scientific parameters of the application in sufficient detail to allow the proposal to be reviewed and allocated time. It does not cover all the technical detail of instrument setup that would be needed to actually schedule the observations, although the intention is that information about targets etc. could be automatically transferred to an observing system." @@ -10,7 +10,7 @@ observations, although the intention is that information about targets etc. coul title "Proposal" include "../../../build/tmp/IVOA-v1.0.vodsl" // note that this is auto generated from dependencies by vodslToVodml command - include "../../../build/tmp/Coords-v1.0.vodsl" // this is a case where recursive import would be better - https://github.com/ivoa/vo-dml/issues/7 - here stc is really only used in the proposaldm + include "../../../build/tmp/ADQLGeomDM-v1.vodsl" // this is a case where recursive import would be better - https://github.com/ivoa/vo-dml/issues/7 - here stc is really only used in the proposaldm primitive WikiDataId -> ivoa:stringIdentifier "a WikiData identifier" @@ -21,6 +21,24 @@ observations, although the intention is that information about targets etc. coul Survey "Part of a large programme" } + package coords { + enum Polarization "description of polarization" { // IMPL - this is in no way a comprehensive description of polarization + Linear "linear", + Circular "circular" + } + + primitive mjd -> ivoa:real "modified julian date" + + dtype CartesianPoint "" { + x : ivoa:RealQuantity "x coord"; + y : ivoa:RealQuantity "y coord"; + z : ivoa:RealQuantity "z coord"; + refpos : ivoa:string "The reference position for this coordinate system" semantic in "http://www.ivoa.net/rdf/refposition"; + } + + } + + abstract otype AbstractProposal "base proposal" { ^title: ivoa:string "the proposal title" ; @@ -107,10 +125,17 @@ observations, although the intention is that information about targets etc. coul } + dtype CelestialPosition "a point on the celestial sphere" { + sourceCoordinates: adqlgeom:Point ""; + referenceFrame: ivoa:string "the reference frame" semantic in "http://www.ivoa.net/rdf/refframe"; + equinox: proposal:coords.mjd @? "the equinox when needed - not for modern reference frames"; + } + otype CelestialTarget -> Target "The basic target setup for a celestial Target." { //IMPL most of these source parameters should be in an ivoa source model. - sourceCoordinates: coords:EquatorialPoint "" ; - positionEpoch : coords:Epoch "the epoch at which the position was measured"; + coord: CelestialPosition "the coordinates"; + coordUnit : ivoa:Unit "the unit for the coordinates"; //TODO perhaps better to fix the units... + positionEpoch : proposal:coords.mjd "the epoch at which the position was measured"; pmRA: ivoa:RealQuantity @? "" ; pmDec: ivoa:RealQuantity @? "" ; parallax: ivoa:RealQuantity @? "" ; @@ -134,20 +159,8 @@ observations, although the intention is that information about targets etc. coul } - otype Point -> Field "Single point on the sky" { - centre: coords:Point "" ; - } - - otype Polygon -> Field "Polygonal map" - { - points: coords:EquatorialPoint @* "an array of points...." ; - } - - otype Ellipse -> Field "Specialization of a Field for an elliptical map." - { - semiMajor: ivoa:RealQuantity "" ; - semiMinor: ivoa:RealQuantity "" ; - pAMajor: ivoa:RealQuantity "" ; + otype SinglePointing -> Field "Single point on the sky" { + centre: CelestialPosition "Where to point" ; } @@ -189,7 +202,7 @@ observations, although the intention is that information about targets etc. coul end: ivoa:RealQuantity "The end of the spectral window" ; spectralResolution: ivoa:RealQuantity @? "channel width" ; //IMPL would like this to be optional, but cannot have optional embedded in JPA - if resolution not important then set same as width. isSkyFrequency: ivoa:boolean "represents an observed frequency" ; - polarization: coords:PolStateEnum "desired polarization"; //FIXME - in general the STC polstate enum is not enough - how to say L circular for instance. - also do want multiple pol states in same window defn. + polarization: proposal:coords.Polarization "desired polarization"; //FIXME - in general the STC polstate enum is not enough - how to say L circular for instance. - also do want multiple pol states in same window defn. } diff --git a/src/test/java/org/ivoa/dm/proposal/prop/AbstractProposalTest.java b/src/test/java/org/ivoa/dm/proposal/prop/AbstractProposalTest.java index b6fbc72..66d2528 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/AbstractProposalTest.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/AbstractProposalTest.java @@ -26,7 +26,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.ivoa.dm.proposal.management.*; -import org.ivoa.dm.stc.coords.SpaceSys; import org.ivoa.vodml.ModelDescription; import org.junit.jupiter.api.*; @@ -202,7 +201,7 @@ public void testObservations() { assertNotNull(obs.target); assertInstanceOf(CelestialTarget.class, obs.target.get(0)); CelestialTarget target = (CelestialTarget)obs.target.get(0); - SpaceSys cosys = target.sourceCoordinates.getCoordSys(); + String cosys = target.getCoord().getReferenceFrame(); assertNotNull(cosys); diff --git a/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java b/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java index 9c6f323..fdb22c2 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java @@ -3,8 +3,6 @@ * Created on 17/03/2022 by Paul Harrison (paul.harrison@manchester.ac.uk). */ -import static org.ivoa.dm.stc.coords.CartesianPoint.createCartesianPoint; - import java.time.LocalDate; import java.time.ZoneId; import java.util.*; @@ -19,19 +17,19 @@ import org.ivoa.dm.proposal.management.TAC; import org.ivoa.dm.proposal.management.TacRole; import org.ivoa.dm.proposal.management.Telescope; -import org.ivoa.dm.stc.coords.SpaceFrame; -import org.ivoa.dm.stc.coords.SpaceSys; -import org.ivoa.dm.stc.coords.StdRefLocation; + import org.ivoa.vodml.stdtypes.Unit; +import static org.ivoa.dm.proposal.prop.coords.CartesianPoint.createCartesianPoint; + public abstract class BaseExample { /** SPACE_SYS. */ //IMPL - removed the CartesianCoordSpace from the definitions below because you have to include the axis definitions which is a pain.... - protected static final SpaceSys GEO_SYS = new SpaceSys().withFrame(new SpaceFrame(new StdRefLocation("TOPOCENTER"), "BODY", null, ""));//FIXME - this should really define the frame better - STC coords library should have some standard model instances... - //FIXME 2. the spaceRefFrame should be something like ECEF but http://www.ivoa.net/rdf/refframe does not have that. + protected static final String GEO_SYS = "GEOCENTER"; + - protected static final SpaceSys ICRS_SYS = new SpaceSys().withFrame(new SpaceFrame(new StdRefLocation("BARYCENTER"), "ICRS", null, ""));//FIXME - this should really define the frame better - STC coords library should have some standard model instances... + protected static final String ICRS_SYS = "ICRS"; protected static final Organization[] institutes = { new Organization("org", "org address",new Ivoid("ivo://org/anorg"), null),//TODO is null same as not setting? new Organization("org2", "org2 address",new Ivoid("ivo://org/org2"), null) @@ -108,7 +106,7 @@ protected Telescope createTelescope(String name, double x, double y, double z) { p.x = new RealQuantity(x, metres); p.y = new RealQuantity(y, metres); p.z = new RealQuantity(z, metres); - p.coordSys = GEO_SYS; + p.refpos = GEO_SYS; })); } diff --git a/src/test/java/org/ivoa/dm/proposal/prop/BaseGenerator.java b/src/test/java/org/ivoa/dm/proposal/prop/BaseGenerator.java index 9694722..84c8dcd 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/BaseGenerator.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/BaseGenerator.java @@ -8,7 +8,6 @@ import org.ivoa.dm.proposal.management.AllocatedProposal; import org.ivoa.dm.proposal.management.ProposalCycle; import org.ivoa.dm.proposal.management.SubmittedProposal; -import org.ivoa.dm.stc.coords.SpaceSys; public class BaseGenerator implements ExampleGenerator { ExampleProposal prop = new ExampleProposal(); @@ -29,12 +28,12 @@ public ObservingProposal getProposal() { } @Override - public SpaceSys getICRS() { + public String getICRS() { return BaseExample.ICRS_SYS; } @Override - public SpaceSys getICRF() { + public String getICRF() { return BaseExample.GEO_SYS; } diff --git a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java index fed9a72..4774601 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java @@ -4,9 +4,9 @@ */ import org.ivoa.dm.proposal.management.*; -import org.ivoa.dm.stc.coords.PolStateEnum; import org.ivoa.dm.ivoa.Ivoid; import org.ivoa.dm.ivoa.RealQuantity; +import org.ivoa.dm.proposal.prop.coords.Polarization; import java.util.*; import java.util.stream.Collectors; @@ -40,7 +40,7 @@ protected SpectralWindowSetup simpleSpecRange(double start, double end) { return createSpectralWindowSetup(sw -> { sw.start = new RealQuantity(start, ghz); sw.end = new RealQuantity(end, ghz); - sw.polarization = PolStateEnum.V ; //FIXME - trying to express circular polarized + sw.polarization = Polarization.CIRCULAR ; //FIXME - polarization should be better modeled sw.isSkyFrequency = true; sw.spectralResolution = new RealQuantity(end-start, ghz); //Indicate that resolution is not important - set same as width. }); diff --git a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java index 9400dfd..aeb4382 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java @@ -22,6 +22,7 @@ import org.ivoa.dm.proposal.management.TAC; import jakarta.persistence.TypedQuery; +import org.javastro.ivoacore.pgsphere.types.Point; /** @@ -47,7 +48,8 @@ public void testJackson() throws JsonProcessingException List fields = Arrays.asList(new TargetField("first"), new TargetField("second"), - new Point(new org.ivoa.dm.stc.coords.EquatorialPoint(new RealQuantity(45.0, BaseExample.degrees ), new RealQuantity(45.0, BaseExample.degrees ), ex.getICRS()),"a point") ); + new SinglePointing(new CelestialPosition(new Point(45.0, 65.0),"ICRS", null),"arbitrary")); + String json = ProposalModel.jsonMapper().writeValueAsString(fields.get(0)); assertEquals("{\"@type\":\"proposal:TargetField\",\"_id\":0,\"name\":\"first\"}", json); System.out.println(json); diff --git a/src/test/java/org/ivoa/dm/proposal/prop/ExampleGenerator.java b/src/test/java/org/ivoa/dm/proposal/prop/ExampleGenerator.java index 7dd9402..9b5c344 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/ExampleGenerator.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/ExampleGenerator.java @@ -3,13 +3,12 @@ * Created on 17/03/2022 by Paul Harrison (paul.harrison@manchester.ac.uk). */ -import org.ivoa.dm.stc.coords.SpaceSys; public interface ExampleGenerator extends ProposalGenerator, TACFunctions { - - SpaceSys getICRF(); - SpaceSys getICRS(); + //TODO since these are just strings now - this interface is hardly necessary + String getICRF(); + String getICRS(); } diff --git a/src/test/java/org/ivoa/dm/proposal/prop/ExampleProposal.java b/src/test/java/org/ivoa/dm/proposal/prop/ExampleProposal.java index 1dae71d..a3ba955 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/ExampleProposal.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/ExampleProposal.java @@ -21,9 +21,9 @@ import org.ivoa.dm.ivoa.RealQuantity; import org.ivoa.dm.ivoa.StringIdentifier; -import org.ivoa.dm.stc.coords.Epoch; -import org.ivoa.dm.stc.coords.EquatorialPoint; -import org.ivoa.dm.stc.coords.PolStateEnum; +import org.ivoa.dm.proposal.prop.coords.Mjd; +import org.ivoa.dm.proposal.prop.coords.Polarization; +import org.javastro.ivoacore.pgsphere.types.Point; /** * . @@ -41,8 +41,12 @@ public ObservingProposal getProposal() { final Target target = CelestialTarget.createCelestialTarget(c -> { c.sourceName = "fictional"; - c.sourceCoordinates = new EquatorialPoint(new RealQuantity(45.0, degrees), new RealQuantity(60.0, degrees), ICRS_SYS);//IMPL it would actually be nice to be able to input sexagesimal - that is the most human readable - c.positionEpoch = new Epoch("J2013.123");//FIXME - this is not really what epoch means + c.coord = CelestialPosition.createCelestialPosition(p->{ + p.sourceCoordinates = new Point(45.0,60.0); + p.referenceFrame = ICRS_SYS; + }); + c.coordUnit = degrees; + c.positionEpoch = new Mjd(61046.0); }); final Field field = new TargetField("source1"); @@ -61,7 +65,7 @@ public ObservingProposal getProposal() { sw.end = new RealQuantity(1.7, ghz); sw.spectralResolution = new RealQuantity(0.5, ghz); sw.isSkyFrequency = true; - sw.polarization = PolStateEnum.LL; //IMPL really want a list here - or repeat the whole spectralwindow setup for each poln + sw.polarization = Polarization.CIRCULAR; }); }), @@ -78,7 +82,7 @@ public ObservingProposal getProposal() { sw.end = new RealQuantity(1.43, ghz); sw.spectralResolution = new RealQuantity(100.0, khz); sw.isSkyFrequency = false; // exact freq depends on the source... - sw.polarization = PolStateEnum.LL; + sw.polarization = Polarization.CIRCULAR; }); }) diff --git a/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java b/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java index 101ea99..fd60432 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java @@ -21,7 +21,7 @@ import org.ivoa.dm.ivoa.Ivoid; import org.ivoa.dm.ivoa.RealQuantity; import org.ivoa.dm.proposal.management.*; -import org.ivoa.dm.stc.coords.PolStateEnum; +import org.ivoa.dm.proposal.prop.coords.Polarization; /** * . @@ -42,7 +42,7 @@ private SpectralWindowSetup fromWl( double centwl, double fwhm) return createSpectralWindowSetup(sw -> { sw.start = new RealQuantity(c/(centwl-fwhm)/1e9, ghz); sw.end = new RealQuantity(c/(centwl+fwhm)/1e9, ghz); - sw.polarization = PolStateEnum.V ; //FIXME - just plain wrong! + sw.polarization = Polarization.CIRCULAR ; //FIXME - really need better polarization model. sw.isSkyFrequency = true; sw.spectralResolution = new RealQuantity(sw.end.getValue()-sw.start.getValue(), ghz); //Indicate that resolution is not important - set same as width. }); From 9b9006c7911c4ff3eed3c4ff2ba85b75e5c7e2bd Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Mon, 16 Mar 2026 09:16:09 +0000 Subject: [PATCH 2/2] update tests to work with the model changes --- build.gradle.kts | 20 +++++++++++++++++-- settings.gradle.kts | 2 +- .../ivoa/dm/proposal/prop/BaseExample.java | 2 +- .../ivoa/dm/proposal/prop/EmerlinExample.java | 2 +- .../org/ivoa/dm/proposal/prop/LCOExample.java | 2 +- .../org/ivoa/dm/proposal/prop/NOTexample.java | 2 +- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 537113d..97ddd99 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - id("net.ivoa.vo-dml.vodmltools") version "0.5.30" + id("net.ivoa.vo-dml.vodmltools") version "0.5.31" `maven-publish` // id("io.github.gradle-nexus.publish-plugin") version "1.3.0" signing - + id("com.diffplug.spotless") version "6.25.0" } group = "org.javastro.ivoa.dm" @@ -50,7 +50,23 @@ java { withSourcesJar() } +spotless { + java { + target(vodml.outputJavaDir.asFileTree.matching( + PatternSet().include("**/*.java") + )) + googleJavaFormat("1.17.0") + } +} + +tasks.named("spotlessJava") { + dependsOn("vodmlJavaGenerate") +} +tasks.named(JavaPlugin.COMPILE_JAVA_TASK_NAME) { + dependsOn("spotlessApply") +} +// end of spotless config //make the fact that sources are generated explicit (gets rid of warning that it will not work in gradle 8)- see https://melix.github.io/blog/2021/10/gradle-quickie-dependson.html tasks.named("sourcesJar") { diff --git a/settings.gradle.kts b/settings.gradle.kts index 9482637..c2e7e4b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,7 +17,7 @@ dependencyResolutionManagement { will not be necessary when this library is released as a non-SNAPSHOT version. */ maven { - url= uri("https://repo.dev.uksrc.org/repository/maven-snapshots/") + url= uri("https://repo.dev.uksrc.org/repository/maven-public/") } } } diff --git a/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java b/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java index fdb22c2..052005a 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/BaseExample.java @@ -8,7 +8,7 @@ import java.util.*; import java.util.function.Consumer; -import org.ivoa.dm.ivoa.Ivoid; +import org.ivoa.vodml.stdtypes.Ivoid; import org.ivoa.dm.ivoa.RealQuantity; import org.ivoa.dm.ivoa.StringIdentifier; import org.ivoa.dm.proposal.management.CommitteeMember; diff --git a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java index 4774601..cd57f8b 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java @@ -4,7 +4,7 @@ */ import org.ivoa.dm.proposal.management.*; -import org.ivoa.dm.ivoa.Ivoid; +import org.ivoa.vodml.stdtypes.Ivoid; import org.ivoa.dm.ivoa.RealQuantity; import org.ivoa.dm.proposal.prop.coords.Polarization; diff --git a/src/test/java/org/ivoa/dm/proposal/prop/LCOExample.java b/src/test/java/org/ivoa/dm/proposal/prop/LCOExample.java index 8c5a3e1..fcc6139 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/LCOExample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/LCOExample.java @@ -11,7 +11,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.ivoa.dm.ivoa.Ivoid; +import org.ivoa.vodml.stdtypes.Ivoid; import org.ivoa.dm.proposal.management.*; /** diff --git a/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java b/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java index fd60432..3affe0b 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/NOTexample.java @@ -18,7 +18,7 @@ import java.util.GregorianCalendar; import java.util.List; -import org.ivoa.dm.ivoa.Ivoid; +import org.ivoa.vodml.stdtypes.Ivoid; import org.ivoa.dm.ivoa.RealQuantity; import org.ivoa.dm.proposal.management.*; import org.ivoa.dm.proposal.prop.coords.Polarization;