Skip to content

Commit

Permalink
Merge pull request #2023 from swalker2m/bugfix/REL-4020-B
Browse files Browse the repository at this point in the history
REL-4020: set a 'rotator' param instead of 'posAngle' for MaroonX
  • Loading branch information
swalker2m authored Jun 5, 2022
2 parents aa8c5d8 + ca7ab43 commit 91ff535
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 13 deletions.
17 changes: 17 additions & 0 deletions bundle/edu.gemini.wdba.xmlrpc.server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ $ curl --data @req.xml http://gsodbtest:8442/wdba
<?xml version="1.0" encoding="UTF-8"?><methodResponse xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions"><params><param><value><array><data><value><struct><member><name>OBS_ID</name><value>GS-ENG20210827-5</value></member><member><name>TITLE</name><value>GMOS Grating tilt LUT check</value></member></struct></value></data></array></value></param></params></methodResponse>
```

### Example TCC configuration fetch

```commandline
$ cat GetCoordinates.xml
<?xml version="1.0"?>
<methodCall>
<methodName>WDBA_Tcc.getCoordinates</methodName>
<params>
<param>
<value><string>GN-2022A-LP-202-54</string></value>
</param>
</params>
</methodCall>
$ curl --data @GetCoordinates.xml http://gnodb:8442/wdba | python3 -c 'import html, sys; [print(html.unescape(l), end="") for l in sys.stdin]'
```

### Provenance

This bundle originated from `edu.gemini.wdba.xmlrpc.server` in the OCS 1.5 build. It subsumes the following OCS 1.5 bundles, which no longer exist on their own.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,16 @@ public boolean build() throws WdbaGlueException {
putParameter(TccNames.GUIDE_GROUP, getPrimaryGuideGroupName());

// Add a rotator parameter and then create the config
// Note: If the config name contains "Fixed" in some way, it's assumed to be a Fixed rotator config
RotatorConfig rc = new RotatorConfig(_oe);
final RotatorConfig rc = new RotatorConfig(_oe);
if (rc.build()) {
String rotConfigName = rc.getConfigName();
if (rotConfigName.equals(TccNames.ALTAIR_FIXED)) {
putParameter(TccNames.ROTATOR, rotConfigName);
} else
// If the instrument adds something, create a rotator config and add it in
if (rotConfigName.contains(TccNames.FIXED)) {
putParameter(TccNames.ROTATOR, rotConfigName);
add(rc);
} else {
putParameter(TccNames.POSANGLE, rotConfigName);
add(rc);
}
ImOption.apply(rc.attributeValue(TYPE)).foreach(t -> {
final String name = rc.getConfigName();
putParameter(t, name);
if (!TccNames.ALTAIR_FIXED.equals(name)) {
add(rc);
}
});
}

GuideConfig gc = new GuideConfig(_oe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import edu.gemini.spModel.gemini.nici.InstNICI;
import edu.gemini.spModel.gemini.nici.NICIParams;
import edu.gemini.spModel.gemini.niri.InstNIRI;
import edu.gemini.spModel.gemini.visitor.VisitorConfig;
import edu.gemini.spModel.gemini.visitor.VisitorInstrument;
import org.dom4j.Document;
import org.dom4j.Element;

Expand Down Expand Up @@ -54,6 +56,14 @@ private Gpi addGpi() throws Exception {
return (Gpi) addInstrument(Gpi.SP_TYPE).getDataObject();
}

private VisitorInstrument addMaroonX() throws Exception {
final ISPObsComponent oc = addInstrument(SPComponentType.INSTRUMENT_VISITOR);
final VisitorInstrument vi = (VisitorInstrument) oc.getDataObject();
vi.setVisitorConfig(VisitorConfig.MaroonX$.MODULE$);
oc.setDataObject(vi);
return vi;
}

private InstGmosSouth addGmos() throws Exception {
return (InstGmosSouth) addInstrument(InstGmosSouth.SP_TYPE).getDataObject();
}
Expand Down Expand Up @@ -268,4 +278,18 @@ void validate() throws Exception {
val.cosys = TccNames.FIXED;
val.validate();
}

@Test public void testMaroonXFixed() throws Exception {
VisitorInstrument vi = addMaroonX();
vi.setPosAngleDegrees(15.0); // this should be ignored due to Maroon X position angle mode
instObsComp.setDataObject(vi);

RotConfigValidator val = new RotConfigValidator();
val.site = Site.north;
val.type = Type.rotator;
val.name = "fixed";
val.ipa = "0"; // should always be 0 for Maroon X
val.cosys = TccNames.FIXED;
val.validate();
}
}

0 comments on commit 91ff535

Please sign in to comment.