diff --git a/docs/reports/2026-11-19-phase8-report.md b/docs/reports/2026-11-19-phase8-report.md new file mode 100644 index 0000000..ebb076e --- /dev/null +++ b/docs/reports/2026-11-19-phase8-report.md @@ -0,0 +1,137 @@ +# Pure-Java AST: phase 8 report + +## Summary + +Phase 8 ported jniast's SelectorMap and STC classes, and C's `astRemoveRegions`, on 19 November 2026, following the plan [`2026-11-19-pure-java-ast-phase8-stc.md`](../superpowers/plans/2026-11-19-pure-java-ast-phase8-stc.md); with phase 7's Region classes it completes the spec's "Later phases" item 6, Regions and STC. +`SelectorMap`, `AstroCoords`, `Stc` and its four subclasses `StcResourceProfile`, `StcSearchLocation`, `StcCatalogEntryLocation` and `StcObsDataLocation` now construct, transform, compare, simplify, dump and load as C's do. +Their public members are exactly jniast's, and `JniastApiTest` passes with all seven classes in scope; everything else new (`removeRegions`, the Stc constructors taking KeyMaps, `StcObsDataLocation.setObs`, the AstroCoords key constants) is package-private. +Every Mapping and Frame class removes its Regions as C's `astRemoveRegions` does (package-private `removeRegions`, which Plot will call), and `Region.cast` copies a Region into the class of a Region it is an instance of (`isInstance`, which would accept a subclass), which changes no result while jniast's Stc is abstract, since no concrete Region class is then a subclass of another. +`Region.dump` now writes a Region's own Negated, Closed, MeshSize, FillFactor and Adaptive values where they are set, as region.c's `Dump` does, which changed one existing dump (a PointList with Closed set). +Every fixture of C's corpora that holds a SelectorMap or an StcResourceProfile now reads, writes and simplifies as C's does, and no deferred list names a class of this phase; of the Rust port's tests for these classes and for `remove_regions`, all are translated except `error_ellipse_licence_is_still_needed`, which checks the Rust port's own licence. +Four new C probes and two converted oracle files give the expected values. +The work found 6 defects in the C library, which were reported to the user privately and are not described here. +Against the branch base `55eba4c` (the end of phase 7) the work adds 2,062 lines of main code and 4,058 lines of tests, and removes 18 and 148; `mvn verify` passes with 4,649 tests on JDK 21 (4,555 at the end of phase 7), and the tests pass on the JDK 27 runtime. + +## What was ported + +| Task | What | Main lines | Test lines | +| --- | --- | ---: | ---: | +| 1 | `removeRegions` on `Mapping`, `Frame`, `Region`, `CmpMap`, `TranMap`, `RateMap`, `SwitchMap`, `CmpFrame` and `FrameSet` | 277 | 670 | +| 2 | `SelectorMap` (selectormap.c: Transform, Equal, MapMerge, Copy, Dump and load) | 366 | 1,238 | +| 3 | `Region.dump` writing a Region's own attribute values; `Stc` (stc.c: the encapsulated Region and AstroCoords, every override its vtab installs, dump and load), `AstroCoords` and `StcResourceProfile` | 1,180 | 1,740 | +| 4 | `StcSearchLocation`, `StcCatalogEntryLocation`, `StcObsDataLocation` (with its observatory position) and `Region.cast` within the Stc hierarchy | 254 | 547 | +| 5 | The deferred sweep and this report | | | + +Lines are those each task's commits add, the fix commits included; summed, they exceed the branch totals by the lines a later task changed again. +The test lines include the probe sources and outputs and the converted oracle files. +Each task was done by one implementer subagent, reviewed by a second, and verified in the controlling session before it was recorded. +The reviews found no Critical problem and three Important ones: a half-length tolerance for the fitted Error Ellipse read off C's output rather than derived, and then a derived bound whose precondition a correct port would fail on one or two platforms in a hundred (Task 3, two fix rounds); and a statement that C's region.c `Cast` always crashes, where it runs once a Region description has been read (Task 4, one fix round). +Tasks 1 and 2 were approved at the first review. +The tasks were committed between 12:51 (Remove the Regions from a Mapping) and 17:36 on 19 November, after the plan at 12:09. + +New main classes: `SelectorMap`, `AstroCoords`, `Stc`, `StcResourceProfile`, `StcSearchLocation`, `StcCatalogEntryLocation`, `StcObsDataLocation`. +New test classes, with their tests: `RemoveRegionsOracleTest` (1), `RemoveRegionsTest` (20), `SelectorMapTest` (13), `SelectorMapProbeTest` (8), `JniastSelectorMapTest` (2), `RegionStcOracleTest` (6), `StcProbeTest` (24), `AstroCoordsTest` (2), `StcTest` (1). +Existing test classes gained the cases held back for these classes: `RegionsTest`, `RegionsCTest`, `SwitchMapTest`, `EqualTest`, `RateOracleTest`, `ObjectIdOracleTest`, `FrameInMapSlotTest`, `ConstructorChecksTest` and `JniastApiTest`. +New probes: `remove_regions_extra_probe.c`, `selectormap_probe.c`, `region_dump_probe.c` and `stc_probe.c`; converted oracles: `remove_regions.json` and `region_stc.json`. +`docs/rust-c-differences.md` has 11 new entries (five SelectorMap, four Stc, two `RemoveRegions`), and its entry on casting a Region into the class of another Region is rewritten. + +## Departures from the plan + +The [rulings](2026-11-19-phase8-rulings.md) give each with its reason and cost; these change what later work builds on. + +- **C does not load a SelectorMap without `Reg1`.** + The plan's "Taken from C" item 6 listed it among the dumps C reads; C fails with `AST__OBJIN` from releasing a null pointer, and Java reports `AST__LDERR`. +- **`Region.dump` reads the Region's own fields directly**, rather than through the package-private raw accessors the plan's Task 3 named; nothing else needed them. +- **The fitted Error Ellipse's axis ends are not compared** (the plan's fallback), but its centre and two half-lengths are, within bounds derived in `RegionStcOracleTest`'s Javadoc; the half-length bound for this platform's fit is worked out after the fact from a bit-for-bit repeat of the fit in the test. +- **`StcObsDataLocation`'s observatory position is held as any `AstObject`**, since C's loader reads an Object of any class there; `setObs` takes a PointList, as C's `astStcSetObs` does. +- **The plan's cast rows do not reach C's `Cast`.** + `astFindFrame` and `astConvert` between Stcs never call region.c `Cast`, so `Region.cast` is pinned by Java-only tests, and one C row: the probe's last case reads a Region description (which C needs before `Cast` can run) and then converts two CmpFrames of Stcs in different Domains, which C does not convert. +- **jniast's `StcTest` is translated in part**: `testConstructors` runs; `testReads` and `testChandra` need XmlChan. +- **No sweep commit**: Tasks 1 to 4 removed every deferred entry and deferral note for their classes, and rewriting the lists changed nothing. + +## Gates + +| Gate | Before | After | +| --- | --- | --- | +| `rust-tests.txt` entries | 318 | 283: 35 removed as translated (SelectorMap 25, `astRemoveRegions` 4, Stc and AstroCoords 6), none added | +| `simplify.txt` entries | 70 | 60 (8 SelectorMap, 2 StcResourceProfile) | +| `simplify-cases.txt` entries | 57 | 48 (8 SelectorMap, 1 StcResourceProfile) | +| `full-dumps.txt`, `read-warnings.txt`, `serialisation.txt` entries | 74, 76, 75 | 62, 64, 63 (10 SelectorMap and 2 StcResourceProfile each) | +| `framesets.txt`, `headers.txt`, `oracle-rows.txt`, `wcsconv.txt` entries | 1, 0, 0, 1 | unchanged | +| `remove_regions` oracle cases run | none | 9 of 11; `normmap_region` and `normmap_cmpframe` skipped by name (NormMap, not in jniast) | +| `region_stc` oracle cases run | none | 10 of 10 in each of `stc_matches_c`, `full_dumps_match_c` and `c_dumps_read_back_as_c_reads_them`, and the overlap, AstroCoords and unknown-key tests | +| `object_id.json` cases run | 24 | 26 (`selectormap`, `selectormap_part_ids`, which the Rust test excludes and which matches C) | +| `EqualTest` SelectorMap cases, `RateOracleTest` SwitchMap cases | 0, 5 | 3, 8 | +| `FrameInMapSlotTest` fixtures that must read | 28 | 34 (none refused) | +| `testregions.c` (as `test_regions_c.rs`) | 16 of 18 | 17 of 18 (`checkRemoveRegions`); `region_gaps_still_differ` listed as Rust-only | +| jniast's tests | | `AstTest.testSwitchMap`, `AstroCoordsTest` (2 of 2), `StcTest.testConstructors` (1 of 3) | +| Tests | 4,555 | 4,649 | + +Every oracle and probe test asserts the number of cases it ran. +Every test function of `test_selectormap.rs`, `test_remove_regions_oracle.rs` and `test_region_stc_oracle.rs`, and every test naming SelectorMap, an Stc class, AstroCoords or `remove_regions` in `test_switchmap.rs`, `test_regions.rs`, `test_regions_c.rs`, `test_equal_oracle.rs`, `test_rate_oracle.rs`, `test_object_id_oracle.rs` and `test_constructor_checks.rs`, is translated; `rust-tests.txt` keeps only `error_ellipse_licence_is_still_needed` of this phase's entries. +Three Rust meta-tests that name these classes while checking the Rust port's own files are neither translated nor listed (see Gaps and risks). +Rewriting the lists with `-Dast.writeDeferred=true` changes nothing. +`mvn verify` passes on JDK 21 (4,649 tests, Error Prone, Checkstyle and PMD clean), and the tests pass on the JDK 27 runtime; no Java 8 runtime is installed on this machine. + +## Tolerances + +SelectorMap transformations and dumps, `removeRegions` results (dumps compared byte for byte), plain-Frame Stc dumps, and every dump C wrote and Java reads back are compared exactly. +Values that pass through `java.lang.Math` are compared within a bound derived in the test's Javadoc: + +| Where | Bound | Derivation | +| --- | --- | --- | +| `RegionStcOracleTest` sky dumps (`SKY_TOL`) | 1e-12 | The `SkyFrame.offset2` chain of a Circle's second point, bounded at 3e-14 in `RegionEllipseOracleTest` | +| `RegionStcOracleTest` fitted Error Ellipse centre | 1e-12 (`SKY_TOL`) | The Circle's centre converted from Galactic to ICRS (sines and cosines, a product of rotation matrices, then `atan2` and `asin`): a few ulps of values below 2 | +| `RegionStcOracleTest` fitted Error Ellipse half-lengths | computed in the test (1.05e-12 here) | Each mesh coordinate within 1e-14; the primary within 1.5e-13 of C's whatever the direction; the secondary as C's first-order rounding at C's direction (whose precondition holds by a factor of 1.3e4), plus the curvature difference between the two directions (1.3e-17), plus this platform's rounding bounded after the fact from a repeat of its fit that must reproduce the dumped Ellipse bit for bit | +| `RegionsCTest.checkRemoveRegions` | 1e-10 | C's own tolerance in `testregions.c` | + +The fitted Ellipse's axis ends are not compared: on the near-circle the fitted direction follows the last bits of the mesh, so no bound on them can be derived, as `docs/rust-c-differences.md` records. +`SelectorMapTest` keeps the Rust tests' 1e-10 tolerances on WinMap outputs that could be compared exactly. + +## Departures from C and from Rust + +Each is an entry of [`docs/rust-c-differences.md`](../rust-c-differences.md), under "Mappings" (SelectorMap) and "Regions" (`RemoveRegions`, the Stc classes and `Cast`). + +- **C's quirks are kept** where C's result is defined: SelectorMap's Transform negates and re-closes its own Regions and leaves the attributes set, so a dump after use writes `Closed = 1`; an Stc's Transform and GetBounded leave Negated set on its encapsulated Region, so `test("Negated")` is true after use; two equal 1-D SelectorMaps applied forward in series simplify to a UnitMap, as in C, since the project follows C where its result is defined; a FrameSet component of a TranMap, or a changed one of a RateMap or SwitchMap, becomes a UnitMap when the Regions are removed, losing its Mapping. +- **Where C's result is undefined or C fails for a reason unrelated to the input, Java gives an error or C's documented result.** + An Stc dump without its Region or with a missing AstroCoords element, and a SelectorMap dump without Regions, give `AST__LDERR`; a `Begin Stc` gives `AST__LDERR`, since jniast's Stc is abstract; casting a Region into the class of a Region that is not its own class or a parent gives null, the result region.c `Cast` documents. +- **Non-finite coordinates are bad**: SelectorMap's Transform treats a NaN or infinite input as bad, by the library's rule, where C tests `AST__BAD` only. +- **Where Rust departs from C, Java follows C**: SelectorMap's simplification by identity for any Region class, its merge of equal neighbours, its in-place Transform and C's constructor messages; the Regions a container's `removeRegions` turns into UnitMaps; the Stc Negated quirk; the cast within the Stc hierarchy. + +## Defects found in the C library + +The tasks and the sweep found 6 defects in the pinned C library (`3d3f255f`). +At `1d0714fb`, the tip of the upstream pull request (PR #104) the C library is being hardened in, 1 is still present. +They were reported to the user privately, for upstream, and are not described in this repository beyond the behaviour `docs/rust-c-differences.md` records for each departure. +Java follows C in every case that has a defined result, and gives an error or C's documented result where C's result is undefined. + +## Gaps and risks + +- **Runtimes.** + The tests ran on JDK 21 and the JDK 27 runtime on AArch64 macOS only; CI's x86-64 Linux runtimes are the first to exercise the Error Ellipse bounds there, whose platform part is computed from each platform's own fit. +- **`rust-tests.txt` has no automated checker.** + The sweep matched each Rust test naming this phase's classes against the Java test methods by name and checked each mismatch by hand. + Three tests in those files are neither translated nor listed: `test_guide.rs::guide_mentions_no_unported_class`, `test_mapmerge_audit.rs::no_checklist_is_orphaned` and the class-name check of `src/serial/object_text.rs`, which test the Rust port's own documents and files; phase 7 found about 350 such unlisted tests outside the Region files. +- **No C value pins `Region.cast` between two Regions.** + Four texts said or implied that C's `astConvert` between CmpFrames of Stcs casts one Stc into the class of the other with `astCastCopy`: the header of `stc_probe.c` (lines 31-34, the reason its last case uses Stcs of one class), the Javadoc of `StcProbeTest.aCmpFrameOfStcsInOtherDomainsDoesNotConvert` ("into the class of the target's component"), the Cast entry of `docs/rust-c-differences.md`, and Task 4's ruling on that entry; Task 4's report also said an lldb breakpoint showed `astCastCopy` reached from region.c `Cast`. + It is not: the `astCastCopy` calls `astConvert` makes come from cmpframe.c `Cast`, a CmpFrame into a CmpFrame, and region.c `Cast` is given the target's picked axes, a Frame (cmpframe.c `PartMatch`, region.c `SubFrame`), or a whole CmpFrame (`ComponentMatch`), and casts the Region's current Frame. + The four texts are corrected; since only the protected `astCast` gives region.c `Cast` a Region to cast into, `Region.cast` between Stcs is pinned by Java-only tests, and C's crash before a Region description is read is the only effect of the CmpFrame path that the probe pins. +- **Minor findings from the reviews** were fixed before the branch was finished: `RemoveRegionsTest` now has C values for a SwitchMap's inverse selector and for the RateMap and SwitchMap cases of a FrameSet component turned into a UnitMap, and checks the probe's case names; `SelectorMap` shares `SwitchMap`'s neighbour cancellation and its Javadoc describes its dump and its 1-D merge; `StcProbeTest` has C values for simplifying a negated Stc and one whose AstroCoords Regions are remapped; `RegionStcOracleTest` refits the Error Ellipse with `Ellipse`'s own package-private steps. +- **The pin will change some results.** + PR #104 (`55cd143d`) makes C's `Cast` in region.c, cmpframe.c and frameset.c refuse a class the object does not belong to, so a FluxFrame and a SpecFluxFrame no longer convert into each other and a CmpFrame no longer casts into a SpecFluxFrame. + When the pin moves past it, `SpecFluxFrameTest`, the CmpFrame cast tests and the CmpFrame/SpecFluxFrame and Region cast entries of `docs/rust-c-differences.md` need their C values updated. + +## Future work + +- **A checker for `rust-tests.txt`**, so that a Rust test file neither translated nor listed fails a test. +- **XmlChan**, for jniast's `StcTest.testReads` and `testChandra` and the `teststc` fixtures of the Rust port, which are STC-X documents. + +## What the next phase takes + +The next phase is the spec's "Later phases" item 7: **Plot**, after it is ported in Rust, behind jniast's `Grf` interface; jniast's `DefaultGrf` is GPL, so a Graphics2D implementation is either written afresh or relicensed by its authors. +Of jniast's classes, only `Plot`, `Grf` and the `grf` package (item 7) and `XmlChan` with the `xml` package (item 8) are not yet ported. +Plot builds on this phase and the last: it calls `removeRegions` on the Mapping it draws through, and needs the Region functions phase 7 left for it (`astRegTrace`, `astRegSplit` and the boundary breaks of `CmpRegion` and `Prism`) and the Plot methods of `CmpFrame` (`Abbrev`, `Centre`, `Fields` and `Gap`). + +## Rulings + +Every decision made while executing the plan where it was wrong, unclear or silent, every departure from Rust, C or jniast and every C quirk kept is in [`2026-11-19-phase8-rulings.md`](2026-11-19-phase8-rulings.md), with its reason and its cost if wrong: 55 rulings, 9 from the plan's Shared Design, 43 by the implementers of Tasks 1 to 4, 1 by the controller and 2 in the sweep. diff --git a/docs/reports/2026-11-19-phase8-rulings.md b/docs/reports/2026-11-19-phase8-rulings.md new file mode 100644 index 0000000..1793879 --- /dev/null +++ b/docs/reports/2026-11-19-phase8-rulings.md @@ -0,0 +1,106 @@ +# Phase 8: rulings + +These are the decisions made while executing the phase 8 plan ([`2026-11-19-pure-java-ast-phase8-stc.md`](../superpowers/plans/2026-11-19-pure-java-ast-phase8-stc.md)) where the plan was wrong, unclear or silent, or where the port departs from Rust, C or jniast or keeps a C quirk. +They are copied from the plan's Shared Design (the rulings made when the plan was written), from the execution ledger (the controller's rulings) and from each task's report (the implementer's rulings), grouped by task; within a task the implementer's come first, in the order of the report, fix rounds included, then the controller's, in the order they were made. +Each ruling gives what was decided, why, and what it costs if wrong; the plan's rulings state what and why, and the cost here is added from what the tasks found. +A later ruling can reverse or amend an earlier one; a ruling that a later one replaced carries a bracketed note saying so. +There are 55 rulings: 9 from the plan, 43 by the implementers of Tasks 1 to 4, 1 by the controller, and 2 by the implementer of the sweep (Task 5). +Commits are cited by subject. +The phase report is [`2026-11-19-phase8-report.md`](2026-11-19-phase8-report.md). + +## Plan: Shared Design + +### Taken from C rather than Rust + +- Ruling: a Region's `removeRegions` returns a copy of its current Frame, and each container turns a component that comes back as a Frame into a `UnitMap`, as cmpmap.c, tranmap.c, switchmap.c and frameset.c do; cmpmap.c and tranmap.c convert even a plain Frame component that was already there when another component changed, while switchmap.c and frameset.c convert only a component that changed — Rust returns a UnitMap directly and cannot show the second case, since its Frames are not Mappings — cost if wrong: none found; `RemoveRegionsTest` pins each case from `remove_regions_extra_probe.c`. +- Ruling: SelectorMap's Transform negates and re-closes its own Regions in place, restoring the old values in a `finally`, and leaves the attributes set, as selectormap.c does — Rust transforms negated copies, and C's dump after a transformation shows `Closed = 1` — cost if wrong: a SelectorMap is not safe for concurrent use (its Javadoc says so), and a dump after use differs from Rust's. +- Ruling: SelectorMap's MapMerge detects a simplified Region by identity (`simplify()` returned a different object), for any Region class, as C compares pointers — Rust compares with `equals` against a fixed list of nine classes — cost if wrong: a Region whose `simplify` returns a new but equal object rebuilds the SelectorMap, as in C. +- Ruling: SelectorMap's MapMerge merges neighbours as C's does (invert the neighbour, compare with `Equal`, which ignores Invert, restore it), so two equal 1-D SelectorMaps both applied forward in series become a UnitMap — Rust demands differing Invert flags; C is the authority, and the probe pins the case — cost if wrong: the simplified pair transforms differently from the pair, exactly as in C (a C bug, recorded in `docs/rust-c-differences.md`). +- Ruling: Stc's Transform and GetBounded set the encapsulated Region's Negated to its own value around the call, leaving it set, as stc.c does — C's `test("Negated")` is true after use — cost if wrong: a Negated test differs from Rust's after a transformation. +- Ruling: loaders follow C where C's result is usable (a SelectorMap with no `Reg1`, an `ObsLoc` of any class, `Ncoord` below 0 read as 0, the later dummy-FrameSet Regions given the first Region's FrameSet) and raise `AST__LDERR` where C would store a null and fail later (an Stc without `Region`, a missing `Coord`), and a `Begin Stc` raises `AST__LDERR` since jniast's Stc cannot be instantiated — H9 prefers an error to a plausible value — cost if wrong: a dump C reads (or crashes on) does not load. [amended in Task 2: C does not load a SelectorMap with no `Reg1` either (its `astAnnul( NULL )` fails), and Java raises `AST__LDERR`] +- Ruling: error messages are C's (selectormap.c `AST__BDPAR` and `AST__BADNI`, stc.c's four `AST__STCIND` variants and `AST__STCKEY`), not Rust's — C is the reference for jniast's users — cost if wrong: none. +- Ruling: jniast's null handling: a null `regs` array or element, or a null Stc `region`, is a `NullPointerException` naming the argument, as phase 6 ruled for jniast arguments; a null `coords` array means no AstroCoords, as `jniastConstructStc` reads it — cost if wrong: an exception type or order differs from jniast's where both are null. + +### `ERROR_ELLIPSE_LICENSED` + +- Ruling: the `region_stc` cases `sky`, `catalog_entry` and `sky_coord`, whose AstroCoords Error Region C re-expresses as the best-fit Ellipse of a 1e-4 rad Circle's mesh, compare the Ellipse's points with a tolerance derived from the fit's conditioning, and if no bound can be derived, the Ellipse's `X` lines are dropped as Rust drops them off macOS and the omission is recorded in `docs/rust-c-differences.md` — the fit's defining points move about 1e-5 relative under last-bit `Math` differences — cost if wrong: an error in the fitted Ellipse goes unnoticed. [Task 3 dropped the axis ends and derived bounds for the centre and the two half-lengths] + +## Task 1: removeRegions + +### Implementer + +- Ruling: `Frame` overrides `removeRegions()` with return type `Frame` (body `return this`, mapping.c's behaviour) — every Frame class's C RemoveRegions returns a Frame, and the override lets CmpFrame and FrameSet hold the results without an unchecked cast; frame.c itself has no RemoveRegions — cost if wrong: none in behaviour; one more override to read. +- Ruling: a component that did not change is marked shared (`markShared`) when installed into the copy, since C's copy holds a clone of it (reference count 2, so `astMAKE_SET1` attributes such as a ZoomMap's Zoom become immutable); a fresh component (new UnitMap, Region's Frame copy, a changed sub-container) is not, as C's count returns to 1 — cost if wrong: a ZoomMap shared between the two results could be changed through one. +- Ruling: the top-level `return this` (C's `astClone( this )`) does not mark the Mapping shared — the caller holds the same object, C callers annul one of the two handles, and Java's mark is never cleared, so marking would make the caller's own Mapping permanently immutable — cost if wrong: a SET1 attribute set on the result of an unchanged removeRegions is allowed where C (until the extra handle is annulled) refuses it. +- Ruling: a FrameSet component of a TranMap (any change) or a changed FrameSet component of a RateMap or SwitchMap becomes a UnitMap, dropping its Mapping, as C's `astIsAFrame` makes it (**C quirk**, kept, pinned by `tranmap_frameset_beside_region`, recorded in `docs/rust-c-differences.md`; Rust keeps the FrameSet) — cost if wrong: Java loses a FrameSet's Mapping exactly where C does. +- Ruling: Rust's `remove_regions_from_frameset` is translated as Rust wrote it, though the FrameSet `convert` gives holds no Region (its Javadoc says so and points to `checkRemoveRegions` and `RemoveRegionsTest`, which remove Regions a FrameSet holds) — cost if wrong: none; the weak test adds no false coverage claim. +- Ruling: the two NormMap oracle cases are skipped by name ("NormMap (not in jniast)") and the test asserts 9 run — as decided in the dispatch — cost if wrong: none until NormMap is ported. + +## Task 2: SelectorMap + +### Implementer + +- Ruling: two equal 1-D SelectorMaps both applied forward in series simplify to a UnitMap, as C does (probe `series_1d_both_forward`) — the dispatcher's instruction and C is the authority; recorded in `docs/rust-c-differences.md` as a C bug — cost if wrong: a simplified pair transforms differently from the unsimplified one, exactly as in C. +- Ruling: a description without `Reg1` is AST__LDERR "astLoadSelectorMap(SelectorMap): The SelectorMap holds no Regions." — C does not load it either, but fails with AST__OBJIN from `astAnnul` of a null FrameSet pointer, a status that describes a C defect rather than the description — cost if wrong: a caller testing for AST__OBJIN gets AST__LDERR. +- Ruling: a `Reg` component that is not a Region is AST__LDERR naming it, as SwitchMap and CmpRegion do — C would fail in `astCheckRegion` inside `astGetRegFS`/`astRegDummyFS` with its own status — cost if wrong: a different status for a corrupt description. +- Ruling: the loader does not compare the Regions' Frames (C does not; Rust rebuilds through its builder and refuses) — follows C — cost if wrong: a hand-made description with Regions in different Frames loads. +- Ruling: Transform restores Closed and Negated in a `finally`, so a failed Region transformation still puts them back, where C, with its status set, leaves them changed — the dispatcher's instruction — cost if wrong: after an exception the Regions differ from C's. +- Ruling: Transform treats a NaN or infinite input as bad (`Mapping.isBad`), where C tests `== AST__BAD` only — the library-wide Mapping contract (Mapping Javadoc) — cost if wrong: a NaN input gives badval here and a Region-dependent index in C. +- Ruling: Transform in a direction the SelectorMap does not define writes nothing, as C (only reachable if a description sets `Inv = 1`; the checks refuse it otherwise) — follows C — cost if wrong: none observable for a SelectorMap the library makes. +- Ruling: MapMerge raises AST__INTER if a Region's `simplify()` returns something that is not a Region (C would fail in `astCheckRegion`) — project rule for unexpected values — cost if wrong: none expected, no Region class does so. +- Ruling: `selectormapSerializationRoundtrip` checks the region count and badval through the dump text, since Rust's `regions()` and `badval()` accessors are not jniast API — keeps the public API exact — cost if wrong: none. +- Ruling: `switchmapRemoveRegions` asserts the SwitchMap comes back as the same object (C's clone), not Rust's comment that "those Regions become UnitMaps inside the selector" — SelectorMap installs no RemoveRegions in C or Rust — cost if wrong: none. + +### Controller + +- Ruling: Task 2's run command also runs `JniastSelectorMapTest` — the plan names that test under Files but its Step 3 pattern misses it — cost if wrong: none. + +## Task 3: Stc, AstroCoords and StcResourceProfile + +### Implementer + +- Ruling: `Region.dump` reads the private fields directly, so no package-private raw accessors were added (the brief's Files line names them) — nothing outside `Region.dump` needs them; Stc's `regOverlay` already reads raw fields — cost if wrong: none, an accessor can be added when a caller appears. +- Ruling: Adapt is also written from the Region's own field when set, as region.c does — no class overrides Adaptive, so no output changes — cost if wrong: none. +- Ruling: a PointList with Closed set now dumps the value set (it dumped !Negated before) — C's region.c `Dump`, pinned by `region_dump_probe` — cost if wrong: none; this is C's output. +- Ruling: Stc's Transform and GetBounded leave Negated set on the encapsulated Region (C quirk kept; Rust does not) so `test("Negated")` is true after use — Review Focus 2, probe `used_plain`/`used_bounded`; recorded in rust-c-differences — cost if wrong: a Negated test differs from Rust's after a transform. +- Ruling: `Begin Stc` is AST__LDERR ("astLoadStc(Stc): An Object of the abstract class Stc cannot be read; only its subclasses can."), raised in `ObjectRegistry.load` so `isRegistered("Stc")` stays false — C reads it (probe `begin_stc`), jniast's Stc is abstract — cost if wrong: a hand-written or foreign dump of that class does not load. +- Ruling: an Stc dump without `Region`, or with fewer `Coord` than `Ncoord`, is AST__LDERR — C stores null and segfaults (in `astRegDummyFS_` during the load; in `astCopy_` from `astGetStcCoord`), so no probe row; Rust also LDERR — cost if wrong: none (C crashes). +- Ruling: a `Coord` that is not a KeyMap, a Region item that is not a Region, and a loaded AstroCoords value under a Region key that is not a Region are AST__LDERR — C would use the object as a Region/KeyMap (H9) — cost if wrong: such dumps fail to load. +- Ruling: `Ncoord` below 0 reads as 0, as C (probe `negative_ncoord`) — cost if wrong: none. +- Ruling: ERROR_ELLIPSE_LICENSED: no defensible tolerance exists for the Ellipse's axis-end points (on the near-circle the fitted direction follows the last bits of the mesh; Java on this machine is ~2e-5 from C, centre identical), so their values (X3..X6) are dropped from the `sky` and `sky_coord` dump comparisons on every platform; the centre (X1, X2) stays in the comparison at 1e-12, and the two half-lengths are compared within 1e-13, derived from the spread of the mesh distances that C's own two half-lengths show (5.2e-14 apart) — derivation in the test's class Javadoc; omission in `docs/rust-c-differences.md`; follows phase 7's ruling for an Ellipse fitted to a Circle — cost if wrong: an error in the fitted direction goes unnoticed. [the half-length derivation was replaced in fix rounds 1 and 2; the axis ends stay dropped] +- Ruling: numbers in sky dumps (Circle second points from `SkyFrame.offset2`) compared within 1e-12 absolute, citing `RegionEllipseOracleTest`'s 3e-14 bound for the same chain — cost if wrong: a few-ulp error is accepted, as elsewhere. +- Ruling: jniast null handling: a null `region` is `NullPointerException("region")`; a null AstroCoords element is `NullPointerException("coords[i]")`, raised first, as jniast's Java converter runs before its native null check; a null or empty `coords` array means no AstroCoords; a null or empty name array and null Regions are simply omitted from the KeyMap (jniast's converter) — plan item 8 — cost if wrong: exception order when both are null. +- Ruling: the package-private `StcResourceProfile(Region, KeyMap[])` overload is C's `astStcResourceProfile`; an in-package caller passing a literal null must cast (`(AstroCoords[]) null`) — outside the package only the public constructor is visible, so jniast callers are unaffected — cost if wrong: none. +- Ruling: a KeyMap holding null under a Region key gives C's "is a NULL pointer" AST__STCKEY message, pinned by a Java-only test (C's public `astMapPut0A` refuses NULL, so the probe cannot reach it; the message text is stc.c's) — cost if wrong: one message. +- Ruling: `stcCoord` (C's `astGetStcCoord`) skips an object under a Region key that is not a Region, where C casts blindly — such a KeyMap cannot be built or loaded here — cost if wrong: none. +- Ruling: `set("RegionClass=")` with an empty value is passed to Region, as C's `MATCH` needs at least one character of value — cost if wrong: a different error for an empty value. +- Ruling: `RegionStcOracleTest` runs only `stc_matches_c` (six cases, count asserted), overlap, astro_coords and unknown-key; `full_dumps_match_c` and `c_dumps_read_back_as_c_reads_them` are left to Task 4 (brief) — cost if wrong: none. +- Ruling: `rust-tests.txt`'s `stc_matches_c` reason was edited to drop StcResourceProfile, whose cases now run, beyond the removals the brief names — an accurate reason — cost if wrong: one reason string. + +#### Fix round 1 + +- Ruling: the secondary bound depends on how close a mesh point lies to each fitted axis, so it is computed in the test rather than fixed — a platform whose fitted direction falls within about 2e-4 rad of a mesh point fails the precondition assertion and does not pass silently — cost if wrong: such a platform needs a second-order bound. [superseded in fix round 2: the platform's side is bounded after the fact, with no precondition] + +#### Fix round 2 + +- Ruling: the refit duplicates `bestEllipse`'s arithmetic in the test rather than exposing its intermediates from main code — the bit-for-bit check ties the copy to the real fit — cost if wrong: if `bestEllipse` changes, the test fails until the copy follows. [superseded after the final review: the test calls `Ellipse`'s package-private `bestPrimaryAxis` and `secondaryEstimate`, which `bestEllipse` is built from] + +## Task 4: The other Stc classes, and casting within the Stc hierarchy + +### Implementer + +- Ruling: `StcObsDataLocation.obs` is typed `AstObject`, with `setObs(PointList)` the only setter — C's loader stores an Object of any class there (probe `obs_loc_any_class`) — cost if wrong: none; the field is private. +- Ruling: the `obs_data` oracle case is built with `setObs`, as the C probe built it, rather than read from C's dump as Rust does — Java has C's protected setter — cost if wrong: none; the read-back path is covered by `cDumpsReadBackAsCReadsThem`. +- Ruling: `fullDumpsMatchC` transforms the two test points before writing the Full = 1 dump, as region_stc_probe.c's `emit` does (Rust does not; its Stc does not leave Negated set) — cost if wrong: none; this is C's order. +- Ruling: `catalog_entry` dumps are compared with SKY_TOL and the Ellipse machinery, `cDumpsReadBackAsCReadsThem` exactly (C's own numbers re-read) — as Rust; no new tolerance — cost if wrong: none. +- Ruling: the cast rows the brief asks for (astFindFrame between Stcs of the same and different classes) are in the probe with astConvert alongside, but in C neither reaches region.c `Cast` (lldb breakpoint on `astCastCopy_` never hit): `astFindFrame` matches with matchsub 0 and region.c `ConvertX` replaces Regions by their current Frames; the rows pin outcomes (all found in one Domain, none across Domains, astEqual 0 across classes); `Region.cast` itself is pinned by Java-only tests — cost if wrong: none. +- Ruling (superseded in fix round 1): `aCmpFrameOfStcsInOtherDomainsDoesNotConvert` was Java-only; it now takes its null from the probe's last case. +- Ruling: StcTest translates only `testConstructors`; `testReads`/`testChandra` need XmlChan (not in scope) — brief. [cost added in the sweep: cost if wrong: two of jniast's three Stc tests wait for XmlChan] +- Ruling: the Cast docs entry now says C crashes before `astCastCopy` and keeps the description of region.c `Cast` as written — the brief asked that the entry describe the sibling cast — cost if wrong: one docs paragraph. [amended in fix round 1: C crashes only until a description of the class Region has been read; after one, the CmpFrames do not convert] [corrected after the final review: the CmpFrame path reaches region.c `Cast` with a Frame or a CmpFrame to cast into, never its `astCastCopy` branch, which only the protected `astCast` reaches; the entry now says so] + +## Task 5: Sweep and report + +### Implementer + +- Ruling: no `Sweep the deferred lists after phase 8` commit — Tasks 1 to 4 had removed every deferred entry and Javadoc deferral note naming this phase's classes, `JniastApiTest.IN_SCOPE` holds all seven, and `mvn test -Dast.writeDeferred=true` changed nothing — cost if wrong: none. +- Ruling: three Rust tests in files that name this phase's classes are neither translated nor listed: `test_guide.rs::guide_mentions_no_unported_class`, `test_mapmerge_audit.rs::no_checklist_is_orphaned` and the fixture-less class check in `src/serial/object_text.rs`; they check the Rust port's own documents and files, and phase 7 left such meta-tests unlisted (its report, Gaps and risks) — cost if wrong: `rust-tests.txt` stays incomplete for Rust-only meta-tests until a checker exists. diff --git a/docs/rust-c-differences.md b/docs/rust-c-differences.md index 7c5a0ac..525a07d 100644 --- a/docs/rust-c-differences.md +++ b/docs/rust-c-differences.md @@ -547,6 +547,39 @@ The entries are grouped by area, in the order the Java classes were ported. - Rust: has its own messages, with the same statuses. - Java: as C, the public constructor giving the public function's message. +### SelectorMap's transformation changes its own Regions + +- **C quirk**: `Transform` (`selectormap.c`) tests the points against each of its own Regions by negating it and reversing its Closed attribute with `astNegate` and `astSetClosed`, and puts both back the same way, so each Region is left with Negated and Closed set to the values they had. + A dump made after a transformation writes `Closed = 1` for each Region whose Closed was unset (probe `src/test/resources/probes/selectormap_probe.c`, cases `focus_dump_before` and `focus_dump_after`); `astEqual`, which compares the values, is unchanged (case `focus_equal_after`). +- Rust: transforms a negated copy of each Region, so the SelectorMap is unchanged. +- Java: as C, putting the attributes back even when a transformation fails, where C leaves them changed. + +### SelectorMap's simplification of its Regions + +- C: `MapMerge` (`selectormap.c`) simplifies each Region and rebuilds the SelectorMap when `astSimplify` returns a different pointer for any of them, whatever its class. +- Rust: `reduced_children` (`mappings/selectormap.rs`) takes a Region as changed when its simplification is not `equal` to it or differs in Invert, and keeps the result only for nine listed Region classes. +- Java: as C, comparing the objects `simplify` returns (probe cases `simplify_unchanged` and `simplify_changed`). + +### Two equal 1-D SelectorMaps in series simplify to a UnitMap + +- **C bug**: `MapMerge` (`selectormap.c`) inverts the neighbouring SelectorMap, compares it with `Equal`, and replaces the pair with a UnitMap if they are equal; `Equal` compares the numbers of inputs, the Regions and the bad value but not the Invert attributes, so for 1-D SelectorMaps, whose inverse has as many inputs as outputs, it cannot tell a SelectorMap from its inverse. + Two equal 1-D SelectorMaps both applied forward are replaced with a UnitMap, which changes the transformation: the pair gives 1 for every good point, whatever Region holds it, and the UnitMap gives the point (probe case `series_1d_both_forward`). +- Rust: `try_merge` requires the two Invert flags to differ, so the pair is kept. +- Java: as C. + +### Loading a SelectorMap + +- **C bug**: `astLoadSelectorMap` annuls the first Region's FrameSet pointer after reading the Regions, so a description without `Reg1` fails with AST__OBJIN from `astAnnul` of a null pointer (probe case `load_no_regions`). + The Regions' Frames are not compared, and a later Region written without its Frame is given the first Region's FrameSet with `astSetRegFS`, which makes a FrameSet of copies of all its Frames, joining a copy of its base Frame, as the Region's base Frame, to a copy of its current Frame, as the Region's current Frame, with a UnitMap; a first Region whose FrameSet holds another Mapping therefore leaves the later Region as it was written (probe case `load_first_region_mapped`, whose first Region's FrameSet holds a MathMap). +- Rust: gives a later Region two copies of the first Region's current Frame, joined by a UnitMap, so only the base Frame differs from C's; it rebuilds the SelectorMap through its builder, so Regions in different Frames are AST__LDERR, and it refuses a description without Regions with AST__LDERR. +- Java: as C, except that a description without Regions is AST__LDERR, and a component that is not a Region is AST__LDERR. + +### The messages of SelectorMap's constructor + +- C: no Regions is AST__BDPAR "astSelectorMap(SelectorMap): Bad number of Regions (0) specified.", and the first Region whose Frame is not equal to the first Region's is AST__BADNI "astInitSelectorMap(SelectorMap): Region number 2 does not refer to the same coordinate Frame as the first Region." (probe cases `error_no_regions`, `error_naxes`, `error_skyframe`). +- Rust: the same statuses, with its own messages. +- Java: as C; a null array or Region is a NullPointerException naming it, as for jniast's other arguments. + ### The directions of a loaded IntraMap - C: `astLoadIntraMap` leaves TranForward and TranInverse to the Mapping part of the dump (`Fwd` and `Inv`); the registered function's AST__NOFWD and AST__NOINV flags decide them only when an IntraMap is made (`astInitIntraMap`). @@ -849,10 +882,42 @@ Rust's `src/units/` departs from C's `unit.c` in the following ways; Java follow ### Casting a Region into the class of another Region (`Cast`) -- C: region.c `Cast` copies a Region as an instance of the class of any Region given to it, with `astCastCopy`, which changes the class of the copy without checking that the Region is of that class or of a subclass of it: a Box cast into the class of a Circle is a Circle holding a Box's values. **C bug.** +- C: as written, region.c `Cast` copies a Region as an instance of the class of any Region given to it, with `astCastCopy`, which changes the class of the copy without checking that the Region is of that class or of a subclass of it: a Box cast into the class of a Circle is a Circle holding a Box's values, and between the Stc classes, which are siblings, the copy of a smaller StcSearchLocation, StcCatalogEntryLocation or StcResourceProfile cast into an StcObsDataLocation reads past its end, where the observatory position would be. **C bug.** + Before choosing, `Cast` compares the class of its own vtab (`class_vtab`) with that of the Object given (`astClassCompare`), and that vtab is initialised only when an Object of the class Region itself is made, which only `astRead` of a `Begin Region` description (loader.c `LOAD(Region)`, `astLoadRegion` with a null vtab) does; until then the comparison follows a null class identifier and the program crashes, whatever the Object given. **C bug.** + `astFindFrame` matches with `matchsub` 0, and region.c's `ConvertX` aligns the current Frames of Regions, so neither reaches `Cast` with a Region. + A CmpFrame holding a Region reaches `Cast`, but never with a Region to cast into: cmpframe.c `PartMatch` matches the template's Region against the target's picked axes, a Frame (`astSubFrame`, which region.c `SubFrame` takes from the Region's current Frame), and `ComponentMatch` against the whole target CmpFrame, a cousin, so `Cast` takes its other branch and casts the Region's current Frame; the `astCastCopy` calls `astConvert` makes come from cmpframe.c `Cast`, a CmpFrame into a CmpFrame, and only the protected `astCast` reaches the `astCastCopy` of region.c `Cast`. + So `astConvert` between two CmpFrames, each of an Stc (or a Circle) and a Frame, whose Regions are in different Domains, crashes in `astClassCompare` under `Cast` (`frame.c` `astMatch`, from cmpframe.c `PartMatch`) unless a Region description has been read; after one, it gives no conversion and no error. + Probe `src/test/resources/probes/stc_probe.c`, case `stc_classes`, holds `astFindFrame` and `astConvert` between Stcs of the same and of different classes, and `astFindFrame` between those CmpFrames, none of which reaches `Cast`; its last case, `cast_after_region_read`, reads a Region description and then converts the CmpFrames of two StcSearchLocations, reaching `Cast`: no conversion. - Rust: not examined. -- Java: a copy when the Region is of the class of the Region given, and null for any other class (`Region.cast`). - C's cast into the class of a parent is defined, and is not followed; no Region class of this library is a parent of another (the Stc classes, which are, are not yet ported). +- Java: a copy when the Region is an instance of the class of the Region given, and null for any other class (`Region.cast`), so an Stc is not cast into the class of another Stc; the CmpFrames above do not convert, as in C after a Region description has been read (`StcProbeTest`). + Null is the result C documents: region.c `Cast`'s prologue documents a NULL pointer without error for a class it cannot cast into (its code calls `astCastCopy` for any Region class that is not a cousin), as object.c's generic `Cast` returns for a class not on the line of descent, and frame.c `astMatch_` treats it as no cast, not as a failure; and the copy `astCastCopy` would make of a sibling Stc matches no better, since its Match forwards to its current Frame. + C's cast into the class of a parent is defined, and is not followed: the copy keeps its own class; jniast's Stc is abstract, so no concrete Region class of this library is a parent of another, and the copy is always of the class of the Region given. + +### An Stc's transformation sets Negated on its encapsulated Region + +- **C quirk**: `Transform` and `GetBounded` (stc.c) set the encapsulated Region's Negated attribute to the value it already has with `astSetNegated`, around the call and again after it, so it is left set; an Stc reads Negated from its encapsulated Region (stc.c `TestNegated`), so `astTest( stc, "Negated" )` is true once the Stc has transformed points or been asked whether it is bounded, and so is that of a copy (probe `src/test/resources/probes/stc_probe.c`, cases `used_plain` and `used_bounded`). + The dump, which writes `Negate` only when it is 1, and `astEqual`, which compares the values, are unchanged. +- Rust: transforms with the encapsulated Region as it is, so Negated stays unset. +- Java: as C (`Stc.regBaseMask`, `Stc.isBoundedInner`), putting the value back even when a transformation fails, as C does. + +### An Stc dump without its Region or an AstroCoords element + +- C: stc.c `astLoadStc` stores a null pointer for a missing `Region` or `Coord` item and reports no error; with no `Region`, the load then dereferences it (`astRegDummyFS`) and crashes unless the Stc was itself written without its Frame, and with a missing `Coord`, the load succeeds and `astGetStcCoord` crashes copying the null KeyMap (probed: SIGSEGV in each). **C bug.** +- Rust: `AST__LDERR` for either. +- Java: `AST__LDERR` for either (`Stc(NativeNode)`; `StcProbeTest`). + +### An Stc of the abstract class Stc + +- C: a dump that begins `Begin Stc` is read by `astLoadStc` as an Stc of the class Stc itself, which transforms points, dumps and compares like any other (`src/test/resources/probes/stc_probe.c`, case `begin_stc`). +- Rust: no loader for the class name Stc, so the read fails. +- Java: jniast's `Stc` is abstract, so no Object can be of that class alone; the read fails with `AST__LDERR` (`ObjectRegistry.load`). + +### The axis ends of an AstroCoords Error Ellipse fitted to a Circle + +- C: an AstroCoords Region in another SkyFrame is mapped into the Stc's Frame and simplified (stc.c `MakeAstroCoordsKeyMap`), so a small Circle becomes the Ellipse that best fits its mapped mesh (ellipse.c `astBestEllipse`); on a near-circle the direction of the fitted axes, and so the ends of the axes the Ellipse is defined by, follow from the last bits of the mesh. +- Rust: compares the Ellipse's values exactly on the platform its C values were taken on and leaves them out elsewhere (`ERROR_ELLIPSE_LICENSED` in `tests/test_region_stc_oracle.rs`). +- Java: `java.lang.Math` puts the axis ends about `2e-5` from C's on this platform; `RegionStcOracleTest` leaves out their values from the `sky` and `sky_coord` dumps on every platform and compares the centre within `1e-12`. + It compares the two half-lengths instead, within bounds worked out from `bestEllipse`'s arithmetic: the primary within `1.5e-13`, from the parabola's vertex lying at most a quarter of the rounding spread of the mesh distances above the largest; the secondary within about `1.1e-12`, the sum of three parts: C's rounding at C's direction, propagated to first order (C's axis, oracle data, lies far from every mesh point); the difference between the two directions in the systematic offset the sphere's curvature gives it (`R^3 / 18`, about `5.6e-14` above the primary on both platforms); and this platform's rounding at its own direction, bounded after the fact from the fit's own per-point values, which the test recomputes and checks against the dumped Ellipse bit for bit, so that nothing is assumed about how close this platform's axis lies to a mesh point. ### A value holding `%` set on an Adaptive Region @@ -1133,6 +1198,21 @@ Rust's `src/units/` departs from C's `unit.c` in the following ways; Java follow - Rust: sets the uncertainty on a new Region, and returns a copy of the Prism when nothing simplifies, so the Prism given is not changed (`regions/prism.rs`). - Java: as C (`Prism.simplifyStep`). +### What removing the Regions from a Mapping gives (`RemoveRegions`) + +- C: region.c `RemoveRegions` returns a copy of the Region's current Frame, for every Region class. + A container turns a component result that is a Frame (`astIsAFrame`) into a UnitMap: cmpmap.c and tranmap.c every such component, so also a plain Frame component that did not change when the other one did; ratemap.c, switchmap.c and frameset.c only a component that changed, so a plain Frame route of a SwitchMap or a Frame used as a Mapping of a FrameSet stays a Frame. + A CmpFrame or FrameSet that changed is a copy holding clones of its unchanged components, so they are shared with the original, and an axis Label set on one is seen in the other. +- Rust: a Region's `mapping_without_regions` returns a UnitMap, and its Frames are not Mappings, so a plain Frame component cannot arise; the copies own their components. +- Java: as C (`removeRegions`); `RemoveRegionsTest` pins each case from `src/test/resources/probes/remove_regions_extra_probe.c`. + +### A FrameSet component loses its Mapping when the Regions are removed + +- C: `astIsAFrame` is true of a FrameSet, so tranmap.c `RemoveRegions` turns a FrameSet component of a TranMap into a UnitMap whenever either component changed, and ratemap.c and switchmap.c turn a FrameSet component that held a Region into a UnitMap, dropping the FrameSet's Mapping: a TranMap of a FrameSet holding a ZoomMap and a Box becomes a UnitMap. **C quirk.** + A CmpMap is not affected, since `astInitCmpMap` holds a FrameSet's Mapping in its place. +- Rust: keeps a FrameSet component, with its own Regions removed. +- Java: as C (`Mapping.frameToUnitMap`); `RemoveRegionsTest.aTranMapTurnsAFrameSetIntoAUnitMap`, `aSwitchMapTurnsAChangedFrameSetRouteIntoAUnitMap` and `aRateMapTurnsAChangedFrameSetIntoAUnitMap` pin it. + ## FitsChan ### An equals sign in a keyword name is reported as an `astPutFits` error from every method diff --git a/docs/superpowers/plans/2026-11-19-pure-java-ast-phase8-stc.md b/docs/superpowers/plans/2026-11-19-pure-java-ast-phase8-stc.md new file mode 100644 index 0000000..9f9d93d --- /dev/null +++ b/docs/superpowers/plans/2026-11-19-pure-java-ast-phase8-stc.md @@ -0,0 +1,170 @@ +# Pure-Java AST Phase 8 (SelectorMap, RemoveRegions and STC) Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. +> Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** jniast's `SelectorMap`, `Stc` with its four subclasses `StcResourceProfile`, `StcSearchLocation`, `StcCatalogEntryLocation` and `StcObsDataLocation`, and `AstroCoords` construct, transform, compare, simplify, dump and load as C's do, and every Mapping and Frame class removes its Regions as C's `astRemoveRegions` does, so that every C fixture and Rust test still deferred for these classes runs. + +**Architecture:** Port the Rust port's `src/mappings/selectormap.rs`, `src/regions/stc.rs` and the `remove_regions` overrides onto the phase 1 to 7 classes, with C (`reference/starlink-ast/src/selectormap.c`, `stc.c`, `stcresourceprofile.c`, `stcsearchlocation.c`, `stccatalogentrylocation.c`, `stcobsdatalocation.c`, and the `RemoveRegions` of `mapping.c`, `region.c`, `cmpmap.c`, `cmpframe.c`, `frameset.c`, `switchmap.c`, `tranmap.c`, `ratemap.c`) as the authority wherever the two differ. +`Stc` is an abstract `Region` that encapsulates a copy of another Region and forwards its geometry to it, on the pattern `CmpRegion` set in phase 7. + +**Tech Stack:** as phases 1 to 7: Java 8 (`--release 8`), Maven, JUnit 5, Jackson (test scope), Error Prone, Checkstyle, PMD, Spotless; JDK 21 to build. + +**Spec:** `docs/superpowers/specs/2026-11-02-pure-java-ast-design.md` ("Later phases", item 6, second part). +Phase 7 (`docs/superpowers/plans/2026-11-18-pure-java-ast-phase7-regions.md`) was the first part; this branch, `u/timj/phase8-stc`, is stacked on it. +The earlier plans' Shared Design sections and the rulings in `docs/reports/2026-11-1*-phase*-rulings.md` still apply where this plan does not change them. +The scope survey this plan was written from is summarised in Shared Design; its C and Rust line references are the starting points named below. + +## Global Constraints + +- Every Global Constraint of the phase 1 plan applies unchanged (Java 8, no runtime dependencies, jniast signatures, C at `3d3f255f`, `default` and final `else` throw `AST__INTER`, `MODERN-JAVA` tags, no heuristics the original lacks, expected values from C only, share where C calls `astClone` and copy where C calls `astCopy`, British spelling, one sentence per line in Markdown). +- Public API: exactly jniast's members for the classes of this phase (`reference/starjava/jniast/src/main/uk/ac/starlink/ast`), already listed in `src/test/resources/jniast-api.txt`: + - `SelectorMap(Region[] regs, double badval)`. + - `Stc` (abstract, `extends Region`): `getStcNCoord()`, `getStcCoord(int)` (1-based), `getStcRegion()`. + - `StcResourceProfile`, `StcSearchLocation`, `StcCatalogEntryLocation`, `StcObsDataLocation`: each one constructor `(Region region, AstroCoords[] coords)`. + - `AstroCoords` (a plain class holding references, not copies): `AstroCoords()`, `AstroCoords(String[] names)`, and get/set `Name` (`String[]`), `Value`, `Error`, `Resolution`, `Size`, `PixSize` (`Region`). + - Each task adds its classes to `JniastApiTest.IN_SCOPE`; nothing else public is added. + - jniast's package-private `Stc.astroCoordsToKeyMap`, `keyMapToAstroCoords` and `astroCoordsToKeyMaps` are kept package-private with jniast's behaviour; the six `AST__STC*` key names (C `stc.h`: `"Name"`, `"Value"`, `"Error"`, `"Resolution"`, `"Size"`, `"PixSize"`) are package-private constants on `Stc`, since astjava has no `getAstConstantC`. +- `removeRegions()` is package-private (jniast has none; tests and a later Plot call it). +- Before porting a class, read Rust `docs/porting-hazards.md` (H4, H9 above all) and every entry naming the class in `docs/issues/c-library-quirks.md`. +- Rust comments cite older C line numbers; find each C function by name in the pinned source. +- Classes still absent after this phase: Moc, MocChan, NormMap, UnitNormMap, FitsTable, ChebyMap, XphMap, SplineMap, StcsChan, XmlChan, and the other AST classes jniast lacks. +- Values must match C to the oracle tolerances; when one does not, find the C function that computes it before touching the arithmetic (H7). +- Tolerances for values that pass through `java.lang.Math` come from an error bound worked out from the computation, never from the drift seen on this machine: CI runs on x86-64 Linux. +- C probes go in `src/test/resources/probes/` with the build recipe in the header, built against the pinned C in `scratchpad/build-ast`, values printed with `%.17g`; source and output are committed. + +## Review Focus + +1. A SelectorMap whose Regions overlap, are negated or unbounded, a point on a Region's boundary, and a point bad on only one axis: the index (or `badval`) C returns, the first Region holding a point winning (test in Task 2, from `selectormap_probe.c`). +2. A SelectorMap or Stc used, then dumped, copied and compared: C's Transform changes its own Regions in place (SelectorMap) or the encapsulated Region (Stc) and leaves attributes set, so the dump, `test("Negated")` and `equals` after a transformation are C's (tests in Tasks 2 and 3, from the probes). +3. `removeRegions` on nested containers: a Region inside a CmpMap inside a FrameSet, a Region used as a Frame of a FrameSet, a CmpMap whose other component is a plain Frame, a SwitchMap whose selector is a SelectorMap, and a Mapping with no Regions (returned unchanged, the same object, as C's clone is): C's result for each (test in Task 1, from `remove_regions_extra_probe.c`). +4. AstroCoords given an empty or null name array, null Regions, Regions in another Frame than the Stc's Region, and `getStcCoord(0)` or an index past the end: C's KeyMap contents and `AST__STCIND` messages, and jniast's null handling (test in Task 3). +5. A Frame attribute (`System`), `Negated` or `Closed` set on an Stc: forwarded to the encapsulated Region and the AstroCoords Regions as C's `RegSetAttrib` and the `MAKE_SET` macros do, and visible in the next dump, `getStcRegion` and `getStcCoord` (test in Task 3, from `stc_probe.c`). + +--- + +## Shared Design + +### Where the code goes + +- `Mapping.removeRegions()` (package-private, returns `this`, as `mapping.c`'s `astClone`), overridden in `Region` (C: `astGetRegionFrame`, a copy of the current Frame, for every Region class, Stc included), `CmpMap`, `TranMap`, `RateMap`, `SwitchMap`, `CmpFrame` (the copy keeps `SpecFluxFrame`'s class) and `FrameSet` (both as a Frame and as a Mapping), each following its C file's `RemoveRegions`. +- `SelectorMap` (public, `extends Mapping`): `selectormap.c`'s state (copies of the Regions, `badval`), Transform, Equal, MapMerge, Copy, Dump and load; registered in `ObjectRegistry`. +- `AstroCoords` (public, plain class, as jniast's). +- `Stc` (public abstract, `extends Region`): `stc.c`'s state (the encapsulated Region, the AstroCoords KeyMaps), every override `stc.c`'s vtab installs, dump and load of the Stc part, the jniast converters and key constants. +- `StcResourceProfile`, `StcSearchLocation`, `StcCatalogEntryLocation` (public, each its class name, dump comment and loader), `StcObsDataLocation` (also the observatory position `obs`, settable package-private as C's protected `astStcSetObs`). +- `Region.dump` reads the Region class's own Negated, Closed, MeshSize and FillFactor where they are set, falling back to the overridable accessors only when unset, as `region.c`'s `Dump` calls its own static `TestNegated` and the others; Stc overrides the accessors to read the encapsulated Region (C `stc.c` `MAKE_GET`/`MAKE_TEST`). + +### Copy and share (H4) + +- Copy where C copies: SelectorMap copies each Region at construction (`selectormap.c` `astInitSelectorMap_`) and in Copy; Stc copies its Region at construction unless the Region is itself an Stc, which is mapped into the Stc's Frame instead (`stc.c` `astInitStc_`), copies each AstroCoords KeyMap (`MakeAstroCoordsKeyMap`), and `getStcRegion` and `getStcCoord` return copies; StcObsDataLocation copies `obs` in Copy and shares it in `astStcSetObs`. +- Share where C clones: `removeRegions` of an unchanged Mapping returns `this`; a changed CmpFrame or FrameSet is a copy whose unchanged components are the original's own objects, shared, as `cmpframe.c` and `frameset.c` replace the copy's components with clones of the new pointers. + The sharing is C's and is visible when an attribute is set on a shared Frame; the Javadoc of `removeRegions` says so. + +### Taken from C rather than Rust + +1. **A Region's `removeRegions` returns a copy of its current Frame**, and each container turns a component that comes back as a Frame into a `UnitMap`, as `cmpmap.c`, `tranmap.c`, `switchmap.c` and `frameset.c` do; `cmpmap.c` and `tranmap.c` convert even a plain Frame component that was already there when another component changed, while `switchmap.c` and `frameset.c` convert only a component that changed; Rust returns a UnitMap directly and cannot show the second case, since its Frames are not Mappings. +2. **SelectorMap's Transform negates and re-closes its own Regions in place**, restoring the old values in a `finally`, as `selectormap.c` does; the attributes are left set, as C's `astSetNegated` and `astSetClosed` leave them, and the probe pins what that changes in a later dump. + Rust transforms negated copies. +3. **SelectorMap's MapMerge detects a simplified Region by identity** (`simplify()` returned a different object), for any Region class, as C compares pointers; Rust compares with `equals` against a fixed list of nine classes. +4. **SelectorMap's MapMerge merges neighbours as C's does**: invert the neighbour, compare with `Equal` (which ignores Invert and, for a 1-D SelectorMap, cannot tell one from its inverse), restore it; Rust demands differing Invert flags. + The probe pins two equal, both-forward 1-D SelectorMaps in series. +5. **Stc's Transform and GetBounded set the encapsulated Region's Negated to its own value around the call**, leaving it set, as `stc.c` does. +6. **Loaders follow C where C's result is usable** (a SelectorMap with no `Reg1`, an `ObsLoc` of any class, `Ncoord` below 0 read as 0, the later dummy-FrameSet Regions given the first Region's FrameSet) and raise `AST__LDERR` where C would store a null and fail later (an Stc without `Region`, a missing `Coord`) (H9). + A `Begin Stc` of the abstract class itself raises `AST__LDERR`, since jniast's `Stc` cannot be instantiated. +7. **Error messages are C's** (`selectormap.c`: `AST__BDPAR` "Bad number of Regions", `AST__BADNI` "does not refer to the same coordinate Frame as the first Region"; `stc.c`: the four `AST__STCIND` variants and `AST__STCKEY`), not Rust's. +8. **jniast's null handling:** a null `regs` array or element, or a null Stc `region`, is a `NullPointerException` naming the argument, as phase 6 ruled for jniast arguments; a null `coords` array means no AstroCoords, as `jniastConstructStc` reads it. + +### `ERROR_ELLIPSE_LICENSED` + +The `region_stc` oracle cases `sky`, `catalog_entry` and `sky_coord` hold an AstroCoords Error Region that C re-expresses as the best-fit Ellipse of a 1e-4 rad Circle's mesh, an ill-conditioned fit whose defining points move about 1e-5 relative under last-bit `Math` differences (Rust `tests/test_region_stc_oracle.rs`, `PLAN.md`). +Java compares those Ellipse points with a tolerance derived from the fit's conditioning, worked out in the test's comment, and every other value at the oracle's usual tolerance; if no bound can be derived, the Ellipse's `X` lines are compared as Rust does off macOS (dropped) and the omission is recorded in `docs/rust-c-differences.md`. + +### Gates and deferred lists + +- Each Rust test file becomes a Java test class as before (`test_selectormap.rs` → `SelectorMapTest`, `test_region_stc_oracle.rs` → `RegionStcOracleTest` reading `src/test/resources/oracle/region_stc.json`, `test_remove_regions_oracle.rs` → `RemoveRegionsOracleTest` reading `remove_regions.json`, both converted with `CasesToJson`). +- Each task removes from the deferred lists the entries whose only missing classes or functions are now present (`mvn test -Dast.writeDeferred=true`, then check that the diff removes only entries naming the task's classes). +- The two `remove_regions` oracle cases that need NormMap (`normmap_region`, `normmap_cmpframe`) are skipped by name in the test with the reason `NormMap (not in jniast)`, and the test asserts the number of cases it ran. +- `rust-tests.txt` keeps `test_region_stc_oracle.rs::error_ellipse_licence_is_still_needed` (Rust-only API). + +--- + +### Task 1: removeRegions + +**Files:** +- Modify: `Mapping.java`, `Region.java`, `CmpMap.java`, `TranMap.java`, `RateMap.java`, `SwitchMap.java`, `CmpFrame.java` (and its Javadoc's "not ported" sentence), `FrameSet.java`, `RegionsTest.java` and `RegionsCTest.java` Javadoc +- Create: `src/test/resources/oracle/remove_regions.json`, `src/test/resources/probes/remove_regions_extra_probe.c` and its output +- Test: `RemoveRegionsOracleTest` (`test_remove_regions_oracle.rs`, 9 of 11 cases), `RemoveRegionsTest` (Review Focus 3, from the probe: SwitchMap with a Region route, FrameSet with a Region as a Frame and one inside a CmpMap, CmpFrame of two Regions, a CmpMap with a plain Frame component beside a Region, a Mapping with no Regions returned as the same object, the sharing of an unchanged CmpFrame component), `RegionsTest` (`remove_regions_from_frameset`, `remove_regions_unit_passthrough`), `RegionsCTest` (`check_remove_regions`) + +**Interfaces:** +- Produces: package-private `Mapping removeRegions()` on `Mapping` and the overriding classes above; SelectorMap does not override it (C installs none), so its Regions stay. + +- [ ] **Step 1: Write the probe** `remove_regions_extra_probe.c` (Review Focus 3; the SwitchMap case uses a SwitchMap of Box routes, since SelectorMap is not yet ported in Java; the probe prints for each case the class tree of the result as a dump and whether it is the same object as the input), build it and commit source and output; convert the oracle with `CasesToJson`. +- [ ] **Step 2: Write the failing tests** named under Files. +- [ ] **Step 3: Run** `mvn test -Dtest='RemoveRegions*Test,RegionsTest,RegionsCTest'` — Expected: FAIL (method missing). +- [ ] **Step 4: Implement** from each C file's `RemoveRegions` (Shared Design, "Taken from C" item 1, and the sharing rule), with Rust's `remove_regions` and `*_without_regions` overrides as the guide. +- [ ] **Step 5: Run** the Step 3 command, `mvn test -Dast.writeDeferred=true` and then `mvn -q test` — Expected: PASS; the list diff removes only the four `astRemoveRegions` entries. +- [ ] **Step 6: Commit** `Remove the Regions from a Mapping`. + +### Task 2: SelectorMap + +**Files:** +- Create: `SelectorMap.java`, `src/test/resources/probes/selectormap_probe.c` and its output +- Modify: `ObjectRegistry.java`, `JniastApiTest.java` (`SelectorMap`), `EqualTest.java` (3 cases, count 7 to 10), `RateOracleTest.java` (3 cases, count 5 to 8), `ObjectIdOracleTest.java` (`selectormap`, `selectormap_part_ids`), `FrameInMapSlotTest.java` (floor 28 to 34, no refusals), `SwitchMapTest.java` (the 10 listed tests and its Javadoc), `SwitchMap.java` Javadoc +- Test: `SelectorMapTest` (`test_selectormap.rs`, 13, its `two_regions.ast` copied into `src/test/resources/selectormap/`), `SelectorMapProbeTest` (Review Focus 1 and 2 and "Taken from C" items 2 to 4, from the probe), `ConstructorChecksTest` (`a_selectormap_needs_regions_in_one_frame`), `JniastSelectorMapTest` (new: jniast's `AstTest.testSwitchMap`), the tests named under Modify + +**Interfaces:** +- Consumes: Task 1 (`switchmap_remove_regions`), phase 7's `Region`. +- Produces: `public class SelectorMap extends Mapping`. + +- [ ] **Step 1: Write the probe** `selectormap_probe.c`: Review Focus 1; a SelectorMap dumped before and after a transformation (item 2); a SelectorMap of Regions whose simplification changes nothing and one whose simplification changes a Region (item 3); two equal both-forward 1-D SelectorMaps in series simplified, and the 2-D pair with the second inverted (item 4); a load of a dump whose later Regions have a dummy FrameSet and whose first Region's base-to-current Mapping is not a unit Mapping; a load with no `Reg1`; `testregions.c`'s `checkSelectorMapEqual` cases; build it and commit source and output. +- [ ] **Step 2: Write the failing tests** named under Files. +- [ ] **Step 3: Run** `mvn test -Dtest='SelectorMap*Test,SwitchMapTest,EqualTest,RateOracleTest,ObjectIdOracleTest,FrameInMapSlotTest,ConstructorChecksTest'` — Expected: FAIL (class missing). +- [ ] **Step 4: Implement** from `selectormap.c` (Shared Design, "Taken from C" items 2 to 4, 6 to 8), with Rust `selectormap.rs` as the guide. +- [ ] **Step 5: Run** the Step 3 command, `mvn test -Dast.writeDeferred=true` and then `mvn -q test` — Expected: PASS; the list diff removes only entries whose missing class was SelectorMap (25 `rust-tests.txt`, 10 each of `full-dumps.txt`, `read-warnings.txt`, `serialisation.txt`, 8 of `simplify.txt`, 8 of `simplify-cases.txt`). +- [ ] **Step 6: Commit** `Add SelectorMap`, and the list changes as `Run the SelectorMap fixtures`. + +### Task 3: Stc, AstroCoords and StcResourceProfile + +**Files:** +- Create: `Stc.java`, `AstroCoords.java`, `StcResourceProfile.java`, `src/test/resources/oracle/region_stc.json`, `src/test/resources/probes/stc_probe.c` and its output +- Modify: `Region.java` (`dump` reads the Region's own set values; package-private raw accessors), `ObjectRegistry.java`, `JniastApiTest.java` (`AstroCoords`, `Stc`, `StcResourceProfile`) +- Test: `RegionStcOracleTest` (`test_region_stc_oracle.rs`: cases `plain`, `negated`, `sky`, `mapped`, `from_mapped`, `mapped_simplified`, with `overlap_with_a_circle_matches_c`, `astro_coords_match_c`, `unknown_astro_coords_key_is_stckey`; the case filter asserts the count run), `StcProbeTest` (Review Focus 2, 4 and 5, `testregions.c`'s `checkStcNegated`, a `Begin Stc` dump, loads without `Region` and without a `Coord`), `AstroCoordsTest` (jniast's 2), `RegionsTest` (a CmpRegion and a Box dump unchanged by the `Region.dump` change), `cap_timemap_02` in the fixture lists + +**Interfaces:** +- Consumes: phase 7's `Region` hooks (`regBaseInside`, `regBaseMask`, `regBaseBox`, `regBaseMesh`, `isBoundedInner`, `regBasePick`, `regPins`, `getDefUnc`, `setRegFS`, `regSetAttrib`, `regClearAttrib`, `getUseDefs`, `overlapX`, `simplifyStep`, `equalTo`, `regOverlay`), `KeyMap.mapPut0A`, `mapPut1C`, `mapGet0A`, `mapGet1C`, `mapType`. +- Produces: `public abstract class Stc extends Region` with a package-private constructor taking the Region and the AstroCoords KeyMaps and a class-specific dump comment; `public class StcResourceProfile extends Stc`; `public class AstroCoords`; package-private `Stc.AST__STCNAME` and the other five key names. + +- [ ] **Step 1: Write the probe** `stc_probe.c`: Review Focus 2, 4 and 5; `checkStcNegated`; a hand-written `Begin Stc` dump read by C; build it and commit source and output; convert the oracle. +- [ ] **Step 2: Write the failing tests** named under Files, with the `ERROR_ELLIPSE_LICENSED` handling of Shared Design. +- [ ] **Step 3: Run** `mvn test -Dtest='RegionStcOracleTest,StcProbeTest,AstroCoordsTest,Region*Test'` — Expected: FAIL (classes missing). +- [ ] **Step 4: Implement** `Region.dump`'s change first and run `mvn -q test` to show no existing dump changes; then `Stc`, `AstroCoords` and `StcResourceProfile` from `stc.c` and `stcresourceprofile.c`, with Rust `stc.rs` and the Stc part of `serial/mod.rs` as the guide ("Taken from C" items 5 to 8). +- [ ] **Step 5: Run** the Step 3 command, `mvn test -Dast.writeDeferred=true` and then `mvn -q test` — Expected: PASS; the list diff removes only the `cap_timemap_02` entries and the Stc `rust-tests.txt` entries for these cases. +- [ ] **Step 6: Commit** `Add Stc, AstroCoords and StcResourceProfile`, and the list changes as `Run the StcResourceProfile fixtures`. + +### Task 4: The other Stc classes, and casting within the Stc hierarchy + +**Files:** +- Create: `StcSearchLocation.java`, `StcCatalogEntryLocation.java`, `StcObsDataLocation.java` +- Modify: `Region.java` (`cast`: `obj.getClass().isInstance(this)` in place of `getClass() == obj.getClass()`), `ObjectRegistry.java`, `JniastApiTest.java`, `stc_probe.c` and its output (`checkStcObsDump`, a cast between Stc classes through `astFindFrame`), `docs/rust-c-differences.md` (the "Casting a Region into the class of another Region" entry) +- Test: `RegionStcOracleTest` (cases `search`, `catalog_entry`, `obs_data_without_obs`, `obs_data`, `full_dumps_match_c`, `c_dumps_read_back_as_c_reads_them`; the filter removed), `StcProbeTest` (`checkStcObsDump`, the cast rows), `StcTest` (jniast's `testConstructors`; `testReads` and `testChandra` need XmlChan and are not translated, the class Javadoc says so) + +**Interfaces:** +- Consumes: Task 3. +- Produces: the three public classes; `StcObsDataLocation`'s package-private `setObs(PointList)` (C's `astStcSetObs`, sharing the PointList as C's clone does). + +- [ ] **Step 1: Extend** the probe, and write the failing tests named under Files. +- [ ] **Step 2: Run** `mvn test -Dtest='RegionStcOracleTest,StcProbeTest,StcTest'` — Expected: FAIL. +- [ ] **Step 3: Implement** from `stcsearchlocation.c`, `stccatalogentrylocation.c` and `stcobsdatalocation.c` (`ObsLoc` written only when present, copied in Copy, not compared by Equal, as C installs no Equal), and the `cast` change; casting between sibling Stc classes stays null in Java where C's truncating cast reads past the smaller object (the `docs/rust-c-differences.md` entry says so). +- [ ] **Step 4: Run** the Step 2 command, `mvn test -Dast.writeDeferred=true` and then `mvn -q test` — Expected: PASS; the list diff removes only the remaining Stc entries. +- [ ] **Step 5: Commit** `Add the other Stc classes`. + +### Task 5: Sweep and report + +**Files:** +- Modify: the deferred lists, the Javadoc deferral notes that remain (`SwitchMapTest`, `EqualTest`, `RateOracleTest`, `ObjectIdOracleTest`, `RegionsTest`, `RegionsCTest`, `SwitchMap`, `CmpFrame`), `NativeStream.java` and `ObjectRegistry.java` comments, `docs/rust-c-differences.md` +- Create: `docs/reports/2026-11-19-phase8-report.md`, `docs/reports/2026-11-19-phase8-rulings.md` + +- [ ] **Step 1: Sweep:** `rg` the Rust `tests/` directory and the test sources for SelectorMap, Stc, AstroCoords and `remove_regions`; each test is translated or listed with a reason; `rust-tests.txt` keeps only `error_ellipse_licence_is_still_needed` of this phase's entries; `mvn test -Dast.writeDeferred=true` changes nothing. +- [ ] **Step 2: Write the report** in the layout of `docs/reports/2026-11-19-phase7-report.md`: what was ported, the gates and their counts, the deferred-list changes, the C defects found (reported to the user only, never to GitHub), the gaps, and what the next phase takes (spec item 7, Plot, after it is ported in Rust); and the rulings file, citing commits by subject. +- [ ] **Step 3: Run** `mvn -q verify` and `mvn -q test -Djvm=/opt/homebrew/opt/openjdk@27/libexec/openjdk.jdk/Contents/Home/bin/java` — Expected: PASS. +- [ ] **Step 4: Commit** `Sweep the deferred lists after phase 8` and `Report phase 8`. diff --git a/src/main/java/uk/ac/starlink/ast/AstroCoords.java b/src/main/java/uk/ac/starlink/ast/AstroCoords.java new file mode 100644 index 0000000..8ab5c9f --- /dev/null +++ b/src/main/java/uk/ac/starlink/ast/AstroCoords.java @@ -0,0 +1,146 @@ +package uk.ac.starlink.ast; + +/** + * Represents an {@code AstroCoords} element from the Space-Time Coordinate (STC) metadata. This + * class is used in place of AST's {@link KeyMap} for user-visible cases where the KeyMap's purpose + * is to represent an {@code AstroCoords} element, since it is easier for programmers and more + * typesafe. Note however that it does not have all the complexity of an STC {@code AstroCoords} + * element, only those parts which are required for its use with the AST {@link Stc} classes. + * + *

An AstroCoords holds the arrays and Regions it is given, not copies of them; an {@link Stc} + * made from it holds copies. + * + *

Ported from jniast's {@code AstroCoords}. + */ +public class AstroCoords { + + private String[] name; + private Region value; + private Region error; + private Region resolution; + private Region size; + private Region pixSize; + + /** Constructor. */ + public AstroCoords() {} + + /** + * Constructor which allows specification of axis names. + * + * @param axisNames array of names for each axis in the coordinate system of the corresponding + * {@code Region} + */ + public AstroCoords(String[] axisNames) { + this.name = axisNames; + } + + /** + * Sets the axis names. + * + * @param axisNames array of names for each axis in the coordinate system of the corresponding + * {@code Region} + */ + public void setName(String[] axisNames) { + this.name = axisNames; + } + + /** + * Returns the axis names. + * + * @return array of names for each axis in the coordinate system of the corresponding {@code + * Region} + */ + public String[] getName() { + return name; + } + + /** + * Sets the value of this coordinate. + * + * @param value value region + */ + public void setValue(Region value) { + this.value = value; + } + + /** + * Returns the value of this coordinate. + * + * @return value region + */ + public Region getValue() { + return value; + } + + /** + * Sets the error region for this coordinate. + * + * @param error error region + */ + public void setError(Region error) { + this.error = error; + } + + /** + * Returns the error region for this coordinate. + * + * @return error region + */ + public Region getError() { + return error; + } + + /** + * Sets the resolution region for this coordinate. + * + * @param resolution resolution region + */ + public void setResolution(Region resolution) { + this.resolution = resolution; + } + + /** + * Returns the resolution region for this coordinate. + * + * @return resolution region + */ + public Region getResolution() { + return resolution; + } + + /** + * Sets the size region for this coordinate. + * + * @param size size region + */ + public void setSize(Region size) { + this.size = size; + } + + /** + * Returns the size region for this coordinate. + * + * @return size region + */ + public Region getSize() { + return size; + } + + /** + * Sets the pixel size for this coordinate. + * + * @param pixSize pixel size + */ + public void setPixSize(Region pixSize) { + this.pixSize = pixSize; + } + + /** + * Returns the pixel size for this coordinate. + * + * @return pixel size + */ + public Region getPixSize() { + return pixSize; + } +} diff --git a/src/main/java/uk/ac/starlink/ast/CmpFrame.java b/src/main/java/uk/ac/starlink/ast/CmpFrame.java index a2d26d8..fc25530 100644 --- a/src/main/java/uk/ac/starlink/ast/CmpFrame.java +++ b/src/main/java/uk/ac/starlink/ast/CmpFrame.java @@ -30,8 +30,7 @@ * values. * *

Ported from C {@code cmpframe.c}, with Rust {@code frames/cmpframe.rs}. The Plot methods of - * C's CmpFrame ({@code Abbrev}, {@code Centre}, {@code Fields}, {@code Gap}) and its Region - * handling ({@code RemoveRegions}) are not ported. + * C's CmpFrame ({@code Abbrev}, {@code Centre}, {@code Fields}, {@code Gap}) are not ported. */ public class CmpFrame extends Frame { @@ -214,6 +213,27 @@ Mapping[] decomposeInto(boolean[] flags) { return new Mapping[] {frame1, frame2}; } + /** + * cmpframe.c {@code RemoveRegions}: removes the Regions from both component Frames. When + * neither changed it is the CmpFrame itself; otherwise it is a copy of the CmpFrame, of the same + * class, keeping its attributes, that holds the new components. A component that did not change + * is the original's own, shared, as C's copy holds a clone of it, so that a change made to it + * through either CmpFrame, such as an axis Label, is seen in both. + */ + @Override + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // C compares the pointers. + Frame removeRegions() { + Frame new1 = frame1.removeRegions(); + Frame new2 = frame2.removeRegions(); + if (new1 == frame1 && new2 == frame2) { + return this; + } + CmpFrame result = (CmpFrame) copy(); + result.frame1 = keptComponent(new1, frame1); + result.frame2 = keptComponent(new2, frame2); + return result; + } + /** The first component Frame, the CmpFrame's own (C's {@code frame1}). */ final Frame firstFrame() { return frame1; diff --git a/src/main/java/uk/ac/starlink/ast/CmpMap.java b/src/main/java/uk/ac/starlink/ast/CmpMap.java index 8b0037c..da39b58 100644 --- a/src/main/java/uk/ac/starlink/ast/CmpMap.java +++ b/src/main/java/uk/ac/starlink/ast/CmpMap.java @@ -606,6 +606,56 @@ boolean getInvert2() { return invert2; } + /** + * cmpmap.c {@code RemoveRegions}: removes the Regions from both components. When neither + * changed it is the CmpMap itself. Otherwise each component result that is a Frame becomes a + * UnitMap, whether or not that component changed; a series CmpMap with a UnitMap component + * becomes a copy of the other component, with the Invert value the CmpMap records for it and + * inverted again if the CmpMap is inverted; a parallel CmpMap of two UnitMaps becomes one + * UnitMap; and any other is a copy of the CmpMap holding the new components. A component that + * did not change is the original's own, shared, as C's copy holds a clone of it. + */ + @Override + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // C compares the pointers. + Mapping removeRegions() { + Mapping new1 = map1.removeRegions(); + Mapping new2 = map2.removeRegions(); + if (new1 == map1 && new2 == map2) { + return this; + } + new1 = frameToUnitMap(new1); + new2 = frameToUnitMap(new2); + boolean unit1 = new1 instanceof UnitMap; + boolean unit2 = new2 instanceof UnitMap; + if (series) { + if (unit1) { + return invertedCopy(new2, invert2); + } + if (unit2) { + return invertedCopy(new1, invert1); + } + } else if (unit1 && unit2) { + return new UnitMap(new1.getNin() + new2.getNin()); + } + CmpMap result = (CmpMap) copy(); + result.map1 = keptComponent(new1, map1); + result.map2 = keptComponent(new2, map2); + return result; + } + + /** + * A copy of the component {@code map} with the Invert value {@code invert}, inverted again if + * the CmpMap is inverted: what remains of a series CmpMap whose other component is a UnitMap. + */ + private Mapping invertedCopy(Mapping map, boolean invert) { + Mapping result = (Mapping) map.copy(); + result.setInvert(invert); + if (getInvert()) { + result.invert(); + } + return result; + } + // ------------------------------------------------------------------ // Transformation // ------------------------------------------------------------------ diff --git a/src/main/java/uk/ac/starlink/ast/Ellipse.java b/src/main/java/uk/ac/starlink/ast/Ellipse.java index 3c00116..95bc7f0 100644 --- a/src/main/java/uk/ac/starlink/ast/Ellipse.java +++ b/src/main/java/uk/ac/starlink/ast/Ellipse.java @@ -544,10 +544,48 @@ boolean regPins(double[][] pset, Region pointUnc, boolean[] mask) { * the centre, where C reads beyond its arrays */ static Ellipse bestEllipse(double[][] mesh, double[] cen, Region unc) { + Frame frm = unc.regFrame(); + double[] axis = bestPrimaryAxis(mesh, cen, frm); + if (axis == null) { + return null; + } + double at = axis[0]; + double mx = axis[1]; + int np = mesh[0].length; + double[] pa = new double[2]; + frm.offset2(cen, at, mx, pa); + double[][] ps2 = frm.resolvePoints(cen, pa, mesh, np); + double smn = 0.0; + double sw = 0.0; + for (int ip = 0; ip < np; ip++) { + double t = secondaryEstimate(mx, ps2[0][ip], ps2[1][ip]); + if (t != AST__BAD) { + smn += t; + sw += Math.abs(ps2[1][ip]); + } + } + if (sw > 0) { + double mn = smn / sw; + double[] pb = new double[2]; + frm.offset2(cen, at + PIBY2, mn, pb); + return new Ellipse(frm, 0, cen, pa, pb, unc); + } + return null; + } + + /** + * The primary axis of {@link #bestEllipse}'s fit: its direction at the centre, as {@link + * Frame#offset2} takes it, and its half-length. A separate method so that {@code + * RegionStcOracleTest} can bound the rounding of the fit from the half-length it used. + * + * @return {@code {direction, half-length}}, or null if the quadratic cannot be found + * @throws AstException with status {@code AST__INTER} if every point of the mesh is bad or at + * the centre + */ + static double[] bestPrimaryAxis(double[][] mesh, double[] cen, Frame frm) { int np = mesh[0].length; double[] dist = new double[np]; double[] ang = new double[np]; - Frame frm = unc.regFrame(); double[] p = new double[2]; int ip; for (ip = 0; ip < np; ip++) { @@ -632,38 +670,28 @@ static Ellipse bestEllipse(double[][] mesh, double[] cen, Region unc) { double c1 = (qd * qc - qa * qf) / den; double c2 = (qa * qe - qd * qb) / den; double c0 = r1 - c1 * t1 - c2 * t1 * t1; - double mx; - double at; if (c2 < 0.0) { - mx = (4 * c0 * c2 - c1 * c1) / (4 * c2); - at = a0 - c1 / (2 * c2); - } else { - mx = r2; - at = a0 - t2; + return new double[] {a0 - c1 / (2 * c2), (4 * c0 * c2 - c1 * c1) / (4 * c2)}; } - double[] pa = new double[2]; - frm.offset2(cen, at, mx, pa); - double[][] ps2 = frm.resolvePoints(cen, pa, mesh, np); - double smn = 0.0; - double sw = 0.0; - for (ip = 0; ip < np; ip++) { - double px = ps2[0][ip]; - double py = ps2[1][ip]; - if (px != AST__BAD && py != AST__BAD) { - double dd = mx * mx - px * px; - if (dd > 0.0) { - smn += Math.abs(mx * py * py) / Math.sqrt(dd); - sw += Math.abs(py); - } - } + return new double[] {a0 - t2, r2}; + } + + /** + * The secondary half-length a mesh point gives {@link #bestEllipse}, from its components + * {@code px} along and {@code py} across the primary axis of half-length {@code mx}: {@code + * |mx py^2| / sqrt(mx^2 - px^2)}, or {@link #AST__BAD} if either component is bad or {@code + * mx^2 - px^2} is not positive. The fit's secondary half-length is the mean of these, + * weighted by {@code |py|}. A separate method for the reason {@link #bestPrimaryAxis} gives. + */ + static double secondaryEstimate(double mx, double px, double py) { + if (px == AST__BAD || py == AST__BAD) { + return AST__BAD; } - if (sw > 0) { - double mn = smn / sw; - double[] pb = new double[2]; - frm.offset2(cen, at + PIBY2, mn, pb); - return new Ellipse(frm, 0, cen, pa, pb, unc); + double dd = mx * mx - px * px; + if (dd > 0.0) { + return Math.abs(mx * py * py) / Math.sqrt(dd); } - return null; + return AST__BAD; } // ------------------------------------------------------------------ diff --git a/src/main/java/uk/ac/starlink/ast/Frame.java b/src/main/java/uk/ac/starlink/ast/Frame.java index 9d24c95..3c38666 100644 --- a/src/main/java/uk/ac/starlink/ast/Frame.java +++ b/src/main/java/uk/ac/starlink/ast/Frame.java @@ -583,6 +583,16 @@ MapSplit splitOff(int[] in) { return new MapSplit(in.clone(), pickAxes(in.length, axes1, null)); } + /** + * mapping.c {@code RemoveRegions}, which frame.c inherits: the Frame itself. The result of a + * Frame is a Frame for every class (a Region gives its current Frame, a CmpFrame and a FrameSet + * themselves or copies of themselves), which a CmpFrame relies on for its components. + */ + @Override + Frame removeRegions() { + return this; + } + // ------------------------------------------------------------------ // Axes // ------------------------------------------------------------------ diff --git a/src/main/java/uk/ac/starlink/ast/FrameSet.java b/src/main/java/uk/ac/starlink/ast/FrameSet.java index c53560f..4257346 100644 --- a/src/main/java/uk/ac/starlink/ast/FrameSet.java +++ b/src/main/java/uk/ac/starlink/ast/FrameSet.java @@ -374,6 +374,49 @@ void deepCopy() { integrityMethod = ""; } + /** + * frameset.c {@code RemoveRegions}, for the FrameSet as a Frame and as a Mapping alike: removes + * the Regions from every Mapping between nodes and every Frame. A Mapping that changed and is + * now a Frame becomes a UnitMap; one that did not change is kept as it is, a Frame included; a + * Frame that is a Region becomes a copy of its current Frame. When none changed it is the + * FrameSet itself; otherwise it is a copy of the FrameSet, keeping its attributes, that holds + * the new Frames and Mappings. Those that did not change are the original's own, shared, as + * C's copy holds clones of them, so that a change made to one through either FrameSet is seen + * in both. + */ + @Override + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // C compares the pointers. + Frame removeRegions() { + boolean changed = false; + int nmap = nnode - 1; + Mapping[] newmaps = new Mapping[nmap]; + for (int i = 0; i < nmap; i++) { + newmaps[i] = maps[i].removeRegions(); + if (newmaps[i] != maps[i]) { + changed = true; + newmaps[i] = frameToUnitMap(newmaps[i]); + } + } + Frame[] newfrms = new Frame[nframe]; + for (int i = 0; i < nframe; i++) { + newfrms[i] = frames[i].removeRegions(); + if (newfrms[i] != frames[i]) { + changed = true; + } + } + if (!changed) { + return this; + } + FrameSet result = (FrameSet) copy(); + for (int i = 0; i < nmap; i++) { + result.maps[i] = keptComponent(newmaps[i], maps[i]); + } + for (int i = 0; i < nframe; i++) { + result.frames[i] = keptComponent(newfrms[i], frames[i]); + } + return result; + } + // ------------------------------------------------------------------ // Frames, Base and Current // ------------------------------------------------------------------ diff --git a/src/main/java/uk/ac/starlink/ast/Mapping.java b/src/main/java/uk/ac/starlink/ast/Mapping.java index 925a176..7c91f26 100644 --- a/src/main/java/uk/ac/starlink/ast/Mapping.java +++ b/src/main/java/uk/ac/starlink/ast/Mapping.java @@ -588,6 +588,41 @@ int mapMerge(MergeList list, int where, boolean series) { return -1; } + /** + * The neighbour step of selectormap.c and switchmap.c {@code MapMerge}, the same code in both: + * if the Mapping after {@code where} in the list is a {@code kind}, or failing that the one + * before it, that neighbour is inverted for the duration and compared with {@code map} ({@link + * #astEqual}, each with its own Invert attribute), and if they are equal the pair is replaced + * by a UnitMap of the lower one's number of inputs. + * + * @param map the Mapping at {@code where}, a {@code kind} + * @param kind the class whose neighbour cancels {@code map} + * @return {@code where} if the pair was replaced, or -1 + */ + static int cancelWithNeighbour(Mapping map, MergeList list, int where, Class kind) { + int ilo; + if (where < list.size() - 1 && kind.isInstance(list.map(where + 1))) { + ilo = where; + } else if (where > 0 && kind.isInstance(list.map(where - 1))) { + ilo = where - 1; + } else { + return -1; + } + Mapping neb = list.map(ilo == where ? where + 1 : where - 1); + neb.invert(); + boolean equal; + try { + equal = map.astEqual(neb); + } finally { + neb.invert(); + } + if (!equal) { + return -1; + } + list.replacePairWith(ilo, new UnitMap(list.map(ilo).getNin()), false); + return where; + } + /** * Simplifies a Mapping, eliminating redundant computational steps or merging separate steps * that can be performed more efficiently in a single operation, as C's {@code astSimplify} @@ -1236,6 +1271,49 @@ boolean mapList(boolean series, boolean invert, List maps, List T keptComponent(T now, T old) { + if (now == old) { + now.markShared(); + } + return now; + } + // ------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------ diff --git a/src/main/java/uk/ac/starlink/ast/ObjectRegistry.java b/src/main/java/uk/ac/starlink/ast/ObjectRegistry.java index 8e117de..d088045 100644 --- a/src/main/java/uk/ac/starlink/ast/ObjectRegistry.java +++ b/src/main/java/uk/ac/starlink/ast/ObjectRegistry.java @@ -86,6 +86,8 @@ static Loader loader(String className) { return Prism::new; case "RateMap": return RateMap::new; + case "SelectorMap": + return SelectorMap::new; case "ShiftMap": return ShiftMap::new; case "SkyAxis": @@ -102,6 +104,14 @@ static Loader loader(String className) { return SpecMap::new; case "SphMap": return SphMap::new; + case "StcCatalogEntryLocation": + return StcCatalogEntryLocation::new; + case "StcObsDataLocation": + return StcObsDataLocation::new; + case "StcResourceProfile": + return StcResourceProfile::new; + case "StcSearchLocation": + return StcSearchLocation::new; case "SwitchMap": return SwitchMap::new; case "TimeFrame": @@ -137,6 +147,13 @@ static boolean isRegistered(String className) { static AstObject load(NativeNode node) { Loader loader = loader(node.className); if (loader == null) { + if ("Stc".equals(node.className)) { + // C reads an Stc of the class Stc itself (astLoadStc); jniast's Stc is abstract. + throw Ast.err( + AstException.AST__LDERR, + "astLoadStc(Stc): An Object of the abstract class Stc cannot be read; only its " + + "subclasses can."); + } throw Ast.err(AstException.AST__LDERR, "unknown AST class: " + node.className); } return loader.load(node); diff --git a/src/main/java/uk/ac/starlink/ast/RateMap.java b/src/main/java/uk/ac/starlink/ast/RateMap.java index 83e0d0a..1e83537 100644 --- a/src/main/java/uk/ac/starlink/ast/RateMap.java +++ b/src/main/java/uk/ac/starlink/ast/RateMap.java @@ -168,6 +168,27 @@ boolean getRecordedInvert() { return invert; } + /** + * ratemap.c {@code RemoveRegions}: removes the Regions from the encapsulated Mapping. When it + * did not change it is the RateMap itself; otherwise it is a copy of the RateMap holding the new + * Mapping, which, if it is a Frame, is replaced by a UnitMap with as many coordinates as the + * RateMap has inputs. + */ + @Override + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // C compares the pointers. + Mapping removeRegions() { + Mapping newmap = map.removeRegions(); + if (newmap == map) { + return this; + } + if (newmap instanceof Frame) { + newmap = new UnitMap(getNin()); + } + RateMap result = (RateMap) copy(); + result.map = newmap; + return result; + } + /** The zero-based index of the encapsulated Mapping's input that is varied. */ int getIin() { return iin; diff --git a/src/main/java/uk/ac/starlink/ast/Region.java b/src/main/java/uk/ac/starlink/ast/Region.java index 9ce5d28..96280f0 100644 --- a/src/main/java/uk/ac/starlink/ast/Region.java +++ b/src/main/java/uk/ac/starlink/ast/Region.java @@ -253,7 +253,10 @@ String dumpComment() { /** * Writes the Region class's part of a description, as C's {@code Dump} (region.c) does, after - * the Frame part, which describes the current Frame: Negate, Fill, MeshSz, Closed and Adapt; + * the Frame part, which describes the current Frame: Negate, Fill, MeshSz, Closed and Adapt, + * each the value held by the Region class itself where it is set, and otherwise the value the + * class's accessor gives, so that a class reading these attributes from elsewhere (an Stc + * reads its encapsulated Region's) still writes its own settings; * the current Frame ({@code Frm}) if the Mapping from the base Frame is a UnitMap, unless * RegionFS is zero, and otherwise the FrameSet ({@code FrmSet}); RegFS; the defining points or * the number of axes; and the uncertainty, if one is set. @@ -262,18 +265,18 @@ String dumpComment() { void dump(NativeNode node) { super.dump(node); node.writeIsA("Frame", "Coordinate system description"); - boolean set; - int ival = getNegated() ? 1 : 0; + boolean set = negated != UNSET; + int ival = set ? negated : (getNegated() ? 1 : 0); node.writeInt("Negate", ival != 0, false, ival, ival != 0 ? "Region negated" : "Region not negated"); - set = testFillFactor(); - node.writeDouble("Fill", set, false, getFillFactor(), "Region fill factor"); - set = testMeshSize(); - node.writeInt("MeshSz", set, false, getMeshSize(), "No. of points used to represent boundary"); - set = testClosed(); - ival = getClosed() ? 1 : 0; + set = fillFactor != AST__BAD; + node.writeDouble("Fill", set, false, set ? fillFactor : getFillFactor(), "Region fill factor"); + set = meshSize != UNSET; + node.writeInt("MeshSz", set, false, set ? meshSize : getMeshSize(), "No. of points used to represent boundary"); + set = closed != UNSET; + ival = set ? closed : (getClosed() ? 1 : 0); node.writeInt("Closed", set, false, ival, ival != 0 ? "Boundary is inside" : "Boundary is outside"); - set = testAdaptive(); - ival = getAdaptive() ? 1 : 0; + set = adaptive != UNSET; + ival = set ? adaptive : (getAdaptive() ? 1 : 0); node.writeInt( "Adapt", ival != 0 || set, @@ -936,6 +939,16 @@ public Frame getRegionFrame() { return (Frame) frameset.getFrame(FrameSet.AST__CURRENT).copy(); } + /** + * region.c {@code RemoveRegions}: a copy of the Frame the Region represents ({@link + * #getRegionFrame}), for a Region of every class. A container holding Mappings replaces it with a + * UnitMap. + */ + @Override + Frame removeRegions() { + return getRegionFrame(); + } + /** A copy of the encapsulated FrameSet (C's {@code astGetRegionFrameSet}). */ FrameSet regionFrameSet() { return (FrameSet) frameset.copy(); @@ -2117,13 +2130,17 @@ final Region parentSimplify() { /** * This Region cast into the class of another Frame (C's {@code Cast}, region.c): a copy if - * {@code obj} is a Region of this class, null for a Region of another class, and otherwise the - * current Frame cast into the class of {@code obj}. + * {@code obj} is a Region and this Region's class is the class of {@code obj} or a subclass of + * it, null for a Region of any other class, and otherwise the current Frame cast into the class + * of {@code obj}. The copy keeps this Region's own class; since jniast's Stc is abstract, no + * concrete Region class of this library is a subclass of another, so the copy is always of the + * class of {@code obj}. C's {@code Cast} differs for a Region {@code obj}; see {@code + * docs/rust-c-differences.md}. */ @Override Frame cast(Frame obj) { if (obj instanceof Region) { - return obj.getClass() == getClass() ? (Frame) copy() : null; + return obj.getClass().isInstance(this) ? (Frame) copy() : null; } return frameset.getFrame(FrameSet.AST__CURRENT).cast(obj); } diff --git a/src/main/java/uk/ac/starlink/ast/SelectorMap.java b/src/main/java/uk/ac/starlink/ast/SelectorMap.java new file mode 100644 index 0000000..f6acc41 --- /dev/null +++ b/src/main/java/uk/ac/starlink/ast/SelectorMap.java @@ -0,0 +1,334 @@ +package uk.ac.starlink.ast; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * A Mapping that locates positions within one of a set of alternate Regions. + * + *

A SelectorMap is a Mapping that identifies which Region contains a given input position. + * + *

A SelectorMap encapsulates a number of Regions that all have the same number of axes and + * represent the same coordinate Frame. The number of inputs (Nin attribute) of the SelectorMap + * equals the number of axes spanned by one of the encapsulated Regions. All SelectorMaps have only + * a single output. SelectorMaps do not define an inverse transformation. + * + *

For each input position, the forward transformation of a SelectorMap searches through the + * encapsulated Regions (in the order supplied when the SelectorMap was created) until a Region is + * found which contains the input position. The index associated with this Region is returned as the + * SelectorMap output value (the index value is the position of the Region within the list of + * Regions supplied when the SelectorMap was created, starting at 1 for the first Region). If an + * input position is not contained within any Region, a value of zero is returned by the forward + * transformation. + * + *

If a compound Mapping contains a SelectorMap in series with its own inverse, the combination + * of the two adjacent SelectorMaps will be replaced by a UnitMap when the compound Mapping is + * simplified using {@link #simplify}. As C's does, simplification does not compare the Invert + * attributes, so two equal SelectorMaps of one input applied in series, both forward, are also + * replaced by a UnitMap, though their transformation is not a unit one: a bug in C, kept. + * + *

In practice, SelectorMaps are often used in conjunction with {@link SwitchMap}s. + * + *

A SelectorMap holds copies of the Regions it is given. As C's does, it tests a position + * against each Region by negating the Region and reversing its Closed attribute for the duration, + * so transforming points changes its own Regions while it runs, and afterwards leaves each with the + * Negated and Closed attributes set (to the values they had). Its description then shows the Closed + * value of every Region, but Negated only for a Region that is negated, since a Region's + * description shows Negated only when it is true. Like every Object, a SelectorMap is not safe for + * use by two threads at once, even to transform points. + * + *

Ported from Rust {@code mappings/selectormap.rs} and C {@code selectormap.c}. + */ +public class SelectorMap extends Mapping { + + /** The Regions, copies of those given (C's {@code reg}). */ + private Region[] regs; + + /** The output value for an input position bad on any axis (C's {@code badval}). */ + private final double badval; + + /** + * Creates a SelectorMap. + * + * @param regs the Regions. All the supplied Regions must relate to the same coordinate Frame. + * The number of axes in this coordinate Frame defines the number of inputs for the + * SelectorMap. The SelectorMap holds copies of them. + * @param badval the value to be returned by the forward transformation of the SelectorMap for + * any input positions that have a bad ({@link #AST__BAD}) value on any axis + * @throws NullPointerException if {@code regs} or one of its Regions is null + * @throws AstException with status {@code AST__BDPAR} if no Regions are given, or {@code + * AST__BADNI} if a Region does not refer to the same coordinate Frame as the first + */ + public SelectorMap(Region[] regs, double badval) { + this(check(regs), regs, badval); + } + + /** + * C's {@code astInitSelectorMap} (selectormap.c), once {@link #check} has given the number of + * inputs: one output, the forward transformation only, and copies of the Regions. + */ + private SelectorMap(int nin, Region[] regs, double badval) { + super(nin, 1, true, false); + this.regs = new Region[regs.length]; + for (int i = 0; i < regs.length; i++) { + this.regs[i] = (Region) regs[i].copy(); + } + this.badval = badval; + } + + /** + * The number of inputs of a SelectorMap of these Regions, the first Region's, after the checks + * C's {@code astSelectorMap} and {@code astInitSelectorMap} make, in their order: no Regions is + * {@code AST__BDPAR}, and the first Region whose Frame ({@code astRegFrame}) is not equal to + * the first Region's is {@code AST__BADNI}. A null array or Region is refused first. + */ + private static int check(Region[] regs) { + Objects.requireNonNull(regs, "regs"); + for (int i = 0; i < regs.length; i++) { + Objects.requireNonNull(regs[i], "regs[" + i + "]"); + } + int nreg = regs.length; + if (nreg <= 0) { + throw Ast.err( + AstException.AST__BDPAR, + "astSelectorMap(SelectorMap): Bad number of Regions (" + nreg + ") specified."); + } + Frame f0 = regs[0].regFrame(); + for (int i = 1; i < nreg; i++) { + if (!regs[i].regFrame().astEqual(f0)) { + throw Ast.err( + AstException.AST__BADNI, + "astInitSelectorMap(SelectorMap): Region number " + (i + 1) + + " does not refer to the same coordinate Frame as the first Region."); + } + } + return regs[0].getNin(); + } + + /** + * Loads a SelectorMap from its description, as C's {@code astLoadSelectorMap} does: {@code + * Reg1}, {@code Reg2} and so on until a Region is missing, then {@code BadVal} ({@link + * #AST__BAD} if absent). A later Region written without its Frame, which reads with a stand-in + * FrameSet ({@link Region#regDummyFS}), is given the first Region's FrameSet ({@link + * Region#setRegFS}). As in C, the Regions' Frames are not compared. + * + * @throws AstException with status {@code AST__LDERR} if a component is not a Region or there + * is no Region; C fails on a description without Regions too, with {@code AST__OBJIN}, when + * it releases the first Region's FrameSet, which it never obtained + */ + SelectorMap(NativeNode node) { + super(node); + NativeNode part = node.section("SelectorMap"); + List list = new ArrayList<>(); + FrameSet fs = null; + while (true) { + String key = "Reg" + (list.size() + 1); + NativeNode desc = part.readObject(key); + if (desc == null) { + break; + } + AstObject obj = ObjectRegistry.loadNested(desc, key); + if (!(obj instanceof Region)) { + throw Ast.err( + AstException.AST__LDERR, + "astLoadSelectorMap(SelectorMap): The component " + key + " is a " + obj.astClass() + + ", not a Region."); + } + Region reg = (Region) obj; + if (list.isEmpty()) { + fs = reg.getRegFS(); + } else if (reg.regDummyFS()) { + reg.setRegFS(fs); + } + list.add(reg); + } + if (list.isEmpty()) { + throw Ast.err( + AstException.AST__LDERR, "astLoadSelectorMap(SelectorMap): The SelectorMap holds no Regions."); + } + regs = list.toArray(new Region[0]); + badval = part.readDouble("BadVal", AST__BAD); + } + + @Override + String dumpComment() { + return "Region identification Mapping"; + } + + /** + * Writes each Region, the second and later without their Frame, which the first Region's + * gives them all when read back, and the bad value if it is not {@link #AST__BAD}, as C's + * {@code Dump} (selectormap.c) does: each later Region's RegionFS is set to false while it is + * written and cleared afterwards. + */ + @Override + void dump(NativeNode node) { + super.dump(node); + node.writeIsA("Mapping", "Mapping between coordinate systems"); + for (int i = 0; i < regs.length; i++) { + Region reg = regs[i]; + NativeNode desc; + if (i > 0) { + reg.setRegionFS(false); + try { + desc = NativeNode.of(reg); + } finally { + reg.clearRegionFS(); + } + } else { + desc = NativeNode.of(reg); + } + node.writeObject("Reg" + (i + 1), true, true, desc, "Region of input space"); + } + if (badval != AST__BAD) { + node.writeDouble("BadVal", true, true, badval, "Output value for bad input positions"); + } + } + + /** Gives the copy copies of the Regions, as C's {@code Copy} (selectormap.c) does. */ + @Override + void deepCopy() { + super.deepCopy(); + Region[] copies = new Region[regs.length]; + for (int i = 0; i < regs.length; i++) { + copies[i] = (Region) regs[i].copy(); + } + regs = copies; + } + + // ------------------------------------------------------------------ + // Transformation + // ------------------------------------------------------------------ + + /** + * C's {@code Transform} (selectormap.c). Each output is -1 for a point bad on any input and 0 + * otherwise; then each Region in turn is negated and its Closed attribute reversed, so that its + * transformation makes bad the points inside it, and the points it makes bad that have no index + * yet are given its (one-based) index; its output, in which those points are bad, is what the + * next Region transforms. Each Region's Closed attribute and negation are put back after it + * transforms, so both are left set. Finally -1 becomes the bad value. A transformation in the + * direction the SelectorMap does not define, which the checks refuse, writes nothing, as in C. + */ + @Override + void transformInto(double[][] in, int npoint, boolean forward, double[][] out) { + validateTransformInto(in, npoint, forward, out); + if (!effectiveForward(forward)) { + return; + } + int ncoord = in.length; + double[][] ps1 = new double[ncoord][]; + for (int c = 0; c < ncoord; c++) { + ps1[c] = Arrays.copyOf(in[c], npoint); + } + double[] pout = out[0]; + for (int p = 0; p < npoint; p++) { + boolean bad = false; + for (int c = 0; c < ncoord; c++) { + if (isBad(ps1[c][p])) { + bad = true; + break; + } + } + pout[p] = bad ? -1 : 0; + } + for (int ireg = 1; ireg <= regs.length; ireg++) { + Region reg = regs[ireg - 1]; + reg.negate(); + boolean closed = reg.getClosed(); + reg.setClosedValue(!closed); + try { + double[][] ps2 = reg.transform(ps1, npoint, true); + double[] p2 = ps2[0]; + for (int p = 0; p < npoint; p++) { + if (pout[p] == 0 && p2[p] == AST__BAD) { + pout[p] = ireg; + } + } + ps1 = ps2; + } finally { + reg.setClosedValue(closed); + reg.negate(); + } + } + for (int p = 0; p < npoint; p++) { + if (pout[p] == -1) { + pout[p] = badval; + } + } + } + + // ------------------------------------------------------------------ + // Equality + // ------------------------------------------------------------------ + + /** + * selectormap.c {@code Equal}: {@code that} is a SelectorMap with the same number of inputs as + * each now has, the same number of Regions and a bad value equal to within {@code astEQUAL}, + * whose Regions are equal ({@link #astEqual}) in order. The Invert attributes are not compared, + * so a 1-D SelectorMap is equal to its inverse. + */ + @Override + boolean equalTo(AstObject that) { + if (!(that instanceof SelectorMap)) { + return false; + } + SelectorMap other = (SelectorMap) that; + if (other.getNin() != getNin()) { + return false; + } + int nreg = regs.length; + if (other.regs.length != nreg || !MappingHelpers.astEqual(other.badval, badval)) { + return false; + } + for (int i = 0; i < nreg; i++) { + if (!regs[i].astEqual(other.regs[i])) { + return false; + } + } + return true; + } + + // ------------------------------------------------------------------ + // Simplification + // ------------------------------------------------------------------ + + /** + * selectormap.c {@code MapMerge}. If simplifying any Region gives a different Region, the + * SelectorMap is replaced by a new one of the simplified Regions, applied as the list applies + * this one. Otherwise, in series, the SelectorMap after it in the list, or failing that the + * one before it, is inverted, compared with it ({@link #astEqual}) and inverted back; if they + * are equal the pair is replaced by a UnitMap of the lower one's number of inputs. As {@code + * Equal} does not compare the Invert attributes, two equal 1-D SelectorMaps applied in the same + * direction are replaced too, though their transformation is not a unit one. + */ + // C compares the pointers: whether astSimplify returned the Region it was given. + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) + @Override + int mapMerge(MergeList list, int where, boolean series) { + int nreg = regs.length; + int result = -1; + Region[] sreg = new Region[nreg]; + boolean simp = false; + for (int i = 0; i < nreg; i++) { + Mapping s = regs[i].simplify(); + if (!(s instanceof Region)) { + throw Ast.err( + AstException.AST__INTER, + "astMapMerge(SelectorMap): Simplifying a " + regs[i].astClass() + " gave a " + s.astClass() + + ", not a Region (internal AST programming error)."); + } + sreg[i] = (Region) s; + simp = simp || sreg[i] != regs[i]; + } + if (simp) { + list.set(where, new SelectorMap(sreg, badval), list.invert(where)); + result = where; + } + if (result == -1 && series) { + result = cancelWithNeighbour(this, list, where, SelectorMap.class); + } + return result; + } +} diff --git a/src/main/java/uk/ac/starlink/ast/Stc.java b/src/main/java/uk/ac/starlink/ast/Stc.java new file mode 100644 index 0000000..08d144a --- /dev/null +++ b/src/main/java/uk/ac/starlink/ast/Stc.java @@ -0,0 +1,945 @@ +package uk.ac.starlink.ast; + +import java.util.Objects; + +/** + * Represents an instance of the IVOA STC class. The Stc class is an implementation of the IVOA STC + * class which forms part of the IVOA Space-Time Coordinate Metadata system. See: + * + *

http://hea-www.harvard.edu/~arots/nvometa/STC.html + * + *

The Stc class does not have a constructor function of its own, as it is simply a container + * class for a family of specialised sub-classes including {@link StcResourceProfile}. + * + *

An Stc encapsulates a copy of the Region it is made from, and covers exactly the points that + * Region covers; a Region that is itself an Stc is replaced by its own encapsulated Region, mapped + * into the coordinate system it represents. The Negated, Closed, MeshSize and FillFactor + * attributes are read from the encapsulated Region, and setting or clearing one on the Stc sets or + * clears it on both. Transforming points with an Stc, or asking whether it is bounded, sets the + * encapsulated Region's Negated attribute to the value it already has, so that Negated then reads + * as set on the Stc, as it does in C. The read-only RegionClass attribute is the class of the + * encapsulated Region. + * + *

An Stc also holds a list of AstroCoords elements, each a copy of the description given, with + * each Region it holds mapped into the coordinate system of the encapsulated Region. A Frame + * attribute set through an Stc that is not Adaptive is set on the encapsulated Region and on each + * of these Regions too; one cleared is cleared on the encapsulated Region only. + * + *

Ported from C {@code stc.c}, with Rust {@code regions/stc.rs}. + */ +public abstract class Stc extends Region { + + /** The AstroCoords key for the axis names, a vector of strings (C's {@code AST__STCNAME}). */ + static final String AST__STCNAME = "Name"; + + /** The AstroCoords key for the value, a Region (C's {@code AST__STCVALUE}). */ + static final String AST__STCVALUE = "Value"; + + /** The AstroCoords key for the error, a Region (C's {@code AST__STCERROR}). */ + static final String AST__STCERROR = "Error"; + + /** The AstroCoords key for the resolution, a Region (C's {@code AST__STCRES}). */ + static final String AST__STCRES = "Resolution"; + + /** The AstroCoords key for the size, a Region (C's {@code AST__STCSIZE}). */ + static final String AST__STCSIZE = "Size"; + + /** The AstroCoords key for the pixel size, a Region (C's {@code AST__STCPIXSZ}). */ + static final String AST__STCPIXSZ = "PixSize"; + + /** The AstroCoords keys that may hold a Region, in C's order (stc.c {@code regkey}). */ + private static final String[] REG_KEYS = {AST__STCERROR, AST__STCRES, AST__STCSIZE, AST__STCPIXSZ, AST__STCVALUE}; + + /** The comment stored with each of {@link #REG_KEYS} (stc.c {@code regcom}). */ + private static final String[] REG_COMMENTS = { + "AstroCoords error region", + "AstroCoords resolution region", + "AstroCoords size region", + "AstroCoords pixel size region", + "AstroCoords value region" + }; + + /** + * The encapsulated Region, the Stc's own, describing an area in the Stc's base Frame, which is + * its current Frame (C's {@code region}). + */ + private Region region; + + /** The AstroCoords elements, the Stc's own, each Region in the base Frame (C's {@code coord}). */ + private KeyMap[] coords; + + /** The Region an Stc encapsulates, which {@code astInitStc} makes before the Region part. */ + private static final class Encapsulated { + final Region reg; + + Encapsulated(Region reg) { + this.reg = reg; + } + } + + /** + * Creates an Stc (C's {@code astInitStc}). + * + * @param region the Region to encapsulate: a copy of it is held, or, if it is an Stc, its + * encapsulated Region mapped into the Frame it represents + * @param coords the AstroCoords elements, each a KeyMap with the keys {@link #AST__STCNAME} (a + * name for each axis) and those of {@link #REG_KEYS} (one Region each), or null for none + * @throws NullPointerException if {@code region} or an element of {@code coords} is null + * @throws AstException with status {@code AST__STCKEY} if an AstroCoords element has another + * key, a number of names other than the number of axes, names that are not strings, more + * than one value or a value that is not a Region under another key, or a Region that cannot + * be converted to the coordinate system of the encapsulated Region + */ + Stc(Region region, KeyMap[] coords) { + this(encapsulate(region), coords); + } + + /** The second part of C's {@code astInitStc}, once the Region to encapsulate is made. */ + // C's astInitStc copies the attributes through the class's own setters (astRegOverlay), so + // that the encapsulated Region takes MeshSize and FillFactor too. + @SuppressWarnings({"this-escape", "PMD.ConstructorCallsOverridableMethod"}) + private Stc(Encapsulated e, KeyMap[] coords) { + super(e.reg, null, null); + Region reg = e.reg; + this.region = reg; + this.coords = new KeyMap[0]; + regOverlay(reg, true); + if (reg.testAttrib("ident")) { + setIdent(reg.getIdent()); + } + reg.setRegionFS(false); + if (coords != null && coords.length > 0) { + KeyMap[] made = new KeyMap[coords.length]; + for (int i = 0; i < coords.length; i++) { + Objects.requireNonNull(coords[i], "coords[" + i + "]"); + made[i] = makeAstroCoordsKeyMap(reg, coords[i], astClass()); + } + this.coords = made; + } + } + + /** + * The first part of C's {@code astInitStc}: a copy of {@code region}, or, if it is an Stc, its + * encapsulated Region mapped into the Frame it represents (not simplified). + */ + private static Encapsulated encapsulate(Region region) { + Objects.requireNonNull(region, "region"); + if (region instanceof Stc) { + FrameSet fs = region.getRegFS(); + Mapping map = fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + Frame frm = fs.getFrame(FrameSet.AST__CURRENT); + return new Encapsulated(((Stc) region).region.mapRegionInto(map, frm)); + } + return new Encapsulated((Region) region.copy()); + } + + /** + * A copy of the AstroCoords KeyMap {@code coord}, checked, with each Region it holds mapped + * into the Frame of {@code reg} and simplified where the two Frames differ, and marked as not + * needing its Frame in a description (stc.c {@code MakeAstroCoordsKeyMap}). + */ + private static KeyMap makeAstroCoordsKeyMap(Region reg, KeyMap coord, String cls) { + KeyMap result = (KeyMap) coord.copy(); + int naxes = reg.getNaxes(); + int nkey = result.mapSize(); + String pre = "astInitStc(" + cls + "): "; + for (int j = 0; j < nkey; j++) { + String key = result.mapKey(j); + int nv = result.mapLength(key); + int type = result.mapType(key); + if (!isAstroCoordsKey(key)) { + throw Ast.err( + AstException.AST__STCKEY, pre + "Unknown key \"" + key + "\" supplied in an AstroCoords list."); + } else if (AST__STCNAME.equals(key)) { + if (nv != naxes) { + throw Ast.err( + AstException.AST__STCKEY, + pre + nv + " \"" + key + "\" values supplied in an AstroCoords list, but the Stc has " + + naxes + " axes. "); + } else if (type != KeyMap.AST__STRINGTYPE) { + throw Ast.err( + AstException.AST__STCKEY, + pre + "The \"" + key + "\" values supplied in an AstroCoords list are not character " + + "strings. "); + } + } else if (nv != 1) { + throw Ast.err( + AstException.AST__STCKEY, + pre + nv + " \"" + key + "\" values supplied in an AstroCoords list, but only one is " + + "allowed. "); + } else if (type != KeyMap.AST__OBJECTTYPE) { + throw Ast.err( + AstException.AST__STCKEY, + pre + "The \"" + key + "\" value supplied in an AstroCoords list is not an AST Object " + + "pointer. "); + } else { + AstObject obj = result.mapGet0A(key); + if (obj == null) { + throw Ast.err( + AstException.AST__STCKEY, + pre + "The \"" + key + "\" value supplied in an AstroCoords list is a NULL pointer. "); + } else if (!(obj instanceof Region)) { + throw Ast.err( + AstException.AST__STCKEY, + pre + "The \"" + key + "\" value supplied in an AstroCoords list is a " + obj.astClass() + + ", not a Region. "); + } + Region areg = (Region) obj; + FrameSet fs = areg.convert(reg, ""); + if (fs == null) { + throw Ast.err( + AstException.AST__STCKEY, + pre + "The \"" + key + "\" value supplied in an AstroCoords list cannot be converted to " + + "the coordinate system of its parent Stc object."); + } + Mapping map = fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + if (!isUnitMap(map)) { + Frame frm = fs.getFrame(FrameSet.AST__CURRENT); + Region sareg = (Region) areg.mapRegionInto(map, frm).simplify(); + sareg.setRegionFS(false); + result.mapPut0A(key, sareg, null); + } else { + areg.setRegionFS(false); + } + } + } + return result; + } + + /** Whether {@code key} is one of the six AstroCoords keys. */ + private static boolean isAstroCoordsKey(String key) { + if (AST__STCNAME.equals(key)) { + return true; + } + for (String k : REG_KEYS) { + if (k.equals(key)) { + return true; + } + } + return false; + } + + /** + * Loads an Stc from its description, as C's {@code astLoadStc} does: the Region part, then + * {@code Region}, the encapsulated Region, {@code Ncoord} (0 if absent or below 0) and {@code + * Coord1} to {@code Coord}, the AstroCoords elements. A Region read without its Frame, + * the encapsulated Region or one in an AstroCoords element, is given the base Frame of the + * Stc, and one in an AstroCoords element is stored again with its comment, unless the Stc was + * read without its own Frame, when the Region that holds it gives the encapsulated Region its + * Frame. + * + * @throws AstException with status {@code AST__LDERR} if the encapsulated Region or an + * AstroCoords element is missing or of the wrong class, or an AstroCoords element holds + * something other than a Region under a key that may hold one; C stores a null for a + * missing item, and its load or later use then fails + */ + Stc(NativeNode node) { + super(node); + NativeNode part = node.section("Stc"); + String pre = "astLoadStc(" + astClass() + "): "; + NativeNode desc = part.readObject("Region"); + if (desc == null) { + throw Ast.err(AstException.AST__LDERR, pre + "The encapsulated Region is missing."); + } + AstObject obj = ObjectRegistry.loadNested(desc, "Region"); + if (!(obj instanceof Region)) { + throw Ast.err( + AstException.AST__LDERR, + pre + "The encapsulated Region is a " + obj.astClass() + ", not a Region."); + } + region = (Region) obj; + Frame f1 = baseFrame(); + boolean dummy = regDummyFS(); + if (!dummy && region.regDummyFS()) { + region.setRegFS(f1); + } + int ncoord = Math.max(part.readInt("Ncoord", 0), 0); + coords = new KeyMap[ncoord]; + for (int ico = 1; ico <= ncoord; ico++) { + String key = "Coord" + ico; + desc = part.readObject(key); + if (desc == null) { + throw Ast.err(AstException.AST__LDERR, pre + "The AstroCoords element " + key + " is missing."); + } + obj = ObjectRegistry.loadNested(desc, key); + if (!(obj instanceof KeyMap)) { + throw Ast.err( + AstException.AST__LDERR, + pre + "The AstroCoords element " + key + " is a " + obj.astClass() + ", not a KeyMap."); + } + KeyMap km = (KeyMap) obj; + coords[ico - 1] = km; + if (!dummy) { + for (int ikey = 0; ikey < REG_KEYS.length; ikey++) { + Region creg = coordRegion(km, REG_KEYS[ikey]); + if (creg != null && creg.regDummyFS()) { + creg.setRegFS(f1); + km.mapPut0A(REG_KEYS[ikey], creg, REG_COMMENTS[ikey]); + } + } + } + } + } + + /** + * The Region {@code km} holds under {@code key}, the KeyMap's own, or null if it holds none. + * + * @throws AstException with status {@code AST__LDERR} if it holds an Object that is not a + * Region, which C would go on to use as one + */ + private static Region coordRegion(KeyMap km, String key) { + AstObject[] out = new AstObject[1]; + if (!km.mapGet0A(key, out) || out[0] == null) { + return null; + } + if (!(out[0] instanceof Region)) { + throw Ast.err( + AstException.AST__LDERR, + "astLoadStc: The AstroCoords \"" + key + "\" value is a " + out[0].astClass() + ", not a Region."); + } + return (Region) out[0]; + } + + /** + * Writes the Stc class's part of a description (C's {@code Dump}, stc.c): {@code Region}, the + * encapsulated Region, {@code Ncoord}, set when not zero, and each AstroCoords element. + */ + @Override + void dump(NativeNode node) { + super.dump(node); + node.writeIsA("Region", "An area within a coordinate system"); + node.writeObject("Region", true, true, NativeNode.of(region), "STC Region"); + int ncoord = coords.length; + node.writeInt("Ncoord", ncoord != 0, false, ncoord, "Number of AstroCoords elements"); + for (int ico = 1; ico <= ncoord; ico++) { + node.writeObject("Coord" + ico, true, true, NativeNode.of(coords[ico - 1]), "AstroCoords number " + ico); + } + } + + /** + * Completes a copy as C's {@code Copy} (stc.c) does: the encapsulated Region and each + * AstroCoords element are copied. + */ + @Override + void deepCopy() { + super.deepCopy(); + region = (Region) region.copy(); + KeyMap[] copies = new KeyMap[coords.length]; + for (int i = 0; i < coords.length; i++) { + copies[i] = (KeyMap) coords[i].copy(); + } + coords = copies; + } + + // ------------------------------------------------------------------ + // jniast's public methods + // ------------------------------------------------------------------ + + /** + * Returns the number of AstroCoords elements stored within this {@code Stc} when it was + * constructed. + * + * @return number of coords stored + */ + public int getStcNCoord() { + return coords.length; + } + + /** + * Returns one of the AstroCoords elements stored within this {@code Stc} when it was + * constructed. If the coordinate system represented by this {@code Stc} has been changed since + * it was created (for instance, by changing its System attribute), then the sizes and positions + * in the returned {@code AstroCoords} object will reflect the change in coordinate system. + * + * @param i index of coords to retrieve. The first index is 1. + * @return {@code i}'th coord stored + * @throws AstException with status {@code AST__STCIND} if {@code i} is not from 1 to {@link + * #getStcNCoord} + */ + public AstroCoords getStcCoord(int i) { + return keyMapToAstroCoords(stcCoord(i)); + } + + /** + * Obtain a copy of the encapsulated Region within a Stc. This function returns a deep copy of + * the Region supplied when the Stc was created. + * + * @return A deep copy of the Region encapsulated within the supplied Stc. + */ + public Region getStcRegion() { + return (Region) region.copy(); + } + + /** + * A copy of AstroCoords element {@code icoord}, counting from 1 (C's {@code astGetStcCoord}). + * When the Mapping from the base to the current Frame does not simplify to a UnitMap, each + * Region in it is mapped into the current Frame and simplified, and the axis names are + * removed; each Region in it includes its Frame when written. + * + * @throws AstException with status {@code AST__STCIND} if {@code icoord} is not from 1 to + * {@link #getStcNCoord} + */ + KeyMap stcCoord(int icoord) { + int nc = coords.length; + String cls = astClass(); + if (icoord < 1 || icoord > nc) { + String more; + if (icoord < 1) { + more = "The index of the first AstroCoord element is one, not zero."; + } else if (nc == 0) { + more = "There are no AstroCoords elements in the supplied " + cls + "."; + } else if (nc == 1) { + more = "There is 1 AstroCoords element in the supplied " + cls + "."; + } else { + more = "There are " + nc + " AstroCoords elements in the supplied " + cls + "."; + } + throw Ast.err( + AstException.AST__STCIND, + "astGetStcCoord(" + cls + "): Supplied AstroCoords index (" + icoord + ") is invalid.\n" + more); + } + KeyMap result = (KeyMap) coords[icoord - 1].copy(); + FrameSet fs = getRegFS(); + Mapping smap = fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT).simplify(); + Frame frm = fs.getFrame(FrameSet.AST__CURRENT); + boolean unit = isUnitMap(smap); + if (!unit) { + result.mapRemove(AST__STCNAME); + } + for (String key : REG_KEYS) { + AstObject[] out = new AstObject[1]; + if (result.mapGet0A(key, out) && out[0] instanceof Region) { + Region reg = (Region) out[0]; + reg.setRegionFS(true); + Region srereg = + unit ? reg : (Region) reg.mapRegionInto(smap, frm).simplify(); + result.mapPut0A(key, srereg, null); + } + } + return result; + } + + // ------------------------------------------------------------------ + // jniast's conversions between AstroCoords and KeyMaps + // ------------------------------------------------------------------ + + /** + * Converts an AstroCoords object to an equivalent KeyMap object, which holds the AstroCoords + * object's Regions, not copies: the axis names if there are any, and each Region that is not + * null. + * + * @param astroCoords AstroCoords object + * @return KeyMap object + * @throws NullPointerException if {@code astroCoords} is null + */ + static KeyMap astroCoordsToKeyMap(AstroCoords astroCoords) { + KeyMap kmap = new KeyMap(); + String[] axisNames = astroCoords.getName(); + if (axisNames != null && axisNames.length > 0) { + kmap.mapPut1C(AST__STCNAME, axisNames, "STC axis names"); + } + Region value = astroCoords.getValue(); + if (value != null) { + kmap.mapPut0A(AST__STCVALUE, value, "STC value"); + } + Region error = astroCoords.getError(); + if (error != null) { + kmap.mapPut0A(AST__STCERROR, error, "STC error"); + } + Region res = astroCoords.getResolution(); + if (res != null) { + kmap.mapPut0A(AST__STCRES, res, "STC resolution"); + } + Region size = astroCoords.getSize(); + if (size != null) { + kmap.mapPut0A(AST__STCSIZE, size, "STC size"); + } + Region pixSize = astroCoords.getPixSize(); + if (pixSize != null) { + kmap.mapPut0A(AST__STCPIXSZ, pixSize, "STC pixel size"); + } + return kmap; + } + + /** + * Converts a KeyMap object to an equivalent AstroCoords object, which holds the KeyMap's + * Regions, not copies: the axis names if they are strings, and each Region. + * + * @param keyMap KeyMap object + * @return AstroCoords object + */ + static AstroCoords keyMapToAstroCoords(KeyMap keyMap) { + AstroCoords ac = new AstroCoords(); + if (keyMap.mapType(AST__STCNAME) == KeyMap.AST__STRINGTYPE) { + ac.setName(keyMap.mapGet1C(AST__STCNAME, 100)); + } + ac.setValue(keyMapRegion(keyMap, AST__STCVALUE)); + ac.setError(keyMapRegion(keyMap, AST__STCERROR)); + ac.setResolution(keyMapRegion(keyMap, AST__STCRES)); + ac.setSize(keyMapRegion(keyMap, AST__STCSIZE)); + ac.setPixSize(keyMapRegion(keyMap, AST__STCPIXSZ)); + return ac; + } + + /** The Region {@code keyMap} holds under {@code key}, or null, as jniast reads it. */ + private static Region keyMapRegion(KeyMap keyMap, String key) { + if (keyMap.mapType(key) == KeyMap.AST__OBJECTTYPE) { + AstObject obj = keyMap.mapGet0A(key); + if (obj instanceof Region) { + return (Region) obj; + } + } + return null; + } + + /** + * Converts an array of AstroCoords objects to an equivalent array of KeyMap objects. + * + * @param coords array of AstroCoords objects + * @return array of KeyMap objects, or null if {@code coords} is null + * @throws NullPointerException if an element of {@code coords} is null + */ + static KeyMap[] astroCoordsToKeyMaps(AstroCoords[] coords) { + if (coords == null) { + return null; + } + KeyMap[] kmaps = new KeyMap[coords.length]; + for (int i = 0; i < coords.length; i++) { + kmaps[i] = astroCoordsToKeyMap(Objects.requireNonNull(coords[i], "coords[" + i + "]")); + } + return kmaps; + } + + // ------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------ + + /** C's {@code GetAttrib} (stc.c): RegionClass, then the Region's. */ + @Override + String getAttrib(String attrib) { + if ("regionclass".equals(attrib)) { + return region.astClass(); + } + return super.getAttrib(attrib); + } + + /** C's {@code SetAttrib} (stc.c): RegionClass is read-only; anything else is the Region's. */ + @Override + void setAttrib(String attrib, String value) { + if ("regionclass".equals(attrib) && !value.isEmpty()) { + throw Ast.err( + AstException.AST__NOWRT, + "astSet: The setting \"" + attrib + "=" + value + "\" is invalid for a " + astClass() + + ".\nThis is a read-only attribute."); + } + super.setAttrib(attrib, value); + } + + /** C's {@code TestAttrib} (stc.c): RegionClass is never set; anything else is the Region's. */ + @Override + boolean testAttrib(String attrib) { + return !"regionclass".equals(attrib) && super.testAttrib(attrib); + } + + /** C's {@code ClearAttrib} (stc.c): RegionClass is read-only; anything else is the Region's. */ + @Override + void clearAttrib(String attrib) { + if ("regionclass".equals(attrib)) { + throw Ast.err( + AstException.AST__NOWRT, + "astClear: Invalid attempt to clear the \"" + attrib + "\" value for a " + astClass() + + ".\nThis is a read-only attribute."); + } + super.clearAttrib(attrib); + } + + /** + * Gets the Negated attribute of the encapsulated Region (stc.c {@code GetNegated}). + * + * @return the Negated attribute + */ + @Override + public boolean getNegated() { + return region.getNegated(); + } + + /** Sets Negated on the Stc and on the encapsulated Region (stc.c {@code SetNegated}). */ + @Override + void setNegatedValue(boolean value) { + super.setNegatedValue(value); + region.setNegatedValue(value); + } + + /** Whether Negated is set on the encapsulated Region (stc.c {@code TestNegated}). */ + @Override + boolean testNegated() { + return region.testNegated(); + } + + /** Clears Negated on the Stc and on the encapsulated Region (stc.c {@code ClearNegated}). */ + @Override + void clearNegated() { + super.clearNegated(); + region.clearNegated(); + } + + /** + * Gets the Closed attribute of the encapsulated Region (stc.c {@code GetClosed}). + * + * @return the Closed attribute + */ + @Override + public boolean getClosed() { + return region.getClosed(); + } + + /** Sets Closed on the Stc and on the encapsulated Region (stc.c {@code SetClosed}). */ + @Override + void setClosedValue(boolean value) { + super.setClosedValue(value); + region.setClosedValue(value); + } + + /** Whether Closed is set on the encapsulated Region (stc.c {@code TestClosed}). */ + @Override + boolean testClosed() { + return region.testClosed(); + } + + /** Clears Closed on the Stc and on the encapsulated Region (stc.c {@code ClearClosed}). */ + @Override + void clearClosed() { + super.clearClosed(); + region.clearClosed(); + } + + /** + * Gets the MeshSize attribute of the encapsulated Region (stc.c {@code GetMeshSize}). + * + * @return the MeshSize attribute + */ + @Override + public int getMeshSize() { + return region.getMeshSize(); + } + + /** Sets MeshSize on the Stc and on the encapsulated Region (stc.c {@code SetMeshSize}). */ + @Override + void setMeshSizeValue(int value) { + super.setMeshSizeValue(value); + region.setMeshSizeValue(value); + } + + /** Whether MeshSize is set on the encapsulated Region (stc.c {@code TestMeshSize}). */ + @Override + boolean testMeshSize() { + return region.testMeshSize(); + } + + /** Clears MeshSize on the Stc and on the encapsulated Region (stc.c {@code ClearMeshSize}). */ + @Override + void clearMeshSize() { + super.clearMeshSize(); + region.clearMeshSize(); + } + + /** + * Gets the FillFactor attribute of the encapsulated Region (stc.c {@code GetFillFactor}). + * + * @return the FillFactor attribute + */ + @Override + public double getFillFactor() { + return region.getFillFactor(); + } + + /** Sets FillFactor on the Stc and on the encapsulated Region (stc.c {@code SetFillFactor}). */ + @Override + void setFillFactorValue(double value) { + super.setFillFactorValue(value); + region.setFillFactorValue(value); + } + + /** Whether FillFactor is set on the encapsulated Region (stc.c {@code TestFillFactor}). */ + @Override + boolean testFillFactor() { + return region.testFillFactor(); + } + + /** Clears FillFactor on the Stc and on the encapsulated Region (stc.c {@code ClearFillFactor}). */ + @Override + void clearFillFactor() { + super.clearFillFactor(); + region.clearFillFactor(); + } + + /** The Stc's UseDefs if set, otherwise the encapsulated Region's (stc.c {@code GetUseDefs}). */ + @Override + boolean getUseDefs() { + if (testUseDefs() || region == null) { + return super.getUseDefs(); + } + return region.getUseDefs(); + } + + /** + * Sets a Frame attribute without remapping (stc.c {@code RegSetAttrib}): region.c's, then the + * base Frame setting on the encapsulated Region, whose current Frame is the base Frame of the + * Stc, and on each Region in an AstroCoords element; a Region without the attribute is passed + * over. + */ + @Override + String regSetAttrib(String attrib, String value) { + String battrib = super.regSetAttrib(attrib, value); + regSetIgnoringBadAttrib(region, battrib, value); + for (KeyMap km : coords) { + for (String key : REG_KEYS) { + AstObject[] out = new AstObject[1]; + if (km.mapGet0A(key, out) && out[0] instanceof Region) { + regSetIgnoringBadAttrib((Region) out[0], battrib, value); + } + } + } + return battrib; + } + + /** {@code reg.regSetAttrib}, an {@code AST__BADAT} error ignored, as C annuls it. */ + private static void regSetIgnoringBadAttrib(Region reg, String battrib, String value) { + try { + reg.regSetAttrib(battrib, value); + } catch (AstException e) { + if (e.getStatus() != AstException.AST__BADAT) { + throw e; + } + } + } + + /** + * Clears a Frame attribute without remapping (stc.c {@code RegClearAttrib}): region.c's, then + * the base Frame attribute on the encapsulated Region, an {@code AST__BADAT} error ignored. The + * Regions in the AstroCoords elements keep it. + */ + @Override + String regClearAttrib(String attrib) { + String battrib = super.regClearAttrib(attrib); + try { + region.regClearAttrib(battrib); + } catch (AstException e) { + if (e.getStatus() != AstException.AST__BADAT) { + throw e; + } + } + return battrib; + } + + /** + * Gives the Stc a FrameSet of {@code frm} (stc.c {@code SetRegFS}), and the encapsulated Region + * too if it is written without its Frame. + */ + @Override + void setRegFS(Frame frm) { + super.setRegFS(frm); + if (region != null && !region.getRegionFS()) { + region.setRegFS(frm); + } + } + + // ------------------------------------------------------------------ + // Membership, bounds and boundary + // ------------------------------------------------------------------ + + /** + * Which base Frame points are in the Stc (stc.c {@code Transform}): those the encapsulated + * Region, with its own Negated value, leaves good on some axis. As C does, Negated is set on + * the encapsulated Region to the value it has for the duration, and so is left set. + */ + @Override + boolean[] regBaseMask(double[][] base, int npoint) { + boolean neg = region.getNegated(); + boolean negOld = region.getNegated(); + region.setNegatedValue(neg); + try { + return goodPoints(region.transform(base, npoint, false), base.length, npoint); + } finally { + region.setNegatedValue(negOld); + } + } + + /** + * Not used: {@link Region#regBaseMask} is this hook's only caller, and Stc replaces it with C's + * {@code Transform} ({@link #regBaseMask}), as stc.c installs no other membership test. + * + * @throws AstException with status {@code AST__INTER} always + */ + @Override + boolean[] regBaseInside(double[][] base, int npoint) { + throw Ast.err( + AstException.AST__INTER, + "astRegBaseInside(" + astClass() + "): An Stc decides membership through its encapsulated Region " + + "(internal AST programming error)."); + } + + /** For each point, whether some one of its first {@code ncoord} coordinates is good. */ + private static boolean[] goodPoints(double[][] ps, int ncoord, int npoint) { + boolean[] mask = new boolean[npoint]; + for (int point = 0; point < npoint; point++) { + for (int coord = 0; coord < ncoord; coord++) { + if (ps[coord][point] != AST__BAD) { + mask[point] = true; + break; + } + } + } + return mask; + } + + /** + * Whether the encapsulated Region is bounded (stc.c {@code GetBounded}). As C does, Negated is + * set on the encapsulated Region to the value it has for the duration, and so is left set. + */ + @Override + boolean isBoundedInner() { + boolean neg = region.getNegated(); + boolean negOld = region.getNegated(); + region.setNegatedValue(neg); + try { + return region.getBounded(); + } finally { + region.setNegatedValue(negOld); + } + } + + /** The encapsulated Region's bounding box in its base Frame (stc.c {@code RegBaseBox}). */ + @Override + void regBaseBox(double[] lbnd, double[] ubnd) { + region.regBaseBox(lbnd, ubnd); + } + + /** + * The encapsulated Region's boundary mesh in its current Frame, which is the base Frame of the + * Stc (stc.c {@code RegBaseMesh}). + */ + @Override + double[][] regBaseMesh() { + return region.regMesh(); + } + + /** The encapsulated Region's pick of base Frame axes (stc.c {@code RegBasePick}). */ + @Override + Region regBasePick(int[] axes) { + return region.regBasePick(axes); + } + + /** Whether the points are on the encapsulated Region's boundary (stc.c {@code RegPins}). */ + @Override + boolean regPins(double[][] pset, Region pointUnc, boolean[] mask) { + return region.regPins(pset, pointUnc, mask); + } + + /** + * The default uncertainty (stc.c {@code GetDefUnc}): the encapsulated Region's uncertainty in + * its current Frame if one is set, otherwise region.c's default. + */ + @Override + Region getDefUnc() { + if (region.testUnc()) { + return region.getUncFrm(FrameSet.AST__CURRENT); + } + return super.getDefUnc(); + } + + /** How the encapsulated Region and {@code that} overlap (stc.c {@code Overlap}). */ + @Override + int overlapWith(Region that) { + return region.overlap(that); + } + + /** + * How {@code thisRegion} and this Stc overlap (stc.c {@code OverlapX}): how the encapsulated + * Region and {@code thisRegion} overlap, with inside and outside exchanged. + */ + @Override + int overlapX(Region thisRegion) { + int result = region.overlap(thisRegion); + if (result == OVERLAP_INSIDE) { + result = OVERLAP_OUTSIDE; + } else if (result == OVERLAP_OUTSIDE) { + result = OVERLAP_INSIDE; + } + return result; + } + + /** + * stc.c {@code Equal}: region.c's tests, then equal encapsulated Regions. The AstroCoords + * elements are not compared. + */ + @Override + boolean equalTo(AstObject that) { + return super.equalTo(that) && region.astEqual(((Stc) that).region); + } + + // ------------------------------------------------------------------ + // Simplification + // ------------------------------------------------------------------ + + /** + * Simplifies the Stc (C's {@code Simplify}, stc.c). After the Region-generic simplification, a + * negated Stc has the negation moved onto the encapsulated Region; the encapsulated Region, + * mapped into the current Frame if the Mapping from the base Frame is not a UnitMap, is + * simplified, and if that gives a different Region it is stored, the Stc's FrameSet becoming + * one of the current Frame; and each Region in an AstroCoords element is treated alike. The Stc + * is copied before the first change, and returned itself if nothing changes. + */ + // C compares the pointers; the loop over the AstroCoords elements indexes them, since the Stc + // whose element is changed may become a copy part way through. + @Override + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals", "PMD.ForLoopCanBeForeach"}) + Mapping simplifyStep() { + Stc stc = (Stc) parentSimplify(); + if (stc.getNegated()) { + if (stc == this) { + stc = (Stc) copy(); + } + stc.negate(); + stc.region.negate(); + } + FrameSet fs = stc.getRegFS(); + Mapping map = fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + Frame frm = fs.getFrame(FrameSet.AST__CURRENT); + boolean unit = isUnitMap(map); + Region newreg; + if (!unit) { + newreg = (Region) stc.region.mapRegionInto(map, frm).simplify(); + } else { + newreg = (Region) stc.region.simplify(); + } + if (newreg != stc.region) { + if (stc == this) { + stc = (Stc) copy(); + } + stc.region = newreg; + if (!unit) { + stc.setRegFS(frm); + } + } + for (int i = 0; i < stc.coords.length; i++) { + KeyMap keymap = stc.coords[i]; + for (int ikey = 0; ikey < REG_KEYS.length; ikey++) { + AstObject[] out = new AstObject[1]; + if (!keymap.mapGet0A(REG_KEYS[ikey], out) || !(out[0] instanceof Region)) { + continue; + } + Region reg = (Region) out[0]; + Region treg = unit ? reg : reg.mapRegionInto(map, frm); + Region sreg = (Region) treg.simplify(); + if (sreg != reg) { + if (stc == this) { + stc = (Stc) copy(); + keymap = stc.coords[i]; + } + keymap.mapPut0A(REG_KEYS[ikey], sreg, REG_COMMENTS[ikey]); + } + } + } + return stc; + } +} diff --git a/src/main/java/uk/ac/starlink/ast/StcCatalogEntryLocation.java b/src/main/java/uk/ac/starlink/ast/StcCatalogEntryLocation.java new file mode 100644 index 0000000..31a3606 --- /dev/null +++ b/src/main/java/uk/ac/starlink/ast/StcCatalogEntryLocation.java @@ -0,0 +1,58 @@ +package uk.ac.starlink.ast; + +/** + * Corresponds to the IVOA STCCatalogEntryLocation class. The StcCatalogEntryLocation class is a sub-class of {@link + * Stc} used to describe the coverage of the datasets contained in some VO resource. + * + *

See http://hea-www.harvard.edu/~arots/nvometa/STC.html + * + *

Ported from C {@code stccatalogentrylocation.c}. + */ +public class StcCatalogEntryLocation extends Stc { + + /** + * Constructs a new StcCatalogEntryLocation. + * + * @param region the encapsulated region; a copy is held + * @param coords the AstroCoords elements associated with this Stc, or null for none; copies of + * their Regions are held + * @throws NullPointerException if {@code region} or an element of {@code coords} is null + * @throws AstException with status {@code AST__STCKEY} if an AstroCoords element has a number + * of axis names other than the number of axes of {@code region}, or a Region that cannot + * be converted to the coordinate system of {@code region} + */ + public StcCatalogEntryLocation(Region region, AstroCoords[] coords) { + this(region, astroCoordsToKeyMaps(coords)); + } + + /** + * Constructs a new StcCatalogEntryLocation from AstroCoords elements given as KeyMaps (C's {@code + * astStcCatalogEntryLocation}). + * + * @see Stc#Stc(Region, KeyMap[]) + */ + StcCatalogEntryLocation(Region region, KeyMap[] coords) { + super(region, coords); + } + + /** Loads an StcCatalogEntryLocation from its description (C's {@code astLoadStcCatalogEntryLocation}). */ + StcCatalogEntryLocation(NativeNode node) { + super(node); + node.section("StcCatalogEntryLocation"); + } + + @Override + String dumpComment() { + return "Resource coverage"; + } + + /** + * Writes the StcCatalogEntryLocation class's part of a description (C's {@code Dump}, + * stccatalogentrylocation.c), which holds nothing of its own. + */ + @Override + void dump(NativeNode node) { + super.dump(node); + node.writeIsA("Stc", "An IVOA Space-Time-Coords object"); + } +} diff --git a/src/main/java/uk/ac/starlink/ast/StcObsDataLocation.java b/src/main/java/uk/ac/starlink/ast/StcObsDataLocation.java new file mode 100644 index 0000000..d9ff45c --- /dev/null +++ b/src/main/java/uk/ac/starlink/ast/StcObsDataLocation.java @@ -0,0 +1,119 @@ +package uk.ac.starlink.ast; + +/** + * Corresponds to the IVOA ObsDataLocation class. The StcObsDataLocation class is a sub-class of + * {@link Stc} used to describe the coordinate space occupied by a particular observational dataset. + * + *

See http://hea-www.harvard.edu/~arots/nvometa/STC.html + * + *

An STC ObsDataLocation element specifies the extent of the observation within a specified + * coordinate system, and also specifies the observatory location within a second coordinate + * system. + * + *

The AST StcObsDataLocation class inherits from Stc, and therefore an StcObsDataLocation can be + * used directly as an Stc. When used in this way, the StcObsDataLocation describes the location of + * the observation (not the observatory). + * + *

Eventually, this class will have a method for returning an Stc describing the observatory + * location. However, AST currently does not include any classes of Frame for describing + * terrestrial or solar system positions. Therefore, the provision for returning observatory + * location as an Stc is not yet available. However, for terrestrial observations, the position of + * the observatory can still be recorded using the ObsLon and ObsLat attributes of the Frame + * encapsulated within the Stc representing the observation location (this assumes the observatory + * is located at sea level). + * + *

An StcObsDataLocation made by its constructor holds no observatory position; one read from a + * description holds the one written there, if any. The observatory position takes no part in + * AST's own comparison (C's {@code astEqual}, which compares an StcObsDataLocation as an Stc); it + * does in {@link #equals}, which compares the descriptions, as jniast's does. + * + *

Ported from C {@code stcobsdatalocation.c}. + */ +public class StcObsDataLocation extends Stc { + + /** + * The observatory position, or null if there is none (C's {@code obs}). It is a PointList when + * set through {@link #setObs}; a description may hold an Object of any class here, which is + * read as it is, as C reads it. + */ + private AstObject obs; + + /** + * Constructs a new StcObsDataLocation. + * + * @param region the encapsulated region; a copy is held + * @param coords the AstroCoords elements associated with this Stc, or null for none; copies of + * their Regions are held + * @throws NullPointerException if {@code region} or an element of {@code coords} is null + * @throws AstException with status {@code AST__STCKEY} if an AstroCoords element has a number + * of axis names other than the number of axes of {@code region}, or a Region that cannot + * be converted to the coordinate system of {@code region} + */ + public StcObsDataLocation(Region region, AstroCoords[] coords) { + this(region, astroCoordsToKeyMaps(coords)); + } + + /** + * Constructs a new StcObsDataLocation, without an observatory position, from AstroCoords + * elements given as KeyMaps (C's {@code astStcObsDataLocation}). + * + * @see Stc#Stc(Region, KeyMap[]) + */ + StcObsDataLocation(Region region, KeyMap[] coords) { + super(region, coords); + } + + /** + * Loads an StcObsDataLocation from its description (C's {@code astLoadStcObsDataLocation}): + * the Stc part, then the observatory position {@code ObsLoc}, if present, an Object of any + * class. + */ + StcObsDataLocation(NativeNode node) { + super(node); + NativeNode part = node.section("StcObsDataLocation"); + NativeNode desc = part.readObject("ObsLoc"); + if (desc != null) { + obs = ObjectRegistry.loadNested(desc, "ObsLoc"); + } + } + + /** + * Sets the observatory position (C's protected {@code astStcSetObs}). The PointList given is + * held itself, not a copy, as C holds a clone of it. + * + * @param obs the observatory position, or null to remove any + */ + void setObs(PointList obs) { + this.obs = obs; + } + + @Override + String dumpComment() { + return "Observation coverage"; + } + + /** + * Writes the StcObsDataLocation class's part of a description (C's {@code Dump}, + * stcobsdatalocation.c): the observatory position {@code ObsLoc}, only when there is one. + */ + @Override + void dump(NativeNode node) { + super.dump(node); + node.writeIsA("Stc", "An IVOA Space-Time-Coords object"); + if (obs != null) { + node.writeObject("ObsLoc", true, true, NativeNode.of(obs), "Observatory position"); + } + } + + /** + * Completes a copy as C's {@code Copy} (stcobsdatalocation.c) does: the observatory position is + * copied. + */ + @Override + void deepCopy() { + super.deepCopy(); + if (obs != null) { + obs = obs.copy(); + } + } +} diff --git a/src/main/java/uk/ac/starlink/ast/StcResourceProfile.java b/src/main/java/uk/ac/starlink/ast/StcResourceProfile.java new file mode 100644 index 0000000..ce34463 --- /dev/null +++ b/src/main/java/uk/ac/starlink/ast/StcResourceProfile.java @@ -0,0 +1,58 @@ +package uk.ac.starlink.ast; + +/** + * Corresponds to the IVOA STCResourceProfile class. The StcResourceProfile class is a sub-class of + * {@link Stc} used to describe the coverage of the datasets contained in some VO resource. + * + *

See http://hea-www.harvard.edu/~arots/nvometa/STC.html + * + *

Ported from C {@code stcresourceprofile.c}. + */ +public class StcResourceProfile extends Stc { + + /** + * Constructs a new StcResourceProfile. + * + * @param region the encapsulated region; a copy is held + * @param coords the AstroCoords elements associated with this Stc, or null for none; copies of + * their Regions are held + * @throws NullPointerException if {@code region} or an element of {@code coords} is null + * @throws AstException with status {@code AST__STCKEY} if an AstroCoords element has a number + * of axis names other than the number of axes of {@code region}, or a Region that cannot + * be converted to the coordinate system of {@code region} + */ + public StcResourceProfile(Region region, AstroCoords[] coords) { + this(region, astroCoordsToKeyMaps(coords)); + } + + /** + * Constructs a new StcResourceProfile from AstroCoords elements given as KeyMaps (C's {@code + * astStcResourceProfile}). + * + * @see Stc#Stc(Region, KeyMap[]) + */ + StcResourceProfile(Region region, KeyMap[] coords) { + super(region, coords); + } + + /** Loads an StcResourceProfile from its description (C's {@code astLoadStcResourceProfile}). */ + StcResourceProfile(NativeNode node) { + super(node); + node.section("StcResourceProfile"); + } + + @Override + String dumpComment() { + return "Resource coverage"; + } + + /** + * Writes the StcResourceProfile class's part of a description (C's {@code Dump}, + * stcresourceprofile.c), which holds nothing of its own. + */ + @Override + void dump(NativeNode node) { + super.dump(node); + node.writeIsA("Stc", "An IVOA Space-Time-Coords object"); + } +} diff --git a/src/main/java/uk/ac/starlink/ast/StcSearchLocation.java b/src/main/java/uk/ac/starlink/ast/StcSearchLocation.java new file mode 100644 index 0000000..a677776 --- /dev/null +++ b/src/main/java/uk/ac/starlink/ast/StcSearchLocation.java @@ -0,0 +1,58 @@ +package uk.ac.starlink.ast; + +/** + * Corresponds to the IVOA SearchLocation class. The StcSearchLocation class is a sub-class of {@link + * Stc} used to describe the coverage of a query. + * + *

See http://hea-www.harvard.edu/~arots/nvometa/STC.html + * + *

Ported from C {@code stcsearchlocation.c}. + */ +public class StcSearchLocation extends Stc { + + /** + * Constructs a new StcSearchLocation. + * + * @param region the encapsulated region; a copy is held + * @param coords the AstroCoords elements associated with this Stc, or null for none; copies of + * their Regions are held + * @throws NullPointerException if {@code region} or an element of {@code coords} is null + * @throws AstException with status {@code AST__STCKEY} if an AstroCoords element has a number + * of axis names other than the number of axes of {@code region}, or a Region that cannot + * be converted to the coordinate system of {@code region} + */ + public StcSearchLocation(Region region, AstroCoords[] coords) { + this(region, astroCoordsToKeyMaps(coords)); + } + + /** + * Constructs a new StcSearchLocation from AstroCoords elements given as KeyMaps (C's {@code + * astStcSearchLocation}). + * + * @see Stc#Stc(Region, KeyMap[]) + */ + StcSearchLocation(Region region, KeyMap[] coords) { + super(region, coords); + } + + /** Loads an StcSearchLocation from its description (C's {@code astLoadStcSearchLocation}). */ + StcSearchLocation(NativeNode node) { + super(node); + node.section("StcSearchLocation"); + } + + @Override + String dumpComment() { + return "Query coverage"; + } + + /** + * Writes the StcSearchLocation class's part of a description (C's {@code Dump}, + * stcsearchlocation.c), which holds nothing of its own. + */ + @Override + void dump(NativeNode node) { + super.dump(node); + node.writeIsA("Stc", "An IVOA Space-Time-Coords object"); + } +} diff --git a/src/main/java/uk/ac/starlink/ast/SwitchMap.java b/src/main/java/uk/ac/starlink/ast/SwitchMap.java index 275f45d..b131440 100644 --- a/src/main/java/uk/ac/starlink/ast/SwitchMap.java +++ b/src/main/java/uk/ac/starlink/ast/SwitchMap.java @@ -45,8 +45,8 @@ * a value of {@link #AST__BAD} on every axis. * *

In practice, appropriate selector Mappings should be chosen to associate a different route - * Mapping with each region of coordinate space. Note that the SelectorMap class of Mapping is - * particularly appropriate for this purpose. + * Mapping with each region of coordinate space. Note that the {@link SelectorMap} class of Mapping + * is particularly appropriate for this purpose. * *

If a compound Mapping contains a SwitchMap in series with its own inverse, the combination of * the two adjacent SwitchMaps will be replaced by a UnitMap when the compound Mapping is @@ -332,6 +332,57 @@ void deepCopy() { routeinv = routeinv.clone(); } + /** + * switchmap.c {@code RemoveRegions}: removes the Regions from each route Mapping and each + * selector. A Mapping that changed and is now a Frame becomes a UnitMap; one that did not change + * is kept as it is, a Frame included. When none changed it is the SwitchMap itself; otherwise it + * is a copy of the SwitchMap holding the new Mappings, sharing with the original those that did + * not change, as C's copy holds clones of them. + */ + @Override + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // C compares the pointers. + Mapping removeRegions() { + boolean changed = false; + Mapping[] newroutes = new Mapping[routemap.length]; + for (int i = 0; i < routemap.length; i++) { + newroutes[i] = routemap[i].removeRegions(); + if (newroutes[i] != routemap[i]) { + changed = true; + newroutes[i] = frameToUnitMap(newroutes[i]); + } + } + Mapping newfsmap = null; + if (fsmap != null) { + newfsmap = fsmap.removeRegions(); + if (newfsmap != fsmap) { + changed = true; + newfsmap = frameToUnitMap(newfsmap); + } + } + Mapping newismap = null; + if (ismap != null) { + newismap = ismap.removeRegions(); + if (newismap != ismap) { + changed = true; + newismap = frameToUnitMap(newismap); + } + } + if (!changed) { + return this; + } + SwitchMap result = (SwitchMap) copy(); + for (int i = 0; i < routemap.length; i++) { + result.routemap[i] = keptComponent(newroutes[i], routemap[i]); + } + if (newfsmap != null) { + result.fsmap = keptComponent(newfsmap, fsmap); + } + if (newismap != null) { + result.ismap = keptComponent(newismap, ismap); + } + return result; + } + // ------------------------------------------------------------------ // Selectors and routes // ------------------------------------------------------------------ @@ -631,7 +682,7 @@ int mapMerge(MergeList list, int where, boolean series) { try { int result = -1; if (series) { - result = cancelWithNeighbour(list, where); + result = cancelWithNeighbour(this, list, where, SwitchMap.class); } if (result == -1) { if (list.invert(where)) { @@ -674,35 +725,4 @@ int mapMerge(MergeList list, int where, boolean series) { } } } - - /** - * The neighbour half of {@link #mapMerge}: replaces this SwitchMap, at {@code where}, and the - * SwitchMap after it in the list, or failing that the one before it, with a UnitMap, if the - * neighbour, inverted for the duration, is equal to this one. - * - * @return {@code where} if the pair was replaced, or -1 - */ - private int cancelWithNeighbour(MergeList list, int where) { - int ilo; - if (where < list.size() - 1 && list.map(where + 1) instanceof SwitchMap) { - ilo = where; - } else if (where > 0 && list.map(where - 1) instanceof SwitchMap) { - ilo = where - 1; - } else { - return -1; - } - Mapping swneb = list.map(ilo == where ? where + 1 : where - 1); - swneb.invert(); - boolean equal; - try { - equal = astEqual(swneb); - } finally { - swneb.invert(); - } - if (!equal) { - return -1; - } - list.replacePairWith(ilo, new UnitMap(list.map(ilo).getNin()), false); - return where; - } } diff --git a/src/main/java/uk/ac/starlink/ast/TranMap.java b/src/main/java/uk/ac/starlink/ast/TranMap.java index 26fea14..97f6c17 100644 --- a/src/main/java/uk/ac/starlink/ast/TranMap.java +++ b/src/main/java/uk/ac/starlink/ast/TranMap.java @@ -189,6 +189,33 @@ boolean getInvert2() { return invert2; } + /** + * tranmap.c {@code RemoveRegions}: removes the Regions from both components. When neither + * changed it is the TranMap itself. Otherwise each component result that is a Frame becomes a + * UnitMap, whether or not that component changed, so a FrameSet component, a Frame in C, becomes + * one too; two UnitMaps become one UnitMap with as many coordinates as the first, the TranMap's + * own number; and otherwise it is a copy of the TranMap holding the new components. A component + * that did not change is the original's own, shared, as C's copy holds a clone of it. + */ + @Override + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // C compares the pointers. + Mapping removeRegions() { + Mapping new1 = map1.removeRegions(); + Mapping new2 = map2.removeRegions(); + if (new1 == map1 && new2 == map2) { + return this; + } + new1 = frameToUnitMap(new1); + new2 = frameToUnitMap(new2); + if (new1 instanceof UnitMap && new2 instanceof UnitMap) { + return new UnitMap(new1.getNin()); + } + TranMap result = (TranMap) copy(); + result.map1 = keptComponent(new1, map1); + result.map2 = keptComponent(new2, map2); + return result; + } + /** * The components, as C's {@code Decompose} (tranmap.c) gives them: an inverted TranMap gives * them in reverse order with their recorded Invert values reversed. C's {@code Decompose} does diff --git a/src/test/java/uk/ac/starlink/ast/AstroCoordsTest.java b/src/test/java/uk/ac/starlink/ast/AstroCoordsTest.java new file mode 100644 index 0000000..4ada379 --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/AstroCoordsTest.java @@ -0,0 +1,83 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; + +import org.junit.jupiter.api.Test; + +/** + * Translation of jniast's {@code AstroCoordsTest}: the conversions between an AstroCoords and a + * KeyMap. jniast reads the key names through {@code Stc.getAstConstantC("AST__STCNAME")} and so on; + * here they are Stc's constants. + */ +class AstroCoordsTest { + + @Test + void emptyCoords() { + assertEquals(0, Stc.astroCoordsToKeyMap(new AstroCoords()).mapSize()); + + AstroCoords ac = Stc.keyMapToAstroCoords(new KeyMap()); + assertNull(ac.getName()); + assertNull(ac.getValue()); + assertNull(ac.getError()); + assertNull(ac.getResolution()); + assertNull(ac.getSize()); + assertNull(ac.getPixSize()); + } + + @Test + void coords() { + String[] name = {"X", "Y"}; + Region value = makeBox(1); + Region error = makeBox(2); + Region res = makeBox(3); + Region size = makeBox(4); + Region pixsz = makeBox(5); + + AstroCoords ac = new AstroCoords(); + ac.setName(new String[] {"X", "Y"}); + ac.setValue(value); + ac.setError(error); + ac.setResolution(res); + ac.setSize(size); + ac.setPixSize(pixsz); + + assertArrayEquals(name, ac.getName()); + assertSameShape(value, ac.getValue()); + assertSameShape(error, ac.getError()); + assertSameShape(res, ac.getResolution()); + assertSameShape(size, ac.getSize()); + assertSameShape(pixsz, ac.getPixSize()); + + AstroCoords ac0 = ac; + KeyMap km = Stc.astroCoordsToKeyMap(ac); + assertEquals(6, km.mapSize()); + assertEquals(2, km.mapLength(Stc.AST__STCNAME)); + assertEquals(1, km.mapLength(Stc.AST__STCRES)); + assertEquals(0, km.mapLength("urrgh")); + + ac = Stc.keyMapToAstroCoords(km); + assertNotSame(ac0, ac); + + assertArrayEquals(name, ac.getName()); + assertSameShape(value, ac.getValue()); + assertSameShape(error, ac.getError()); + assertSameShape(res, ac.getResolution()); + assertSameShape(size, ac.getSize()); + assertSameShape(pixsz, ac.getPixSize()); + + assertArrayEquals(name, new AstroCoords(name).getName()); + } + + private static Region makeBox(double origin) { + return new Box( + new Frame(2), 1, new double[] {origin, origin + 1.0}, new double[] {origin + 2.0, origin + 4.0}, null); + } + + private static void assertSameShape(Region region1, Region region2) { + int ov = region1.overlap(region2); + assertEquals(Region.OVERLAP_SAME, ov, "Regions don't match (" + ov + ")"); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/ConstructorChecksTest.java b/src/test/java/uk/ac/starlink/ast/ConstructorChecksTest.java index c60291b..c09a070 100644 --- a/src/test/java/uk/ac/starlink/ast/ConstructorChecksTest.java +++ b/src/test/java/uk/ac/starlink/ast/ConstructorChecksTest.java @@ -56,6 +56,21 @@ void aSwitchmapSelectorNeedsItsDirection() { assertEquals(AstException.AST__INTRD, e.getStatus()); } + /** + * selectormap.c astInitSelectorMap: every Region must refer to a Frame equal to the first + * Region's, or it is AST__BADNI. + */ + @Test + void aSelectormapNeedsRegionsInOneFrame() { + Region plain1 = new Circle(new Frame(2), new double[] {0.0, 0.0}, 1.0, null); + Region plain2 = new Circle(new Frame(2), new double[] {0.0, 0.0}, 1.0, null); + Region sky = new Circle(new SkyFrame(), new double[] {0.0, 0.0}, 0.1, null); + new SelectorMap(new Region[] {plain1, plain2}, AstObject.AST__BAD); + AstException e = + assertThrows(AstException.class, () -> new SelectorMap(new Region[] {plain1, sky}, AstObject.AST__BAD)); + assertEquals(AstException.AST__BADNI, e.getStatus()); + } + /** wcsmap.c SetPV: an axis out of range, or one that is not celestial, is AST__AXIIN. */ @Test void aWcsmapPvNeedsACelestialAxis() { diff --git a/src/test/java/uk/ac/starlink/ast/EqualTest.java b/src/test/java/uk/ac/starlink/ast/EqualTest.java index 992fbca..700fbb6 100644 --- a/src/test/java/uk/ac/starlink/ast/EqualTest.java +++ b/src/test/java/uk/ac/starlink/ast/EqualTest.java @@ -24,8 +24,7 @@ * Objects of classes without their own {@code Equal}. * *

Rust's {@code chebymap_same} and {@code chebymap_different_bounds} need ChebyMap and are listed - * in {@code deferred/rust-tests.txt}. The SelectorMap cases of {@code oracle/equal.json} are - * skipped: they need SelectorMap. + * in {@code deferred/rust-tests.txt}. */ class EqualTest { @@ -703,7 +702,15 @@ private static WcsMap sinPv(double... pv) { return w; } - /** The two Mappings an oracle case compares, or null for a case that needs SelectorMap. */ + private static Circle circle(double x, double y) { + return new Circle(new Frame(2), new double[] {x, y}, 1.0, null); + } + + private static SelectorMap selectormap(Region... regions) { + return new SelectorMap(regions, BAD); + } + + /** The two Mappings an oracle case compares. */ private static Mapping[] pair(String name) { switch (name) { case "winmap_self_inverse_vs_inverted_copy": { @@ -713,9 +720,15 @@ private static Mapping[] pair(String name) { case "winmap_inverse_of_its_inverse": return new Mapping[] {winCorners(0.0, 1.0, 1.0, 3.0), inv(winCorners(0.0, 2.0, -0.5, 0.5))}; case "selectormap_one_region_vs_two": - case "selectormap_vs_inverted_copy": - case "selectormap_1d_vs_inverted_copy": - return null; + return new Mapping[] {selectormap(circle(0.0, 0.0)), selectormap(circle(0.0, 0.0), circle(5.0, 5.0))}; + case "selectormap_vs_inverted_copy": { + SelectorMap a = selectormap(circle(0.0, 0.0)); + return new Mapping[] {a, inv((SelectorMap) a.copy())}; + } + case "selectormap_1d_vs_inverted_copy": { + SelectorMap a = selectormap(new Box(new Frame(1), 1, new double[] {0.0}, new double[] {1.0}, null)); + return new Mapping[] {a, inv((SelectorMap) a.copy())}; + } case "tranmap_vs_reread_without_component_invert": { TranMap tm = new TranMap(inv(zoom(1, 2.0)), zoom(1, 0.5)); String dump = ChannelText.dump(tm); @@ -754,16 +767,13 @@ void equalityMatchesTheCLibrary() { for (JsonNode c : ProbeData.load("equal").get("CASES")) { String name = c.get(0).asText(); Mapping[] p = pair(name); - if (p == null) { - continue; - } boolean got = p[0].astEqual(p[1]); if (got != c.get(1).asBoolean()) { failures.add(name + ": " + got + ", C " + c.get(1).asBoolean()); } run++; } - assertEquals(7, run, "the in-scope cases the C probe recorded"); + assertEquals(10, run, "the cases the C probe recorded"); assertTrue(failures.isEmpty(), String.join("\n", failures)); } diff --git a/src/test/java/uk/ac/starlink/ast/FrameInMapSlotTest.java b/src/test/java/uk/ac/starlink/ast/FrameInMapSlotTest.java index 4f1ab17..4f06594 100644 --- a/src/test/java/uk/ac/starlink/ast/FrameInMapSlotTest.java +++ b/src/test/java/uk/ac/starlink/ast/FrameInMapSlotTest.java @@ -4,7 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; @@ -13,7 +13,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayDeque; -import java.util.ArrayList; import java.util.Arrays; import java.util.Deque; import java.util.List; @@ -104,17 +103,13 @@ void frameInAMapSlotIsRejected() { /** * A Region is a Mapping, so a CmpMap may hold one: every {@code simplify/*.map} fixture nesting - * a Region inside a CmpMap reads, unless it also holds a SelectorMap, which the library cannot - * load yet, and then it must fail for that reason alone. The corpus has 34 such fixtures, 6 of - * them with a SelectorMap. At least 28 must read: like the Rust test's count of 33, written when - * the corpus had 33, this is a floor, so that a fixture added to the corpus does not fail the - * test. The 6 refused are counted exactly, so that a fixture with a SelectorMap added to the - * corpus is noticed before SelectorMap is ported. + * a Region inside a CmpMap reads, 6 of them holding SelectorMaps. The corpus has 34 such + * fixtures; at least 34 must read: like the Rust test's count of 33, written when the corpus + * had 33, this is a floor, so that a fixture added to the corpus does not fail the test. */ @Test void aRegionInsideACmpMapStillReads() throws IOException { int read = 0; - List refused = new ArrayList<>(); try (DirectoryStream dir = Files.newDirectoryStream(Fixtures.root().resolve("simplify"), "*.map")) { for (Path path : dir) { @@ -122,20 +117,12 @@ void aRegionInsideACmpMapStillReads() throws IOException { if (!regionNestedIn(text, "CmpMap")) { continue; } - String needs = NativeClasses.needs(text); - if (needs == null) { - assertNotNull(ChannelText.read(text), path.getFileName() + " no longer reads"); - read++; - } else { - assertEquals("needs SelectorMap", needs, path.getFileName().toString()); - AstException e = assertThrows(AstException.class, () -> ChannelText.read(text)); - assertTrue(e.getMessage().contains("unknown AST class: SelectorMap"), e.getMessage()); - refused.add(path.getFileName().toString()); - } + assertNull(NativeClasses.needs(text), path.getFileName().toString()); + assertNotNull(ChannelText.read(text), path.getFileName() + " no longer reads"); + read++; } } - assertTrue(read >= 28, "only " + read + " fixtures nest a Region inside a CmpMap and read"); - assertEquals(6, refused.size(), "fixtures refused for want of SelectorMap: " + refused); + assertTrue(read >= 34, "only " + read + " fixtures nest a Region inside a CmpMap and read"); } /** diff --git a/src/test/java/uk/ac/starlink/ast/JniastApiTest.java b/src/test/java/uk/ac/starlink/ast/JniastApiTest.java index faf51c6..492245f 100644 --- a/src/test/java/uk/ac/starlink/ast/JniastApiTest.java +++ b/src/test/java/uk/ac/starlink/ast/JniastApiTest.java @@ -39,6 +39,7 @@ class JniastApiTest { static final List IN_SCOPE = Arrays.asList( "AstException", "AstObject", + "AstroCoords", "Axis", "Box", "Channel", @@ -72,6 +73,7 @@ class JniastApiTest { "RateMap", "Region", "ResampleFlags", + "SelectorMap", "ShiftMap", "SkyAxis", "SkyFrame", @@ -80,6 +82,11 @@ class JniastApiTest { "SpecFrame", "SpecMap", "SphMap", + "Stc", + "StcCatalogEntryLocation", + "StcObsDataLocation", + "StcResourceProfile", + "StcSearchLocation", "SwitchMap", "TimeFrame", "TimeMap", diff --git a/src/test/java/uk/ac/starlink/ast/JniastSelectorMapTest.java b/src/test/java/uk/ac/starlink/ast/JniastSelectorMapTest.java new file mode 100644 index 0000000..5f08f20 --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/JniastSelectorMapTest.java @@ -0,0 +1,43 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +/** + * Translation of jniast's own {@code AstTest.testSwitchMap} ({@code + * reference/starjava/jniast/src/testcases/uk/ac/starlink/ast/AstTest.java}), with the values it + * expects, which jniast found with C's library: a SelectorMap of two 1-D Boxes meeting at 0, and a + * SwitchMap whose forward selector it is. Its null arguments are refused as jniast's other + * arguments are, with a {@code NullPointerException} naming the argument. + */ +class JniastSelectorMapTest { + + @Test + void testSwitchMap() { + Frame f = new Frame(1); + Region lReg = new Box(f, 1, new double[] {-100}, new double[] {0}, null); + Region rReg = new Box(f, 1, new double[] {0}, new double[] {+100}, null); + SelectorMap fsMap = new SelectorMap(new Region[] {lReg, rReg}, -99); + assertEquals(1, fsMap.getNout()); + assertArrayEquals( + new double[] {0, 1, 2, -99}, fsMap.tran1(4, new double[] {9999, -1, +1, AstObject.AST__BAD}, true)); + Mapping lMap = new ShiftMap(new double[] {-4}); + Mapping rMap = new ShiftMap(new double[] {+4}); + SwitchMap swMap = new SwitchMap(fsMap, null, new Mapping[] {lMap, rMap}); + assertArrayEquals( + new double[] {AstObject.AST__BAD, -5, +5, AstObject.AST__BAD}, + swMap.tran1(4, new double[] {-1000, -1, +1, +1000}, true)); + } + + @Test + void nullArgumentsAreRefused() { + NullPointerException e = assertThrows(NullPointerException.class, () -> new SelectorMap(null, 0.0)); + assertEquals("regs", e.getMessage()); + Region box = new Box(new Frame(1), 1, new double[] {0}, new double[] {1}, null); + e = assertThrows(NullPointerException.class, () -> new SelectorMap(new Region[] {box, null}, 0.0)); + assertEquals("regs[1]", e.getMessage()); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/ObjectIdOracleTest.java b/src/test/java/uk/ac/starlink/ast/ObjectIdOracleTest.java index e739914..ba45fa1 100644 --- a/src/test/java/uk/ac/starlink/ast/ObjectIdOracleTest.java +++ b/src/test/java/uk/ac/starlink/ast/ObjectIdOracleTest.java @@ -26,12 +26,13 @@ * frame}, {@code skyframe}, {@code frameset}, {@code frameset_frame_id}, {@code * frameset_part_ids}, {@code cmpframe}, {@code fitschan}, {@code cmpmap_unsimplifiable}, {@code * tranmap}, {@code ratemap}, {@code circle}, {@code cmpregion}, {@code cmpregion_part_ids}, - * {@code prism} and {@code prism_part_ids}. + * {@code prism}, {@code prism_part_ids}, {@code selectormap} and {@code selectormap_part_ids}. * {@code simplify} returns the ZoomMap itself, as C's {@code astSimplify} returns a Mapping it cannot simplify, recording it as * simplified, and a CmpMap shares its components, as C's does, so the Rust test's exclusions for * copies do not arise for them. A case whose dump differs from C's is listed in {@link #EXCLUDED}, - * and {@code excluded_cases_still_differ} fails when it matches. The remaining cases need - * SelectorMap and NormMap, which are not yet ported. + * and {@code excluded_cases_still_differ} fails when it matches. A SelectorMap copies its Regions, + * as C's does, so their IDs are not in its dump, and {@code selectormap_part_ids}, which the Rust + * test excludes, matches C. The remaining cases need NormMap, which is not in jniast. */ class ObjectIdOracleTest { @@ -60,7 +61,9 @@ class ObjectIdOracleTest { "cmpregion", "cmpregion_part_ids", "prism", - "prism_part_ids"); + "prism_part_ids", + "selectormap", + "selectormap_part_ids"); /** The cases whose dump differs from C's, with the reason. */ private static final String[][] EXCLUDED = {}; @@ -114,6 +117,13 @@ private static Circle circle(String fid, String id) { return c; } + /** A SelectorMap of {@code region} with bad value -1 and ID "s". */ + private static SelectorMap selectormap(Circle region) { + SelectorMap m = new SelectorMap(new Region[] {region}, -1.0); + m.setID("s"); + return m; + } + /** The AND of two Circles, with ID "cr". */ private static CmpRegion cmpregion(Circle r1, Circle r2) { CmpRegion r = new CmpRegion(r1, r2, CmpRegion.AST__AND); @@ -153,6 +163,10 @@ private static AstObject object(String name) { return cmpregion(circle(null, null), circle(null, null)); case "cmpregion_part_ids": return cmpregion(circle("f1", "r1"), circle("f2", "r2")); + case "selectormap": + return selectormap(circle(null, null)); + case "selectormap_part_ids": + return selectormap(circle("sframe", "sreg")); case "prism": return prism(null, null, null, null); case "prism_part_ids": diff --git a/src/test/java/uk/ac/starlink/ast/RateOracleTest.java b/src/test/java/uk/ac/starlink/ast/RateOracleTest.java index bde779d..db3444e 100644 --- a/src/test/java/uk/ac/starlink/ast/RateOracleTest.java +++ b/src/test/java/uk/ac/starlink/ast/RateOracleTest.java @@ -15,10 +15,8 @@ * ({@code tools/oracle_fixtures/rate_probe.c}): a RateMap asks its Mapping's rate at every point, * bad inputs included (ratemap.c Transform); a TranMap its forward component's, in the orientation * it records (tranmap.c Rate). A RateMap read from a dump whose recorded orientation ({@code Inv}) - * differs from its Mapping's Invert asks the rate in the recorded orientation. - * - *

The SwitchMap cases select their routes with a SelectorMap of Box Regions; SelectorMap is not - * yet ported, so {@code rates_match_the_c_library} runs the others. + * differs from its Mapping's Invert asks the rate in the recorded orientation. A SwitchMap asks the + * rate of the route its forward selector, a SelectorMap of Box Regions, picks (switchmap.c Rate). */ class RateOracleTest { @@ -29,8 +27,37 @@ private static double ratemapAt(Mapping map, double... at) { return new RateMap(map, 1, 1).tranN(1, at.length, at, true, 1)[0]; } - /** Java's rate for a case, or null for a case that needs SelectorMap. */ - private static Double rate(String name) { + /** A SelectorMap over the 1-D intervals {@code bounds}, each {lower, upper}. */ + private static SelectorMap selector(double[]... bounds) { + Region[] regions = new Region[bounds.length]; + for (int i = 0; i < bounds.length; i++) { + regions[i] = new Box(new Frame(1), 1, new double[] {bounds[i][0]}, new double[] {bounds[i][1]}, null); + } + return new SelectorMap(regions, BAD); + } + + private static WinMap route(double lo, double hi, double olo, double ohi) { + return new WinMap(1, new double[] {lo}, new double[] {hi}, new double[] {olo}, new double[] {ohi}); + } + + /** + * The probe's SwitchMap: routes from [0,10] to [0,100] and from [20,30] to [200,300], a + * forward selector over the input intervals and, if {@code inverse}, an inverse selector over + * the output intervals, given inverted as C's constructor takes it. + */ + private static SwitchMap switchmap(boolean inverse) { + SelectorMap ismap = null; + if (inverse) { + ismap = selector(new double[] {0.0, 100.0}, new double[] {200.0, 300.0}); + ismap.invert(); + } + return new SwitchMap(selector(new double[] {0.0, 10.0}, new double[] {20.0, 30.0}), ismap, new Mapping[] { + route(0.0, 10.0, 0.0, 100.0), route(20.0, 30.0, 200.0, 300.0) + }); + } + + /** Java's rate for a case. */ + private static double rate(String name) { switch (name) { case "ratemap_zoommap_bad_input": return ratemapAt(new ZoomMap(1, 3.0), BAD); @@ -60,9 +87,13 @@ private static Double rate(String name) { return rm.tran1(1, new double[] {1.0}, true)[0]; } case "switchmap_forward": + return switchmap(false).rate(new double[] {5.0}, 1, 1); case "switchmap_inverted_no_selector": - case "switchmap_inverted_route": - return null; + case "switchmap_inverted_route": { + SwitchMap sm = switchmap("switchmap_inverted_route".equals(name)); + sm.invert(); + return sm.rate(new double[] {50.0}, 1, 1); + } default: throw new IllegalArgumentException("no Java construction for case " + name); } @@ -74,10 +105,7 @@ void ratesMatchTheCLibrary() { int ran = 0; for (JsonNode c : ProbeData.load("rate").get("CASES")) { String name = c.get(0).asText(); - Double got = rate(name); - if (got == null) { - continue; - } + double got = rate(name); double want = ProbeData.toDouble(c.get(1)); if (Double.compare(got, want) != 0) { failures.add(name + ": " + got + ", C " + want); @@ -85,6 +113,6 @@ void ratesMatchTheCLibrary() { ran++; } assertTrue(failures.isEmpty(), String.join("\n", failures)); - assertEquals(5, ran, "cases run"); + assertEquals(8, ran, "cases run"); } } diff --git a/src/test/java/uk/ac/starlink/ast/RegionStcOracleTest.java b/src/test/java/uk/ac/starlink/ast/RegionStcOracleTest.java new file mode 100644 index 0000000..c041d00 --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/RegionStcOracleTest.java @@ -0,0 +1,571 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.fasterxml.jackson.databind.JsonNode; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; +import uk.ac.starlink.ast.testsupport.CValues; +import uk.ac.starlink.ast.testsupport.ProbeData; + +/** + * Translation of Rust {@code tests/test_region_stc_oracle.rs}: the Stc classes against C (stc.c, + * stcresourceprofile.c, stcsearchlocation.c, stccatalogentrylocation.c, stcobsdatalocation.c), from + * {@code oracle/region_stc.json} ({@code tools/oracle_fixtures/region_stc_probe.c}): the dumps of a + * plain, a negated and a sky StcResourceProfile whose AstroCoords Error Region is given in another + * SkyFrame, of an Stc made from an Stc whose base->current Mapping is a ZoomMap, of that mapped Stc + * simplified, of an StcSearchLocation, of an StcCatalogEntryLocation with the sky AstroCoords, and + * of an StcObsDataLocation without and with an observatory position; two test points transformed + * by each and whether it is bounded; each dump written with Full = 1; each of C's dumps read back + * and written again; the overlap of the plain Stc with a Circle each way round; the AstroCoords + * element {@code astGetStcCoord} gives; and the errors for an AstroCoords index out of range and an + * unknown key. C's probe transforms the points before it writes the dumps, as {@link #stcMatchesC} + * and {@link #fullDumpsMatchC} do, since the transformation leaves Negated set on the encapsulated + * Region. The probe gives the {@code obs_data} case its position with the protected {@code + * astStcSetObs}, as {@link #built} does with {@link StcObsDataLocation#setObs}. + * + *

{@code error_ellipse_licence_is_still_needed} checks a licence of the Rust port's own and is + * not translated. + * + *

The values in a plain Frame are exact. In the SkyFrame of the {@code sky} and {@code + * catalog_entry} cases, the second defining point of each Circle comes from {@code + * SkyFrame.offset2}, whose difference from C's {@code astOffset2} {@code RegionEllipseOracleTest} + * bounds by {@code 3e-14} for a centre at latitude 0.8 and an offset of 0.2 radians; the chain here + * is the same with smaller offsets, so the numbers in those dumps are compared to within {@link + * #SKY_TOL}, {@code 1e-12}. A dump C wrote and Java reads back holds C's numbers, and is compared + * exactly. + * + *

The AstroCoords Error Region of the {@code sky} and {@code catalog_entry} cases, and so {@code + * SKY_COORD}, is a Galactic + * Circle of radius {@code R = 1e-4} that the Stc re-expresses in ICRS as the Ellipse that best fits + * its mapped boundary mesh of {@code N = 200} points (ellipse.c {@code astBestEllipse}, {@link + * Ellipse#bestEllipse}; {@code ERROR_ELLIPSE_LICENSED} in the Rust test). The Ellipse's three defining + * points are its centre and the ends of its primary and secondary axes. The centre is the Circle's + * centre converted from Galactic to ICRS (the sines and cosines of its coordinates, a product of + * rotation matrices, then {@code atan2} and {@code asin}), a few ulps of values below 2, and is + * compared within {@link #SKY_TOL}. + * + *

The ends of the axes are not determined by the values. The conversion is a rotation, so the + * exact mesh is a circle about the centre and its points' distances from the centre differ only by + * rounding. The fit takes the direction of the primary axis from the vertex of the parabola through + * the farthest mesh point and its neighbours, so a difference of a few ulps in the mesh moves that + * direction anywhere within a mesh step around the centre: this machine's {@code java.lang.Math} + * puts the axis ends about {@code 2e-5} away from C's, as the Rust test finds of other platforms. No + * tolerance on them short of the radius follows, and one of the radius tests nothing, so {@link + * #withoutEllipseAxisEnds} leaves out their values, as the Rust test leaves out the Ellipse's values + * off the platform its C values were taken on, as phase 7 compares an Ellipse fitted to a Circle, + * and as {@code docs/rust-c-differences.md} records. The two half-lengths, which the direction does + * not decide, are compared instead ({@link #assertHalfLengths}), within bounds worked out from + * {@code bestEllipse}'s arithmetic as follows. + * + *

Each platform's mesh coordinates are within {@link #DELTA}, {@code 1e-14}, of their exact + * values: {@code SkyFrame.offset2} with an offset of {@code 1e-4} on values below 2, then the + * conversion above, each step a few ulps (below {@code 4.4e-16} each) of well-conditioned values, + * about 20 ulps in all. A distance of {@code 1e-4} from the centre is then within {@link #EPS_D}, + * {@code 3 DELTA}, of the exact {@code R} (both points move, by up to {@code sqrt(2) DELTA} each, + * and the distance's own rounding is below {@code 1e-16}); the components {@code px} and {@code py} + * of a mesh point along and across the primary axis are within {@link #ETA}, {@code 4 DELTA} (as the + * distance, and the axis end the components are resolved against moves the direction by {@code + * DELTA / R} radians, which moves {@code py} by up to {@code DELTA} more). + * + *

Primary half-length {@code mx}: it is the largest distance {@code r2}, or the vertex of the + * parabola through {@code r2} and its neighbours {@code r1} and {@code r3}, at equal steps of angle + * (the mesh is uniform), whose height above {@code r2} is {@code (a - b)^2 / (8 (a + b)) <= (a + b) / + * 8} with {@code a = r2 - r1}, {@code b = r2 - r3}. The distances are all {@code R} within {@code + * EPS_D}, so {@code a + b <= 4 EPS_D} and each platform's {@code mx} is within {@link #DMX}, {@code + * 1.5 EPS_D}, of {@code R}. The dumped axis end is {@code astOffset2} of the centre by {@code mx}, + * whose distance the test measures again within {@code EPS_D}. So the two platforms' primary + * half-lengths agree within {@code 2 DMX + 2 EPS_D = 1.5e-13}. + * + *

Secondary half-length {@code mn}: {@code smn / sw}, where {@code sw = sum w_i}, {@code smn = sum + * T_i}, {@code w_i = |py_i|} and {@code T_i = mx py_i^2 / sqrt(mx^2 - px_i^2)}, over the points with + * {@code mx^2 - px_i^2 > 0}. In exact arithmetic {@code mx = R}, and for a point on the circle the + * spherical right triangle {@code cos R = cos px cos py} gives {@code R^2 - px^2 = py^2 (1 - px^2 / 3 + * + O(R^4))}, so {@code T*_i = R |py*_i| (1 + px*_i^2 / 6)} to a relative {@code O(R^4)}, and the + * exact value at a direction {@code theta} is {@code mn*(theta) = R + R F(theta) / 6} with {@code F = + * sum(px^2 |py|) / sum|py|}, about {@code R^2 / 3}: the offset of about {@code R^3 / 18 = 5.6e-14} + * seen between each platform's two half-lengths. The two platforms' values are compared through + * {@code mn_C - mn_J = (mn_C - mn*(theta_C)) + (mn*(theta_C) - mn*(theta_J)) + (mn*(theta_J) - + * mn_J)}, each part bounded as follows. + * + *

    + *
  • C's own rounding, at C's direction, which is oracle data: to first order, {@code DMX} + * through the factor {@code mx}, {@code 3 N mx ETA / sw} through {@code py^2} and the weights, + * and {@code mx R (DMX + ETA) sum(1/|py|) / sw} through {@code mx^2 - px^2}, which is about + * {@code py^2} and moves by up to {@code 2 R (DMX + ETA)}; the last is 1.2 times its first-order + * value wherever that relative change is at most 0.1, as it is at every point by a factor of + * {@code 1.3e4} at C's direction ({@link #firstOrderBound}, which checks it). + *
  • The directions: {@code R |F(theta_C) - F(theta_J)| / 6}, from the mesh resolved at each + * ({@link #curvature}; {@code 1.3e-17} here; {@code ETA} moves each {@code F} by under {@code + * 1e-16}, which {@code R / 6} makes {@code 2e-21}). + *
  • This platform's own rounding, at its own direction, which may lie as near a mesh point as the + * last bits of the mesh put it, so the first-order bound does not serve: it is bounded after + * the fact instead ({@link #platformBound}). The test repeats this platform's fit ({@link + * #refit}, calling the Circle's fit and the parts of {@code bestEllipse} that give the + * primary half-length and each {@code T_i}) and requires it to give the dumped axis ends bit + * for bit, so that its {@code T_i}, {@code w_i} and resolved components are the fit's own; + * then, since {@code |px*_i - px_i|} and {@code |py*_i - py_i|} are at most {@code ETA}, + * {@code |smn - sum T*_i| <= sum |T_i - R |py_i| (1 + px_i^2 / 6)| + N R ETA (1 + R^2)} (a point + * the fit left out has {@code T_i = 0}) and {@code |sw - sum w*_i| <= N ETA + sum of |py_i| over + * those points}, whence {@code |mn_J - mn*(theta_J)| <= (|smn - sum T*| + R (1 + R^2) |sw - sum + * w*|) / sw}, with {@code R^5} added for the {@code O(R^4)} term. No term divides by a small + * {@code |py|}, and nothing about the platform's direction is assumed. + *
+ * + *

Each dumped secondary axis end is measured again within {@code EPS_D}. The two platforms' + * secondary half-lengths agree within the sum, about {@code 1.1e-12} on this machine, a part in + * {@code 1e8} of the radius; they differ by {@code 6.4e-15}. + */ +class RegionStcOracleTest { + + private static final JsonNode DATA = ProbeData.load("region_stc"); + + /** The tolerance on the numbers of a dump in a SkyFrame (see the class description). */ + private static final double SKY_TOL = 1.0e-12; + + /** The number of cases in {@code CASES} and in {@code FULL_DUMPS}. */ + private static final int NCASES = 10; + + /** The radius of the Error Circle, {@code R} in the class description. */ + private static final double ERROR_RADIUS = 1.0e-4; + + /** How far each platform's mesh coordinates may be from exact (see the class description). */ + private static final double DELTA = 1.0e-14; + + /** How far a distance from the centre may be from exact (see the class description). */ + private static final double EPS_D = 3.0 * DELTA; + + /** How far a component along or across the axis may be from exact (see the class description). */ + private static final double ETA = 4.0 * DELTA; + + /** How far the primary half-length may be from the radius (see the class description). */ + private static final double DMX = 1.5 * EPS_D; + + /** The cases whose dump holds the fitted Error Ellipse (see the class description). */ + private static final List ERROR_ELLIPSE_CASES = Arrays.asList("sky", "catalog_entry", "sky_coord"); + + /** The cases whose dump is in a SkyFrame (see the class description). */ + private static final List SKY_CASES = ERROR_ELLIPSE_CASES; + + private static final double[] C0 = {0.0, 0.0}; + + private static Circle circle(Frame frame, double[] centre, double radius) { + return new Circle(frame, 1, centre, new double[] {radius}, null); + } + + private static StcResourceProfile plain() { + return new StcResourceProfile(circle(new Frame(2), C0, 1.0), (AstroCoords[]) null); + } + + private static SkyFrame sky(String system) { + SkyFrame sf = new SkyFrame(); + if (system != null) { + sf.setSystem(system); + } + return sf; + } + + private static KeyMap skyCoord() { + KeyMap coord = new KeyMap(); + coord.mapPut1C(Stc.AST__STCNAME, new String[] {"RA", "Dec"}, null); + coord.mapPut0A(Stc.AST__STCERROR, circle(sky("Galactic"), new double[] {2.0, -0.3}, 0.0001), null); + return coord; + } + + private static Circle skyCircle() { + return circle(sky(null), new double[] {1.0, 0.5}, 0.01); + } + + private static Circle plainCircle() { + return circle(new Frame(2), C0, 1.0); + } + + private static StcResourceProfile skyStc() { + return new StcResourceProfile(skyCircle(), new KeyMap[] {skyCoord()}); + } + + private static Region mapped() { + Frame zoomed = new Frame(2); + zoomed.setDomain("ZOOMED"); + return plain().mapRegionInto(new ZoomMap(2, 2.0), zoomed); + } + + /** The Stc each case names, built as the probe builds it. */ + private static Region built(String name) { + switch (name) { + case "plain": + return plain(); + case "negated": + // C negates a copy (astCopy) of the plain Stc. + Region neg = (Region) plain().copy(); + neg.negate(); + return neg; + case "sky": + return skyStc(); + case "mapped": + return mapped(); + case "from_mapped": + return new StcResourceProfile(mapped(), (AstroCoords[]) null); + case "mapped_simplified": + return (Region) mapped().simplify(); + case "search": + return new StcSearchLocation(plainCircle(), (AstroCoords[]) null); + case "catalog_entry": + return new StcCatalogEntryLocation(skyCircle(), new KeyMap[] {skyCoord()}); + case "obs_data_without_obs": + return new StcObsDataLocation(plainCircle(), (AstroCoords[]) null); + case "obs_data": + StcObsDataLocation obsData = new StcObsDataLocation(plainCircle(), (AstroCoords[]) null); + Frame geo = new Frame(3); + geo.setDomain("GEO"); + obsData.setObs(new PointList(geo, 1, new double[][] {{1.0}, {2.0}, {3.0}}, null)); + return obsData; + default: + throw new IllegalArgumentException("no case " + name); + } + } + + /** + * {@code dump} without the values of the PointSets inside Ellipses other than the first point, + * the centre. + */ + static String withoutEllipseAxisEnds(String dump) { + StringBuilder sb = new StringBuilder(); + boolean inEllipse = false; + for (String l : CValues.lines(dump)) { + String t = l.trim(); + if (t.startsWith("Begin Ellipse")) { + inEllipse = true; + } else if (t.startsWith("End Ellipse")) { + inEllipse = false; + } + if (!(inEllipse && isValue(t) && !t.startsWith("X1 =") && !t.startsWith("X2 ="))) { + sb.append(l).append('\n'); + } + } + return sb.toString(); + } + + /** Whether {@code t}, a trimmed line, is a value {@code X = ...} of a PointSet. */ + private static boolean isValue(String t) { + return t.startsWith("X") && t.contains(" = "); + } + + /** The defining points of each Ellipse in {@code dump}: centre, then the two axis ends. */ + private static List ellipsePoints(String dump) { + List out = new ArrayList<>(); + List vals = null; + for (String l : CValues.lines(dump)) { + String t = l.trim(); + if (t.startsWith("Begin Ellipse")) { + vals = new ArrayList<>(); + } else if (t.startsWith("End Ellipse")) { + assertEquals(6, vals.size(), "values of an Ellipse"); + double[][] p = new double[3][2]; + for (int i = 0; i < 6; i++) { + p[i / 2][i % 2] = vals.get(i); + } + out.add(p); + vals = null; + } else if (vals != null && isValue(t)) { + vals.add(Double.parseDouble(CValues.splitWhitespace(t)[2])); + } + } + return out; + } + + /** + * The Error Circle mapped into ICRS, as the Stc maps it before simplifying it, which fits the + * Ellipse. + */ + private static Region mappedErrorCircle() { + Circle err = circle(sky("Galactic"), new double[] {2.0, -0.3}, ERROR_RADIUS); + FrameSet fs = err.convert(sky(null), ""); + return err.mapRegionInto( + fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT), fs.getFrame(FrameSet.AST__CURRENT)); + } + + /** This platform's fit of an Ellipse to the Error Circle, with the values it computed on the way. */ + private static final class Fit { + /** The Frame of the fit, the uncertainty's. */ + Frame frm; + /** The centre. */ + double[] cen; + /** The mesh, {@code [2][n]}. */ + double[][] mesh; + /** The ends of the primary and secondary axes. */ + double[] pa; + + double[] pb; + /** The primary half-length. */ + double mx; + /** The components of the mesh points along and across the primary axis. */ + double[][] ps2; + /** Each point's {@code T_i}, and {@code w_i}; zero for a point the fit leaves out. */ + double[] t; + + double[] w; + } + + /** + * This platform's Ellipse fit of the Error Circle, as {@code Circle.simplifyStep} makes it + * ({@link Circle#fittedCircleOrEllipse}), with the mesh, centre and Frame it fits in, the + * primary half-length ({@link Ellipse#bestPrimaryAxis}), and the resolved components, {@code + * T_i} ({@link Ellipse#secondaryEstimate}) and {@code w_i} the fit used, which the bound needs. + */ + private static Fit refit() { + Region reg = mappedErrorCircle(); + Region nw = reg.parentSimplify(); + Fit f = new Fit(); + f.mesh = nw.regMesh(); + double[][] c = reg.regTransform(null, true); + f.cen = new double[] {c[0][0], c[1][0]}; + f.frm = nw.getUncFrm(FrameSet.AST__CURRENT).regFrame(); + Ellipse fit = assertInstanceOf(Ellipse.class, Circle.fittedCircleOrEllipse(reg, nw), "the fit"); + double[][] pts = fit.getRegionPoints(); + f.pa = new double[] {pts[0][1], pts[1][1]}; + f.pb = new double[] {pts[0][2], pts[1][2]}; + f.mx = Ellipse.bestPrimaryAxis(f.mesh, f.cen, f.frm)[1]; + int np = f.mesh[0].length; + f.ps2 = f.frm.resolvePoints(f.cen, f.pa, f.mesh, np); + f.t = new double[np]; + f.w = new double[np]; + for (int ip = 0; ip < np; ip++) { + double t = Ellipse.secondaryEstimate(f.mx, f.ps2[0][ip], f.ps2[1][ip]); + if (t != AstObject.AST__BAD) { + f.t[ip] = t; + f.w[ip] = Math.abs(f.ps2[1][ip]); + } + } + return f; + } + + /** {@code sum(px^2 |py|) / sum|py|}, the sampling of the systematic term (see the class description). */ + private static double curvature(double[][] r) { + double num = 0.0; + double den = 0.0; + for (int i = 0; i < r[0].length; i++) { + double py = Math.abs(r[1][i]); + num += r[0][i] * r[0][i] * py; + den += py; + } + return num / den; + } + + /** + * The first-order bound on how far rounding moves C's secondary half-length from its exact + * value at C's direction, whose components are {@code r} (see the class description). + */ + private static double firstOrderBound(double[][] r, double mx) { + int n = r[0].length; + double sumAbs = 0.0; + double sumInv = 0.0; + double minAbs = Double.MAX_VALUE; + for (int i = 0; i < n; i++) { + double py = Math.abs(r[1][i]); + sumAbs += py; + sumInv += 1.0 / py; + minAbs = Math.min(minAbs, py); + } + double change = 2.0 * ERROR_RADIUS * (DMX + ETA); + assertTrue(change / (minAbs * minAbs) <= 0.1, "C's axis is too close to a mesh point (|py| = " + minAbs + ")"); + return DMX + mx * (3.0 * n * ETA + 1.2 * ERROR_RADIUS * (DMX + ETA) * sumInv) / sumAbs; + } + + /** + * The bound, after the fact, on how far rounding moves this platform's secondary half-length + * from its exact value at its own direction (see the class description). + */ + private static double platformBound(Fit f) { + double r = ERROR_RADIUS; + int n = f.t.length; + double sw = 0.0; + double dt = 0.0; + double dw = n * ETA; + for (int i = 0; i < n; i++) { + double px = f.ps2[0][i]; + double py = Math.abs(f.ps2[1][i]); + sw += f.w[i]; + dt += Math.abs(f.t[i] - r * py * (1.0 + px * px / 6.0)); + if (f.w[i] == 0.0) { + dw += py; + } + } + dt += n * r * ETA * (1.0 + r * r); + return (dt + r * (1.0 + r * r) * dw) / sw + Math.pow(r, 5); + } + + /** Compares the half-lengths of the Ellipses in two dumps (see the class description). */ + private static void assertHalfLengths(String name, String got, String want) { + List g = ellipsePoints(got); + List w = ellipsePoints(want); + assertFalse(w.isEmpty(), name + ": C's dump holds an Ellipse"); + assertEquals(w.size(), g.size(), name + ": Ellipses"); + Fit fit = refit(); + SkyFrame icrs = new SkyFrame(); + for (int i = 0; i < w.size(); i++) { + double[][] pw = w.get(i); + double[][] pg = g.get(i); + assertArrayEquals(fit.cen, pg[0], name + ": the refit centre is the dumped one"); + assertArrayEquals(fit.pa, pg[1], name + ": the refit primary axis end is the dumped one"); + assertArrayEquals(fit.pb, pg[2], name + ": the refit secondary axis end is the dumped one"); + double mx = icrs.distance(pw[0], pw[1]); + assertEquals( + mx, icrs.distance(pg[0], pg[1]), 2.0 * DMX + 2.0 * EPS_D, name + ": Ellipse " + i + " primary"); + double[][] rw = icrs.resolvePoints(pw[0], pw[1], fit.mesh, fit.mesh[0].length); + double tol = firstOrderBound(rw, mx) + + ERROR_RADIUS * Math.abs(curvature(rw) - curvature(fit.ps2)) / 6.0 + + platformBound(fit) + + 2.0 * EPS_D; + assertEquals( + icrs.distance(pw[0], pw[2]), + icrs.distance(pg[0], pg[2]), + tol, + name + ": Ellipse " + i + " secondary"); + } + } + + /** Compares the dump of case {@code name} with C's, as the class description says. */ + private static void assertDump(String name, String got, String want) { + String g = got; + String w = want; + if (ERROR_ELLIPSE_CASES.contains(name)) { + assertHalfLengths(name, got, want); + g = withoutEllipseAxisEnds(g); + w = withoutEllipseAxisEnds(w); + } + if (SKY_CASES.contains(name)) { + assertTrue(CValues.nativeStringsWithin(g, w, SKY_TOL), name + ": dump\n--- got\n" + g + "--- C\n" + w); + } else { + assertEquals(w, g, name + ": dump"); + } + } + + /** The case of {@code CASES} called {@code name}. */ + private static JsonNode testCase(String name) { + for (JsonNode c : DATA.get("CASES")) { + if (c.get(0).textValue().equals(name)) { + return c; + } + } + throw new IllegalArgumentException("no case " + name); + } + + /** Transforms the two test points of case {@code c} with {@code stc} and compares them with C's. */ + private static void assertPoints(String name, Region stc, JsonNode c) { + JsonNode points = c.get(3); + int n = points.size(); + double[][] in = new double[2][n]; + for (int i = 0; i < n; i++) { + in[0][i] = ProbeData.toDouble(points.get(i).get(0)); + in[1][i] = ProbeData.toDouble(points.get(i).get(1)); + } + double[][] out = stc.transform(in, n, true); + for (int i = 0; i < n; i++) { + double[] want = { + ProbeData.toDouble(points.get(i).get(2)), + ProbeData.toDouble(points.get(i).get(3)) + }; + CValues.assertCValues(new double[] {out[0][i], out[1][i]}, want, name + ": point " + i); + } + } + + /** The text a Channel with Full = 1 writes for {@code obj}. */ + private static String fullDump(AstObject obj) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + Channel ch = new Channel(null, out); + ch.setFull(1); + try { + ch.write(obj); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return new String(out.toByteArray(), StandardCharsets.UTF_8); + } + + @Test + void stcMatchesC() { + int run = 0; + for (JsonNode c : DATA.get("CASES")) { + String name = c.get(0).textValue(); + run++; + Region stc = built(name); + assertPoints(name, stc, c); + assertDump(name, ChannelText.dump(stc), c.get(1).textValue()); + assertEquals(c.get(4).booleanValue(), stc.getBounded(), name + ": bounded"); + } + assertEquals(NCASES, run, "cases run"); + } + + @Test + void fullDumpsMatchC() { + int run = 0; + for (JsonNode c : DATA.get("FULL_DUMPS")) { + String name = c.get(0).textValue(); + run++; + Region stc = built(name); + assertPoints(name, stc, testCase(name)); + assertDump(name, fullDump(stc), c.get(1).textValue()); + } + assertEquals(NCASES, run, "cases run"); + } + + @Test + void cDumpsReadBackAsCReadsThem() { + int run = 0; + for (JsonNode c : DATA.get("CASES")) { + String name = c.get(0).textValue(); + run++; + Region region = (Region) ChannelText.read(c.get(1).textValue()); + assertEquals(c.get(2).textValue(), ChannelText.dump(region), name); + } + assertEquals(NCASES, run, "cases run"); + } + + @Test + void overlapWithACircleMatchesC() { + StcResourceProfile stc = plain(); + Circle big = circle(new Frame(2), C0, 2.0); + assertEquals(DATA.get("OVERLAP_STC_CIRCLE").intValue(), stc.overlap(big)); + assertEquals(DATA.get("OVERLAP_CIRCLE_STC").intValue(), big.overlap(stc)); + } + + @Test + void astroCoordsMatchC() { + StcResourceProfile stc = skyStc(); + assertEquals(DATA.get("SKY_NCOORD").intValue(), stc.getStcNCoord()); + KeyMap coord = stc.stcCoord(1); + assertDump("sky_coord", ChannelText.dump(coord), DATA.get("SKY_COORD").textValue()); + assertEquals("Circle", stc.getC("RegionClass")); + + AstException e = assertThrows(AstException.class, () -> stc.stcCoord(2)); + assertEquals(DATA.get("COORD_INDEX").intValue(), e.getStatus()); + assertEquals( + "astGetStcCoord(StcResourceProfile): Supplied AstroCoords index (2) is invalid.", + e.getMsgText().split("\n", -1)[0]); + } + + @Test + void unknownAstroCoordsKeyIsStckey() { + KeyMap bad = new KeyMap(); + bad.mapPut0A("Colour", circle(sky("Galactic"), new double[] {2.0, -0.3}, 0.0001), null); + AstException e = + assertThrows(AstException.class, () -> new StcResourceProfile(skyCircle(), new KeyMap[] {bad})); + assertEquals(AstException.AST__STCKEY, e.getStatus()); + assertEquals(DATA.get("COORD_KEY").intValue(), e.getStatus()); + assertEquals( + "astInitStc(StcResourceProfile): Unknown key \"Colour\" supplied in an AstroCoords list.", + e.getMsgText()); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/RegionsCTest.java b/src/test/java/uk/ac/starlink/ast/RegionsCTest.java index 915efe3..368b9fb 100644 --- a/src/test/java/uk/ac/starlink/ast/RegionsCTest.java +++ b/src/test/java/uk/ac/starlink/ast/RegionsCTest.java @@ -21,8 +21,7 @@ * REGIONS_C_GAP_EXCLUDED}): an Ellipse with a Box uncertainty mapped through a full MatrixMap and * back gives C's result, an Ellipse with no FrameSet each way that overlaps the original as the * same Region. Rust's {@code region_gaps_still_differ}, which checks that Rust's gap persists, is - * listed in {@code deferred/rust-tests.txt}, as is {@code check_remove_regions} ({@code - * astRemoveRegions}, which is not in this phase). + * listed in {@code deferred/rust-tests.txt}. */ class RegionsCTest { @@ -90,6 +89,51 @@ static void checkDump(Region reg, String text) { } } + /** Whether {@code a} and {@code b} agree on both axes to within 1e-10, C's test. */ + private static boolean near(double[] a, double[] b) { + return Math.abs(a[0] - b[0]) <= 1.0e-10 && Math.abs(a[1] - b[1]) <= 1.0e-10; + } + + /** + * {@code checkRemoveRegions}: a Circle clips a point outside it, and so does the FrameSet that + * converts Galactic coordinates to the Circle; with its Regions removed that FrameSet passes the + * point. A TranMap of two Regions becomes a UnitMap with the TranMap's own number of axes. + */ + @Test + void checkRemoveRegions() { + SkyFrame sf1 = sky("ICRS"); + Region reg = new Circle(sf1, new double[] {0.0, 0.0}, 0.001, null); + double[][] iin = {{0.0, 0.0}, {0.01, 0.01}}; + + double[][] out = tran2(reg, iin, true); + assertTrue(out[0][0] != BAD && out[0][1] != BAD, "RemoveRegions test 1 failed"); + assertTrue(near(out[0], iin[0]), "RemoveRegions test 2 failed"); + assertArrayEquals(new double[] {BAD, BAD}, out[1], "RemoveRegions test 3 failed"); + + SkyFrame sf2 = sky("Galactic"); + FrameSet fs = sf1.convert(sf2, " "); + double[][] gin = tran2(fs, iin, true); + FrameSet fs2 = new FrameSet(sf2); + fs2.addFrame(FrameSet.AST__BASE, new UnitMap(2), sf2); + fs = fs2.convert(reg, " "); + Mapping map = fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + out = tran2(map, gin, true); + assertTrue(out[0][0] != BAD && out[0][1] != BAD, "RemoveRegions test 4 failed"); + assertTrue(near(out[0], iin[0]), "RemoveRegions test 5 failed"); + assertArrayEquals(new double[] {BAD, BAD}, out[1], "RemoveRegions test 6 failed"); + + FrameSet removed = (FrameSet) fs.removeRegions(); + map = removed.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + out = tran2(map, gin, true); + assertTrue(out[0][0] != BAD && out[0][1] != BAD, "RemoveRegions test 7 failed"); + assertTrue(near(out[0], iin[0]), "RemoveRegions test 8 failed"); + assertTrue(near(out[1], iin[1]), "RemoveRegions test 9 failed"); + + map = new TranMap(reg, reg).removeRegions(); + assertInstanceOf(UnitMap.class, map, "RemoveRegions test 10 failed"); + assertEquals(2, map.getNin(), "RemoveRegions test 11 failed"); + } + /** * {@code checkBoxTransformAfterBounds}: a zero-width Box contains a point just off its * degenerate axis whether its bounds are asked for before or after the transformation, and the diff --git a/src/test/java/uk/ac/starlink/ast/RegionsTest.java b/src/test/java/uk/ac/starlink/ast/RegionsTest.java index 4f9f417..a25e0a6 100644 --- a/src/test/java/uk/ac/starlink/ast/RegionsTest.java +++ b/src/test/java/uk/ac/starlink/ast/RegionsTest.java @@ -28,15 +28,15 @@ * bounds of its own; and otherwise those the Rust test records, which the probe finds C gives for * each overlap and for several of the membership tests on the sky. The one the probe finds C does * not give is replaced by C's ({@link #cmpRegionNegatedReversal}). The other membership tests on - * the sky, which the probe does not make, test points well clear of every boundary. + * the sky, which the probe does not make, test points well clear of every boundary. The dumps of + * Regions with Negated, Closed, MeshSize and FillFactor set are C's, from {@code + * probes/region_dump_probe.c}. * *

{@code general_circle_bounds_and_disc} and {@code fitschan_sky_circle_bounds} are translated * without their checks of the bounding disc ({@code astGetRegionDisc}, not in jniast), as {@link * #generalCircleBounds} and {@link #fitsChanSkyCircleBounds}. Listed in {@code * deferred/rust-tests.txt}: {@code sky_circle_disc} and {@code sky_polygon_disc} ({@code - * astGetRegionDisc}), {@code remove_regions_from_frameset} and {@code - * remove_regions_unit_passthrough} ({@code astRemoveRegions}, not in this phase), and {@code - * convex_hull_basic} ({@code astConvex}, not in jniast). + * astGetRegionDisc}), and {@code convex_hull_basic} ({@code astConvex}, not in jniast). */ class RegionsTest { @@ -45,6 +45,9 @@ class RegionsTest { /** C's results for the checks {@code testregions.c} does not make, from {@code probes/regions_cross_probe.c}. */ private static final Map PROBE = ProbeOutput.load("regions_cross_probe"); + /** C's dumps of Regions with attributes set, from {@code probes/region_dump_probe.c}. */ + private static final Map DUMP_PROBE = ProbeOutput.load("region_dump_probe"); + /** * The tolerance on bounds compared with C's. The bounds of a Region on a SkyFrame come from * its boundary mesh, each point of which is found by a few calls of {@code sin}, {@code cos}, @@ -1516,6 +1519,51 @@ void systemChangeSimplifiedTransformConsistent() { } } + // ------------------------------------------------------------------ + // Removing Regions (testregions.c checkRemoveRegions) + // ------------------------------------------------------------------ + + /** + * A Circle clips a point outside it, and the Mapping of the ICRS to Galactic FrameSet, with its + * Regions removed, passes that point. This translates Rust's {@code remove_regions_from_frameset}, + * whose FrameSet from {@code convert} holds no Region, so nothing is removed. The C-valued cases + * that remove a Region a FrameSet holds are {@code RegionsCTest.checkRemoveRegions} (a Circle as + * the current Frame) and the {@code RemoveRegionsTest} cases {@code frameset_region_frame} (a Box + * as a Frame), {@code frameset_region_in_cmpmap} (a Circle in a CmpMap) and {@code + * frameset_region_map} (a Box as a Mapping). + */ + @Test + void removeRegionsFromFrameSet() { + SkyFrame sf1 = sky("ICRS"); + Circle circle = circleRadius(sf1, new double[] {0.0, 0.0}, 0.001); + assertNotEquals(BAD, tranRows(circle, true, new double[] {0.0, 0.0})[0][0], "centre should be inside"); + assertEquals(BAD, tranRows(circle, true, new double[] {0.01, 0.01})[0][0], "distant point should be clipped"); + + FrameSet fs = sf1.convert(sky("GALACTIC"), ""); + Mapping map = fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + assertNotEquals( + BAD, tranRows(map, true, new double[] {0.0, 0.0})[0][0], "origin should transform through FrameSet"); + + Mapping clean = map.removeRegions(); + assertNotEquals( + BAD, + tranRows(clean, true, new double[] {0.01, 0.01})[0][0], + "remove_regions should eliminate clipping"); + } + + /** Removing Regions from a Mapping that holds none gives an equivalent Mapping. */ + @Test + void removeRegionsUnitPassthrough() { + FrameSet fs = new FrameSet(new Frame(2)); + Mapping map = fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + Mapping clean = map.removeRegions(); + assertEquals(2, clean.getNin()); + assertEquals(2, clean.getNout()); + double[] out = tranRows(clean, true, new double[] {3.0, 4.0})[0]; + assertEquals(3.0, out[0], 1e-10); + assertEquals(4.0, out[1], 1e-10); + } + // ------------------------------------------------------------------ // A Region as the target of findFrame // ------------------------------------------------------------------ @@ -1529,4 +1577,54 @@ void findFrameSearchesARegionTargetAsItsFrame() { assertFalse(found.getFrame(FrameSet.AST__BASE) instanceof Circle); assertFalse(found.getFrame(FrameSet.AST__CURRENT) instanceof Circle); } + + // ------------------------------------------------------------------ + // Attribute values in a dump + // ------------------------------------------------------------------ + + /** The dump of {@code obj}, as the probe's {@code astShow} writes it. */ + private static String show(AstObject obj) { + StringBuilder sb = new StringBuilder(); + for (String l : ChannelText.dump(obj).split("\n", -1)) { + if (!l.isEmpty()) { + sb.append(ProbeOutput.trimLines(l)).append('\n'); + } + } + return sb.toString(); + } + + /** A Box with Closed, MeshSize and FillFactor set writes the values set, as C's does. */ + @Test + void boxDumpsTheValuesSet() { + Box box = new Box(new Frame(2), 1, new double[] {0.0, 0.0}, new double[] {1.0, 2.0}, null); + box.set("Closed=0,MeshSize=50,FillFactor=0.5"); + assertEquals(DUMP_PROBE.get("box"), show(box)); + } + + /** + * A CmpRegion with Closed and MeshSize set writes them, and so do its components, which its + * setters give them, as C's does. + */ + @Test + void cmpRegionDumpsTheValuesSet() { + Box a = new Box(new Frame(2), 1, new double[] {0.0, 0.0}, new double[] {2.0, 2.0}, null); + Box b = new Box(new Frame(2), 1, new double[] {1.0, 1.0}, new double[] {3.0, 3.0}, null); + CmpRegion cmp = new CmpRegion(a, b, CmpRegion.AST__AND); + cmp.set("Closed=0,MeshSize=20"); + assertEquals(DUMP_PROBE.get("cmpregion"), show(cmp)); + } + + /** + * A PointList's Closed attribute is always the opposite of Negated, but its dump writes the + * Closed value set on it, as C's region.c {@code Dump} reads it through its own {@code + * TestClosed} and {@code GetClosed}. + */ + @Test + void pointListDumpsTheClosedValueSet() { + PointList pl = new PointList(new Frame(2), 2, new double[][] {{0.0, 1.0}, {0.0, 2.0}}, null); + pl.set("Closed=0"); + assertEquals(DUMP_PROBE.get("pointlist"), "Closed " + pl.getI("Closed") + "\n" + show(pl)); + pl.set("Negated=1,Closed=1"); + assertEquals(DUMP_PROBE.get("pointlist_negated"), "Closed " + pl.getI("Closed") + "\n" + show(pl)); + } } diff --git a/src/test/java/uk/ac/starlink/ast/RemoveRegionsOracleTest.java b/src/test/java/uk/ac/starlink/ast/RemoveRegionsOracleTest.java new file mode 100644 index 0000000..98a271c --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/RemoveRegionsOracleTest.java @@ -0,0 +1,64 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.fasterxml.jackson.databind.JsonNode; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; +import uk.ac.starlink.ast.testsupport.ProbeData; + +/** + * Translation of Rust {@code tests/test_remove_regions_oracle.rs}: removing the Regions from a + * Mapping gives what C's {@code astRemoveRegions} gives. Each class removes them from its own + * components (cmpmap.c, tranmap.c, ratemap.c, region.c {@code RemoveRegions}), a series CmpMap + * drops a component that became a UnitMap, and a parallel CmpMap or a TranMap of two UnitMaps + * becomes one UnitMap. Each case's Mapping is read from C's dump, and the dump of the result must + * equal C's ({@code oracle/remove_regions.json}, from {@code + * tools/oracle_fixtures/remove_regions_probe.c}). + * + *

The cases {@code normmap_region} and {@code normmap_cmpframe} need NormMap, which jniast does + * not have, and are skipped by name. + */ +class RemoveRegionsOracleTest { + + private static final JsonNode DATA = ProbeData.load("remove_regions"); + + /** The cases that need a class astjava does not have. */ + private static final List SKIPPED = Arrays.asList("normmap_region", "normmap_cmpframe"); + + private static String text(JsonNode lines) { + StringBuilder sb = new StringBuilder(); + for (JsonNode l : lines) { + sb.append(l.textValue()).append('\n'); + } + return sb.toString(); + } + + @Test + void removingRegionsMatchesTheCLibrary() { + List failures = new ArrayList<>(); + int ran = 0; + int skipped = 0; + for (JsonNode c : DATA.get("CASES")) { + String name = c.get(0).textValue(); + if (SKIPPED.contains(name)) { + // NormMap (not in jniast). + skipped++; + continue; + } + Mapping map = (Mapping) ChannelText.read(text(c.get(1))); + String got = ChannelText.dump(map.removeRegions()); + String want = text(c.get(2)); + if (!want.equals(got)) { + failures.add(name + ":\n" + got + "\nC gives:\n" + want); + } + ran++; + } + assertTrue(failures.isEmpty(), String.join("\n", failures)); + assertEquals(9, ran, "cases run"); + assertEquals(SKIPPED.size(), skipped, "cases skipped"); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/RemoveRegionsTest.java b/src/test/java/uk/ac/starlink/ast/RemoveRegionsTest.java new file mode 100644 index 0000000..703cd2f --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/RemoveRegionsTest.java @@ -0,0 +1,349 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; +import uk.ac.starlink.ast.testsupport.ProbeOutput; + +/** + * Removing the Regions from the containers and nestings the {@code remove_regions} oracle does not + * cover, against C ({@code probes/remove_regions_extra_probe.c}). + * + *

A Region gives a copy of its current Frame (region.c {@code RemoveRegions}), and a Mapping + * holding no Region gives itself (mapping.c, C's {@code astClone}). A container replaces a + * component that comes back as a Frame with a UnitMap: a CmpMap and a TranMap every such + * component, so also a plain Frame or a FrameSet component that was already there when the other + * component changed (cmpmap.c, tranmap.c); a SwitchMap (its routes and both selectors), a RateMap + * and a FrameSet only a component that changed (switchmap.c, ratemap.c, frameset.c), which includes + * a FrameSet holding a Region, since C's {@code astIsAFrame} is true of a FrameSet. A CmpFrame or a + * FrameSet that changed is a copy whose unchanged components are the original's own Objects + * (cmpframe.c, frameset.c), so that an attribute set through the result is seen in the original. + * + *

Each case writes the lines the probe writes and compares them with C's exactly: the dump of + * the Mapping ({@code in}), the dump of the result ({@code out}), whether the result is the Mapping + * itself ({@code same}), and for a CmpFrame or a FrameSet whether each component of the result is + * the original's own. A SelectorMap removes no Regions (selectormap.c installs no {@code + * RemoveRegions}), so it is itself, and a SwitchMap with one as its selector removes the Regions of + * its routes only. + */ +class RemoveRegionsTest { + + private static final Map PROBE = ProbeOutput.load("remove_regions_extra_probe"); + + /** The names of the probe's cases, in the probe's order. */ + private static final List CASES = Arrays.asList( + "region_alone", + "frame_alone", + "no_regions_cmpmap", + "no_regions_frameset", + "cmpmap_frame_beside_region", + "tranmap_frame_beside_region", + "tranmap_frameset_beside_region", + "switchmap_region_route", + "switchmap_frame_route", + "switchmap_no_regions", + "switchmap_inverse_selector_region", + "switchmap_inverse_selector_is_region", + "switchmap_frameset_route", + "ratemap_frameset", + "frameset_region_frame", + "frameset_region_in_cmpmap", + "frameset_region_map", + "frameset_frame_map", + "cmpframe_two_regions", + "cmpframe_shared_component", + "cmpframe_no_regions", + "selectormap_alone", + "selectormap_switchmap"); + + private static final double[] SHIFT = {100.0, 100.0}; + + /** The probe's output for one case, written as the probe writes it. */ + private static final class Out { + private final List lines = new ArrayList<>(); + + void line(String text) { + lines.add(trimEnd(text)); + } + + void dump(String prefix, AstObject obj) { + for (String l : ChannelText.dump(obj).split("\n", -1)) { + if (!l.isEmpty()) { + line(prefix + " " + l); + } + } + } + + /** Writes the Mapping and what {@code removeRegions} returns, and returns that. */ + Mapping run(Mapping map) { + dump("in", map); + Mapping result = map.removeRegions(); + dump("out", result); + line("same " + same(result, map)); + return result; + } + + void components(Mapping result, Mapping map) { + Mapping[] r = result.decompose(null, null); + Mapping[] m = map.decompose(null, null); + line("component 1 same " + same(r[0], m[0])); + line("component 2 same " + same(r[1], m[1])); + } + + void frames(FrameSet result, FrameSet map) { + for (int i = 1; i <= map.getNframe(); i++) { + line("frame " + i + " same " + same(result.getFrame(i), map.getFrame(i))); + } + } + + /** C's {@code astSame}: 1 if {@code a} and {@code b} are the same Object, otherwise 0. */ + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // astSame compares the Objects. + private static int same(AstObject a, AstObject b) { + return a == b ? 1 : 0; + } + + private static String trimEnd(String s) { + int n = s.length(); + while (n > 0 && Character.isWhitespace(s.charAt(n - 1))) { + n--; + } + return s.substring(0, n); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + for (String l : lines) { + sb.append(l).append('\n'); + } + return sb.toString(); + } + } + + private static void check(String name, Out out) { + assertTrue(CASES.contains(name), name + " is not in CASES"); + assertEquals(PROBE.get(name), out.toString(), name); + } + + private static void check(String name, Mapping map) { + Out out = new Out(); + out.run(map); + check(name, out); + } + + private static Frame frame(int naxes, String domain) { + Frame f = new Frame(naxes); + if (domain != null) { + f.setDomain(domain); + } + return f; + } + + private static Box box2(double lo, double hi) { + return new Box(new Frame(2), 1, new double[] {lo, lo}, new double[] {hi, hi}, null); + } + + private static Circle circle2() { + return new Circle(new Frame(2), new double[] {1.0, 2.0}, 1.0, null); + } + + /** A PermMap from two axes to one, giving the first input. */ + private static PermMap pickFirst() { + return new PermMap(2, new int[] {1, 0}, 1, new int[] {1}, null); + } + + private static SwitchMap switch2(Mapping fs, Mapping r1, Mapping r2) { + return new SwitchMap(fs, null, new Mapping[] {r1, r2}); + } + + private static FrameSet pixToSky() { + FrameSet fs = new FrameSet(frame(2, "PIX")); + fs.addFrame(FrameSet.AST__BASE, new ZoomMap(2, 2.0), frame(2, "SKY")); + return fs; + } + + private static Out frameSetCase(FrameSet fs) { + Out out = new Out(); + out.frames((FrameSet) out.run(fs), fs); + return out; + } + + private static Out cmpFrameCase(CmpFrame cf) { + Out out = new Out(); + out.components(out.run(cf), cf); + return out; + } + + @Test + void aRegionGivesACopyOfItsFrame() { + check("region_alone", box2(0.0, 1.0)); + } + + @Test + void aFrameIsItself() { + check("frame_alone", frame(2, null)); + } + + @Test + void aCmpMapWithoutRegionsIsItself() { + check("no_regions_cmpmap", new CmpMap(new ZoomMap(2, 3.0), new ShiftMap(SHIFT), true)); + } + + @Test + void aFrameSetWithoutRegionsIsItself() { + check("no_regions_frameset", frameSetCase(pixToSky())); + } + + @Test + void aCmpMapTurnsAnUnchangedFrameIntoAUnitMap() { + check( + "cmpmap_frame_beside_region", + new CmpMap(frame(1, null), new CmpMap(box2(0.0, 1.0), new ZoomMap(2, 3.0), true), false)); + } + + @Test + void aTranMapTurnsAnUnchangedFrameIntoAUnitMap() { + check( + "tranmap_frame_beside_region", + new TranMap(frame(2, null), new CmpMap(box2(0.0, 1.0), new ZoomMap(2, 3.0), true))); + } + + /** C's {@code astIsAFrame} is true of a FrameSet, so its Mapping is lost: a C quirk, kept. */ + @Test + void aTranMapTurnsAFrameSetIntoAUnitMap() { + check("tranmap_frameset_beside_region", new TranMap(pixToSky(), box2(0.0, 1.0))); + } + + @Test + void aSwitchMapRemovesRegionsFromItsSelectorAndRoutes() { + check( + "switchmap_region_route", + switch2(new CmpMap(box2(0.0, 10.0), pickFirst(), true), box2(0.0, 1.0), new ZoomMap(2, 3.0))); + } + + @Test + void aSwitchMapKeepsAnUnchangedFrameRoute() { + check("switchmap_frame_route", switch2(pickFirst(), box2(0.0, 1.0), frame(2, null))); + } + + @Test + void aSwitchMapWithoutRegionsIsItself() { + check("switchmap_no_regions", switch2(pickFirst(), new ZoomMap(2, 2.0), new ZoomMap(2, 3.0))); + } + + @Test + void aSwitchMapRemovesRegionsFromItsInverseSelector() { + Mapping inv = pickFirst(); + inv.invert(); + check( + "switchmap_inverse_selector_region", + new SwitchMap(null, new CmpMap(inv, box2(0.0, 10.0), true), new Mapping[] { + new ZoomMap(2, 2.0), new ZoomMap(2, 3.0) + })); + } + + @Test + void aSwitchMapTurnsAnInverseSelectorRegionIntoAUnitMap() { + check( + "switchmap_inverse_selector_is_region", + new SwitchMap( + null, + new Interval(frame(1, null), new double[] {0.0}, new double[] {10.0}, null), + new Mapping[] {new ZoomMap(1, 2.0), new ZoomMap(1, 3.0)})); + } + + /** A FrameSet from PIX to SKY whose Mapping is a Box. */ + private static FrameSet frameSetWithRegion() { + FrameSet fs = new FrameSet(frame(2, "PIX")); + fs.addFrame(FrameSet.AST__BASE, box2(0.0, 10.0), frame(2, "SKY")); + return fs; + } + + /** C's {@code astIsAFrame} is true of a FrameSet, so its Mapping is lost: a C quirk, kept. */ + @Test + void aSwitchMapTurnsAChangedFrameSetRouteIntoAUnitMap() { + check("switchmap_frameset_route", switch2(pickFirst(), new ZoomMap(2, 2.0), frameSetWithRegion())); + } + + /** C's {@code astIsAFrame} is true of a FrameSet, so its Mapping is lost: a C quirk, kept. */ + @Test + void aRateMapTurnsAChangedFrameSetIntoAUnitMap() { + check("ratemap_frameset", new RateMap(frameSetWithRegion(), 1, 1)); + } + + @Test + void aRegionAsAFrameOfAFrameSetBecomesItsFrame() { + FrameSet fs = new FrameSet(frame(2, "PIX")); + fs.addFrame(FrameSet.AST__BASE, new ZoomMap(2, 2.0), box2(0.0, 10.0)); + fs.addFrame(FrameSet.AST__CURRENT, new ShiftMap(SHIFT), frame(2, "SKY")); + check("frameset_region_frame", frameSetCase(fs)); + } + + @Test + void aRegionInACmpMapInAFrameSetIsRemoved() { + FrameSet fs = new FrameSet(frame(2, "PIX")); + fs.addFrame(FrameSet.AST__BASE, new CmpMap(new ZoomMap(2, 2.0), circle2(), true), frame(2, "SKY")); + check("frameset_region_in_cmpmap", frameSetCase(fs)); + } + + @Test + void aRegionAsAMappingOfAFrameSetBecomesAUnitMap() { + FrameSet fs = new FrameSet(frame(2, "PIX")); + fs.addFrame(FrameSet.AST__BASE, box2(0.0, 10.0), frame(2, "SKY")); + check("frameset_region_map", frameSetCase(fs)); + } + + @Test + void aFrameSetKeepsAnUnchangedFrameAsAMapping() { + FrameSet fs = new FrameSet(frame(2, "PIX")); + fs.addFrame(FrameSet.AST__BASE, frame(2, null), box2(0.0, 10.0)); + check("frameset_frame_map", frameSetCase(fs)); + } + + @Test + void aCmpFrameOfTwoRegionsBecomesACmpFrameOfTheirFrames() { + CmpFrame cf = new CmpFrame( + box2(0.0, 1.0), new Interval(frame(1, null), new double[] {0.0}, new double[] {1.0}, null)); + check("cmpframe_two_regions", cmpFrameCase(cf)); + } + + @Test + void aCmpFrameSharesAnUnchangedComponent() { + CmpFrame cf = new CmpFrame(box2(0.0, 1.0), frame(1, null)); + Out out = new Out(); + Mapping result = out.run(cf); + out.components(result, cf); + ((Frame) result).setLabel(3, "Shared"); + out.dump("orig", cf); + check("cmpframe_shared_component", out); + } + + @Test + void aCmpFrameWithoutRegionsIsItself() { + check("cmpframe_no_regions", cmpFrameCase(new CmpFrame(frame(2, null), frame(1, null)))); + } + + private static SelectorMap selectorOfTwoBoxes() { + return new SelectorMap(new Region[] {box2(0.0, 1.0), box2(2.0, 3.0)}, AstObject.AST__BAD); + } + + @Test + void aSelectorMapKeepsItsRegions() { + check("selectormap_alone", selectorOfTwoBoxes()); + } + + @Test + void aSwitchMapKeepsTheRegionsOfItsSelectorMap() { + check("selectormap_switchmap", switch2(selectorOfTwoBoxes(), box2(0.0, 1.0), new ZoomMap(2, 3.0))); + } + + @Test + void probeCasesAreAllCovered() { + assertEquals(CASES, new ArrayList<>(PROBE.keySet())); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/SelectorMapProbeTest.java b/src/test/java/uk/ac/starlink/ast/SelectorMapProbeTest.java new file mode 100644 index 0000000..5a49539 --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/SelectorMapProbeTest.java @@ -0,0 +1,298 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Map; +import org.junit.jupiter.api.Test; +import uk.ac.starlink.ast.testsupport.ProbeOutput; + +/** + * SelectorMap behaviour against C, from {@code probes/selectormap_probe.c}: the index, or the bad + * value, a SelectorMap gives for points in overlapping, negated, unbounded and open Regions, on a + * boundary, and bad on one axis, the first Region holding a point winning; the dump of a + * SelectorMap after it has transformed points, in which its Regions have Closed set, as C's + * {@code Transform} leaves them (selectormap.c negates and re-closes its own Regions in place); its + * copy and comparisons; simplification, which keeps a SelectorMap whose Regions do not simplify + * and rebuilds one whose Region does; SelectorMaps in series, including two equal 1-D SelectorMaps + * both applied forward, which C's {@code MapMerge} replaces with a UnitMap; the load of a dump whose + * first Region's FrameSet holds a MathMap; the load of a dump without Regions; testregions.c's + * {@code checkSelectorMapEqual}; and the constructor's errors. + * + *

Each case writes the lines the probe writes and compares them with C's exactly. + */ +class SelectorMapProbeTest { + + private static final double BAD = AstObject.AST__BAD; + + private static final Map PROBE_CASES = ProbeOutput.load("selectormap_probe"); + + private static final double[] PX = { + 2.0, 7.0, 12.0, 10.0, 15.0, 60.0, -100.0, -200.0, 50.0, -105.0, BAD, 5.0, BAD, 20.0, 25.0 + }; + private static final double[] PY = { + 2.0, 7.0, 12.0, 5.0, 15.0, -1000.0, -100.0, 0.0, 0.0, -100.0, 5.0, BAD, BAD, 25.0, 25.0 + }; + private static final double[] PTS1 = {-1.0, 0.0, 0.5, 1.0, 2.0, BAD}; + + private static String probe(String name) { + String text = PROBE_CASES.get(name); + if (text == null) { + throw new IllegalStateException("no probe case " + name); + } + return text; + } + + /** The probe case without the lines naming the C source of an error. */ + private static String probeWithoutSource(String name) { + StringBuilder sb = new StringBuilder(); + for (String line : probe(name).split("\n", -1)) { + if (!line.startsWith("!! ") && !line.isEmpty()) { + sb.append(line).append('\n'); + } + } + return sb.toString(); + } + + private static String g(double v) { + return CFormat.format("%.17g", v); + } + + /** The dump of {@code obj}, as the probe's {@code astShow} writes it. */ + private static String show(AstObject obj) { + StringBuilder sb = new StringBuilder(); + for (String l : ChannelText.dump(obj).split("\n", -1)) { + if (!l.isEmpty()) { + sb.append(ProbeOutput.trimLines(l)).append('\n'); + } + } + return sb.toString(); + } + + /** The forward transformation of the 2-D points, one line each. */ + private static String tran2(Mapping m) { + double[] out = m.tranP(PX.length, 2, new double[][] {PX, PY}, true, 1)[0]; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < PX.length; i++) { + sb.append("fwd ") + .append(g(PX[i])) + .append(' ') + .append(g(PY[i])) + .append(" -> ") + .append(g(out[i])) + .append('\n'); + } + return sb.toString(); + } + + /** The forward transformation of 1-D points, one line each. */ + private static String tran1(Mapping m, double[] in) { + double[] out = m.tran1(in.length, in, true); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < in.length; i++) { + sb.append("fwd ").append(g(in[i])).append(" -> ").append(g(out[i])).append('\n'); + } + return sb.toString(); + } + + /** The class of the simplified Mapping, whether it is the Mapping itself, and its dump. */ + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // astSame compares the Objects. + private static String simp(Mapping m) { + Mapping s = m.simplify(); + return "-- simplified " + s.astClass() + " same " + (s == m ? 1 : 0) + "\n" + show(s); + } + + private static int flag(boolean b) { + return b ? 1 : 0; + } + + private static Box box2(double xlo, double ylo, double xhi, double yhi) { + return new Box(new Frame(2), 1, new double[] {xlo, ylo}, new double[] {xhi, yhi}, null); + } + + private static Box box1(double lo, double hi) { + return new Box(new Frame(1), 1, new double[] {lo}, new double[] {hi}, null); + } + + /** Review Focus 1: Regions that overlap, an unbounded Interval and a negated Circle. */ + private static SelectorMap focus(double badval) { + Circle circle = new Circle(new Frame(2), new double[] {-100.0, -100.0}, 5.0, null); + circle.negate(); + Region[] regs = { + box2(0.0, 0.0, 10.0, 10.0), + box2(5.0, 5.0, 15.0, 15.0), + new Interval(new Frame(2), new double[] {50.0, BAD}, new double[] {BAD, BAD}, null), + circle + }; + return new SelectorMap(regs, badval); + } + + /** A SelectorMap of two copies of one Box, the first open. */ + private static SelectorMap openClosed() { + Box open = box2(20.0, 20.0, 30.0, 30.0); + open.setClosed(false); + return new SelectorMap(new Region[] {open, box2(20.0, 20.0, 30.0, 30.0)}, -1.0); + } + + private static SelectorMap twoBoxes() { + return new SelectorMap(new Region[] {box2(0.0, 0.0, 10.0, 10.0), box2(20.0, 20.0, 30.0, 30.0)}, -1.0); + } + + @Test + void indicesMatchC() { + assertEquals(probe("focus_points"), tran2(focus(-1.0))); + assertEquals(probe("focus_points_bad"), tran2(focus(BAD))); + assertEquals(probe("open_closed_points"), tran2(openClosed())); + } + + /** + * Review Focus 2: C's {@code Transform} leaves Closed set on each of the SelectorMap's own + * Regions, so a dump made after a transformation has {@code Closed} lines; comparisons, which + * read the values, are unchanged. + */ + @Test + void aTransformationLeavesClosedSetAsC() { + SelectorMap before = focus(-1.0); + assertEquals(probe("focus_dump_before"), show(before)); + + SelectorMap sm = focus(-1.0); + assertEquals(probe("focus_dump_after"), tran2(sm) + show(sm)); + assertEquals(probe("focus_copy_after"), show(sm.copy())); + SelectorMap fresh = focus(-1.0); + String equal = "equal fresh " + flag(sm.astEqual(fresh)) + "\nequal fresh reversed " + flag(fresh.astEqual(sm)) + + "\nequal copy " + flag(sm.astEqual(sm.copy())) + "\n"; + assertEquals(probe("focus_equal_after"), equal); + + SelectorMap oc = openClosed(); + assertEquals(probe("open_closed_dump_after"), tran2(oc) + show(oc)); + } + + /** Item 3: a SelectorMap whose Regions do not simplify is itself; one whose Region does is rebuilt. */ + @Test + void simplificationMatchesC() { + SelectorMap sm = twoBoxes(); + assertEquals(probe("simplify_unchanged"), simp(sm) + "-- original after\n" + show(sm)); + + Region interval = new Interval(new Frame(2), new double[] {0.0, 0.0}, new double[] {10.0, 10.0}, null); + SelectorMap sm2 = new SelectorMap(new Region[] {interval, box2(20.0, 20.0, 30.0, 30.0)}, -1.0); + assertEquals(probe("simplify_changed"), show(sm2) + simp(sm2) + tran2(sm2.simplify())); + } + + /** + * Item 4: C's {@code MapMerge} inverts the neighbouring SelectorMap and compares it with {@code + * Equal}, which ignores Invert, so two equal 1-D SelectorMaps both applied forward merge into a + * UnitMap, although the pair gives 1 for every point in the Region. + */ + @Test + void selectorMapsInSeriesSimplifyAsC() { + SelectorMap sm = new SelectorMap(new Region[] {box1(0.0, 1.0)}, BAD); + SelectorMap sm2 = (SelectorMap) sm.copy(); + CmpMap cm = new CmpMap(sm, sm2, true); + assertEquals( + probe("series_1d_both_forward"), + "equal " + flag(sm.astEqual(sm2)) + "\n" + tran1(cm, PTS1) + simp(cm) + tran1(cm.simplify(), PTS1)); + + SelectorMap inv = (SelectorMap) sm.copy(); + inv.invert(); + assertEquals(probe("series_1d_second_inverted"), simp(new CmpMap(sm, inv, true))); + + SelectorMap other = new SelectorMap(new Region[] {box1(0.0, 2.0)}, BAD); + assertEquals(probe("series_1d_different"), simp(new CmpMap(sm, other, true))); + + SelectorMap two = twoBoxes(); + SelectorMap twoInv = (SelectorMap) two.copy(); + twoInv.invert(); + assertEquals(probe("series_2d_second_inverted"), simp(new CmpMap(two, twoInv, true))); + assertEquals(probe("series_2d_first_inverted"), simp(new CmpMap(twoInv, two, true))); + assertEquals(probe("parallel_2d"), simp(new CmpMap(two, two, false))); + } + + /** + * The second Region is written without its Frame and, read back, given the first Region's + * FrameSet, whose Mapping is a MathMap (selectormap.c {@code astLoadSelectorMap}): {@code + * astSetRegFS} joins the base Frame to that FrameSet's current Frame with a UnitMap, so the + * Region is as it was. + */ + @Test + void aLaterRegionIsGivenTheFirstRegionsFrameSetAsC() { + Circle circle = new Circle(new Frame(2), new double[] {0.0, 0.0}, 1.0, null); + MathMap cube = + new MathMap(2, 2, new String[] {"x=a*a*a", "y=b"}, new String[] {"a=sign(abs(x)**(1/3.),x)", "b=y"}); + Region[] regs = {circle.mapRegion(cube, new Frame(2)), box2(3.0, 3.0, 4.0, 4.0)}; + SelectorMap sm = new SelectorMap(regs, -1.0); + Mapping back = (Mapping) ChannelText.read(ChannelText.dump(sm)); + StringBuilder sb = new StringBuilder() + .append("-- written\n") + .append(show(sm)) + .append("-- read back\n") + .append(show(back)) + .append("-- equal ") + .append(flag(sm.astEqual(back))) + .append('\n'); + double[][] q = {{0.5, 3.5, 40.0, 7.0}, {0.5, 3.5, 3.5, 7.0}}; + String[] labels = {"written", "read back"}; + Mapping[] maps = {sm, back}; + for (int k = 0; k < 2; k++) { + double[] out = maps[k].tranP(4, 2, q, true, 1)[0]; + for (int i = 0; i < 4; i++) { + sb.append(labels[k]) + .append(' ') + .append(g(q[0][i])) + .append(' ') + .append(g(q[1][i])) + .append(" -> ") + .append(g(out[i])) + .append('\n'); + } + } + assertEquals(probe("load_first_region_mapped"), sb.toString()); + } + + /** + * C cannot load a SelectorMap without Regions: {@code astLoadSelectorMap} annuls the first + * Region's FrameSet pointer, which is null, and fails with AST__OBJIN. Here the load fails with + * AST__LDERR. + */ + @Test + void aDumpWithoutRegionsDoesNotLoad() { + assertTrue(probe("load_no_regions").contains("status " + AstException.AST__OBJIN + "\n-- read nothing\n")); + String text = " Begin SelectorMap\n Nin = 2\n Nout = 1\n Inv = 0\n IsA Mapping\n" + + " BadVal = 7\n End SelectorMap\n"; + AstException e = assertThrows(AstException.class, () -> ChannelText.read(text)); + assertEquals(AstException.AST__LDERR, e.getStatus()); + } + + /** testregions.c {@code checkSelectorMapEqual}. */ + @Test + void checkSelectorMapEqual() { + Frame frm = new Frame(2); + Region[] regs = { + new Circle(frm, new double[] {0.0, 0.0}, 1.0, null), new Circle(frm, new double[] {5.0, 5.0}, 1.0, null) + }; + SelectorMap one = new SelectorMap(new Region[] {regs[0]}, BAD); + SelectorMap two = new SelectorMap(regs, BAD); + String got = "test 1 " + flag(one.astEqual(two)) + "\ntest 2 " + flag(two.astEqual(one)) + "\ntest 3 " + + flag(two.astEqual(two.copy())) + "\n"; + assertEquals(probe("check_selectormap_equal"), got); + } + + @Test + void constructorErrorsMatchC() { + assertError("error_no_regions", () -> new SelectorMap(new Region[0], BAD)); + assertError("error_naxes", () -> new SelectorMap(new Region[] {box2(0.0, 0.0, 1.0, 1.0), box1(0.0, 1.0)}, BAD)); + Circle sky = new Circle(new SkyFrame(), new double[] {0.0, 0.0}, 0.1, null); + assertError( + "error_skyframe", + () -> new SelectorMap(new Region[] {box2(0.0, 0.0, 1.0, 1.0), box2(2.0, 2.0, 3.0, 3.0), sky}, BAD)); + } + + private static void assertError(String name, org.junit.jupiter.api.function.Executable make) { + AstException e = assertThrows(AstException.class, make, name); + StringBuilder sb = new StringBuilder(); + for (String line : ProbeOutput.trimLines(e.getMsgText()).split("\n", -1)) { + sb.append("! ").append(line).append('\n'); + } + assertEquals(probeWithoutSource(name), sb + "status " + e.getStatus() + "\n", name); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/SelectorMapTest.java b/src/test/java/uk/ac/starlink/ast/SelectorMapTest.java new file mode 100644 index 0000000..18d09be --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/SelectorMapTest.java @@ -0,0 +1,187 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import org.junit.jupiter.api.Test; +import uk.ac.starlink.ast.testsupport.Fixtures; + +/** + * Translation of Rust {@code tests/test_selectormap.rs} (C's {@code selectormap.c}): the index of + * the Region holding each point, the bad value for a point bad on any axis, the constructor's + * refusals, the undefined inverse, the cancelling of a SelectorMap and its inverse in series, and + * native dumps. {@code selectormap/two_regions.ast} is C's dump of a SelectorMap of two Circles, + * copied from the Rust port's {@code tests/selectormap_oracle}, where {@code + * tools/oracle_fixtures/selectormap_dump_probe.c} wrote it. + */ +class SelectorMapTest { + + private static final double BAD = AstObject.AST__BAD; + + private static Box box(double[] lo, double[] hi) { + return new Box(new Frame(lo.length), 1, lo, hi, null); + } + + /** Two separate boxes: [0,10]x[0,10] and [20,30]x[20,30]. */ + private static Region[] twoBoxes() { + return new Region[] { + box(new double[] {0.0, 0.0}, new double[] {10.0, 10.0}), + box(new double[] {20.0, 20.0}, new double[] {30.0, 30.0}) + }; + } + + /** The output of {@code sm} for each point, {@code [x, y]}. */ + private static double[] tran(Mapping sm, double[]... points) { + double[][] in = new double[2][points.length]; + for (int i = 0; i < points.length; i++) { + in[0][i] = points[i][0]; + in[1][i] = points[i][1]; + } + return sm.tranP(points.length, 2, in, true, 1)[0]; + } + + @Test + void selectormapBasicConstruction() { + SelectorMap sm = new SelectorMap(twoBoxes(), BAD); + assertEquals(2, sm.getNin()); + assertEquals(1, sm.getNout()); + assertFalse(sm.getInvert()); + assertTrue(sm.getTranForward()); + assertFalse(sm.getTranInverse()); + } + + @Test + void selectormapEmptyRegionsRejected() { + AstException e = assertThrows(AstException.class, () -> new SelectorMap(new Region[0], BAD)); + assertEquals(AstException.AST__BDPAR, e.getStatus()); + } + + @Test + void selectormapMismatchedAxesRejected() { + Region box2d = box(new double[] {0.0, 0.0}, new double[] {1.0, 1.0}); + Region box3d = box(new double[] {0.0, 0.0, 0.0}, new double[] {1.0, 1.0, 1.0}); + AstException e = assertThrows(AstException.class, () -> new SelectorMap(new Region[] {box2d, box3d}, BAD)); + assertEquals(AstException.AST__BADNI, e.getStatus()); + } + + @Test + void selectormapPointInRegion1() { + assertEquals(1.0, tran(new SelectorMap(twoBoxes(), BAD), new double[] {5.0, 5.0})[0]); + } + + @Test + void selectormapPointInRegion2() { + assertEquals(2.0, tran(new SelectorMap(twoBoxes(), BAD), new double[] {25.0, 25.0})[0]); + } + + @Test + void selectormapPointInNoRegion() { + assertEquals(0.0, tran(new SelectorMap(twoBoxes(), BAD), new double[] {15.0, 15.0})[0]); + } + + @Test + void selectormapBadInputReturnsBadval() { + assertEquals(99.0, tran(new SelectorMap(twoBoxes(), 99.0), new double[] {BAD, 5.0})[0]); + } + + @Test + void selectormapMultiplePoints() { + double[] out = tran( + new SelectorMap(twoBoxes(), BAD), + new double[] {5.0, 5.0}, + new double[] {25.0, 25.0}, + new double[] {15.0, 15.0}, + new double[] {BAD, 5.0}); + assertEquals(1.0, out[0]); + assertEquals(2.0, out[1]); + assertEquals(0.0, out[2]); + assertEquals(BAD, out[3]); + } + + @Test + void selectormapFirstRegionWins() { + Region[] regs = { + box(new double[] {0.0, 0.0}, new double[] {10.0, 10.0}), + box(new double[] {0.0, 0.0}, new double[] {10.0, 10.0}) + }; + assertEquals(1.0, tran(new SelectorMap(regs, BAD), new double[] {5.0, 5.0})[0]); + } + + /** A SelectorMap has no inverse (selectormap.c), so C's base Transform raises AST__TRNND. */ + @Test + void selectormapInverseIsAnError() { + SelectorMap sm = new SelectorMap(twoBoxes(), BAD); + assertFalse(sm.getTranInverse()); + AstException e = assertThrows(AstException.class, () -> sm.tranN(1, 1, new double[] {1.0}, false, 2)); + assertEquals(AstException.AST__TRNND, e.getStatus()); + } + + /** The fixture is a series CmpMap of a SelectorMap of Boxes and its inverse: a UnitMap of 2. */ + @Test + void selectormapSimplifyInverseCancelFixture() { + Mapping m = (Mapping) ChannelText.read(Fixtures.read("simplify/selectormap_inverse_cancel.map")); + Mapping s = m.simplify(); + assertInstanceOf(UnitMap.class, s); + assertEquals(2, s.getNin()); + assertEquals(2, s.getNout()); + } + + @Test + void selectormapSerializationRoundtrip() { + SelectorMap sm = new SelectorMap(twoBoxes(), 99.0); + String text = ChannelText.dump(sm); + SelectorMap loaded = assertInstanceOf(SelectorMap.class, ChannelText.read(text)); + assertTrue(text.contains("Reg2 = "), text); + assertFalse(text.contains("Reg3"), text); + assertTrue(text.contains("BadVal = 99 "), text); + assertEquals(text, ChannelText.dump(loaded)); + assertEquals(2, loaded.getNin()); + assertEquals(1, loaded.getNout()); + double[][] pts = {{5.0, 5.0}, {25.0, 25.0}, {15.0, 15.0}}; + double[] out1 = tran(sm, pts); + double[] out2 = tran(loaded, pts); + for (int i = 0; i < pts.length; i++) { + assertEquals(out1[i], out2[i]); + } + } + + /** + * C writes the second and later Regions of a SelectorMap without their Frame, which the + * first Region's gives them all (selectormap.c {@code Dump}). + */ + @Test + void selectormapDumpMatchesTheCLibrary() { + String want = resource("/selectormap/two_regions.ast"); + Region[] regs = { + new Circle(new Frame(2), new double[] {0.0, 0.0}, 1.0, null), + new Circle(new Frame(2), new double[] {5.0, 5.0}, 1.0, null) + }; + assertEquals(want, ChannelText.dump(new SelectorMap(regs, BAD))); + assertEquals(want, ChannelText.dump(ChannelText.read(want))); + } + + private static String resource(String name) { + try (InputStream in = SelectorMapTest.class.getResourceAsStream(name)) { + if (in == null) { + throw new IllegalStateException("no resource " + name); + } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buf = new byte[8192]; + int n; + while ((n = in.read(buf)) > 0) { + out.write(buf, 0, n); + } + return new String(out.toByteArray(), StandardCharsets.UTF_8); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } +} diff --git a/src/test/java/uk/ac/starlink/ast/StcProbeTest.java b/src/test/java/uk/ac/starlink/ast/StcProbeTest.java new file mode 100644 index 0000000..c2207cc --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/StcProbeTest.java @@ -0,0 +1,686 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.function.Executable; +import uk.ac.starlink.ast.testsupport.CValues; +import uk.ac.starlink.ast.testsupport.ProbeOutput; + +/** + * StcResourceProfile behaviour against C, from {@code probes/stc_probe.c}: an Stc transformed or + * asked whether it is bounded, then dumped, copied and compared, which leaves Negated set on the + * encapsulated Region and so reading as set on the Stc (stc.c {@code Transform} and {@code + * GetBounded}); AstroCoords elements without keys, with one Region, and with Regions in another + * Frame, as {@code astGetStcCoord} gives them, its index errors, and the constructor's errors for + * bad AstroCoords; Frame attributes, Negated, Closed, MeshSize and FillFactor set on and cleared + * from an Stc, and the read-only RegionClass; testregions.c's {@code checkStcNegated}; stc.c's + * {@code Simplify} of a negated Stc and of an Stc mapped into another Frame, whose AstroCoords + * Regions it maps there too; and dumps edited by hand: {@code Begin Stc}, which C reads as an Stc + * of the abstract class and Java refuses, and {@code Ncoord} below zero, which both read as no + * AstroCoords elements; testregions.c's {@code + * checkStcObsDump}, an StcObsDataLocation's observatory position, set as C's protected {@code + * astStcSetObs} sets it (holding the PointList given), dumped, copied, compared and removed, and + * one of another class read from a dump; and Stcs of different classes compared, and aligned with + * {@code findFrame} and {@code convert}. + * + *

Casting an Stc into the class of another Region ({@link Region#cast}) gives a copy for a Region + * of its own class and null for any other. No call of {@code astFindFrame} or {@code astConvert} + * between two Stcs reaches region.c's {@code Cast} in C: {@code astFindFrame} matches with {@code + * matchsub} 0, and region.c's {@code ConvertX} aligns the Regions' current Frames. A CmpFrame whose + * component Region fails to match does reach it ({@link #aCmpFrameOfStcsInOtherDomainsDoesNotConvert}): + * C then crashes unless a description of the class Region has been read earlier in the process + * (region.c {@code Cast} compares the class of its own vtab, which only that read initialises), so + * the probe reads one first, in its last case, and C then finds no conversion, as Java does. + * + *

An Stc dump without its {@code Region}, or with fewer {@code Coord} items than {@code + * Ncoord}, is refused here with {@code AST__LDERR}: C's {@code astLoadStc} stores a null for the + * missing item, and then crashes, in the load ({@code astRegDummyFS} of the null Region) or in + * {@code astGetStcCoord} ({@code astCopy} of the null KeyMap), so the probe holds no such case. + * + *

Each case writes the lines the probe writes and compares them with C's exactly, except that + * the numbers of {@code attribs_sky}, whose Circles' second points come from {@code + * SkyFrame.offset2}, are compared within {@link #SKY_TOL} for the reason {@code + * RegionStcOracleTest} gives. + */ +class StcProbeTest { + + private static final Map PROBE_CASES = ProbeOutput.load("stc_probe"); + + private static final double SKY_TOL = 1.0e-12; + + private static String probe(String name) { + String text = PROBE_CASES.get(name); + if (text == null) { + throw new IllegalStateException("no probe case " + name); + } + return text; + } + + /** The probe case without the lines naming the C source of an error. */ + private static String probeWithoutSource(String name) { + StringBuilder sb = new StringBuilder(); + for (String line : probe(name).split("\n", -1)) { + if (!line.startsWith("!! ") && !line.isEmpty()) { + sb.append(line).append('\n'); + } + } + return sb.toString(); + } + + private static String g(double v) { + return CFormat.format("%.17g", v); + } + + private static int flag(boolean b) { + return b ? 1 : 0; + } + + /** The dump of {@code obj}, as the probe's {@code astShow} writes it. */ + private static String show(AstObject obj) { + StringBuilder sb = new StringBuilder(); + for (String l : ChannelText.dump(obj).split("\n", -1)) { + if (!l.isEmpty()) { + sb.append(ProbeOutput.trimLines(l)).append('\n'); + } + } + return sb.toString(); + } + + /** The error {@code run} raises, as the probe reports it, less the line naming the C source. */ + private static String err(Executable run) { + AstException e = assertThrows(AstException.class, run); + StringBuilder sb = new StringBuilder(); + for (String line : ProbeOutput.trimLines(e.getMsgText()).split("\n", -1)) { + sb.append("! ").append(line).append('\n'); + } + return sb + "status " + e.getStatus() + "\n"; + } + + /** The two test points of a 2-D Stc transformed, one line each, as the probe's {@code tran2}. */ + private static String tran2(Region stc, double x0, double y0, double x1, double y1) { + double[] xin = {x0, x1}; + double[] yin = {y0, y1}; + double[][] out = stc.transform(new double[][] {xin.clone(), yin.clone()}, 2, true); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 2; i++) { + sb.append("tran ") + .append(g(xin[i])) + .append(' ') + .append(g(yin[i])) + .append(" -> ") + .append(g(out[0][i])) + .append(' ') + .append(g(out[1][i])) + .append('\n'); + } + return sb.toString(); + } + + private static Circle circle2(double x, double y, double r) { + return new Circle(new Frame(2), 1, new double[] {x, y}, new double[] {r}, null); + } + + private static StcResourceProfile plain() { + return new StcResourceProfile(circle2(0.0, 0.0, 1.0), (KeyMap[]) null); + } + + private static StcResourceProfile withCoords(Region reg, KeyMap... coords) { + return new StcResourceProfile(reg, coords); + } + + /** An Interval from {@code lo} to {@code hi} in a SpecFrame of frequency in {@code unit}. */ + private static Interval specInterval(String unit, double lo, double hi) { + SpecFrame sf = new SpecFrame(); + sf.set("System=FREQ"); + sf.set("Unit=" + unit); + return new Interval(sf, new double[] {lo}, new double[] {hi}, null); + } + + /** {@code astGetStcCoord( stc, i )} as a dump. */ + private static String showCoord(Stc stc, int i) { + return "-- coord " + i + "\n" + show(stc.stcCoord(i)); + } + + /** The Negated, Closed, MeshSize and FillFactor values and whether each is set. */ + private static String showAttrs(String what, Region obj) { + return what + " Negated " + obj.getI("Negated") + " " + flag(obj.test("Negated")) + " Closed " + + obj.getI("Closed") + " " + flag(obj.test("Closed")) + " MeshSize " + obj.getI("MeshSize") + " " + + flag(obj.test("MeshSize")) + " FillFactor " + g(obj.getD("FillFactor")) + " " + + flag(obj.test("FillFactor")) + "\n"; + } + + // ------------------------------------------------------------------ + // Review Focus 2: an Stc used, then dumped, copied and compared + // ------------------------------------------------------------------ + + @Test + void transformingLeavesNegatedSet() { + StcResourceProfile stc = plain(); + String before = "test Negated before " + flag(stc.test("Negated")) + "\n"; + String tran = tran2(stc, 0.0, 0.0, 5.0, 0.0); + String after = "test Negated after " + flag(stc.test("Negated")) + "\n" + show(stc); + Region copy = (Region) stc.copy(); + String got = before + tran + after + "copy test Negated " + flag(copy.test("Negated")) + "\nequal copy " + + flag(stc.astEqual(copy)) + "\nequal fresh " + flag(stc.astEqual(plain())) + + "\nequal fresh reversed " + flag(plain().astEqual(stc)) + "\n"; + assertEquals(probe("used_plain"), got); + } + + @Test + void aNegatedStcUsed() { + Region stc = (Region) plain().copy(); + stc.negate(); + String tran = tran2(stc, 0.0, 0.0, 5.0, 0.0); + String after = "test Negated after " + flag(stc.test("Negated")) + "\n" + show(stc); + StcResourceProfile stc2 = plain(); + stc2.negate(); + String got = tran + after + "equal copy " + flag(stc.astEqual(stc.copy())) + "\nequal fresh negated " + + flag(stc.astEqual(stc2)) + "\nequal plain " + flag(stc.astEqual(plain())) + "\n"; + assertEquals(probe("used_negated"), got); + } + + @Test + void askingBoundedLeavesNegatedSet() { + StcResourceProfile stc = plain(); + String got = "Bounded " + stc.getI("Bounded") + "\ntest Negated after " + flag(stc.test("Negated")) + "\n" + + show(stc); + assertEquals(probe("used_bounded"), got); + } + + // ------------------------------------------------------------------ + // Review Focus 4: AstroCoords elements + // ------------------------------------------------------------------ + + @Test + void anEmptyAstroCoordsElement() { + StcResourceProfile stc = withCoords(circle2(0.0, 0.0, 1.0), new KeyMap()); + String got = "ncoord " + stc.getStcNCoord() + "\n" + show(stc) + showCoord(stc, 1); + assertEquals(probe("coords_empty"), got); + } + + @Test + void astroCoordsElementsWithRegions() { + KeyMap km = new KeyMap(); + km.mapPut0A(Stc.AST__STCVALUE, circle2(0.5, 0.0, 0.25), null); + KeyMap km2 = new KeyMap(); + km2.mapPut1C(Stc.AST__STCNAME, new String[] {"X", "Y"}, "axis names"); + km2.mapPut0A(Stc.AST__STCRES, circle2(0.0, 0.0, 0.01), "resolution"); + StcResourceProfile stc = withCoords(circle2(0.0, 0.0, 1.0), km, km2); + String got = "ncoord " + stc.getStcNCoord() + "\n" + show(stc) + showCoord(stc, 1) + showCoord(stc, 2) + + "-- given KeyMap after\n" + show(km); + assertEquals(probe("coords_value_only"), got); + } + + @Test + void astroCoordsRegionsInAnotherFrame() { + KeyMap km = new KeyMap(); + km.mapPut1C(Stc.AST__STCNAME, new String[] {"Frequency"}, null); + km.mapPut0A(Stc.AST__STCVALUE, specInterval("MHz", 1500.0, 1600.0), null); + km.mapPut0A(Stc.AST__STCSIZE, specInterval("GHz", 0.0, 0.25), null); + StcResourceProfile stc = withCoords(specInterval("GHz", 1.0, 2.0), km); + String given = show(stc) + showCoord(stc, 1); + stc.set("Unit=MHz"); + String got = given + "-- Unit=MHz, Adaptive\n" + show(stc) + showCoord(stc, 1) + "-- region\n" + + show(stc.getStcRegion()); + assertEquals(probe("coords_other_frame"), got); + } + + @Test + void astroCoordsIndexErrors() { + StcResourceProfile none = plain(); + StcResourceProfile one = withCoords(circle2(0.0, 0.0, 1.0), new KeyMap()); + StcResourceProfile two = withCoords(circle2(0.0, 0.0, 1.0), new KeyMap(), new KeyMap()); + String got = err(() -> none.stcCoord(0)) + + err(() -> none.stcCoord(1)) + + err(() -> one.stcCoord(0)) + + err(() -> one.stcCoord(2)) + + err(() -> two.stcCoord(3)) + + err(() -> two.stcCoord(-1)); + assertEquals(probeWithoutSource("coords_index"), got); + // jniast's getStcCoord reports the same. + AstException e = assertThrows(AstException.class, () -> one.getStcCoord(2)); + assertEquals(AstException.AST__STCIND, e.getStatus()); + } + + @Test + void badAstroCoordsKeyMaps() { + Circle reg = circle2(0.0, 0.0, 1.0); + KeyMap colour = new KeyMap(); + colour.mapPut0A("Colour", circle2(0.0, 0.0, 1.0), null); + KeyMap three = new KeyMap(); + three.mapPut1C(Stc.AST__STCNAME, new String[] {"X", "Y", "Z"}, null); + KeyMap ints = new KeyMap(); + ints.mapPut1I(Stc.AST__STCNAME, new int[] {1, 2}, null); + KeyMap twoValues = new KeyMap(); + twoValues.mapPut1A(Stc.AST__STCVALUE, new AstObject[] {circle2(0.0, 0.0, 1.0), circle2(0.0, 0.0, 2.0)}, null); + KeyMap dbl = new KeyMap(); + dbl.mapPut0D(Stc.AST__STCERROR, 1.0, null); + KeyMap frame = new KeyMap(); + frame.mapPut0A(Stc.AST__STCSIZE, new Frame(2), null); + KeyMap box3 = new KeyMap(); + box3.mapPut0A( + Stc.AST__STCPIXSZ, + new Box(new Frame(3), 1, new double[] {0.0, 0.0, 0.0}, new double[] {1.0, 1.0, 1.0}, null), + null); + String got = "-- unknown key\n" + err(() -> withCoords(reg, colour)) + + "-- three names\n" + err(() -> withCoords(reg, three)) + + "-- names not strings\n" + err(() -> withCoords(reg, ints)) + + "-- two values\n" + err(() -> withCoords(reg, twoValues)) + + "-- value not an Object\n" + err(() -> withCoords(reg, dbl)) + + "-- value a Frame\n" + err(() -> withCoords(reg, frame)) + + "-- value in a Frame of three axes\n" + err(() -> withCoords(reg, box3)); + assertEquals(probeWithoutSource("coords_bad_keys"), got); + } + + /** A KeyMap holding null under a Region key, which C's public interface cannot store, gives C's message. */ + @Test + void aNullAstroCoordsRegionIsStckey() { + KeyMap km = new KeyMap(); + km.mapPut0A(Stc.AST__STCERROR, null, null); + AstException e = assertThrows(AstException.class, () -> withCoords(circle2(0.0, 0.0, 1.0), km)); + assertEquals(AstException.AST__STCKEY, e.getStatus()); + assertEquals( + "astInitStc(StcResourceProfile): The \"Error\" value supplied in an AstroCoords list is a NULL " + + "pointer. ", + e.getMsgText()); + } + + /** + * jniast's arguments: a null Region or AstroCoords element is a NullPointerException; a null + * array, an empty array, an AstroCoords with a null or empty name array and null Regions give an + * Stc with no AstroCoords elements or with empty ones. + */ + @Test + void jniastArguments() { + assertThrows(NullPointerException.class, () -> new StcResourceProfile(null, new AstroCoords[0])); + assertThrows( + NullPointerException.class, + () -> new StcResourceProfile(circle2(0.0, 0.0, 1.0), new AstroCoords[] {null})); + assertEquals(0, new StcResourceProfile(circle2(0.0, 0.0, 1.0), (AstroCoords[]) null).getStcNCoord()); + assertEquals(0, new StcResourceProfile(circle2(0.0, 0.0, 1.0), new AstroCoords[0]).getStcNCoord()); + AstroCoords nullNames = new AstroCoords(null); + AstroCoords emptyNames = new AstroCoords(new String[0]); + StcResourceProfile stc = + new StcResourceProfile(circle2(0.0, 0.0, 1.0), new AstroCoords[] {nullNames, emptyNames}); + assertEquals(2, stc.getStcNCoord()); + for (int i = 1; i <= 2; i++) { + assertEquals(probe("coords_empty").split("-- coord 1\n", -1)[1], show(stc.stcCoord(i))); + AstroCoords ac = stc.getStcCoord(i); + assertNull(ac.getName()); + assertNull(ac.getValue()); + assertNull(ac.getError()); + } + } + + /** + * jniast's AstroCoords: the Stc holds copies of its Regions, mapped into its Frame, and {@link + * Stc#getStcCoord} gives them back, shared with the KeyMap it reads. + */ + @Test + void jniastAstroCoordsRoundTrip() { + AstroCoords ac = new AstroCoords(new String[] {"Frequency"}); + Interval value = specInterval("MHz", 1500.0, 1600.0); + ac.setValue(value); + ac.setSize(specInterval("GHz", 0.0, 0.25)); + StcResourceProfile stc = new StcResourceProfile(specInterval("GHz", 1.0, 2.0), new AstroCoords[] {ac}); + AstroCoords back = stc.getStcCoord(1); + assertArrayEquals(new String[] {"Frequency"}, back.getName()); + assertEquals("Box", back.getValue().astClass()); + assertEquals("GHz", back.getValue().getC("Unit(1)")); + assertEquals(Region.OVERLAP_SAME, back.getValue().overlap(value)); + assertNull(back.getError()); + assertSame(ac.getValue(), value); + } + + // ------------------------------------------------------------------ + // Review Focus 5: attributes set on an Stc + // ------------------------------------------------------------------ + + @Test + void frameAttributesForwardAsCDoes() { + SkyFrame sky = new SkyFrame(); + KeyMap km = new KeyMap(); + km.mapPut1C(Stc.AST__STCNAME, new String[] {"RA", "Dec"}, null); + km.mapPut0A(Stc.AST__STCERROR, new Circle(sky, 1, new double[] {1.0, 0.5}, new double[] {0.0001}, null), null); + StcResourceProfile stc = withCoords(new Circle(sky, 1, new double[] {1.0, 0.5}, new double[] {0.01}, null), km); + String readOnly = "RegionClass " + stc.getC("RegionClass") + "\ntest RegionClass " + + flag(stc.test("RegionClass")) + "\n" + err(() -> stc.set("RegionClass=Box")) + + err(() -> stc.clear("RegionClass")); + stc.set("Adaptive=0"); + stc.set("System=Galactic"); + String set = "-- Adaptive=0, System=Galactic\n" + show(stc) + showCoord(stc, 1) + "-- region\n" + + show(stc.getStcRegion()); + stc.clear("System"); + String got = readOnly + set + "-- clear System\n" + show(stc) + showCoord(stc, 1); + String want = probeWithoutSource("attribs_sky"); + assertTrue(CValues.nativeStringsWithin(got, want, SKY_TOL), "--- got\n" + got + "--- C\n" + want); + } + + @Test + void regionAttributesForwardAsCDoes() { + StcResourceProfile stc = plain(); + StringBuilder sb = new StringBuilder(showAttrs("stc", stc)); + stc.set("Negated=1"); + sb.append(showAttrs("stc", stc)) + .append(showAttrs("region", stc.getStcRegion())) + .append(show(stc)); + stc.set("Closed=0,MeshSize=40,FillFactor=0.25"); + sb.append(showAttrs("stc", stc)) + .append(showAttrs("region", stc.getStcRegion())) + .append(show(stc)); + stc.clear("Negated,Closed,MeshSize,FillFactor"); + sb.append("-- clear\n") + .append(showAttrs("stc", stc)) + .append(showAttrs("region", stc.getStcRegion())) + .append(show(stc)); + Circle reg = circle2(0.0, 0.0, 1.0); + reg.set("Negated=1,Closed=0,MeshSize=30,FillFactor=0.5"); + StcResourceProfile fromSet = new StcResourceProfile(reg, (KeyMap[]) null); + sb.append("-- set on the region given\n") + .append(showAttrs("stc", fromSet)) + .append(show(fromSet)); + assertEquals(probe("attribs_region"), sb.toString()); + } + + /** testregions.c {@code checkStcNegated}. */ + @Test + void checkStcNegated() { + StcResourceProfile stc = plain(); + String got = tran2(stc, 0.0, 0.0, 5.0, 0.0); + stc.negate(); + got += tran2(stc, 0.0, 0.0, 5.0, 0.0) + "Bounded " + stc.getI("Bounded") + "\n"; + assertEquals(probe("check_stc_negated"), got); + } + + // ------------------------------------------------------------------ + // stc.c Simplify + // ------------------------------------------------------------------ + + /** C's {@code astSame}: 1 if {@code a} and {@code b} are the same Object, otherwise 0. */ + @SuppressWarnings({"ReferenceEquality", "PMD.CompareObjectsWithEquals"}) // astSame compares the Objects. + private static int same(AstObject a, AstObject b) { + return a == b ? 1 : 0; + } + + /** Simplifying a negated Stc moves the negation onto a copy of its encapsulated Region. */ + @Test + void simplifyingANegatedStc() { + StcResourceProfile stc = plain(); + String got = "plain same " + same(stc.simplify(), stc) + "\n"; + stc.negate(); + Region simp = (Region) stc.simplify(); + got += "same " + same(simp, stc) + "\n" + showAttrs("given", stc) + showAttrs("stc", simp) + + showAttrs("region", ((Stc) simp).getStcRegion()) + show(simp) + tran2(simp, 0.0, 0.0, 5.0, 0.0); + assertEquals(probe("simplify_negated"), got); + } + + /** + * Mapping an Stc into another Frame simplifies it, which maps its encapsulated Region and the + * Regions of its AstroCoords elements into the new Frame, leaving the given Stc as it was. + */ + @Test + void simplifyingRemapsTheAstroCoordsRegions() { + KeyMap km = new KeyMap(); + km.mapPut1C(Stc.AST__STCNAME, new String[] {"X", "Y"}, null); + km.mapPut0A(Stc.AST__STCVALUE, circle2(0.5, 0.0, 0.25), null); + km.mapPut0A(Stc.AST__STCERROR, circle2(0.0, 0.0, 0.01), null); + StcResourceProfile stc = withCoords(circle2(0.0, 0.0, 1.0), km); + Frame zoom = new Frame(2); + zoom.setDomain("ZOOM"); + Region mapped = stc.mapRegion(new ZoomMap(2, 2.0), zoom); + String got = "class " + mapped.getC("Class") + "\n" + show(mapped) + showCoord((Stc) mapped, 1) + "-- region\n" + + show(((Stc) mapped).getStcRegion()) + "-- given\n" + showCoord(stc, 1); + assertEquals(probe("simplify_remapped_coords"), got); + } + + // ------------------------------------------------------------------ + // StcObsDataLocation's observatory position + // ------------------------------------------------------------------ + + /** The probe's {@code read_back}: the dump of {@code obj}, then that dump read back. */ + private static AstObject readBack(AstObject obj, StringBuilder sb) { + String text = show(obj); + AstObject back = ChannelText.read(text); + sb.append("-- text\n") + .append(text) + .append("-- end text\n-- read ") + .append(back.astClass()) + .append('\n'); + return back; + } + + private static StcObsDataLocation obsData() { + return new StcObsDataLocation(circle2(0.0, 0.0, 1.0), (KeyMap[]) null); + } + + /** testregions.c {@code checkStcObsDump}. */ + @Test + void checkStcObsDump() { + StcObsDataLocation noobs = obsData(); + StringBuilder sb = new StringBuilder(); + AstObject back = readBack(noobs, sb); + sb.append("equal ").append(flag(back.astEqual(noobs))).append('\n').append(show(back)); + assertEquals(probe("check_stc_obs_dump"), sb.toString()); + } + + /** + * The observatory position: written as {@code ObsLoc}, held as given (so that a change to the + * PointList shows in the next dump) and copied in a copy, not compared, and removed. + */ + @Test + void anObservatoryPosition() { + StcObsDataLocation noobs = obsData(); + StcObsDataLocation obsdata = obsData(); + Frame geo = new Frame(3); + geo.setDomain("GEO"); + PointList obs = new PointList(geo, 1, new double[][] {{1.0}, {2.0}, {3.0}}, null); + obsdata.setObs(obs); + StringBuilder sb = new StringBuilder("set obs status 0\n").append(show(obsdata)); + AstObject obscopy = obsdata.copy(); + obs.setIdent("given"); + sb.append("-- Ident=given set on the PointList given\n") + .append(show(obsdata)) + .append("-- the copy\n") + .append(show(obscopy)) + .append("equal without obs ") + .append(flag(obsdata.astEqual(noobs))) + .append("\nequal without obs reversed ") + .append(flag(noobs.astEqual(obsdata))) + .append("\nequal copy ") + .append(flag(obsdata.astEqual(obscopy))) + .append("\n-- removed\nset obs status 0\n"); + obsdata.setObs(null); + sb.append(show(obsdata)).append("-- the copy read back\n"); + AstObject back = readBack(obscopy, sb); + sb.append("equal ").append(flag(back.astEqual(obscopy))).append('\n').append(show(back)); + assertEquals(probe("obs_loc"), sb.toString()); + } + + /** An {@code ObsLoc} of another class than PointList, a ZoomMap, is read as it is, as C reads it. */ + @Test + void anObservatoryPositionOfAnyClassIsRead() { + String text = textRead("obs_loc_any_class"); + AstObject back = ChannelText.read(text); + String got = "set obs status 0\n-- text\n" + text + "-- end text\n-- read " + back.astClass() + "\n" + + show(back) + "-- copy\n" + show(back.copy()); + assertEquals(probe("obs_loc_any_class"), got); + } + + // ------------------------------------------------------------------ + // Stcs of different classes + // ------------------------------------------------------------------ + + /** The probe's {@code show_fs}. */ + private static String showFs(String what, FrameSet fs) { + if (fs == null) { + return what + " 0\n"; + } + return what + " 1 " + fs.getFrame(FrameSet.AST__BASE).astClass() + " " + + fs.getFrame(FrameSet.AST__CURRENT).astClass() + " " + + fs.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT) + .simplify() + .astClass() + "\n"; + } + + /** The probe's {@code find_and_convert}. */ + private static String findAndConvert(String what, Region a, Region b) { + return "-- " + what + "\n" + showFs("findframe", a.findFrame(b, "")) + showFs("convert", a.convert(b, "")); + } + + private static Circle circleIn(String domain, double r) { + Frame f = new Frame(2); + f.setDomain(domain); + return new Circle(f, 1, new double[] {0.0, 0.0}, new double[] {r}, null); + } + + /** A CmpFrame of {@code reg} and a 1-D Frame in the Domain C. */ + private static CmpFrame cmpFrameC(Region reg) { + Frame c = new Frame(1); + c.setDomain("C"); + return new CmpFrame(reg, c); + } + + @Test + void stcsOfDifferentClasses() { + StcSearchLocation search = new StcSearchLocation(circle2(0.0, 0.0, 1.0), (KeyMap[]) null); + StcCatalogEntryLocation entry = new StcCatalogEntryLocation(circle2(0.0, 0.0, 1.0), (KeyMap[]) null); + StcObsDataLocation obsdata = obsData(); + StcResourceProfile profile = plain(); + StcSearchLocation search2 = new StcSearchLocation(circle2(0.0, 0.0, 1.0), (KeyMap[]) null); + StcSearchLocation searcha = new StcSearchLocation(circleIn("A", 1.0), (KeyMap[]) null); + StcSearchLocation searchb = new StcSearchLocation(circleIn("B", 1.0), (KeyMap[]) null); + StcObsDataLocation obsb = new StcObsDataLocation(circleIn("B", 1.0), (KeyMap[]) null); + StcCatalogEntryLocation entryb = new StcCatalogEntryLocation(circleIn("B", 1.0), (KeyMap[]) null); + String got = "equal search search " + flag(search.astEqual(search2)) + "\nequal search entry " + + flag(search.astEqual(entry)) + "\nequal search obsdata " + flag(search.astEqual(obsdata)) + + "\nequal obsdata profile " + flag(obsdata.astEqual(profile)) + "\n" + + findAndConvert("search, search", search, search2) + + findAndConvert("search, obsdata", search, obsdata) + + findAndConvert("obsdata, search", obsdata, search) + + findAndConvert("entry, profile", entry, profile) + + findAndConvert("search A, search B", searcha, searchb) + + findAndConvert("search A, obsdata B", searcha, obsb) + + findAndConvert("obsdata B, search A", obsb, searcha) + + findAndConvert("search A, entry B", searcha, entryb) + + "-- CmpFrames of search B and search A\n" + + showFs("findframe", cmpFrameC(searchb).findFrame(cmpFrameC(searcha), "")); + assertEquals(probe("stc_classes"), got); + } + + /** + * {@link Region#cast}: an Stc cast into the class of a Region is a copy if the Stc is an + * instance of that class, and null otherwise, so that two Stc classes, which are siblings, do not + * cast into each other; cast into the class of a plain Frame, it is its current Frame cast. + */ + @Test + void castWithinTheStcClasses() { + StcSearchLocation search = new StcSearchLocation(circle2(0.0, 0.0, 1.0), (KeyMap[]) null); + StcSearchLocation search2 = new StcSearchLocation(circle2(1.0, 0.0, 2.0), (KeyMap[]) null); + StcObsDataLocation obsdata = obsData(); + Frame same = search.cast(search2); + assertNotSame(search, same); + assertSame(StcSearchLocation.class, same.getClass()); + assertTrue(search.astEqual(same)); + assertNull(search.cast(obsdata)); + assertNull(obsdata.cast(search)); + assertNull(search.cast(plain())); + assertNull(search.cast(circle2(0.0, 0.0, 1.0))); + assertNull(circle2(0.0, 0.0, 1.0).cast(search)); + assertSame(Frame.class, search.cast(new Frame(2)).getClass()); + } + + /** + * Two CmpFrames, each of an Stc and a Frame, whose Stcs are in different Domains, do not convert. + * The CmpFrame's match casts the template's Stc into the class of the target's picked axes, a + * Frame (frame.c {@code astMatch}, cmpframe.c {@code PartMatch}, region.c {@code SubFrame}), so + * C's region.c {@code Cast} casts the Region's current Frame; it crashes there unless a + * description of the class Region has been read earlier in the process, which initialises the + * vtab whose class it compares, so the probe's last case reads one first. + */ + @Test + void aCmpFrameOfStcsInOtherDomainsDoesNotConvert() { + CmpFrame ca = cmpFrameC(new StcSearchLocation(circleIn("A", 1.0), (KeyMap[]) null)); + CmpFrame cb = cmpFrameC(new StcSearchLocation(circleIn("B", 1.0), (KeyMap[]) null)); + String c = probe("cast_after_region_read"); + assertEquals( + "-- CmpFrames of search B and search A\n" + showFs("convert", cb.convert(ca, "")), + c.substring(c.indexOf("-- CmpFrames"))); + } + + // ------------------------------------------------------------------ + // Dumps edited by hand + // ------------------------------------------------------------------ + + /** The text a case of the probe read, between {@code -- text} and {@code -- end text}. */ + private static String textRead(String name) { + String c = probe(name); + int start = c.indexOf("-- text\n") + "-- text\n".length(); + return c.substring(start, c.indexOf("-- end text\n")); + } + + /** + * C reads a {@code Begin Stc}, an Stc of the abstract class; no Java class is the abstract Stc + * alone, so the read fails here with {@code AST__LDERR}. + */ + @Test + void anStcOfTheAbstractClassIsNotRead() { + assertTrue(probe("begin_stc").contains("-- read Stc\nncoord 0\n")); + AstException e = assertThrows(AstException.class, () -> ChannelText.read(textRead("begin_stc"))); + assertEquals(AstException.AST__LDERR, e.getStatus()); + assertTrue(e.getMsgText().contains("Stc"), e.getMsgText()); + } + + @Test + void ncoordBelowZeroReadsAsNone() { + String text = textRead("negative_ncoord"); + Stc stc = (Stc) ChannelText.read(text); + String got = "-- text\n" + text + "-- end text\n-- read " + stc.astClass() + "\nncoord " + stc.getStcNCoord() + + "\n" + show(stc); + assertEquals(probe("negative_ncoord"), got); + } + + /** + * The plain Stc's dump without the lines from the first starting with {@code startsWith} to the + * next starting with {@code endsWith}. + */ + private static String plainDumpWithout(String startsWith, String endsWith) { + StringBuilder sb = new StringBuilder(); + boolean skipping = false; + for (String l : CValues.lines(show(plain()))) { + if (l.startsWith(startsWith)) { + skipping = true; + } + if (!skipping) { + sb.append(l).append('\n'); + } + if (skipping && l.startsWith(endsWith)) { + skipping = false; + } + } + return sb.toString(); + } + + @Test + void anStcWithoutItsRegionIsNotRead() { + String text = plainDumpWithout(" Region =", " End Circle"); + assertFalse(text.contains("Circle"), text); + AstException e = assertThrows(AstException.class, () -> ChannelText.read(text)); + assertEquals(AstException.AST__LDERR, e.getStatus()); + } + + @Test + void anStcMissingAnAstroCoordsElementIsNotRead() { + String text = show(plain()).replace(" IsA Stc", " Ncoord = 1\n IsA Stc"); + AstException e = assertThrows(AstException.class, () -> ChannelText.read(text)); + assertEquals(AstException.AST__LDERR, e.getStatus()); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/StcTest.java b/src/test/java/uk/ac/starlink/ast/StcTest.java new file mode 100644 index 0000000..197f358 --- /dev/null +++ b/src/test/java/uk/ac/starlink/ast/StcTest.java @@ -0,0 +1,53 @@ +package uk.ac.starlink.ast; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import org.junit.jupiter.api.Test; + +/** + * Translation of jniast's {@code StcTest}: {@code testConstructors}, each of the four Stc classes + * made from a Box and two AstroCoords elements. jniast's {@code testReads} and {@code testChandra} + * read STC-X documents through an XmlChan, which this library does not have, and are not + * translated. + */ +class StcTest { + + @Test + void constructors() { + Region region = box(-100, -100, 100, 100); + AstroCoords ac1 = new AstroCoords(new String[] {"X", "Y"}); + ac1.setValue(box(1, 1, 5, 10)); + AstroCoords ac2 = new AstroCoords(new String[] {"RA", "DEC"}); + ac2.setError(box(-1, -1, 1, 1)); + AstroCoords[] acs = {ac1, ac2}; + + checkStc(new StcCatalogEntryLocation(region, acs), region, acs); + checkStc(new StcObsDataLocation(region, acs), region, acs); + checkStc(new StcResourceProfile(region, acs), region, acs); + checkStc(new StcSearchLocation(region, acs), region, acs); + } + + private static void checkStc(Stc stc, Region region, AstroCoords[] acs) { + assertSameShape(region, stc.getStcRegion()); + assertEquals(acs.length, stc.getStcNCoord()); + for (int i = 0; i < acs.length; i++) { + AstroCoords ac = stc.getStcCoord(i + 1); + if (acs[i].getName() == null) { + assertNull(ac.getName()); + } else { + assertArrayEquals(acs[i].getName(), ac.getName()); + } + } + } + + private static Box box(double x1, double y1, double x2, double y2) { + return new Box(new Frame(2), 1, new double[] {x1, y1}, new double[] {x2, y2}, null); + } + + private static void assertSameShape(Region region1, Region region2) { + int ov = region1.overlap(region2); + assertEquals(Region.OVERLAP_SAME, ov, "Regions don't match (" + ov + ")"); + } +} diff --git a/src/test/java/uk/ac/starlink/ast/SwitchMapTest.java b/src/test/java/uk/ac/starlink/ast/SwitchMapTest.java index a9c9464..6aa0b0b 100644 --- a/src/test/java/uk/ac/starlink/ast/SwitchMapTest.java +++ b/src/test/java/uk/ac/starlink/ast/SwitchMapTest.java @@ -23,10 +23,8 @@ * components, a SwitchMap inside a CmpMap, a TranMap and a SwitchMap, and a dump without {@code * ISInv}, each read back; equality; simplification of a SwitchMap alone, inverted, with route and * selector Mappings that simplify, beside its own inverse and other Mappings; and the - * constructor's errors. - * - *

The Rust tests whose forward selector is a SelectorMap of Box Regions are listed in {@code - * deferred/rust-tests.txt}: SelectorMap is not yet ported. + * constructor's errors. The Rust tests of a SwitchMap of 1-D routes run with a forward selector + * that is a SelectorMap of Box Regions, as does testswitchmap.c section 3. */ class SwitchMapTest { @@ -169,6 +167,100 @@ private static String invertState(Mapping m) { return "Invert shared after " + (m.getInvert() ? 1 : 0) + " test " + (m.testInvert() ? 1 : 0) + "\n"; } + // ------------------------------------------------------------------ + // test_switchmap.rs: a SelectorMap as the forward selector + // ------------------------------------------------------------------ + + /** + * Two routes, [0,10] to [0,100] and [20,30] to [200,300], and a SelectorMap over the 1-D + * intervals as the forward selector. Each route's scale (10) and shift (0) and its outputs for + * the test points are exact in IEEE arithmetic, so the outputs are compared exactly. + */ + private static SwitchMap make1dSwitchmap() { + Region reg1 = new Box(new Frame(1), 1, new double[] {0.0}, new double[] {10.0}, null); + Region reg2 = new Box(new Frame(1), 1, new double[] {20.0}, new double[] {30.0}, null); + SelectorMap sel = new SelectorMap(new Region[] {reg1, reg2}, BAD); + return new SwitchMap(sel, null, new Mapping[] {win(0.0, 10.0, 0.0, 100.0), win(20.0, 30.0, 200.0, 300.0)}); + } + + /** The number of route Mappings of {@code sw}, from its dump. */ + private static int nroute(SwitchMap sw) { + String text = ChannelText.dump(sw); + int n = 0; + while (text.contains(" RMap" + (n + 1) + " = ")) { + n++; + } + return n; + } + + @Test + void switchmapBasicConstruction() { + SwitchMap sw = make1dSwitchmap(); + assertEquals(1, sw.getNin()); + assertEquals(1, sw.getNout()); + assertEquals(2, nroute(sw)); + assertTrue(sw.getTranForward()); + assertFalse(sw.getTranInverse()); + } + + @Test + void switchmapForwardRoute1() { + assertEquals(50.0, make1dSwitchmap().tran1(1, new double[] {5.0}, true)[0]); + } + + @Test + void switchmapForwardRoute2() { + assertEquals(250.0, make1dSwitchmap().tran1(1, new double[] {25.0}, true)[0]); + } + + @Test + void switchmapForwardNoRoute() { + assertEquals(BAD, make1dSwitchmap().tran1(1, new double[] {15.0}, true)[0]); + } + + @Test + void switchmapForwardBadInput() { + assertEquals(BAD, make1dSwitchmap().tran1(1, new double[] {BAD}, true)[0]); + } + + @Test + void switchmapForwardMultiplePoints() { + double[] out = make1dSwitchmap().tran1(4, new double[] {5.0, 25.0, 15.0, BAD}, true); + assertEquals(50.0, out[0]); + assertEquals(250.0, out[1]); + assertEquals(BAD, out[2]); + assertEquals(BAD, out[3]); + } + + @Test + void switchmapEqual() { + assertTrue(make1dSwitchmap().astEqual(make1dSwitchmap())); + } + + /** + * A SelectorMap removes no Regions (selectormap.c installs no {@code RemoveRegions}), and the + * WinMap routes hold none, so the SwitchMap comes back itself, as C's clone. + */ + @Test + void switchmapRemoveRegions() { + SwitchMap sw = make1dSwitchmap(); + Mapping cleaned = sw.removeRegions(); + assertSame(sw, cleaned); + assertEquals(1, cleaned.getNin()); + assertEquals(1, cleaned.getNout()); + } + + @Test + void switchmapSerializationRoundtrip() { + SwitchMap sw = make1dSwitchmap(); + SwitchMap loaded = assertInstanceOf(SwitchMap.class, ChannelText.read(ChannelText.dump(sw))); + assertEquals(2, nroute(loaded)); + assertEquals(1, loaded.getNin()); + assertEquals(1, loaded.getNout()); + double[] in = {5.0, 25.0, 15.0}; + assertArrayEquals(sw.tran1(3, in, true), loaded.tran1(3, in, true)); + } + // ------------------------------------------------------------------ // test_switchmap.rs: construction // ------------------------------------------------------------------ @@ -438,6 +530,73 @@ void section2TwoHalves() { assertClose(swm.rate(new double[] {1900.0}, 1, 1), 1.0 / 11.0, 1.0e-6, 131); } + /** The FrameSet a TAN header with reference pixel {@code crpix1} reads as. */ + private static FrameSet tanFrameSet(double crpix1) { + FitsChan fc = new FitsChan(); + for (String card : new String[] { + "CRPIX1 = " + (int) crpix1, + "CRPIX2 = 45", + "CRVAL1 = 45", + "CRVAL2 = 89.9", + "CDELT1 = -0.01", + "CDELT2 = 0.01", + "CTYPE1 = 'RA---TAN'", + "CTYPE2 = 'DEC--TAN'" + }) { + fc.putFits(card, false); + } + fc.clear("Card"); + return assertInstanceOf(FrameSet.class, fc.read()); + } + + /** + * testswitchmap.c section 3: two images of one part of the sky side by side in one grid, a + * SelectorMap of two Boxes as the forward selector and a PermMap that always picks the first + * route as the inverse selector. Inverting the shared selector afterwards changes nothing. + */ + @Test + void section3TwoImages() { + Mapping rm0 = tanFrameSet(45.0).getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + FrameSet fs1 = tanFrameSet(135.0); + Mapping rm1 = fs1.getMapping(FrameSet.AST__BASE, FrameSet.AST__CURRENT); + Frame grid = fs1.getFrame(FrameSet.AST__BASE); + Region box1 = new Box(grid, 1, new double[] {10.0, 10.0}, new double[] {80.0, 80.0}, null); + Region box2 = new Box(grid, 1, new double[] {100.0, 10.0}, new double[] {170.0, 80.0}, null); + SelectorMap selmap = new SelectorMap(new Region[] {box1, box2}, BAD); + PermMap isPerm = new PermMap(1, new int[] {-1}, 2, new int[] {0, 0}, new double[] {1.0}); + SwitchMap swm = new SwitchMap(selmap, isPerm, new Mapping[] {rm0, rm1}); + swm.invert(); + selmap.invert(); + + double[][] input = {{5.0, 5.0}, {50.0, 50.0}, {90.0, 50.0}, {140.0, 50.0}}; + double[][] out = tranRows(swm, input, false); + double[][] rmout = tranRows(rm0, input, true); + assertArrayEquals(new double[] {BAD, BAD}, out[0], "Errors 132-133"); + assertArrayEquals(rmout[1], out[1], "Errors 134-135"); + assertArrayEquals(new double[] {BAD, BAD}, out[2], "Errors 136-137"); + for (int k = 0; k < 2; k++) { + assertTrue(Math.abs(out[3][k] - rmout[1][k]) <= 1.0e-6 * Math.abs(rmout[1][k]), "Error " + (138 + k)); + } + + double[][] back = tranRows(swm, out, true); + assertArrayEquals(new double[] {BAD, BAD}, back[0], "Errors 140-141"); + assertClose(back[1][0], 50.0, 1.0e-6, 142); + assertClose(back[1][1], 50.0, 1.0e-6, 143); + assertArrayEquals(new double[] {BAD, BAD}, back[2], "Errors 144-145"); + assertClose(back[3][0], 50.0, 1.0e-6, 146); + assertClose(back[3][1], 50.0, 1.0e-6, 147); + + swm.invert(); + assertSimplificationAndDump(swm, new int[] {148, 149, 150}, "ast_equal 3"); + + int[][] axes = {{1, 1}, {2, 2}, {1, 2}, {2, 1}}; + for (int k = 0; k < axes.length; k++) { + double r1 = swm.rate(new double[] {140.0, 50.0}, axes[k][0], axes[k][1]); + double r2 = rm0.rate(new double[] {50.0, 50.0}, axes[k][0], axes[k][1]); + assertTrue(Math.abs(r1 - r2) <= Math.abs(1.0e-6 * r2), "Error " + (151 + k) + ": " + r1 + " vs " + r2); + } + } + /** The SwitchMaps of testswitchmap.c, at full precision, against the probe. */ @Test void sectionsMatchCExactly() { diff --git a/src/test/resources/deferred/full-dumps.txt b/src/test/resources/deferred/full-dumps.txt index 296cdf5..bb4e9b5 100644 --- a/src/test/resources/deferred/full-dumps.txt +++ b/src/test/resources/deferred/full-dumps.txt @@ -8,8 +8,6 @@ simplify/cap_normmap_cmpframe.map | needs NormMap simplify/cap_normmap_cmpframe.simp | needs NormMap simplify/cap_permmap_01.map | needs NormMap simplify/cap_permmap_01.simp | needs NormMap -simplify/cap_timemap_02.map | needs StcResourceProfile -simplify/cap_timemap_02.simp | needs StcResourceProfile simplify/cap_unitnormmap_01.map | needs UnitNormMap simplify/cap_unitnormmap_01.simp | needs UnitNormMap simplify/cap_xphmap_01.map | needs XphMap @@ -25,10 +23,6 @@ simplify/neg_normmap_inv_diff_frame.map | needs NormMap simplify/neg_normmap_nonnorm_neighbour.map | needs NormMap simplify/neg_normmap_parallel_sky.map | needs NormMap simplify/neg_normmap_parallel.map | needs NormMap -simplify/neg_selectormap_not_equal.map | needs SelectorMap -simplify/neg_selectormap_parallel.map | needs SelectorMap -simplify/neg_selectormap_series_lower.map | needs SelectorMap -simplify/neg_selectormap_series_upper.map | needs SelectorMap simplify/neg_spline_different_coeffs.map | needs SplineMap simplify/neg_spline_nonspline_neighbour.map | needs SplineMap simplify/neg_spline_parallel.map | needs SplineMap @@ -49,12 +43,6 @@ simplify/normmap_duplicate_elim.map | needs NormMap simplify/normmap_duplicate_elim.simp | needs NormMap simplify/normmap_inverse_cancel_upper.map | needs NormMap simplify/normmap_inverse_cancel.map | needs NormMap -simplify/selectormap_inverse_cancel_tail.map | needs SelectorMap -simplify/selectormap_inverse_cancel.map | needs SelectorMap -simplify/selectormap_region_simplify_real.map | needs SelectorMap -simplify/selectormap_region_simplify_real.simp | needs SelectorMap -simplify/selectormap_region_simplify.map | needs SelectorMap -simplify/selectormap_region_simplify.simp | needs SelectorMap simplify/spline_inverse_cancel.map | needs SplineMap simplify/unitnormmap_diff_centre_to_shift.map | needs UnitNormMap simplify/unitnormmap_fwd_winmap_refused.map | needs UnitNormMap diff --git a/src/test/resources/deferred/read-warnings.txt b/src/test/resources/deferred/read-warnings.txt index 9f579fc..7c3c64f 100644 --- a/src/test/resources/deferred/read-warnings.txt +++ b/src/test/resources/deferred/read-warnings.txt @@ -10,8 +10,6 @@ ./simplify/cap_normmap_cmpframe.simp | needs NormMap ./simplify/cap_permmap_01.map | needs NormMap ./simplify/cap_permmap_01.simp | needs NormMap -./simplify/cap_timemap_02.map | needs StcResourceProfile -./simplify/cap_timemap_02.simp | needs StcResourceProfile ./simplify/cap_unitnormmap_01.map | needs UnitNormMap ./simplify/cap_unitnormmap_01.simp | needs UnitNormMap ./simplify/cap_xphmap_01.map | needs XphMap @@ -27,10 +25,6 @@ ./simplify/neg_normmap_nonnorm_neighbour.map | needs NormMap ./simplify/neg_normmap_parallel.map | needs NormMap ./simplify/neg_normmap_parallel_sky.map | needs NormMap -./simplify/neg_selectormap_not_equal.map | needs SelectorMap -./simplify/neg_selectormap_parallel.map | needs SelectorMap -./simplify/neg_selectormap_series_lower.map | needs SelectorMap -./simplify/neg_selectormap_series_upper.map | needs SelectorMap ./simplify/neg_spline_different_coeffs.map | needs SplineMap ./simplify/neg_spline_nonspline_neighbour.map | needs SplineMap ./simplify/neg_spline_parallel.map | needs SplineMap @@ -51,12 +45,6 @@ ./simplify/normmap_duplicate_elim.simp | needs NormMap ./simplify/normmap_inverse_cancel.map | needs NormMap ./simplify/normmap_inverse_cancel_upper.map | needs NormMap -./simplify/selectormap_inverse_cancel.map | needs SelectorMap -./simplify/selectormap_inverse_cancel_tail.map | needs SelectorMap -./simplify/selectormap_region_simplify.map | needs SelectorMap -./simplify/selectormap_region_simplify.simp | needs SelectorMap -./simplify/selectormap_region_simplify_real.map | needs SelectorMap -./simplify/selectormap_region_simplify_real.simp | needs SelectorMap ./simplify/spline_inverse_cancel.map | needs SplineMap ./simplify/unitnormmap_diff_centre_to_shift.map | needs UnitNormMap ./simplify/unitnormmap_fwd_winmap_refused.map | needs UnitNormMap diff --git a/src/test/resources/deferred/rust-tests.txt b/src/test/resources/deferred/rust-tests.txt index 55d1622..9e9b6f4 100644 --- a/src/test/resources/deferred/rust-tests.txt +++ b/src/test/resources/deferred/rust-tests.txt @@ -76,7 +76,6 @@ tests/pointset.rs::axis_iter_returns_column | Rust-only API (PointSet) tests/pointset.rs::view_and_into_ndarray | Rust-only API (PointSet) tests/test_constructor_checks.rs::a_splinemap_checks_its_arguments | SplineMap (out of scope) tests/test_constructor_checks.rs::a_unitnormmap_needs_a_centre | UnitNormMap (out of scope) -tests/test_constructor_checks.rs::a_selectormap_needs_regions_in_one_frame | SelectorMap (out of scope) tests/test_equal.rs::chebymap_same | ChebyMap (out of scope) tests/test_equal.rs::chebymap_different_bounds | ChebyMap (out of scope) tests/test_tran_grid_oracle.rs::quadratic_fits_match_c | astQuadApprox (out-of-scope method) @@ -87,7 +86,6 @@ tests/test_map_split.rs::normmap_split_refuses_out_of_range_and_repeated_axes | tests/test_tran_definedness.rs::chebymap_forward_only_has_no_inverse | ChebyMap (out of scope) tests/test_numeric_rate.rs::numeric_rate_chebymap_quadratic | ChebyMap (out of scope) tests/test_numeric_rate.rs::numeric_rate_chebymap_cubic | ChebyMap (out of scope) -tests/test_rate_oracle.rs::rates_match_the_c_library | SelectorMap (out of scope) src/mappings/linear_approx.rs::returns_correct_type | Rust-only API (LinearFit) tests/test_transform_oracle.rs::fma_substitutions_replace_rows_that_really_differ | Rust-only API (FMA_SUBSTITUTIONS_LICENSED is empty; a row that differs for that cause goes on the deferred lists) tests/test_transform_oracle.rs::transform_oracle_report | Rust-only API (ignored investigative JSON report; the gates list every failure) @@ -191,16 +189,6 @@ tests/test_fitschan_tab.rs::check_tab | needs FitsTable tests/test_fitschan_tab.rs::check_tab_sparse | needs FitsTable tests/test_fitschan_tab.rs::check_tab2 | needs FitsTable tests/test_fitschan_tab.rs::strict_sweep_error_asks_no_table_source | needs FitsTable -tests/test_switchmap.rs::switchmap_basic_construction | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_forward_route1 | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_forward_route2 | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_forward_no_route | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_forward_bad_input | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_forward_multiple_points | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_equal | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_remove_regions | SelectorMap (out of scope) -tests/test_switchmap.rs::switchmap_serialization_roundtrip | SelectorMap (out of scope) -tests/test_switchmap.rs::testswitchmap_c::section_3_two_images | SelectorMap (out of scope) tests/test_resample_oracle.rs::too_few_params_is_an_error | Rust-only API (a params slice of any length; jniast's Interpolator factories fix the parameters) tests/test_resample.rs::user_flags_reach_the_callers_interpolator_and_kernel | Rust-only API (the user flags AST__URESAMP1-4, which jniast's ResampleFlags lacks) tests/test_rebin_oracle.rs::too_few_params_is_an_error | Rust-only API (a params slice of any length; jniast's Spreader factories fix the parameters) @@ -236,12 +224,9 @@ tests/test_region_convex_oracle.rs::convex_rejects_an_array_smaller_than_its_bou tests/test_region_outline_oracle.rs::downsize_matches_the_c_library | astDownsize (not in jniast) tests/test_region_outline_oracle.rs::outline_matches_the_c_library | astOutline (not in jniast) tests/test_region_outline_oracle.rs::outline_reports_no_selected_pixel_as_c_does | astOutline (not in jniast) -tests/test_regions_c.rs::check_remove_regions | astRemoveRegions (out-of-scope method) tests/test_regions_c.rs::region_gaps_still_differ | Rust-only API (checks that Rust's gap from C in checkEllipse Errors 15 to 17 remains; RegionsCTest.checkEllipse gives C's result) tests/test_regions.rs::sky_circle_disc | astGetRegionDisc (not in jniast) tests/test_regions.rs::sky_polygon_disc | astGetRegionDisc (not in jniast) -tests/test_regions.rs::remove_regions_from_frameset | astRemoveRegions (out-of-scope method) -tests/test_regions.rs::remove_regions_unit_passthrough | astRemoveRegions (out-of-scope method) tests/test_regions.rs::convex_hull_basic | astConvex (not in jniast) tests/test_moc.rs::small_circle | Moc (not in jniast) tests/test_moc.rs::larger_circle | Moc (not in jniast) @@ -296,27 +281,7 @@ tests/test_region_moc_text_oracle.rs::headers_match_c | Moc (not in jniast) tests/test_region_moc_text_oracle.rs::malformed_text_is_reported_and_leaves_the_moc | Moc (not in jniast) tests/test_region_moc_text_oracle.rs::malformed_data_is_reported_and_leaves_the_moc | Moc (not in jniast) src/regions/moc.rs::bounds_beyond_any_grid_index_are_an_error | Moc (not in jniast) -tests/test_region_stc_oracle.rs::stc_matches_c | StcResourceProfile, StcSearchLocation, StcCatalogEntryLocation and StcObsDataLocation (out of scope) -tests/test_region_stc_oracle.rs::full_dumps_match_c | StcResourceProfile, StcSearchLocation, StcCatalogEntryLocation and StcObsDataLocation (out of scope) -tests/test_region_stc_oracle.rs::c_dumps_read_back_as_c_reads_them | StcResourceProfile, StcSearchLocation, StcCatalogEntryLocation and StcObsDataLocation (out of scope) -tests/test_region_stc_oracle.rs::overlap_with_a_circle_matches_c | StcResourceProfile (out of scope) tests/test_region_stc_oracle.rs::error_ellipse_licence_is_still_needed | Rust-only API (checks that the Rust port's ERROR_ELLIPSE_LICENSED is still needed off macOS) -tests/test_region_stc_oracle.rs::astro_coords_match_c | StcResourceProfile and AstroCoords (out of scope) -tests/test_region_stc_oracle.rs::unknown_astro_coords_key_is_stckey | StcResourceProfile and AstroCoords (out of scope) -tests/test_selectormap.rs::selectormap_basic_construction | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_empty_regions_rejected | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_mismatched_axes_rejected | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_point_in_region1 | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_point_in_region2 | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_point_in_no_region | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_bad_input_returns_badval | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_multiple_points | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_first_region_wins | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_inverse_is_an_error | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_simplify_inverse_cancel_fixture | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_serialization_roundtrip | SelectorMap (out of scope) -tests/test_selectormap.rs::selectormap_dump_matches_the_c_library | SelectorMap (out of scope) -tests/test_remove_regions_oracle.rs::removing_regions_matches_the_c_library | astRemoveRegions (out-of-scope method) tests/traits_compile.rs::dummy_region_implements_all_traits | Rust-only API (Region trait) tests/traits_compile.rs::region_is_object_safe | Rust-only API (Region trait) tests/traits_compile.rs::dyn_types_are_send | Rust-only API (Send trait bound) diff --git a/src/test/resources/deferred/serialisation.txt b/src/test/resources/deferred/serialisation.txt index ad3ee5d..96dee06 100644 --- a/src/test/resources/deferred/serialisation.txt +++ b/src/test/resources/deferred/serialisation.txt @@ -8,8 +8,6 @@ simplify/cap_normmap_cmpframe.map | needs NormMap simplify/cap_normmap_cmpframe.simp | needs NormMap simplify/cap_permmap_01.map | needs NormMap simplify/cap_permmap_01.simp | needs NormMap -simplify/cap_timemap_02.map | needs StcResourceProfile -simplify/cap_timemap_02.simp | needs StcResourceProfile simplify/cap_unitnormmap_01.map | needs UnitNormMap simplify/cap_unitnormmap_01.simp | needs UnitNormMap simplify/cap_xphmap_01.map | needs XphMap @@ -25,10 +23,6 @@ simplify/neg_normmap_inv_diff_frame.map | needs NormMap simplify/neg_normmap_nonnorm_neighbour.map | needs NormMap simplify/neg_normmap_parallel.map | needs NormMap simplify/neg_normmap_parallel_sky.map | needs NormMap -simplify/neg_selectormap_not_equal.map | needs SelectorMap -simplify/neg_selectormap_parallel.map | needs SelectorMap -simplify/neg_selectormap_series_lower.map | needs SelectorMap -simplify/neg_selectormap_series_upper.map | needs SelectorMap simplify/neg_spline_different_coeffs.map | needs SplineMap simplify/neg_spline_nonspline_neighbour.map | needs SplineMap simplify/neg_spline_parallel.map | needs SplineMap @@ -49,12 +43,6 @@ simplify/normmap_duplicate_elim.map | needs NormMap simplify/normmap_duplicate_elim.simp | needs NormMap simplify/normmap_inverse_cancel.map | needs NormMap simplify/normmap_inverse_cancel_upper.map | needs NormMap -simplify/selectormap_inverse_cancel.map | needs SelectorMap -simplify/selectormap_inverse_cancel_tail.map | needs SelectorMap -simplify/selectormap_region_simplify.map | needs SelectorMap -simplify/selectormap_region_simplify.simp | needs SelectorMap -simplify/selectormap_region_simplify_real.map | needs SelectorMap -simplify/selectormap_region_simplify_real.simp | needs SelectorMap simplify/spline_inverse_cancel.map | needs SplineMap simplify/unitnormmap_diff_centre_to_shift.map | needs UnitNormMap simplify/unitnormmap_fwd_winmap_refused.map | needs UnitNormMap diff --git a/src/test/resources/deferred/simplify-cases.txt b/src/test/resources/deferred/simplify-cases.txt index 49d5973..78d1ccf 100644 --- a/src/test/resources/deferred/simplify-cases.txt +++ b/src/test/resources/deferred/simplify-cases.txt @@ -7,7 +7,6 @@ normmap_inverse_cancel | needs NormMap normmap_duplicate_elim | needs NormMap unitnormmap_inverse_cancel | needs UnitNormMap unitnormmap_diff_centre_to_shift | needs UnitNormMap -selectormap_inverse_cancel | needs SelectorMap neg_spline_same_direction | needs SplineMap neg_normmap_parallel | needs NormMap neg_normmap_different_frames | needs NormMap @@ -18,10 +17,8 @@ neg_spline_different_coeffs | needs SplineMap normmap_inverse_cancel_upper | needs NormMap unitnormmap_inv_fwd_cancel | needs UnitNormMap cap_normmap_cmpframe | needs NormMap -selectormap_region_simplify | needs SelectorMap cap_matrixmap_04 | needs ChebyMap cap_permmap_01 | needs NormMap -cap_timemap_02 | needs StcResourceProfile cap_unitnormmap_01 | needs UnitNormMap cap_xphmap_01 | needs XphMap cap_xphmap_02 | needs XphMap @@ -32,12 +29,6 @@ xph_inverse_cancel | needs XphMap neg_xph_parallel | needs XphMap neg_xph_nonxph_neighbour | needs XphMap neg_xph_not_opposite | needs XphMap -selectormap_region_simplify_real | needs SelectorMap -neg_selectormap_series_upper | needs SelectorMap -neg_selectormap_series_lower | needs SelectorMap -neg_selectormap_not_equal | needs SelectorMap -neg_selectormap_parallel | needs SelectorMap -selectormap_inverse_cancel_tail | needs SelectorMap unitnormmap_shift_fwd_merge | needs UnitNormMap unitnormmap_winmap_fwd_merge | needs UnitNormMap unitnormmap_inv_shift_merge | needs UnitNormMap diff --git a/src/test/resources/deferred/simplify.txt b/src/test/resources/deferred/simplify.txt index c3f9954..a4fa448 100644 --- a/src/test/resources/deferred/simplify.txt +++ b/src/test/resources/deferred/simplify.txt @@ -7,8 +7,6 @@ simplify/cap_normmap_cmpframe.map | needs NormMap simplify/cap_normmap_cmpframe.simp | needs NormMap simplify/cap_permmap_01.map | needs NormMap simplify/cap_permmap_01.simp | needs NormMap -simplify/cap_timemap_02.map | needs StcResourceProfile -simplify/cap_timemap_02.simp | needs StcResourceProfile simplify/cap_unitnormmap_01.map | needs UnitNormMap simplify/cap_unitnormmap_01.simp | needs UnitNormMap simplify/cap_xphmap_01.map | needs XphMap @@ -24,10 +22,6 @@ simplify/neg_normmap_inv_diff_frame.map | needs NormMap simplify/neg_normmap_nonnorm_neighbour.map | needs NormMap simplify/neg_normmap_parallel.map | needs NormMap simplify/neg_normmap_parallel_sky.map | needs NormMap -simplify/neg_selectormap_not_equal.map | needs SelectorMap -simplify/neg_selectormap_parallel.map | needs SelectorMap -simplify/neg_selectormap_series_lower.map | needs SelectorMap -simplify/neg_selectormap_series_upper.map | needs SelectorMap simplify/neg_spline_different_coeffs.map | needs SplineMap simplify/neg_spline_nonspline_neighbour.map | needs SplineMap simplify/neg_spline_parallel.map | needs SplineMap @@ -48,10 +42,6 @@ simplify/normmap_duplicate_elim.map | needs NormMap simplify/normmap_duplicate_elim.simp | needs NormMap simplify/normmap_inverse_cancel.map | needs NormMap simplify/normmap_inverse_cancel_upper.map | needs NormMap -simplify/selectormap_region_simplify.map | needs SelectorMap -simplify/selectormap_region_simplify.simp | needs SelectorMap -simplify/selectormap_region_simplify_real.map | needs SelectorMap -simplify/selectormap_region_simplify_real.simp | needs SelectorMap simplify/spline_inverse_cancel.map | needs SplineMap simplify/unitnormmap_diff_centre_to_shift.map | needs UnitNormMap simplify/unitnormmap_fwd_winmap_refused.map | needs UnitNormMap diff --git a/src/test/resources/oracle/region_stc.json b/src/test/resources/oracle/region_stc.json new file mode 100644 index 0000000..e692bdd --- /dev/null +++ b/src/test/resources/oracle/region_stc.json @@ -0,0 +1,15 @@ +{ + "source": "crates/starlink-ast/tests/region_stc_oracle/cases.rs", + "generator": "tools/oracle_fixtures/region_stc_probe.c", + "rustCommit": "10f61689f19a5f1eacc7e653c7eab9b03809939f", + "consts": { + "CASES": [["plain"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n",[[0.0,0.0,0.0,0.0],[5.0,0.0,"BAD","BAD"]],true],["negated"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n",[[0.0,0.0,"BAD","BAD"],[5.0,0.0,5.0,0.0]],false],["sky"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 5 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Ellipse \t# Elliptical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 3 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.027362430053203605 \t# Coordinate values...\n X2 = 0.7845310768331818\n X3 = 0.027499681267880254\n X4 = 0.78450731774690685\n X5 = 0.027328868636628124\n X6 = 0.78443393886786583\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Ellipse\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 6 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Com1 = \"AstroCoords error region\" \t# Item comment\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Ellipse \t# Elliptical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 3 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.027362430053203605 \t# Coordinate values...\n X2 = 0.7845310768331818\n X3 = 0.027499681267880254\n X4 = 0.78450731774690685\n X5 = 0.027328868636628124\n X6 = 0.78443393886786583\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Ellipse\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n",[[1.0,0.5,1.0,0.5],[1.1,0.5,"BAD","BAD"]],true],["mapped"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n",[[0.0,0.0,0.0,0.0],[3.0,0.0,"BAD","BAD"]],true],["from_mapped"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n",[[0.0,0.0,0.0,0.0],[3.0,0.0,"BAD","BAD"]],true],["mapped_simplified"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"," Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n",[[0.0,0.0,0.0,0.0],[3.0,0.0,"BAD","BAD"]],true],["search"," Begin StcSearchLocation \t# Query coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcSearchLocation\n"," Begin StcSearchLocation \t# Query coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcSearchLocation\n",[[0.0,0.0,0.0,0.0],[5.0,0.0,"BAD","BAD"]],true],["catalog_entry"," Begin StcCatalogEntryLocation \t# Resource coverage\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 5 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Ellipse \t# Elliptical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 3 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.027362430053203605 \t# Coordinate values...\n X2 = 0.7845310768331818\n X3 = 0.027499681267880254\n X4 = 0.78450731774690685\n X5 = 0.027328868636628124\n X6 = 0.78443393886786583\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Ellipse\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcCatalogEntryLocation\n"," Begin StcCatalogEntryLocation \t# Resource coverage\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 6 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Com1 = \"AstroCoords error region\" \t# Item comment\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Ellipse \t# Elliptical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 3 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.027362430053203605 \t# Coordinate values...\n X2 = 0.7845310768331818\n X3 = 0.027499681267880254\n X4 = 0.78450731774690685\n X5 = 0.027328868636628124\n X6 = 0.78443393886786583\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Ellipse\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcCatalogEntryLocation\n",[[1.0,0.5,1.0,0.5],[1.1,0.5,"BAD","BAD"]],true],["obs_data_without_obs"," Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcObsDataLocation\n"," Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcObsDataLocation\n",[[0.0,0.0,0.0,0.0],[5.0,0.0,"BAD","BAD"]],true],["obs_data"," Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\n"," Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\n",[[0.0,0.0,0.0,0.0],[5.0,0.0,"BAD","BAD"]],true]], + "FULL_DUMPS": [["plain"," Begin StcResourceProfile \t# Resource coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"],["negated"," Begin StcResourceProfile \t# Resource coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"],["sky"," Begin StcResourceProfile \t# Resource coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Angle on sky\" \t# Axis Label\n# Symbol = \"delta\" \t# Axis symbol\n# Unit = \"ddd:mm:ss\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"dms\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n IsA Axis \t# Coordinate axis\n# Format = \"dms\" \t# Format specifier\n# IsLat = 0 \t# Longitude axis (not latitude)\n# CnZer = 0 \t# Display axis values in range 0 -> 2.PI\n# AsTime = 0 \t# Display values as angles (not times)\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Angle on sky\" \t# Axis Label\n# Symbol = \"delta\" \t# Axis symbol\n# Unit = \"ddd:mm:ss\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"dms\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n IsA Axis \t# Coordinate axis\n# Format = \"dms\" \t# Format specifier\n# IsLat = 0 \t# Longitude axis (not latitude)\n# CnZer = 0 \t# Display axis values in range 0 -> 2.PI\n# AsTime = 0 \t# Display values as angles (not times)\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# Proj = \"\" \t# Description of sky projection\n# NegLon = 0 \t# Display positive longitude values\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n# Eqnox = 2000 \t# Julian epoch of mean equinox\n# SRefIs = \"Ignored\" \t# Not rotated (ref. pos. is ignored)\n# SRef1 = 0 \t# Ref. pos. RA 0:00:00.0\n# SRef2 = 0 \t# Ref. pos. Dec 0:00:00\n# SRefP1 = 0 \t# Ref. north RA 0:00:00.0\n# SRefP2 = 1.5707963267948966 \t# Ref. north Dec 90:00:00\n# AlOff = 0 \t# Align in system coords\n End SkyFrame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# SzGss = 160 \t# Guess at KeyMap size\n# SortBy = \"None\" \t# Sorting scheme for keys\n# KyCas = 1 \t# Are keys case sensitive?\n# KyErr = 0 \t# Report non-existant keys?\n# MpLck = 0 \t# Prevent addition of new entries?\n MapSz = 16 \t# Size of hash table\n MemCnt = 5 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Ellipse \t# Elliptical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 3 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0.027362430053203605 \t# Coordinate values...\n X2 = 0.7845310768331818\n X3 = 0.027499681267880254\n X4 = 0.78450731774690685\n X5 = 0.027328868636628124\n X6 = 0.78443393886786583\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Ellipse\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"],["mapped"," Begin StcResourceProfile \t# Resource coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n# Nnode = 2 \t# Number of nodes in FrameSet\n# Nod1 = 1 \t# Frame 1 is associated with node 1\n# Nod2 = 2 \t# Frame 2 is associated with node 2\n# VFr1 = 0 \t# Frame 1 inherits variants from Frame 0\n# VFr2 = 0 \t# Frame 2 inherits variants from Frame 0\n Lnk2 = 1 \t# Node 2 is derived from node 1\n# Inv2 = 0 \t# The forward mapping is used\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n IsSimp = 1 \t# Mapping has been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"],["from_mapped"," Begin StcResourceProfile \t# Resource coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n# Nnode = 2 \t# Number of nodes in FrameSet\n# Nod1 = 1 \t# Frame 1 is associated with node 1\n# Nod2 = 2 \t# Frame 2 is associated with node 2\n# VFr1 = 0 \t# Frame 1 inherits variants from Frame 0\n# VFr2 = 0 \t# Frame 2 inherits variants from Frame 0\n Lnk2 = 1 \t# Node 2 is derived from node 1\n# Inv2 = 0 \t# The forward mapping is used\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n IsSimp = 1 \t# Mapping has been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"],["mapped_simplified"," Begin StcResourceProfile \t# Resource coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n# Nnode = 2 \t# Number of nodes in FrameSet\n# Nod1 = 1 \t# Frame 1 is associated with node 1\n# Nod2 = 2 \t# Frame 2 is associated with node 2\n# VFr1 = 0 \t# Frame 1 inherits variants from Frame 0\n# VFr2 = 0 \t# Frame 2 inherits variants from Frame 0\n Lnk2 = 1 \t# Node 2 is derived from node 1\n# Inv2 = 0 \t# The forward mapping is used\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOMED\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"ZOOMED1\" \t# Symbol for axis 1\n# Sym2 = \"ZOOMED2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n IsSimp = 1 \t# Mapping has been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n# RegFS = 1 \t# Include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n"],["search"," Begin StcSearchLocation \t# Query coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcSearchLocation\n"],["catalog_entry"," Begin StcCatalogEntryLocation \t# Resource coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Angle on sky\" \t# Axis Label\n# Symbol = \"delta\" \t# Axis symbol\n# Unit = \"ddd:mm:ss\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"dms\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n IsA Axis \t# Coordinate axis\n# Format = \"dms\" \t# Format specifier\n# IsLat = 0 \t# Longitude axis (not latitude)\n# CnZer = 0 \t# Display axis values in range 0 -> 2.PI\n# AsTime = 0 \t# Display values as angles (not times)\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Angle on sky\" \t# Axis Label\n# Symbol = \"delta\" \t# Axis symbol\n# Unit = \"ddd:mm:ss\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"dms\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n IsA Axis \t# Coordinate axis\n# Format = \"dms\" \t# Format specifier\n# IsLat = 0 \t# Longitude axis (not latitude)\n# CnZer = 0 \t# Display axis values in range 0 -> 2.PI\n# AsTime = 0 \t# Display values as angles (not times)\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# Proj = \"\" \t# Description of sky projection\n# NegLon = 0 \t# Display positive longitude values\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n# Eqnox = 2000 \t# Julian epoch of mean equinox\n# SRefIs = \"Ignored\" \t# Not rotated (ref. pos. is ignored)\n# SRef1 = 0 \t# Ref. pos. RA 0:00:00.0\n# SRef2 = 0 \t# Ref. pos. Dec 0:00:00\n# SRefP1 = 0 \t# Ref. north RA 0:00:00.0\n# SRefP2 = 1.5707963267948966 \t# Ref. north Dec 90:00:00\n# AlOff = 0 \t# Align in system coords\n End SkyFrame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# SzGss = 160 \t# Guess at KeyMap size\n# SortBy = \"None\" \t# Sorting scheme for keys\n# KyCas = 1 \t# Are keys case sensitive?\n# KyErr = 0 \t# Report non-existant keys?\n# MpLck = 0 \t# Prevent addition of new entries?\n MapSz = 16 \t# Size of hash table\n MemCnt = 5 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Ellipse \t# Elliptical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# Sym1 = \"RA\" \t# Symbol for axis 1\n# Sym2 = \"Dec\" \t# Symbol for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# AlSys = \"ICRS\" \t# Alignment coordinate system\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"hms.1\" \t# Format specifier for axis 1\n# Fmt2 = \"dms\" \t# Format specifier for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 3 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0.027362430053203605 \t# Coordinate values...\n X2 = 0.7845310768331818\n X3 = 0.027499681267880254\n X4 = 0.78450731774690685\n X5 = 0.027328868636628124\n X6 = 0.78443393886786583\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Ellipse\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcCatalogEntryLocation\n"],["obs_data_without_obs"," Begin StcObsDataLocation \t# Observation coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcObsDataLocation\n"],["obs_data"," Begin StcObsDataLocation \t# Observation coverage\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 2 \t# Number of input coordinates\n# Nout = 2 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Sym1 = \"x1\" \t# Symbol for axis 1\n# Sym2 = \"x2\" \t# Symbol for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 2 \t# Minimum number of axes to match\n# MaxAx = 2 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 200 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n# RegFS = 0 \t# Do not include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n# Ncoord = 0 \t# Number of AstroCoords elements\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 3 \t# Number of input coordinates\n# Nout = 3 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# Sym1 = \"GEO1\" \t# Symbol for axis 1\n# Sym2 = \"GEO2\" \t# Symbol for axis 2\n# Sym3 = \"GEO3\" \t# Symbol for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Uni3 = \"\" \t# Units for axis 3\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Dig3 = 7 \t# Individual precision for axis 3\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Fmt3 = \"%1.7G\" \t# Format specifier for axis 3\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Dir3 = 1 \t# Plot axis 3 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Bot3 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top3 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 3 \t# Minimum number of axes to match\n# MaxAx = 3 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n IsA Frame \t# Coordinate system description\n# Negate = 0 \t# Region not negated\n# Fill = 1 \t# Region fill factor\n# MeshSz = 2000 \t# No. of points used to represent boundary\n# Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Nin = 3 \t# Number of input coordinates\n# Nout = 3 \t# Number of output coordinates\n# IsSimp = 0 \t# Mapping has not been simplified\n# ReSimp = 0 \t# Simplify uses all Mappings\n# AlSimp = 0 \t# Will not be used by restricted Simplify\n# Invert = 0 \t# Mapping not inverted\n# Fwd = 1 \t# Forward transformation defined\n# Inv = 1 \t# Inverse transformation defined\n# Report = 0 \t# Don't report coordinate transformations\n IsA Mapping \t# Mapping between coordinate systems\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# Sym1 = \"GEO1\" \t# Symbol for axis 1\n# Sym2 = \"GEO2\" \t# Symbol for axis 2\n# Sym3 = \"GEO3\" \t# Symbol for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n# AlSys = \"Cartesian\" \t# Alignment coordinate system\n# Uni1 = \"\" \t# Units for axis 1\n# Uni2 = \"\" \t# Units for axis 2\n# Uni3 = \"\" \t# Units for axis 3\n# Dig1 = 7 \t# Individual precision for axis 1\n# Dig2 = 7 \t# Individual precision for axis 2\n# Dig3 = 7 \t# Individual precision for axis 3\n# Digits = 7 \t# Default formatting precision\n# Fmt1 = \"%1.7G\" \t# Format specifier for axis 1\n# Fmt2 = \"%1.7G\" \t# Format specifier for axis 2\n# Fmt3 = \"%1.7G\" \t# Format specifier for axis 3\n# Dir1 = 1 \t# Plot axis 1 in conventional direction\n# Dir2 = 1 \t# Plot axis 2 in conventional direction\n# Dir3 = 1 \t# Plot axis 3 in conventional direction\n# Bot1 = \t# Lowest legal axis value\n# Bot2 = \t# Lowest legal axis value\n# Bot3 = \t# Lowest legal axis value\n# Top1 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top2 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Top3 = 1.7976931348623157e+308 \t# Highest legal axis value\n# Presrv = 0 \t# Don't preserve target axes\n# Permut = 1 \t# Axes may be permuted to match\n# MinAx = 3 \t# Minimum number of axes to match\n# MaxAx = 3 \t# Maximum number of axes to match\n# MchEnd = 0 \t# Match initial target axes\n# ObsLat = 0 \t# Observers geodetic latitude (rads)\n# ObsLon = 0 \t# Observers geodetic longitude (rads)\n# ObsAlt = 0 \t# Observers geodetic altitude (metres)\n# Dtai = \t# TAI-UTC in seconds\n# Dut1 = 0 \t# UT1-UTC in seconds\n# Prm1 = 1 \t# Axis 1 not permuted\n# Prm2 = 2 \t# Axis 2 not permuted\n# Prm3 = 3 \t# Axis 3 not permuted\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n# Label = \"Coordinate axis\" \t# Axis Label\n# Symbol = \"x\" \t# Axis symbol\n# Unit = \"\" \t# Axis units\n# Digits = 7 \t# Default formatting precision\n# Format = \"%1.7G\" \t# Format specifier\n# Dirn = 1 \t# Plot in conventional direction (hint)\n# Top = 1.7976931348623157e+308 \t# Maximum legal axis value\n# Bottom = \t# Minimum legal axis value\n End Axis\n End Frame\n# RegFS = 1 \t# Include Frame in dump\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n# ID = \"\" \t# Object identification string\n# Ident = \"\" \t# Permanent Object identification string\n# UseDfs = 1 \t# Default attribute values can be used\n IsA Object \t# AST Object\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n# Empty = 0 \t# PointSet contains data\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\n"]], + "OVERLAP_STC_CIRCLE": 2, + "OVERLAP_CIRCLE_STC": 3, + "SKY_NCOORD": 1, + "SKY_COORD": " Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 6 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Ellipse \t# Elliptical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 3 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.027362430053203605 \t# Coordinate values...\n X2 = 0.7845310768331818\n X3 = 0.027499681267880254\n X4 = 0.78450731774690685\n X5 = 0.027328868636628124\n X6 = 0.78443393886786583\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Ellipse\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n", + "COORD_INDEX": 233934146, + "COORD_KEY": 233934138 + } +} diff --git a/src/test/resources/oracle/remove_regions.json b/src/test/resources/oracle/remove_regions.json new file mode 100644 index 0000000..cc3983b --- /dev/null +++ b/src/test/resources/oracle/remove_regions.json @@ -0,0 +1,8 @@ +{ + "source": "crates/starlink-ast/tests/remove_regions_oracle/cases.rs", + "generator": "tools/oracle_fixtures/remove_regions_probe.c", + "rustCommit": "10f61689f19a5f1eacc7e653c7eab9b03809939f", + "consts": { + "CASES": [["cmpmap_series_region_first",[" Begin CmpMap \t# Compound Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# First component Mapping"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," MapB = \t# Second component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 3 \t# Zoom factor"," End ZoomMap"," End CmpMap"],[" Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 3 \t# Zoom factor"," End ZoomMap"]],["cmpmap_series_inverted_component",[" Begin CmpMap \t# Compound Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," InvA = 1 \t# First Mapping used in inverse direction"," MapA = \t# First component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," Invert = 1 \t# Mapping inverted"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 3 \t# Zoom factor"," End ZoomMap"," MapB = \t# Second component Mapping"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," End CmpMap"],[" Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," Invert = 1 \t# Mapping inverted"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 3 \t# Zoom factor"," End ZoomMap"]],["cmpmap_series_inverted",[" Begin CmpMap \t# Compound Mapping"," Nin = 2 \t# Number of input coordinates"," Invert = 1 \t# Mapping inverted"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# First component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 4 \t# Zoom factor"," End ZoomMap"," MapB = \t# Second component Mapping"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," End CmpMap"],[" Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," Invert = 1 \t# Mapping inverted"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 4 \t# Zoom factor"," End ZoomMap"]],["cmpmap_parallel_two_regions",[" Begin CmpMap \t# Compound Mapping"," Nin = 4 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Series = 0 \t# Component Mappings applied in parallel"," MapA = \t# First component Mapping"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," MapB = \t# Second component Mapping"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," End CmpMap"],[" Begin UnitMap \t# Unit (null) Mapping"," Nin = 4 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," End UnitMap"]],["cmpmap_parallel_one_region",[" Begin CmpMap \t# Compound Mapping"," Nin = 3 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Series = 0 \t# Component Mappings applied in parallel"," MapA = \t# First component Mapping"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," MapB = \t# Second component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 1 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 2 \t# Zoom factor"," End ZoomMap"," End CmpMap"],[" Begin CmpMap \t# Compound Mapping"," Nin = 3 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Series = 0 \t# Component Mappings applied in parallel"," MapA = \t# First component Mapping"," Begin UnitMap \t# Unit (null) Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," End UnitMap"," MapB = \t# Second component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 1 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 2 \t# Zoom factor"," End ZoomMap"," End CmpMap"]],["cmpmap_without_regions",[" Begin CmpMap \t# Compound Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# First component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 2 \t# Zoom factor"," End ZoomMap"," MapB = \t# Second component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 5 \t# Zoom factor"," End ZoomMap"," End CmpMap"],[" Begin CmpMap \t# Compound Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# First component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 2 \t# Zoom factor"," End ZoomMap"," MapB = \t# Second component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 5 \t# Zoom factor"," End ZoomMap"," End CmpMap"]],["tranmap_two_regions",[" Begin TranMap \t# Compound Transformation Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# Mapping for forward transformation"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," MapB = \t# Mapping for inverse transformation"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," End TranMap"],[" Begin UnitMap \t# Unit (null) Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," End UnitMap"]],["tranmap_one_region",[" Begin TranMap \t# Compound Transformation Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# Mapping for forward transformation"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," MapB = \t# Mapping for inverse transformation"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 2 \t# Zoom factor"," End ZoomMap"," End TranMap"],[" Begin TranMap \t# Compound Transformation Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# Mapping for forward transformation"," Begin UnitMap \t# Unit (null) Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," End UnitMap"," MapB = \t# Mapping for inverse transformation"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 2 \t# Zoom factor"," End ZoomMap"," End TranMap"]],["ratemap_region",[" Begin RateMap \t# Differential Mapping"," Nin = 2 \t# Number of input coordinates"," Nout = 1 \t# Number of output coordinates"," Inv = 0 \t# Inverse transformation not defined"," IsA Mapping \t# Mapping between coordinate systems"," Map = \t# Mapping to be differentiated"," Begin CmpMap \t# Compound Mapping"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," MapA = \t# First component Mapping"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," MapB = \t# Second component Mapping"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 3 \t# Zoom factor"," End ZoomMap"," End CmpMap"," End RateMap"],[" Begin RateMap \t# Differential Mapping"," Nin = 2 \t# Number of input coordinates"," Nout = 1 \t# Number of output coordinates"," Inv = 0 \t# Inverse transformation not defined"," IsA Mapping \t# Mapping between coordinate systems"," Map = \t# Mapping to be differentiated"," Begin ZoomMap \t# Zoom about the origin"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Zoom = 3 \t# Zoom factor"," End ZoomMap"," End RateMap"]],["normmap_region",[" Begin NormMap \t# Normalise axis values"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Frame = \t# Frame defining the normalisation"," Begin Circle \t# Circular or spherical region","# Title = \"2-d coordinate system\" \t# Title of coordinate system","# Naxes = 2 \t# Number of coordinate axes","# Epoch = 2000 \t# Julian epoch of observation","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# System = \"Cartesian\" \t# Coordinate system type"," IsA Frame \t# Coordinate system description"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," End NormMap"],[" Begin NormMap \t# Normalise axis values"," Nin = 2 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Frame = \t# Frame defining the normalisation"," Begin Frame \t# Coordinate system description","# Title = \"2-d coordinate system\" \t# Title of coordinate system"," Naxes = 2 \t# Number of coordinate axes","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," End NormMap"]],["normmap_cmpframe",[" Begin NormMap \t# Normalise axis values"," Nin = 4 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Frame = \t# Frame defining the normalisation"," Begin CmpFrame \t# Compound coordinate system description","# Title = \"4-d compound coordinate system\" \t# Title of coordinate system","# Naxes = 4 \t# Number of coordinate axes","# Domain = \"-SKY\" \t# Coordinate system domain","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# Lbl3 = \"Right ascension\" \t# Label for axis 3","# Lbl4 = \"Declination\" \t# Label for axis 4","# Uni3 = \"hh:mm:ss.s\" \t# Units for axis 3","# Uni4 = \"ddd:mm:ss\" \t# Units for axis 4","# Dir3 = 0 \t# Plot axis 3 in reverse direction"," IsA Frame \t# Coordinate system description"," FrameA = \t# First component Frame"," Begin Circle \t# Circular or spherical region"," Adapt = 1 \t# Region adapts to coord sys changes"," Frm = \t# Coordinate system"," Begin Frame \t# Coordinate system description"," Naxes = 2 \t# Number of coordinate axes"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," Points = \t# Points defining the shape"," Begin PointSet \t# Container for a set of points"," Npoint = 2 \t# Number of points"," Ncoord = 2 \t# Number of coordinates per point"," X1 = 1 \t# Coordinate values..."," X2 = 2"," X3 = 2"," X4 = 2"," End PointSet"," IsA Region \t# An area within a coordinate system"," End Circle"," FrameB = \t# Second component Frame"," Begin SkyFrame \t# Description of celestial coordinate system"," Naxes = 2 \t# Number of coordinate axes"," Ax1 = \t# Axis number 1"," Begin SkyAxis \t# Celestial coordinate axis"," End SkyAxis"," Ax2 = \t# Axis number 2"," Begin SkyAxis \t# Celestial coordinate axis"," End SkyAxis"," IsA Frame \t# Coordinate system description"," End SkyFrame"," End CmpFrame"," End NormMap"],[" Begin NormMap \t# Normalise axis values"," Nin = 4 \t# Number of input coordinates"," IsA Mapping \t# Mapping between coordinate systems"," Frame = \t# Frame defining the normalisation"," Begin CmpFrame \t# Compound coordinate system description","# Title = \"4-d compound coordinate system\" \t# Title of coordinate system","# Naxes = 4 \t# Number of coordinate axes","# Domain = \"-SKY\" \t# Coordinate system domain","# Lbl1 = \"Axis 1\" \t# Label for axis 1","# Lbl2 = \"Axis 2\" \t# Label for axis 2","# Lbl3 = \"Right ascension\" \t# Label for axis 3","# Lbl4 = \"Declination\" \t# Label for axis 4","# Uni3 = \"hh:mm:ss.s\" \t# Units for axis 3","# Uni4 = \"ddd:mm:ss\" \t# Units for axis 4","# Dir3 = 0 \t# Plot axis 3 in reverse direction"," IsA Frame \t# Coordinate system description"," FrameA = \t# First component Frame"," Begin Frame \t# Coordinate system description"," Naxes = 2 \t# Number of coordinate axes"," Ax1 = \t# Axis number 1"," Begin Axis \t# Coordinate axis"," End Axis"," Ax2 = \t# Axis number 2"," Begin Axis \t# Coordinate axis"," End Axis"," End Frame"," FrameB = \t# Second component Frame"," Begin SkyFrame \t# Description of celestial coordinate system"," Naxes = 2 \t# Number of coordinate axes"," Ax1 = \t# Axis number 1"," Begin SkyAxis \t# Celestial coordinate axis"," End SkyAxis"," Ax2 = \t# Axis number 2"," Begin SkyAxis \t# Celestial coordinate axis"," End SkyAxis"," IsA Frame \t# Coordinate system description"," End SkyFrame"," End CmpFrame"," End NormMap"]]] + } +} diff --git a/src/test/resources/probes/region_dump_probe.c b/src/test/resources/probes/region_dump_probe.c new file mode 100644 index 0000000..b9e91c5 --- /dev/null +++ b/src/test/resources/probes/region_dump_probe.c @@ -0,0 +1,69 @@ +/* region_dump_probe -- the Negate, Fill, MeshSz and Closed items region.c's + * Dump writes for Regions with those attributes set: a Box, a CmpRegion + * (whose own setters pass Closed and MeshSize on to its components), and a + * PointList, whose GetClosed always gives the opposite of Negated while + * Dump writes the Closed value set on it, read through region.c's own + * TestClosed and GetClosed. + * + * Each case starts with a line "== ". + * Built against the C library at 3d3f255f with its static libraries: + * cc -std=c11 -ffp-contract=off -I -o region_dump_probe + * region_dump_probe.c /libast.a /libast_pal.a + * /libast_err.a /libast_grf3d.a /libast_grf_2.0.a + * /libast_grf_3.2.a /libast_grf_5.6.a + * /libast_cminpack.a -lyaml -lm + * and run as ./region_dump_probe > region_dump_probe.txt 2>&1; the output, + * with trailing white space removed from every line, is stored as the + * "output" string of region_dump_probe.json, since the dumps hold C's item + * names, which the spelling check rejects. */ +#include +#include "ast.h" + +static void head( const char *name ) { + printf( "== %s\n", name ); +} + +static AstBox *box2( double xlo, double ylo, double xhi, double yhi ) { + double lb[ 2 ], ub[ 2 ]; + lb[ 0 ] = xlo; + lb[ 1 ] = ylo; + ub[ 0 ] = xhi; + ub[ 1 ] = yhi; + return astBox( astFrame( 2, " " ), 1, lb, ub, NULL, " " ); +} + +int main( void ) { + AstBox *box; + AstCmpRegion *cmp; + AstPointList *pl; + double pts[ 2 ][ 2 ] = { { 0.0, 1.0 }, { 0.0, 2.0 } }; + + setvbuf( stdout, NULL, _IONBF, 0 ); + astBegin; + + head( "box" ); + box = box2( 0.0, 0.0, 1.0, 2.0 ); + astSet( box, "Closed=0,MeshSize=50,FillFactor=0.5" ); + astShow( box ); + + head( "cmpregion" ); + cmp = astCmpRegion( box2( 0.0, 0.0, 2.0, 2.0 ), box2( 1.0, 1.0, 3.0, 3.0 ), + AST__AND, " " ); + astSet( cmp, "Closed=0,MeshSize=20" ); + astShow( cmp ); + + head( "pointlist" ); + pl = astPointList( astFrame( 2, " " ), 2, 2, 2, (const double *) pts, NULL, " " ); + astSet( pl, "Closed=0" ); + printf( "Closed %d\n", astGetI( pl, "Closed" ) ); + astShow( pl ); + + head( "pointlist_negated" ); + astSet( pl, "Negated=1,Closed=1" ); + printf( "Closed %d\n", astGetI( pl, "Closed" ) ); + astShow( pl ); + + if( !astOK ) printf( "status %d\n", astStatus ); + astEnd; + return 0; +} diff --git a/src/test/resources/probes/region_dump_probe.json b/src/test/resources/probes/region_dump_probe.json new file mode 100644 index 0000000..51bb5a5 --- /dev/null +++ b/src/test/resources/probes/region_dump_probe.json @@ -0,0 +1,4 @@ +{ + "source": "probes/region_dump_probe.c", + "output": "== box\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Fill = 0.5 \t# Region fill factor\n MeshSz = 50 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 1\n X3 = 1\n X4 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n== cmpregion\n Begin CmpRegion \t# Combination of two Regions\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n MeshSz = 20 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Operator = 1 \t# Regions combined using Boolean AND\n RegionA = \t# First component Region\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n MeshSz = 20 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 1\n X3 = 2\n X4 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n RegionB = \t# Second component Region\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n MeshSz = 20 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 2 \t# Coordinate values...\n X2 = 2\n X3 = 3\n X4 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n End CmpRegion\n== pointlist\nClosed 1\n Begin PointList \t# Collection of points\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n== pointlist_negated\nClosed 0\n Begin PointList \t# Collection of points\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n" +} diff --git a/src/test/resources/probes/remove_regions_extra_probe.c b/src/test/resources/probes/remove_regions_extra_probe.c new file mode 100644 index 0000000..c42ebcf --- /dev/null +++ b/src/test/resources/probes/remove_regions_extra_probe.c @@ -0,0 +1,271 @@ +/* remove_regions_extra_probe -- what astRemoveRegions makes of the + * containers and nesting the remove_regions oracle does not cover, by the + * pinned C library. + * + * A Region gives a copy of its current Frame (region.c RemoveRegions), and + * a Mapping holding no Region gives itself (mapping.c, astClone). A + * container replaces a component that comes back as a Frame with a + * UnitMap: cmpmap.c and tranmap.c every such component, so also a plain + * Frame or a FrameSet component that was already there when the other + * component changed; switchmap.c (routes and both selectors), ratemap.c + * and frameset.c only a component that changed, which includes a FrameSet + * holding a Region, since astIsAFrame is true of a FrameSet. A CmpFrame + * (cmpframe.c) and a FrameSet (frameset.c) are copies whose unchanged + * components are the original's own Objects, so that a change made through + * one is seen in the other. A SelectorMap installs no + * RemoveRegions, so its Regions stay. + * + * Each case starts with a line "== ". "in" lines give the dump of the + * Mapping, "out" lines the dump of what astRemoveRegions returns, and a + * "same" line whether that is the given Object itself (astSame). For a + * CmpFrame, a "component" line gives whether each component of the result + * is the original's own (astDecompose of each, then astSame); for a + * FrameSet, a "frame" line whether each Frame is (astGetFrame). An "orig" + * line gives a line of the dump of the given Mapping after an attribute + * was set on the result. A "status" line reports a failed call. The cases + * whose names start with "selectormap" are kept for SelectorMap. + * + * Built against the C library at 3d3f255f with its static libraries: + * cc -std=c11 -ffp-contract=off -I -o remove_regions_extra_probe + * remove_regions_extra_probe.c /libast.a /libast_pal.a + * /libast_err.a /libast_grf3d.a /libast_grf_2.0.a + * /libast_grf_3.2.a /libast_grf_5.6.a + * /libast_cminpack.a -lyaml -lm + * and run as ./remove_regions_extra_probe > remove_regions_extra_probe.txt + * 2>&1; the output, with trailing white space removed from every line, is + * stored as the "output" string of remove_regions_extra_probe.json, since + * the dumps hold C's item names, which the spelling check rejects. */ +#include +#include "ast.h" + +static const char *prefix; + +static int failed( void ) { + if( !astOK ) { + printf( "status %d\n", astStatus ); + astClearStatus; + return 1; + } + return 0; +} + +static void sink( const char *line ) { + printf( "%s %s\n", prefix, line ); +} + +static void dump( const char *pre, AstObject *obj ) { + AstChannel *ch; + if( failed() ) return; + prefix = pre; + ch = astChannel( NULL, sink, " " ); + astWrite( ch, obj ); + ch = astAnnul( ch ); + failed(); +} + +/* Writes the case's header, the given Mapping and what astRemoveRegions + returns, and returns that (or NULL after an error). */ +static AstMapping *run( const char *name, AstMapping *map ) { + AstMapping *result; + printf( "== %s\n", name ); + if( failed() ) return NULL; + dump( "in", (AstObject *) map ); + result = astRemoveRegions( map ); + if( failed() ) return NULL; + dump( "out", (AstObject *) result ); + printf( "same %d\n", astSame( result, map ) ); + failed(); + return result; +} + +static void emit( const char *name, AstMapping *map ) { + run( name, map ); +} + +/* Whether each component of the CmpFrame result is the original's own. */ +static void components( AstMapping *result, AstMapping *map ) { + AstMapping *r1, *r2, *m1, *m2; + int series, inv1, inv2; + if( !result || failed() ) return; + astDecompose( result, &r1, &r2, &series, &inv1, &inv2 ); + astDecompose( map, &m1, &m2, &series, &inv1, &inv2 ); + if( failed() ) return; + printf( "component 1 same %d\n", astSame( r1, m1 ) ); + printf( "component 2 same %d\n", astSame( r2, m2 ) ); + failed(); +} + +/* Whether each Frame of the FrameSet result is the original's own. */ +static void frames( AstMapping *result, AstMapping *map ) { + int i, n; + if( !result || failed() ) return; + n = astGetI( map, "Nframe" ); + for( i = 1; i <= n; i++ ) { + printf( "frame %d same %d\n", i, + astSame( astGetFrame( (AstFrameSet *) result, i ), + astGetFrame( (AstFrameSet *) map, i ) ) ); + } + failed(); +} + +static AstFrame *frame( int naxes, const char *domain ) { + AstFrame *f = astFrame( naxes, " " ); + if( domain ) astSetC( f, "Domain", domain ); + return f; +} + +static AstBox *box2( double lo, double hi ) { + double lb[ 2 ], ub[ 2 ]; + lb[ 0 ] = lb[ 1 ] = lo; + ub[ 0 ] = ub[ 1 ] = hi; + return astBox( astFrame( 2, " " ), 1, lb, ub, NULL, " " ); +} + +static AstCircle *circle2( void ) { + double centre[] = { 1.0, 2.0 }, radius[] = { 1.0 }; + return astCircle( astFrame( 2, " " ), 1, centre, radius, NULL, " " ); +} + +/* A PermMap from two axes to one, giving the first input. */ +static AstPermMap *pick_first( void ) { + int inperm[ 2 ] = { 1, 0 }; + int outperm[ 1 ] = { 1 }; + return astPermMap( 2, inperm, 1, outperm, NULL, " " ); +} + +static AstSwitchMap *switch2( AstMapping *fs, AstMapping *r1, AstMapping *r2 ) { + AstMapping *rm[ 2 ]; + rm[ 0 ] = r1; + rm[ 1 ] = r2; + return astSwitchMap( fs, NULL, 2, (void **) rm, " " ); +} + +/* A FrameSet from PIX to SKY whose Mapping is a Box. */ +static AstFrameSet *frameset_with_region( void ) { + AstFrameSet *fs = astFrameSet( frame( 2, "PIX" ), " " ); + astAddFrame( fs, AST__BASE, box2( 0.0, 10.0 ), frame( 2, "SKY" ) ); + return fs; +} + +int main( void ) { + AstCmpFrame *cf; + AstFrameSet *fs; + AstMapping *result, *rm[ 2 ]; + AstPermMap *inv; + AstRegion *sel[ 2 ]; + double lb1[ 1 ] = { 0.0 }, ub1[ 1 ] = { 1.0 }; + double lb10[ 1 ] = { 0.0 }, ub10[ 1 ] = { 10.0 }; + double shift[ 2 ] = { 100.0, 100.0 }; + int status = 0; + astWatch( &status ); + + emit( "region_alone", (AstMapping *) box2( 0.0, 1.0 ) ); + + emit( "frame_alone", (AstMapping *) frame( 2, NULL ) ); + + emit( "no_regions_cmpmap", + (AstMapping *) astCmpMap( astZoomMap( 2, 3.0, " " ), + astShiftMap( 2, shift, " " ), 1, " " ) ); + + fs = astFrameSet( frame( 2, "PIX" ), " " ); + astAddFrame( fs, AST__BASE, astZoomMap( 2, 2.0, " " ), frame( 2, "SKY" ) ); + result = run( "no_regions_frameset", (AstMapping *) fs ); + frames( result, (AstMapping *) fs ); + + emit( "cmpmap_frame_beside_region", + (AstMapping *) astCmpMap( frame( 1, NULL ), + astCmpMap( box2( 0.0, 1.0 ), astZoomMap( 2, 3.0, " " ), 1, " " ), + 0, " " ) ); + + emit( "tranmap_frame_beside_region", + (AstMapping *) astTranMap( frame( 2, NULL ), + astCmpMap( box2( 0.0, 1.0 ), astZoomMap( 2, 3.0, " " ), 1, " " ), + " " ) ); + + fs = astFrameSet( frame( 2, "PIX" ), " " ); + astAddFrame( fs, AST__BASE, astZoomMap( 2, 2.0, " " ), frame( 2, "SKY" ) ); + emit( "tranmap_frameset_beside_region", (AstMapping *) astTranMap( fs, box2( 0.0, 1.0 ), " " ) ); + + emit( "switchmap_region_route", + (AstMapping *) switch2( (AstMapping *) astCmpMap( box2( 0.0, 10.0 ), pick_first(), 1, " " ), + (AstMapping *) box2( 0.0, 1.0 ), + (AstMapping *) astZoomMap( 2, 3.0, " " ) ) ); + + emit( "switchmap_frame_route", + (AstMapping *) switch2( (AstMapping *) pick_first(), (AstMapping *) box2( 0.0, 1.0 ), + (AstMapping *) frame( 2, NULL ) ) ); + + emit( "switchmap_no_regions", + (AstMapping *) switch2( (AstMapping *) pick_first(), (AstMapping *) astZoomMap( 2, 2.0, " " ), + (AstMapping *) astZoomMap( 2, 3.0, " " ) ) ); + + inv = pick_first(); + astInvert( inv ); + rm[ 0 ] = (AstMapping *) astZoomMap( 2, 2.0, " " ); + rm[ 1 ] = (AstMapping *) astZoomMap( 2, 3.0, " " ); + emit( "switchmap_inverse_selector_region", + (AstMapping *) astSwitchMap( NULL, astCmpMap( inv, box2( 0.0, 10.0 ), 1, " " ), 2, + (void **) rm, " " ) ); + + rm[ 0 ] = (AstMapping *) astZoomMap( 1, 2.0, " " ); + rm[ 1 ] = (AstMapping *) astZoomMap( 1, 3.0, " " ); + emit( "switchmap_inverse_selector_is_region", + (AstMapping *) astSwitchMap( NULL, astInterval( frame( 1, NULL ), lb10, ub10, NULL, " " ), 2, + (void **) rm, " " ) ); + + emit( "switchmap_frameset_route", + (AstMapping *) switch2( (AstMapping *) pick_first(), (AstMapping *) astZoomMap( 2, 2.0, " " ), + (AstMapping *) frameset_with_region() ) ); + + emit( "ratemap_frameset", (AstMapping *) astRateMap( frameset_with_region(), 1, 1, " " ) ); + + fs = astFrameSet( frame( 2, "PIX" ), " " ); + astAddFrame( fs, AST__BASE, astZoomMap( 2, 2.0, " " ), box2( 0.0, 10.0 ) ); + astAddFrame( fs, AST__CURRENT, astShiftMap( 2, shift, " " ), frame( 2, "SKY" ) ); + result = run( "frameset_region_frame", (AstMapping *) fs ); + frames( result, (AstMapping *) fs ); + + fs = astFrameSet( frame( 2, "PIX" ), " " ); + astAddFrame( fs, AST__BASE, + astCmpMap( astZoomMap( 2, 2.0, " " ), circle2(), 1, " " ), + frame( 2, "SKY" ) ); + result = run( "frameset_region_in_cmpmap", (AstMapping *) fs ); + frames( result, (AstMapping *) fs ); + + fs = astFrameSet( frame( 2, "PIX" ), " " ); + astAddFrame( fs, AST__BASE, box2( 0.0, 10.0 ), frame( 2, "SKY" ) ); + result = run( "frameset_region_map", (AstMapping *) fs ); + frames( result, (AstMapping *) fs ); + + fs = astFrameSet( frame( 2, "PIX" ), " " ); + astAddFrame( fs, AST__BASE, frame( 2, NULL ), box2( 0.0, 10.0 ) ); + result = run( "frameset_frame_map", (AstMapping *) fs ); + frames( result, (AstMapping *) fs ); + + cf = astCmpFrame( box2( 0.0, 1.0 ), astInterval( frame( 1, NULL ), lb1, ub1, NULL, " " ), " " ); + result = run( "cmpframe_two_regions", (AstMapping *) cf ); + components( result, (AstMapping *) cf ); + + cf = astCmpFrame( box2( 0.0, 1.0 ), frame( 1, NULL ), " " ); + result = run( "cmpframe_shared_component", (AstMapping *) cf ); + components( result, (AstMapping *) cf ); + if( result ) { + astSetC( result, "Label(3)", "Shared" ); + dump( "orig", (AstObject *) cf ); + } + + cf = astCmpFrame( frame( 2, NULL ), frame( 1, NULL ), " " ); + result = run( "cmpframe_no_regions", (AstMapping *) cf ); + components( result, (AstMapping *) cf ); + + sel[ 0 ] = (AstRegion *) box2( 0.0, 1.0 ); + sel[ 1 ] = (AstRegion *) box2( 2.0, 3.0 ); + emit( "selectormap_alone", (AstMapping *) astSelectorMap( 2, (void **) sel, AST__BAD, " " ) ); + + emit( "selectormap_switchmap", + (AstMapping *) switch2( (AstMapping *) astSelectorMap( 2, (void **) sel, AST__BAD, " " ), + (AstMapping *) box2( 0.0, 1.0 ), + (AstMapping *) astZoomMap( 2, 3.0, " " ) ) ); + + return 0; +} diff --git a/src/test/resources/probes/remove_regions_extra_probe.json b/src/test/resources/probes/remove_regions_extra_probe.json new file mode 100644 index 0000000..dbb5757 --- /dev/null +++ b/src/test/resources/probes/remove_regions_extra_probe.json @@ -0,0 +1,4 @@ +{ + "source": "probes/remove_regions_extra_probe.c", + "output": "== region_alone\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nsame 0\n== frame_alone\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nsame 1\n== no_regions_cmpmap\nin Begin CmpMap \t# Compound Mapping\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin MapA = \t# First component Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin MapB = \t# Second component Mapping\nin Begin ShiftMap \t# Shift each coordinate axis\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Sft1 = 100 \t# Shift for axis 1\nin Sft2 = 100 \t# Shift for axis 2\nin End ShiftMap\nin End CmpMap\nout Begin CmpMap \t# Compound Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout MapA = \t# First component Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout MapB = \t# Second component Mapping\nout Begin ShiftMap \t# Shift each coordinate axis\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Sft1 = 100 \t# Shift for axis 1\nout Sft2 = 100 \t# Shift for axis 2\nout End ShiftMap\nout End CmpMap\nsame 1\n== no_regions_frameset\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin IsA Frame \t# Coordinate system description\nin Nframe = 2 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 2 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin End FrameSet\nout Begin FrameSet \t# Set of inter-related coordinate systems\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout IsA Frame \t# Coordinate system description\nout Nframe = 2 \t# Number of Frames in FrameSet\nout # Base = 1 \t# Index of base Frame\nout Currnt = 2 \t# Index of current Frame\nout Lnk2 = 1 \t# Node 2 is derived from node 1\nout Frm1 = \t# Frame number 1\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"PIX\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Frm2 = \t# Frame number 2\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Map2 = \t# Mapping between nodes 1 and 2\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 2 \t# Zoom factor\nout End ZoomMap\nout End FrameSet\nsame 1\nframe 1 same 1\nframe 2 same 1\n== cmpmap_frame_beside_region\nin Begin CmpMap \t# Compound Mapping\nin Nin = 3 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Series = 0 \t# Component Mappings applied in parallel\nin MapA = \t# First component Mapping\nin Begin Frame \t# Coordinate system description\nin # Title = \"1-d coordinate system\" \t# Title of coordinate system\nin Naxes = 1 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin MapB = \t# Second component Mapping\nin Begin CmpMap \t# Compound Mapping\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin MapA = \t# First component Mapping\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin MapB = \t# Second component Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin End CmpMap\nin End CmpMap\nout Begin CmpMap \t# Compound Mapping\nout Nin = 3 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Series = 0 \t# Component Mappings applied in parallel\nout MapA = \t# First component Mapping\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 1 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout MapB = \t# Second component Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout End CmpMap\nsame 0\n== tranmap_frame_beside_region\nin Begin TranMap \t# Compound Transformation Mapping\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin MapA = \t# Mapping for forward transformation\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin MapB = \t# Mapping for inverse transformation\nin Begin CmpMap \t# Compound Mapping\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin MapA = \t# First component Mapping\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin MapB = \t# Second component Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin End CmpMap\nin End TranMap\nout Begin TranMap \t# Compound Transformation Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout MapA = \t# Mapping for forward transformation\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout MapB = \t# Mapping for inverse transformation\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout End TranMap\nsame 0\n== tranmap_frameset_beside_region\nin Begin TranMap \t# Compound Transformation Mapping\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin MapA = \t# Mapping for forward transformation\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin IsA Frame \t# Coordinate system description\nin Nframe = 2 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 2 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin End FrameSet\nin MapB = \t# Mapping for inverse transformation\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin End TranMap\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nsame 0\n== switchmap_region_route\nin Begin SwitchMap \t# Alternate regionalised Mapping\nin Nin = 2 \t# Number of input coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin FSMap = \t# Forward selector Mapping\nin Begin CmpMap \t# Compound Mapping\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin MapA = \t# First component Mapping\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 5 \t# Coordinate values...\nin X2 = 5\nin X3 = 10\nin X4 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin MapB = \t# Second component Mapping\nin Begin PermMap \t# Coordinate permutation\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nin In1 = 1 \t# Input coordinate 1 = output coordinate 1\nin In2 = 0 \t# Input coordinate 2 is \"bad\"\nin End PermMap\nin End CmpMap\nin RMap1 = \t# Route Mapping\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin RMap2 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin End SwitchMap\nout Begin SwitchMap \t# Alternate regionalised Mapping\nout Nin = 2 \t# Number of input coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout FSMap = \t# Forward selector Mapping\nout Begin PermMap \t# Coordinate permutation\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nout In1 = 1 \t# Input coordinate 1 = output coordinate 1\nout In2 = 0 \t# Input coordinate 2 is \"bad\"\nout End PermMap\nout RMap1 = \t# Route Mapping\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout RMap2 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout End SwitchMap\nsame 0\n== switchmap_frame_route\nin Begin SwitchMap \t# Alternate regionalised Mapping\nin Nin = 2 \t# Number of input coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin FSMap = \t# Forward selector Mapping\nin Begin PermMap \t# Coordinate permutation\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nin In1 = 1 \t# Input coordinate 1 = output coordinate 1\nin In2 = 0 \t# Input coordinate 2 is \"bad\"\nin End PermMap\nin RMap1 = \t# Route Mapping\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin RMap2 = \t# Route Mapping\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin End SwitchMap\nout Begin SwitchMap \t# Alternate regionalised Mapping\nout Nin = 2 \t# Number of input coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout FSMap = \t# Forward selector Mapping\nout Begin PermMap \t# Coordinate permutation\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nout In1 = 1 \t# Input coordinate 1 = output coordinate 1\nout In2 = 0 \t# Input coordinate 2 is \"bad\"\nout End PermMap\nout RMap1 = \t# Route Mapping\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout RMap2 = \t# Route Mapping\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout End SwitchMap\nsame 0\n== switchmap_no_regions\nin Begin SwitchMap \t# Alternate regionalised Mapping\nin Nin = 2 \t# Number of input coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin FSMap = \t# Forward selector Mapping\nin Begin PermMap \t# Coordinate permutation\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nin In1 = 1 \t# Input coordinate 1 = output coordinate 1\nin In2 = 0 \t# Input coordinate 2 is \"bad\"\nin End PermMap\nin RMap1 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin RMap2 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin End SwitchMap\nout Begin SwitchMap \t# Alternate regionalised Mapping\nout Nin = 2 \t# Number of input coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout FSMap = \t# Forward selector Mapping\nout Begin PermMap \t# Coordinate permutation\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nout In1 = 1 \t# Input coordinate 1 = output coordinate 1\nout In2 = 0 \t# Input coordinate 2 is \"bad\"\nout End PermMap\nout RMap1 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 2 \t# Zoom factor\nout End ZoomMap\nout RMap2 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout End SwitchMap\nsame 1\n== switchmap_inverse_selector_region\nin Begin SwitchMap \t# Alternate regionalised Mapping\nin Nin = 2 \t# Number of input coordinates\nin Fwd = 0 \t# Forward transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin ISMap = \t# Inverse selector Mapping\nin Begin CmpMap \t# Compound Mapping\nin Nin = 1 \t# Number of input coordinates\nin Nout = 2 \t# Number of output coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin InvA = 1 \t# First Mapping used in inverse direction\nin MapA = \t# First component Mapping\nin Begin PermMap \t# Coordinate permutation\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin Invert = 1 \t# Mapping inverted\nin IsA Mapping \t# Mapping between coordinate systems\nin Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nin In1 = 1 \t# Input coordinate 1 = output coordinate 1\nin In2 = 0 \t# Input coordinate 2 is \"bad\"\nin End PermMap\nin MapB = \t# Second component Mapping\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 5 \t# Coordinate values...\nin X2 = 5\nin X3 = 10\nin X4 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin End CmpMap\nin RMap1 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin RMap2 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin End SwitchMap\nout Begin SwitchMap \t# Alternate regionalised Mapping\nout Nin = 2 \t# Number of input coordinates\nout Fwd = 0 \t# Forward transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout ISMap = \t# Inverse selector Mapping\nout Begin PermMap \t# Coordinate permutation\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout Invert = 1 \t# Mapping inverted\nout IsA Mapping \t# Mapping between coordinate systems\nout Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nout In1 = 1 \t# Input coordinate 1 = output coordinate 1\nout In2 = 0 \t# Input coordinate 2 is \"bad\"\nout End PermMap\nout RMap1 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 2 \t# Zoom factor\nout End ZoomMap\nout RMap2 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout End SwitchMap\nsame 0\n== switchmap_inverse_selector_is_region\nin Begin SwitchMap \t# Alternate regionalised Mapping\nin Nin = 1 \t# Number of input coordinates\nin Fwd = 0 \t# Forward transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin ISMap = \t# Inverse selector Mapping\nin Begin Interval \t# Axis intervals\nin # Title = \"1-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 1 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"1-d coordinate system\" \t# Title of coordinate system\nin Naxes = 1 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 1 \t# Number of coordinates per point\nin X1 = 0 \t# Coordinate values...\nin X2 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Interval\nin RMap1 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 1 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin RMap2 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 1 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin End SwitchMap\nout Begin SwitchMap \t# Alternate regionalised Mapping\nout Nin = 1 \t# Number of input coordinates\nout Fwd = 0 \t# Forward transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout ISMap = \t# Inverse selector Mapping\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 1 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout RMap1 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 1 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 2 \t# Zoom factor\nout End ZoomMap\nout RMap2 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 1 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout End SwitchMap\nsame 0\n== switchmap_frameset_route\nin Begin SwitchMap \t# Alternate regionalised Mapping\nin Nin = 2 \t# Number of input coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin FSMap = \t# Forward selector Mapping\nin Begin PermMap \t# Coordinate permutation\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nin In1 = 1 \t# Input coordinate 1 = output coordinate 1\nin In2 = 0 \t# Input coordinate 2 is \"bad\"\nin End PermMap\nin RMap1 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin RMap2 = \t# Route Mapping\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin IsA Frame \t# Coordinate system description\nin Nframe = 2 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 2 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 5 \t# Coordinate values...\nin X2 = 5\nin X3 = 10\nin X4 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin End FrameSet\nin End SwitchMap\nout Begin SwitchMap \t# Alternate regionalised Mapping\nout Nin = 2 \t# Number of input coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout FSMap = \t# Forward selector Mapping\nout Begin PermMap \t# Coordinate permutation\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Out1 = 1 \t# Output coordinate 1 = input coordinate 1\nout In1 = 1 \t# Input coordinate 1 = output coordinate 1\nout In2 = 0 \t# Input coordinate 2 is \"bad\"\nout End PermMap\nout RMap1 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 2 \t# Zoom factor\nout End ZoomMap\nout RMap2 = \t# Route Mapping\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout End SwitchMap\nsame 0\n== ratemap_frameset\nin Begin RateMap \t# Differential Mapping\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin Map = \t# Mapping to be differentiated\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin IsA Frame \t# Coordinate system description\nin Nframe = 2 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 2 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 5 \t# Coordinate values...\nin X2 = 5\nin X3 = 10\nin X4 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin End FrameSet\nin End RateMap\nout Begin RateMap \t# Differential Mapping\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout Map = \t# Mapping to be differentiated\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout End RateMap\nsame 0\n== frameset_region_frame\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin IsA Frame \t# Coordinate system description\nin Nframe = 3 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 3 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Lnk3 = 2 \t# Node 3 is derived from node 2\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 5 \t# Coordinate values...\nin X2 = 5\nin X3 = 10\nin X4 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin Frm3 = \t# Frame number 3\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin Map3 = \t# Mapping between nodes 2 and 3\nin Begin ShiftMap \t# Shift each coordinate axis\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Sft1 = 100 \t# Shift for axis 1\nin Sft2 = 100 \t# Shift for axis 2\nin End ShiftMap\nin End FrameSet\nout Begin FrameSet \t# Set of inter-related coordinate systems\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout IsA Frame \t# Coordinate system description\nout Nframe = 3 \t# Number of Frames in FrameSet\nout # Base = 1 \t# Index of base Frame\nout Currnt = 3 \t# Index of current Frame\nout Lnk2 = 1 \t# Node 2 is derived from node 1\nout Lnk3 = 2 \t# Node 3 is derived from node 2\nout Frm1 = \t# Frame number 1\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"PIX\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Frm2 = \t# Frame number 2\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Frm3 = \t# Frame number 3\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Map2 = \t# Mapping between nodes 1 and 2\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 2 \t# Zoom factor\nout End ZoomMap\nout Map3 = \t# Mapping between nodes 2 and 3\nout Begin ShiftMap \t# Shift each coordinate axis\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Sft1 = 100 \t# Shift for axis 1\nout Sft2 = 100 \t# Shift for axis 2\nout End ShiftMap\nout End FrameSet\nsame 0\nframe 1 same 1\nframe 2 same 0\nframe 3 same 1\n== frameset_region_in_cmpmap\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin IsA Frame \t# Coordinate system description\nin Nframe = 2 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 2 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin CmpMap \t# Compound Mapping\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin MapA = \t# First component Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 2 \t# Zoom factor\nin End ZoomMap\nin MapB = \t# Second component Mapping\nin Begin Circle \t# Circular or spherical region\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 1 \t# Coordinate values...\nin X2 = 2\nin X3 = 2\nin X4 = 2\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Circle\nin End CmpMap\nin End FrameSet\nout Begin FrameSet \t# Set of inter-related coordinate systems\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout IsA Frame \t# Coordinate system description\nout Nframe = 2 \t# Number of Frames in FrameSet\nout # Base = 1 \t# Index of base Frame\nout Currnt = 2 \t# Index of current Frame\nout Lnk2 = 1 \t# Node 2 is derived from node 1\nout Frm1 = \t# Frame number 1\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"PIX\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Frm2 = \t# Frame number 2\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Map2 = \t# Mapping between nodes 1 and 2\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 2 \t# Zoom factor\nout End ZoomMap\nout End FrameSet\nsame 0\nframe 1 same 1\nframe 2 same 1\n== frameset_region_map\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin IsA Frame \t# Coordinate system description\nin Nframe = 2 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 2 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"SKY\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 5 \t# Coordinate values...\nin X2 = 5\nin X3 = 10\nin X4 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin End FrameSet\nout Begin FrameSet \t# Set of inter-related coordinate systems\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout IsA Frame \t# Coordinate system description\nout Nframe = 2 \t# Number of Frames in FrameSet\nout # Base = 1 \t# Index of base Frame\nout Currnt = 2 \t# Index of current Frame\nout Lnk2 = 1 \t# Node 2 is derived from node 1\nout Frm1 = \t# Frame number 1\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"PIX\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Frm2 = \t# Frame number 2\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"SKY\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Map2 = \t# Mapping between nodes 1 and 2\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout End FrameSet\nsame 0\nframe 1 same 1\nframe 2 same 1\n== frameset_frame_map\nin Begin FrameSet \t# Set of inter-related coordinate systems\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Nframe = 2 \t# Number of Frames in FrameSet\nin # Base = 1 \t# Index of base Frame\nin Currnt = 2 \t# Index of current Frame\nin Lnk2 = 1 \t# Node 2 is derived from node 1\nin Frm1 = \t# Frame number 1\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin Domain = \"PIX\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Frm2 = \t# Frame number 2\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 5 \t# Coordinate values...\nin X2 = 5\nin X3 = 10\nin X4 = 10\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin Map2 = \t# Mapping between nodes 1 and 2\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin End FrameSet\nout Begin FrameSet \t# Set of inter-related coordinate systems\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout IsA Frame \t# Coordinate system description\nout Nframe = 2 \t# Number of Frames in FrameSet\nout # Base = 1 \t# Index of base Frame\nout Currnt = 2 \t# Index of current Frame\nout Lnk2 = 1 \t# Node 2 is derived from node 1\nout Frm1 = \t# Frame number 1\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout Domain = \"PIX\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Frm2 = \t# Frame number 2\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Map2 = \t# Mapping between nodes 1 and 2\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout End FrameSet\nsame 0\nframe 1 same 1\nframe 2 same 0\n== cmpframe_two_regions\nin Begin CmpFrame \t# Compound coordinate system description\nin # Title = \"3-d compound coordinate system\" \t# Title of coordinate system\nin # Naxes = 3 \t# Number of coordinate axes\nin # Domain = \"CMP\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # Lbl3 = \"Axis 1\" \t# Label for axis 3\nin IsA Frame \t# Coordinate system description\nin FrameA = \t# First component Frame\nin Begin Box \t# Axis intervals\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin Naxes = 2 \t# Number of coordinate axes\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin FrameB = \t# Second component Frame\nin Begin Interval \t# Axis intervals\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin Naxes = 1 \t# Number of coordinate axes\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 1 \t# Number of coordinates per point\nin X1 = 0 \t# Coordinate values...\nin X2 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Interval\nin End CmpFrame\nout Begin CmpFrame \t# Compound coordinate system description\nout # Title = \"3-d compound coordinate system\" \t# Title of coordinate system\nout # Naxes = 3 \t# Number of coordinate axes\nout # Domain = \"CMP\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout # Lbl3 = \"Axis 3\" \t# Label for axis 3\nout IsA Frame \t# Coordinate system description\nout FrameA = \t# First component Frame\nout Begin Frame \t# Coordinate system description\nout Naxes = 2 \t# Number of coordinate axes\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout FrameB = \t# Second component Frame\nout Begin Frame \t# Coordinate system description\nout Naxes = 1 \t# Number of coordinate axes\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout End CmpFrame\nsame 0\ncomponent 1 same 0\ncomponent 2 same 0\n== cmpframe_shared_component\nin Begin CmpFrame \t# Compound coordinate system description\nin # Title = \"3-d compound coordinate system\" \t# Title of coordinate system\nin # Naxes = 3 \t# Number of coordinate axes\nin # Domain = \"CMP\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # Lbl3 = \"Axis 3\" \t# Label for axis 3\nin IsA Frame \t# Coordinate system description\nin FrameA = \t# First component Frame\nin Begin Box \t# Axis intervals\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin Naxes = 2 \t# Number of coordinate axes\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin FrameB = \t# Second component Frame\nin Begin Frame \t# Coordinate system description\nin Naxes = 1 \t# Number of coordinate axes\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin End CmpFrame\nout Begin CmpFrame \t# Compound coordinate system description\nout # Title = \"3-d compound coordinate system\" \t# Title of coordinate system\nout # Naxes = 3 \t# Number of coordinate axes\nout # Domain = \"CMP\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout # Lbl3 = \"Axis 3\" \t# Label for axis 3\nout IsA Frame \t# Coordinate system description\nout FrameA = \t# First component Frame\nout Begin Frame \t# Coordinate system description\nout Naxes = 2 \t# Number of coordinate axes\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout FrameB = \t# Second component Frame\nout Begin Frame \t# Coordinate system description\nout Naxes = 1 \t# Number of coordinate axes\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout End CmpFrame\nsame 0\ncomponent 1 same 0\ncomponent 2 same 1\norig Begin CmpFrame \t# Compound coordinate system description\norig # Title = \"3-d compound coordinate system\" \t# Title of coordinate system\norig # Naxes = 3 \t# Number of coordinate axes\norig # Domain = \"CMP\" \t# Coordinate system domain\norig # Lbl1 = \"Axis 1\" \t# Label for axis 1\norig # Lbl2 = \"Axis 2\" \t# Label for axis 2\norig # Lbl3 = \"Shared\" \t# Label for axis 3\norig IsA Frame \t# Coordinate system description\norig FrameA = \t# First component Frame\norig Begin Box \t# Axis intervals\norig Adapt = 1 \t# Region adapts to coord sys changes\norig Frm = \t# Coordinate system\norig Begin Frame \t# Coordinate system description\norig Naxes = 2 \t# Number of coordinate axes\norig Ax1 = \t# Axis number 1\norig Begin Axis \t# Coordinate axis\norig End Axis\norig Ax2 = \t# Axis number 2\norig Begin Axis \t# Coordinate axis\norig End Axis\norig End Frame\norig Points = \t# Points defining the shape\norig Begin PointSet \t# Container for a set of points\norig Npoint = 2 \t# Number of points\norig Ncoord = 2 \t# Number of coordinates per point\norig X1 = 0.5 \t# Coordinate values...\norig X2 = 0.5\norig X3 = 1\norig X4 = 1\norig End PointSet\norig IsA Region \t# An area within a coordinate system\norig End Box\norig FrameB = \t# Second component Frame\norig Begin Frame \t# Coordinate system description\norig Naxes = 1 \t# Number of coordinate axes\norig Ax1 = \t# Axis number 1\norig Begin Axis \t# Coordinate axis\norig Label = \"Shared\" \t# Axis Label\norig End Axis\norig End Frame\norig End CmpFrame\n== cmpframe_no_regions\nin Begin CmpFrame \t# Compound coordinate system description\nin # Title = \"3-d compound coordinate system\" \t# Title of coordinate system\nin # Naxes = 3 \t# Number of coordinate axes\nin # Domain = \"CMP\" \t# Coordinate system domain\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # Lbl3 = \"Axis 3\" \t# Label for axis 3\nin IsA Frame \t# Coordinate system description\nin FrameA = \t# First component Frame\nin Begin Frame \t# Coordinate system description\nin Naxes = 2 \t# Number of coordinate axes\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin FrameB = \t# Second component Frame\nin Begin Frame \t# Coordinate system description\nin Naxes = 1 \t# Number of coordinate axes\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin End CmpFrame\nout Begin CmpFrame \t# Compound coordinate system description\nout # Title = \"3-d compound coordinate system\" \t# Title of coordinate system\nout # Naxes = 3 \t# Number of coordinate axes\nout # Domain = \"CMP\" \t# Coordinate system domain\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout # Lbl3 = \"Axis 3\" \t# Label for axis 3\nout IsA Frame \t# Coordinate system description\nout FrameA = \t# First component Frame\nout Begin Frame \t# Coordinate system description\nout Naxes = 2 \t# Number of coordinate axes\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout FrameB = \t# Second component Frame\nout Begin Frame \t# Coordinate system description\nout Naxes = 1 \t# Number of coordinate axes\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout End CmpFrame\nsame 1\ncomponent 1 same 1\ncomponent 2 same 1\n== selectormap_alone\nin Begin SelectorMap \t# Region identification Mapping\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin Reg1 = \t# Region of input space\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin Reg2 = \t# Region of input space\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 2.5 \t# Coordinate values...\nin X2 = 2.5\nin X3 = 3\nin X4 = 3\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin End SelectorMap\nout Begin SelectorMap \t# Region identification Mapping\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout Reg1 = \t# Region of input space\nout Begin Box \t# Axis intervals\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Epoch = 2000 \t# Julian epoch of observation\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout # System = \"Cartesian\" \t# Coordinate system type\nout IsA Frame \t# Coordinate system description\nout Adapt = 1 \t# Region adapts to coord sys changes\nout Frm = \t# Coordinate system\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Points = \t# Points defining the shape\nout Begin PointSet \t# Container for a set of points\nout Npoint = 2 \t# Number of points\nout Ncoord = 2 \t# Number of coordinates per point\nout X1 = 0.5 \t# Coordinate values...\nout X2 = 0.5\nout X3 = 1\nout X4 = 1\nout End PointSet\nout IsA Region \t# An area within a coordinate system\nout End Box\nout Reg2 = \t# Region of input space\nout Begin Box \t# Axis intervals\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Epoch = 2000 \t# Julian epoch of observation\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout # System = \"Cartesian\" \t# Coordinate system type\nout IsA Frame \t# Coordinate system description\nout Adapt = 1 \t# Region adapts to coord sys changes\nout Points = \t# Points defining the shape\nout Begin PointSet \t# Container for a set of points\nout Npoint = 2 \t# Number of points\nout Ncoord = 2 \t# Number of coordinates per point\nout X1 = 2.5 \t# Coordinate values...\nout X2 = 2.5\nout X3 = 3\nout X4 = 3\nout End PointSet\nout IsA Region \t# An area within a coordinate system\nout End Box\nout End SelectorMap\nsame 1\n== selectormap_switchmap\nin Begin SwitchMap \t# Alternate regionalised Mapping\nin Nin = 2 \t# Number of input coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin FSMap = \t# Forward selector Mapping\nin Begin SelectorMap \t# Region identification Mapping\nin Nin = 2 \t# Number of input coordinates\nin Nout = 1 \t# Number of output coordinates\nin Inv = 0 \t# Inverse transformation not defined\nin IsA Mapping \t# Mapping between coordinate systems\nin Reg1 = \t# Region of input space\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin Reg2 = \t# Region of input space\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 2.5 \t# Coordinate values...\nin X2 = 2.5\nin X3 = 3\nin X4 = 3\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin End SelectorMap\nin RMap1 = \t# Route Mapping\nin Begin Box \t# Axis intervals\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin # Naxes = 2 \t# Number of coordinate axes\nin # Epoch = 2000 \t# Julian epoch of observation\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin # System = \"Cartesian\" \t# Coordinate system type\nin IsA Frame \t# Coordinate system description\nin Adapt = 1 \t# Region adapts to coord sys changes\nin Frm = \t# Coordinate system\nin Begin Frame \t# Coordinate system description\nin # Title = \"2-d coordinate system\" \t# Title of coordinate system\nin Naxes = 2 \t# Number of coordinate axes\nin # Lbl1 = \"Axis 1\" \t# Label for axis 1\nin # Lbl2 = \"Axis 2\" \t# Label for axis 2\nin Ax1 = \t# Axis number 1\nin Begin Axis \t# Coordinate axis\nin End Axis\nin Ax2 = \t# Axis number 2\nin Begin Axis \t# Coordinate axis\nin End Axis\nin End Frame\nin Points = \t# Points defining the shape\nin Begin PointSet \t# Container for a set of points\nin Npoint = 2 \t# Number of points\nin Ncoord = 2 \t# Number of coordinates per point\nin X1 = 0.5 \t# Coordinate values...\nin X2 = 0.5\nin X3 = 1\nin X4 = 1\nin End PointSet\nin IsA Region \t# An area within a coordinate system\nin End Box\nin RMap2 = \t# Route Mapping\nin Begin ZoomMap \t# Zoom about the origin\nin Nin = 2 \t# Number of input coordinates\nin IsA Mapping \t# Mapping between coordinate systems\nin Zoom = 3 \t# Zoom factor\nin End ZoomMap\nin End SwitchMap\nout Begin SwitchMap \t# Alternate regionalised Mapping\nout Nin = 2 \t# Number of input coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout FSMap = \t# Forward selector Mapping\nout Begin SelectorMap \t# Region identification Mapping\nout Nin = 2 \t# Number of input coordinates\nout Nout = 1 \t# Number of output coordinates\nout Inv = 0 \t# Inverse transformation not defined\nout IsA Mapping \t# Mapping between coordinate systems\nout Reg1 = \t# Region of input space\nout Begin Box \t# Axis intervals\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Epoch = 2000 \t# Julian epoch of observation\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout # System = \"Cartesian\" \t# Coordinate system type\nout IsA Frame \t# Coordinate system description\nout Adapt = 1 \t# Region adapts to coord sys changes\nout Frm = \t# Coordinate system\nout Begin Frame \t# Coordinate system description\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout Naxes = 2 \t# Number of coordinate axes\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout Ax1 = \t# Axis number 1\nout Begin Axis \t# Coordinate axis\nout End Axis\nout Ax2 = \t# Axis number 2\nout Begin Axis \t# Coordinate axis\nout End Axis\nout End Frame\nout Points = \t# Points defining the shape\nout Begin PointSet \t# Container for a set of points\nout Npoint = 2 \t# Number of points\nout Ncoord = 2 \t# Number of coordinates per point\nout X1 = 0.5 \t# Coordinate values...\nout X2 = 0.5\nout X3 = 1\nout X4 = 1\nout End PointSet\nout IsA Region \t# An area within a coordinate system\nout End Box\nout Reg2 = \t# Region of input space\nout Begin Box \t# Axis intervals\nout # Title = \"2-d coordinate system\" \t# Title of coordinate system\nout # Naxes = 2 \t# Number of coordinate axes\nout # Epoch = 2000 \t# Julian epoch of observation\nout # Lbl1 = \"Axis 1\" \t# Label for axis 1\nout # Lbl2 = \"Axis 2\" \t# Label for axis 2\nout # System = \"Cartesian\" \t# Coordinate system type\nout IsA Frame \t# Coordinate system description\nout Adapt = 1 \t# Region adapts to coord sys changes\nout Points = \t# Points defining the shape\nout Begin PointSet \t# Container for a set of points\nout Npoint = 2 \t# Number of points\nout Ncoord = 2 \t# Number of coordinates per point\nout X1 = 2.5 \t# Coordinate values...\nout X2 = 2.5\nout X3 = 3\nout X4 = 3\nout End PointSet\nout IsA Region \t# An area within a coordinate system\nout End Box\nout End SelectorMap\nout RMap1 = \t# Route Mapping\nout Begin UnitMap \t# Unit (null) Mapping\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout End UnitMap\nout RMap2 = \t# Route Mapping\nout Begin ZoomMap \t# Zoom about the origin\nout Nin = 2 \t# Number of input coordinates\nout IsA Mapping \t# Mapping between coordinate systems\nout Zoom = 3 \t# Zoom factor\nout End ZoomMap\nout End SwitchMap\nsame 0\n" +} diff --git a/src/test/resources/probes/selectormap_probe.c b/src/test/resources/probes/selectormap_probe.c new file mode 100644 index 0000000..b15688f --- /dev/null +++ b/src/test/resources/probes/selectormap_probe.c @@ -0,0 +1,362 @@ +/* selectormap_probe -- SelectorMap behaviour of the pinned C library that + * no fixture or oracle holds: the index (or bad value) a SelectorMap gives + * for points in overlapping, negated, unbounded and open Regions, on a + * boundary and bad on one axis; the dump of a SelectorMap before and after + * a transformation (selectormap.c Transform negates and re-closes its own + * Regions in place, leaving Negated and Closed set), a copy of it and its + * comparison with a new one; simplification of a SelectorMap whose Regions + * do not simplify and of one whose Region does; two SelectorMaps in series, + * 1-D both forward, and 1-D and 2-D with one inverted; the load of a dump + * whose first Region's FrameSet has a Mapping that is not a UnitMap (the + * later Regions, written without their Frame, are given that FrameSet); + * the load of a dump without Regions; testregions.c's + * checkSelectorMapEqual; and the constructor's errors. + * + * Each case starts with a line "== "; error reports, which the error + * module writes to standard error, are merged in order (stdout unbuffered). + * Built against the C library at 3d3f255f with its static libraries: + * cc -std=c11 -ffp-contract=off -I -o selectormap_probe + * selectormap_probe.c /libast.a /libast_pal.a + * /libast_err.a /libast_grf3d.a /libast_grf_2.0.a + * /libast_grf_3.2.a /libast_grf_5.6.a + * /libast_cminpack.a -lyaml -lm + * and run as ./selectormap_probe > selectormap_probe.txt 2>&1; the output, + * with trailing white space removed from every line, is stored as the + * "output" string of selectormap_probe.json, since the dumps hold C's item + * names, which the spelling check rejects. */ +#include +#include +#include +#include "ast.h" + +/* The lines a Channel writes, which a second Channel reads back. */ +#define MAXLINES 2000 +static char *lines[ MAXLINES ]; +static int nline = 0; +static int iline = 0; + +static void sink( const char *line ) { + if( nline < MAXLINES ) lines[ nline++ ] = strcpy( malloc( strlen( line ) + 1 ), line ); +} + +static const char *source( void ) { + return ( iline < nline ) ? lines[ iline++ ] : NULL; +} + +static void clear_lines( void ) { + for( int i = 0; i < nline; i++ ) free( lines[ i ] ); + nline = iline = 0; +} + +/* A dump given as text, read through a Channel. */ +static const char **text_lines; +static int text_line; + +static const char *text_source( void ) { + return text_lines[ text_line ] ? text_lines[ text_line++ ] : NULL; +} + +static void head( const char *name ) { + printf( "== %s\n", name ); +} + +/* Reports a failed call, then clears the status. */ +static int failed( void ) { + if( !astOK ) { + printf( "status %d\n", astStatus ); + astClearStatus; + return 1; + } + return 0; +} + +static AstBox *box2( double xlo, double ylo, double xhi, double yhi ) { + double lb[ 2 ], ub[ 2 ]; + lb[ 0 ] = xlo; + lb[ 1 ] = ylo; + ub[ 0 ] = xhi; + ub[ 1 ] = yhi; + return astBox( astFrame( 2, " " ), 1, lb, ub, NULL, " " ); +} + +static AstBox *box1( double lo, double hi ) { + return astBox( astFrame( 1, " " ), 1, &lo, &hi, NULL, " " ); +} + +static AstSelectorMap *selmap( int n, AstRegion **regs, double badval ) { + return astSelectorMap( n, (void **) regs, badval, " " ); +} + +/* The points of the 2-D cases. */ +#define NPT2 15 +static const double px[ NPT2 ] = { 2.0, 7.0, 12.0, 10.0, 15.0, 60.0, -100.0, -200.0, + 50.0, -105.0, AST__BAD, 5.0, AST__BAD, 20.0, 25.0 }; +static const double py[ NPT2 ] = { 2.0, 7.0, 12.0, 5.0, 15.0, -1000.0, -100.0, 0.0, + 0.0, -100.0, 5.0, AST__BAD, AST__BAD, 25.0, 25.0 }; + +/* The forward transformation of the 2-D points, one line each. */ +static void tran2( AstMapping *m ) { + double in[ 2 ][ NPT2 ], out[ NPT2 ]; + for( int i = 0; i < NPT2; i++ ) { + in[ 0 ][ i ] = px[ i ]; + in[ 1 ][ i ] = py[ i ]; + } + astTranN( m, NPT2, 2, NPT2, (const double *) in, 1, 1, NPT2, out ); + if( failed() ) return; + for( int i = 0; i < NPT2; i++ ) { + printf( "fwd %.17g %.17g -> %.17g\n", px[ i ], py[ i ], out[ i ] ); + } +} + +/* The forward transformation of 1-D points, one line each. */ +static void tran1( AstMapping *m, int n, const double *in ) { + double out[ 20 ]; + astTran1( m, n, in, 1, out ); + if( failed() ) return; + for( int i = 0; i < n; i++ ) { + printf( "fwd %.17g -> %.17g\n", in[ i ], out[ i ] ); + } +} + +/* The class of the simplified Mapping, whether it is the Mapping itself, + and its dump. */ +static void simp( AstMapping *m ) { + AstMapping *s = astSimplify( m ); + if( failed() ) return; + printf( "-- simplified %s same %d\n", astGetC( s, "Class" ), astSame( s, m ) ); + astShow( s ); + failed(); +} + +/* The SelectorMap of Review Focus 1: Regions that overlap, an unbounded + Interval and a negated Circle. */ +static AstSelectorMap *focus( double badval ) { + AstRegion *regs[ 4 ]; + double lb[] = { 50.0, AST__BAD }, ub[] = { AST__BAD, AST__BAD }; + double centre[] = { -100.0, -100.0 }, radius[] = { 5.0 }; + regs[ 0 ] = (AstRegion *) box2( 0.0, 0.0, 10.0, 10.0 ); + regs[ 1 ] = (AstRegion *) box2( 5.0, 5.0, 15.0, 15.0 ); + regs[ 2 ] = (AstRegion *) astInterval( astFrame( 2, " " ), lb, ub, NULL, " " ); + regs[ 3 ] = (AstRegion *) astCircle( astFrame( 2, " " ), 1, centre, radius, NULL, " " ); + astNegate( regs[ 3 ] ); + return selmap( 4, regs, badval ); +} + +/* A SelectorMap of two copies of one Box, the first open. */ +static AstSelectorMap *open_closed( void ) { + AstRegion *regs[ 2 ]; + regs[ 0 ] = (AstRegion *) box2( 20.0, 20.0, 30.0, 30.0 ); + astSetL( regs[ 0 ], "Closed", 0 ); + regs[ 1 ] = (AstRegion *) box2( 20.0, 20.0, 30.0, 30.0 ); + return selmap( 2, regs, -1.0 ); +} + +int main( void ) { + AstMapping *sm, *sm2, *cm, *back, *fresh; + AstRegion *regs[ 2 ]; + AstChannel *ch; + AstCircle *circle; + AstMathMap *cube; + double pts1[] = { -1.0, 0.0, 0.5, 1.0, 2.0, AST__BAD }; + + setvbuf( stdout, NULL, _IONBF, 0 ); + astBegin; + + /* Review Focus 1, with and without a bad value. */ + head( "focus_points" ); + tran2( (AstMapping *) focus( -1.0 ) ); + head( "focus_points_bad" ); + tran2( (AstMapping *) focus( AST__BAD ) ); + head( "open_closed_points" ); + tran2( (AstMapping *) open_closed() ); + + /* Review Focus 2: dumps before and after a transformation, a copy + made after it, and comparisons. */ + head( "focus_dump_before" ); + sm = (AstMapping *) focus( -1.0 ); + astShow( sm ); + failed(); + head( "focus_dump_after" ); + tran2( sm ); + astShow( sm ); + failed(); + head( "focus_copy_after" ); + astShow( astCopy( sm ) ); + failed(); + head( "focus_equal_after" ); + fresh = (AstMapping *) focus( -1.0 ); + printf( "equal fresh %d\n", astEqual( sm, fresh ) ); + printf( "equal fresh reversed %d\n", astEqual( fresh, sm ) ); + printf( "equal copy %d\n", astEqual( sm, astCopy( sm ) ) ); + failed(); + head( "open_closed_dump_after" ); + sm = (AstMapping *) open_closed(); + tran2( sm ); + astShow( sm ); + failed(); + + /* Item 3: simplification. */ + head( "simplify_unchanged" ); + regs[ 0 ] = (AstRegion *) box2( 0.0, 0.0, 10.0, 10.0 ); + regs[ 1 ] = (AstRegion *) box2( 20.0, 20.0, 30.0, 30.0 ); + sm = (AstMapping *) selmap( 2, regs, -1.0 ); + simp( sm ); + printf( "-- original after\n" ); + astShow( sm ); + failed(); + + head( "simplify_changed" ); + { + double lb[] = { 0.0, 0.0 }, ub[] = { 10.0, 10.0 }; + regs[ 0 ] = (AstRegion *) astInterval( astFrame( 2, " " ), lb, ub, NULL, " " ); + } + regs[ 1 ] = (AstRegion *) box2( 20.0, 20.0, 30.0, 30.0 ); + sm = (AstMapping *) selmap( 2, regs, -1.0 ); + astShow( sm ); + simp( sm ); + tran2( astSimplify( sm ) ); + failed(); + + /* Item 4: SelectorMaps in series. */ + head( "series_1d_both_forward" ); + regs[ 0 ] = (AstRegion *) box1( 0.0, 1.0 ); + sm = (AstMapping *) selmap( 1, regs, AST__BAD ); + sm2 = astCopy( sm ); + printf( "equal %d\n", astEqual( sm, sm2 ) ); + cm = (AstMapping *) astCmpMap( sm, sm2, 1, " " ); + tran1( cm, 6, pts1 ); + simp( cm ); + tran1( astSimplify( cm ), 6, pts1 ); + failed(); + + head( "series_1d_second_inverted" ); + sm2 = astCopy( sm ); + astInvert( sm2 ); + simp( (AstMapping *) astCmpMap( sm, sm2, 1, " " ) ); + + head( "series_1d_different" ); + regs[ 0 ] = (AstRegion *) box1( 0.0, 2.0 ); + sm2 = (AstMapping *) selmap( 1, regs, AST__BAD ); + simp( (AstMapping *) astCmpMap( sm, sm2, 1, " " ) ); + + head( "series_2d_second_inverted" ); + regs[ 0 ] = (AstRegion *) box2( 0.0, 0.0, 10.0, 10.0 ); + regs[ 1 ] = (AstRegion *) box2( 20.0, 20.0, 30.0, 30.0 ); + sm = (AstMapping *) selmap( 2, regs, -1.0 ); + sm2 = astCopy( sm ); + astInvert( sm2 ); + simp( (AstMapping *) astCmpMap( sm, sm2, 1, " " ) ); + + head( "series_2d_first_inverted" ); + simp( (AstMapping *) astCmpMap( sm2, sm, 1, " " ) ); + + head( "parallel_2d" ); + simp( (AstMapping *) astCmpMap( sm, sm, 0, " " ) ); + + /* The load of a dump whose first Region's FrameSet holds a MathMap, + which a Circle cannot absorb. */ + head( "load_first_region_mapped" ); + { + double centre[] = { 0.0, 0.0 }, radius[] = { 1.0 }; + const char *fwd[] = { "x=a*a*a", "y=b" }; + const char *inv[] = { "a=sign(abs(x)**(1/3.),x)", "b=y" }; + circle = astCircle( astFrame( 2, " " ), 1, centre, radius, NULL, " " ); + cube = astMathMap( 2, 2, 2, fwd, 2, inv, " " ); + } + regs[ 0 ] = (AstRegion *) astMapRegion( circle, (AstMapping *) cube, astFrame( 2, " " ) ); + regs[ 1 ] = (AstRegion *) box2( 3.0, 3.0, 4.0, 4.0 ); + sm = (AstMapping *) selmap( 2, regs, -1.0 ); + clear_lines(); + ch = astChannel( source, sink, " " ); + astWrite( ch, sm ); + back = astRead( ch ); + if( !failed() ) { + printf( "-- written\n" ); + astShow( sm ); + printf( "-- read back\n" ); + astShow( back ); + printf( "-- equal %d\n", astEqual( sm, back ) ); + double q[ 2 ][ 4 ] = { { 0.5, 3.5, 40.0, 7.0 }, { 0.5, 3.5, 3.5, 7.0 } }, out[ 4 ]; + astTranN( sm, 4, 2, 4, (const double *) q, 1, 1, 4, out ); + for( int i = 0; i < 4; i++ ) printf( "written %.17g %.17g -> %.17g\n", q[ 0 ][ i ], q[ 1 ][ i ], out[ i ] ); + astTranN( back, 4, 2, 4, (const double *) q, 1, 1, 4, out ); + for( int i = 0; i < 4; i++ ) printf( "read back %.17g %.17g -> %.17g\n", q[ 0 ][ i ], q[ 1 ][ i ], out[ i ] ); + failed(); + } + + /* The load of a dump without Regions. */ + head( "load_no_regions" ); + { + static const char *text[] = { + " Begin SelectorMap", + " Nin = 2", + " Nout = 1", + " Inv = 0", + " IsA Mapping", + " BadVal = 7", + " End SelectorMap", + NULL + }; + text_lines = text; + text_line = 0; + ch = astChannel( text_source, NULL, " " ); + back = astRead( ch ); + if( !failed() && back ) { + printf( "-- read %s Nin %d Nout %d\n", astGetC( back, "Class" ), astGetI( back, "Nin" ), + astGetI( back, "Nout" ) ); + failed(); + tran2( back ); + printf( "-- dump\n" ); + astShow( back ); + failed(); + printf( "-- copy\n" ); + astShow( astCopy( back ) ); + failed(); + printf( "-- equal copy %d\n", astEqual( back, astCopy( back ) ) ); + printf( "-- equal focus %d\n", astEqual( back, focus( 7.0 ) ) ); + failed(); + simp( back ); + } else { + printf( "-- read nothing\n" ); + } + } + + /* testregions.c checkSelectorMapEqual. */ + head( "check_selectormap_equal" ); + { + double c1[] = { 0.0, 0.0 }, c2[] = { 5.0, 5.0 }, r[] = { 1.0 }; + AstFrame *frm = astFrame( 2, " " ); + AstSelectorMap *one, *two; + regs[ 0 ] = (AstRegion *) astCircle( frm, 1, c1, r, NULL, " " ); + regs[ 1 ] = (AstRegion *) astCircle( frm, 1, c2, r, NULL, " " ); + one = selmap( 1, regs, AST__BAD ); + two = selmap( 2, regs, AST__BAD ); + printf( "test 1 %d\n", astEqual( one, two ) ); + printf( "test 2 %d\n", astEqual( two, one ) ); + printf( "test 3 %d\n", astEqual( two, astCopy( two ) ) ); + failed(); + } + + /* The constructor's errors. */ + head( "error_no_regions" ); + selmap( 0, regs, AST__BAD ); + failed(); + head( "error_naxes" ); + regs[ 0 ] = (AstRegion *) box2( 0.0, 0.0, 1.0, 1.0 ); + regs[ 1 ] = (AstRegion *) box1( 0.0, 1.0 ); + selmap( 2, regs, AST__BAD ); + failed(); + head( "error_skyframe" ); + { + double centre[] = { 0.0, 0.0 }, radius[] = { 0.1 }; + AstRegion *r3[ 3 ]; + r3[ 0 ] = (AstRegion *) box2( 0.0, 0.0, 1.0, 1.0 ); + r3[ 1 ] = (AstRegion *) box2( 2.0, 2.0, 3.0, 3.0 ); + r3[ 2 ] = (AstRegion *) astCircle( astSkyFrame( " " ), 1, centre, radius, NULL, " " ); + selmap( 3, r3, AST__BAD ); + failed(); + } + + astEnd; + return 0; +} diff --git a/src/test/resources/probes/selectormap_probe.json b/src/test/resources/probes/selectormap_probe.json new file mode 100644 index 0000000..c8e433e --- /dev/null +++ b/src/test/resources/probes/selectormap_probe.json @@ -0,0 +1,4 @@ +{ + "source": "probes/selectormap_probe.c", + "output": "== focus_points\nfwd 2 2 -> 1\nfwd 7 7 -> 1\nfwd 12 12 -> 2\nfwd 10 5 -> 1\nfwd 15 15 -> 2\nfwd 60 -1000 -> 3\nfwd -100 -100 -> 0\nfwd -200 0 -> 4\nfwd 50 0 -> 3\nfwd -105 -100 -> 4\nfwd -1.7976931348623157e+308 5 -> -1\nfwd 5 -1.7976931348623157e+308 -> -1\nfwd -1.7976931348623157e+308 -1.7976931348623157e+308 -> -1\nfwd 20 25 -> 4\nfwd 25 25 -> 4\n== focus_points_bad\nfwd 2 2 -> 1\nfwd 7 7 -> 1\nfwd 12 12 -> 2\nfwd 10 5 -> 1\nfwd 15 15 -> 2\nfwd 60 -1000 -> 3\nfwd -100 -100 -> 0\nfwd -200 0 -> 4\nfwd 50 0 -> 3\nfwd -105 -100 -> 4\nfwd -1.7976931348623157e+308 5 -> -1.7976931348623157e+308\nfwd 5 -1.7976931348623157e+308 -> -1.7976931348623157e+308\nfwd -1.7976931348623157e+308 -1.7976931348623157e+308 -> -1.7976931348623157e+308\nfwd 20 25 -> 4\nfwd 25 25 -> 4\n== open_closed_points\nfwd 2 2 -> 0\nfwd 7 7 -> 0\nfwd 12 12 -> 0\nfwd 10 5 -> 0\nfwd 15 15 -> 0\nfwd 60 -1000 -> 0\nfwd -100 -100 -> 0\nfwd -200 0 -> 0\nfwd 50 0 -> 0\nfwd -105 -100 -> 0\nfwd -1.7976931348623157e+308 5 -> -1\nfwd 5 -1.7976931348623157e+308 -> -1\nfwd -1.7976931348623157e+308 -1.7976931348623157e+308 -> -1\nfwd 20 25 -> 2\nfwd 25 25 -> 1\n== focus_dump_before\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 10 \t# Coordinate values...\n X2 = 10\n X3 = 15\n X4 = 15\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg3 = \t# Region of input space\n Begin Interval \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 50 \t# Coordinate values...\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Reg4 = \t# Region of input space\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = -100 \t# Coordinate values...\n X2 = -100\n X3 = -95\n X4 = -100\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n== focus_dump_after\nfwd 2 2 -> 1\nfwd 7 7 -> 1\nfwd 12 12 -> 2\nfwd 10 5 -> 1\nfwd 15 15 -> 2\nfwd 60 -1000 -> 3\nfwd -100 -100 -> 0\nfwd -200 0 -> 4\nfwd 50 0 -> 3\nfwd -105 -100 -> 4\nfwd -1.7976931348623157e+308 5 -> -1\nfwd 5 -1.7976931348623157e+308 -> -1\nfwd -1.7976931348623157e+308 -1.7976931348623157e+308 -> -1\nfwd 20 25 -> 4\nfwd 25 25 -> 4\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 10 \t# Coordinate values...\n X2 = 10\n X3 = 15\n X4 = 15\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg3 = \t# Region of input space\n Begin Interval \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 50 \t# Coordinate values...\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Reg4 = \t# Region of input space\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = -100 \t# Coordinate values...\n X2 = -100\n X3 = -95\n X4 = -100\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n== focus_copy_after\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 10 \t# Coordinate values...\n X2 = 10\n X3 = 15\n X4 = 15\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg3 = \t# Region of input space\n Begin Interval \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 50 \t# Coordinate values...\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Reg4 = \t# Region of input space\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = -100 \t# Coordinate values...\n X2 = -100\n X3 = -95\n X4 = -100\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n== focus_equal_after\nequal fresh 1\nequal fresh reversed 1\nequal copy 1\n== open_closed_dump_after\nfwd 2 2 -> 0\nfwd 7 7 -> 0\nfwd 12 12 -> 0\nfwd 10 5 -> 0\nfwd 15 15 -> 0\nfwd 60 -1000 -> 0\nfwd -100 -100 -> 0\nfwd -200 0 -> 0\nfwd 50 0 -> 0\nfwd -105 -100 -> 0\nfwd -1.7976931348623157e+308 5 -> -1\nfwd 5 -1.7976931348623157e+308 -> -1\nfwd -1.7976931348623157e+308 -1.7976931348623157e+308 -> -1\nfwd 20 25 -> 2\nfwd 25 25 -> 1\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n== simplify_unchanged\n-- simplified SelectorMap same 1\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n IsSimp = 1 \t# Mapping has been simplified\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n-- original after\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n IsSimp = 1 \t# Mapping has been simplified\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n== simplify_changed\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Interval \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n-- simplified SelectorMap same 0\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n IsSimp = 1 \t# Mapping has been simplified\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\nfwd 2 2 -> 1\nfwd 7 7 -> 1\nfwd 12 12 -> 0\nfwd 10 5 -> 1\nfwd 15 15 -> 0\nfwd 60 -1000 -> 0\nfwd -100 -100 -> 0\nfwd -200 0 -> 0\nfwd 50 0 -> 0\nfwd -105 -100 -> 0\nfwd -1.7976931348623157e+308 5 -> -1\nfwd 5 -1.7976931348623157e+308 -> -1\nfwd -1.7976931348623157e+308 -1.7976931348623157e+308 -> -1\nfwd 20 25 -> 2\nfwd 25 25 -> 2\n== series_1d_both_forward\nequal 1\nfwd -1 -> 1\nfwd 0 -> 1\nfwd 0.5 -> 1\nfwd 1 -> 1\nfwd 2 -> 1\nfwd -1.7976931348623157e+308 -> -1.7976931348623157e+308\n-- simplified UnitMap same 0\n Begin UnitMap \t# Unit (null) Mapping\n Nin = 1 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n End UnitMap\nfwd -1 -> -1\nfwd 0 -> 0\nfwd 0.5 -> 0.5\nfwd 1 -> 1\nfwd 2 -> 2\nfwd -1.7976931348623157e+308 -> -1.7976931348623157e+308\n== series_1d_second_inverted\n-- simplified UnitMap same 0\n Begin UnitMap \t# Unit (null) Mapping\n Nin = 1 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n End UnitMap\n== series_1d_different\n-- simplified CmpMap same 1\n Begin CmpMap \t# Compound Mapping\n Nin = 1 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n MapA = \t# First component Mapping\n Begin SelectorMap \t# Region identification Mapping\n Nin = 1 \t# Number of input coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"1-d coordinate system\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"1-d coordinate system\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 1\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n End SelectorMap\n MapB = \t# Second component Mapping\n Begin SelectorMap \t# Region identification Mapping\n Nin = 1 \t# Number of input coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"1-d coordinate system\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"1-d coordinate system\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n End SelectorMap\n End CmpMap\n== series_2d_second_inverted\n-- simplified UnitMap same 0\n Begin UnitMap \t# Unit (null) Mapping\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n End UnitMap\n== series_2d_first_inverted\n-- simplified UnitMap same 0\n Begin UnitMap \t# Unit (null) Mapping\n Nin = 1 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n End UnitMap\n== parallel_2d\n-- simplified CmpMap same 1\n Begin CmpMap \t# Compound Mapping\n Nin = 4 \t# Number of input coordinates\n Nout = 2 \t# Number of output coordinates\n IsSimp = 1 \t# Mapping has been simplified\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Series = 0 \t# Component Mappings applied in parallel\n MapA = \t# First component Mapping\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n MapB = \t# Second component Mapping\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 5 \t# Coordinate values...\n X2 = 5\n X3 = 10\n X4 = 10\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 25 \t# Coordinate values...\n X2 = 25\n X3 = 30\n X4 = 30\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n End CmpMap\n== load_first_region_mapped\n-- written\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin MathMap \t# Transformation using mathematical functions\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Fwd1 = \"x=a*a*a\" \t# Forward function 1\n Fwd2 = \"y=b\" \t# Forward function 2\n Inv1 = \"a=sign(abs(x)**(1/3.),x)\" \t# Inverse function 1\n Inv2 = \"b=y\" \t# Inverse function 2\n End MathMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 3.5 \t# Coordinate values...\n X2 = 3.5\n X3 = 4\n X4 = 4\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n-- read back\n Begin SelectorMap \t# Region identification Mapping\n Nin = 2 \t# Number of input coordinates\n Nout = 1 \t# Number of output coordinates\n Inv = 0 \t# Inverse transformation not defined\n IsA Mapping \t# Mapping between coordinate systems\n Reg1 = \t# Region of input space\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin MathMap \t# Transformation using mathematical functions\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Fwd1 = \"x=a*a*a\" \t# Forward function 1\n Fwd2 = \"y=b\" \t# Forward function 2\n Inv1 = \"a=sign(abs(x)**(1/3.),x)\" \t# Inverse function 1\n Inv2 = \"b=y\" \t# Inverse function 2\n End MathMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Reg2 = \t# Region of input space\n Begin Box \t# Axis intervals\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 3.5 \t# Coordinate values...\n X2 = 3.5\n X3 = 4\n X4 = 4\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n BadVal = -1 \t# Output value for bad input positions\n End SelectorMap\n-- equal 1\nwritten 0.5 0.5 -> 1\nwritten 3.5 3.5 -> 2\nwritten 40 3.5 -> 0\nwritten 7 7 -> 0\nread back 0.5 0.5 -> 1\nread back 3.5 3.5 -> 2\nread back 40 3.5 -> 0\nread back 7 7 -> 0\n== load_no_regions\n!! AST: Error in routine main at line 303 in file src/test/resources/probes/selectormap_probe.c.\n! astIsAObject(): Invalid Object pointer given (points at address 0x0).\n! Error while reading a SelectorMap from a Channel.\nstatus 233933594\n-- read nothing\n== check_selectormap_equal\ntest 1 0\ntest 2 0\ntest 3 1\n== error_no_regions\n!! AST: Error in routine selmap at line 87 in file src/test/resources/probes/selectormap_probe.c.\n! astSelectorMap(SelectorMap): Bad number of Regions (0) specified.\nstatus 233934170\n== error_naxes\n!! AST: Error in routine selmap at line 87 in file src/test/resources/probes/selectormap_probe.c.\n! astInitSelectorMap(SelectorMap): Region number 2 does not refer to the same coordinate Frame as the first Region.\nstatus 233933210\n== error_skyframe\n!! AST: Error in routine selmap at line 87 in file src/test/resources/probes/selectormap_probe.c.\n! astInitSelectorMap(SelectorMap): Region number 3 does not refer to the same coordinate Frame as the first Region.\nstatus 233933210\n" +} diff --git a/src/test/resources/probes/stc_probe.c b/src/test/resources/probes/stc_probe.c new file mode 100644 index 0000000..1dde9e8 --- /dev/null +++ b/src/test/resources/probes/stc_probe.c @@ -0,0 +1,617 @@ +/* stc_probe -- StcResourceProfile behaviour of the pinned C library that the + * region_stc oracle does not hold: + * - an Stc used (transformed, or asked whether it is bounded), then dumped, + * copied and compared: stc.c's Transform and GetBounded set the + * encapsulated Region's Negated to its own value around the call and + * leave it set, so that Negated then tests as set on the Stc; + * - AstroCoords elements without keys, with a Value only, and with a + * Region in another Frame (a SpecFrame in MHz for an Stc in GHz), as + * astGetStcCoord gives them; astGetStcCoord's index errors; and + * astInitStc's errors for each kind of bad AstroCoords KeyMap; + * - Frame attributes, Negated, Closed, MeshSize and FillFactor set on and + * cleared from an Stc, Adaptive and not, as the dump, astGetStcRegion + * and astGetStcCoord then show them, and the read-only RegionClass; + * - testregions.c's checkStcNegated; + * - stc.c's Simplify of a negated Stc, and of one mapped by astMapRegion + * with AstroCoords Regions, which it maps into the current Frame; + * - dumps edited by hand and read: "Begin Stc", the abstract class, which + * C reads, and Ncoord below zero; + * - testregions.c's checkStcObsDump, and an StcObsDataLocation given an + * observatory position with the protected astStcSetObs (which stores a + * clone): its dump, a copy, a change to the PointList given, astEqual + * with one without a position, and the position removed; an ObsLoc of + * another class (a ZoomMap) written and read back; + * - astEqual between Stcs of different classes, and astFindFrame and + * astConvert between Stcs of the same and of different classes, in the + * same Domain and in different Domains (neither reaches region.c's Cast: + * astFindFrame matches with matchsub 0, and region.c's ConvertX uses the + * current Frames), and astFindFrame between CmpFrames holding Stcs in + * different Domains; + * - last, since it changes the state of the process: a description of the + * class Region read, which initialises region.c's own vtab, and then + * astConvert between those CmpFrames, which reaches region.c's Cast + * (before such a read, Cast crashes comparing the class of its + * uninitialised vtab). Cast is given the target's picked axes, a Frame + * (cmpframe.c PartMatch, region.c SubFrame), and casts the Region's + * current Frame, so it never copies one Stc as the class of another. + * + * Each case starts with a line "== "; error reports, which the error + * module writes to standard error, are merged in order (stdout unbuffered). + * A dump read back is printed first, between "-- text" and "-- end text". + * Built against the C library at 3d3f255f with its static libraries: + * cc -std=c11 -ffp-contract=off -I -o stc_probe + * stc_probe.c /libast.a /libast_pal.a + * /libast_err.a /libast_grf3d.a /libast_grf_2.0.a + * /libast_grf_3.2.a /libast_grf_5.6.a + * /libast_cminpack.a -lyaml -lm + * and run as ./stc_probe > stc_probe.txt 2>&1; the output, with trailing + * white space removed from every line, is stored as the "output" string of + * stc_probe.json, since the dumps hold C's item names, which the spelling + * check rejects. */ +#include +#include +#include +#include "ast.h" + +extern void astStcSetObs_( AstStcObsDataLocation *, AstPointList *, int * ); + +/* The lines a Channel writes. */ +#define MAXLINES 4000 +static char *lines[ MAXLINES ]; +static int nline = 0; + +static void sink( const char *line ) { + if( nline < MAXLINES ) lines[ nline++ ] = strcpy( malloc( strlen( line ) + 1 ), line ); +} + +static void clear_lines( void ) { + for( int i = 0; i < nline; i++ ) free( lines[ i ] ); + nline = 0; +} + +/* Lines to be read, NULL-terminated. */ +static const char *text[ MAXLINES + 1 ]; +static int text_line; + +static const char *text_source( void ) { + return text[ text_line ] ? text[ text_line++ ] : NULL; +} + +static void head( const char *name ) { + printf( "== %s\n", name ); +} + +/* Reports a failed call, then clears the status. */ +static int failed( void ) { + if( !astOK ) { + printf( "status %d\n", astStatus ); + astClearStatus; + return 1; + } + return 0; +} + +/* The dump of "obj" into "lines". */ +static void dump_lines( AstObject *obj ) { + AstChannel *ch; + clear_lines(); + ch = astChannel( NULL, sink, " " ); + astWrite( ch, obj ); + ch = astAnnul( ch ); +} + +/* Prints the text in "text", then reads it, printing the class read. */ +static AstObject *read_text( void ) { + AstChannel *ch; + AstObject *obj; + printf( "-- text\n" ); + for( int i = 0; text[ i ]; i++ ) printf( "%s\n", text[ i ] ); + printf( "-- end text\n" ); + text_line = 0; + ch = astChannel( text_source, NULL, " " ); + obj = astRead( ch ); + ch = astAnnul( ch ); + if( failed() || !obj ) { + printf( "-- read nothing\n" ); + return NULL; + } + printf( "-- read %s\n", astGetC( obj, "Class" ) ); + return obj; +} + +/* The two test points of a 2-D Stc transformed, one line each. */ +static void tran2( AstObject *stc, double x0, double y0, double x1, double y1 ) { + double xin[ 2 ], yin[ 2 ], xout[ 2 ], yout[ 2 ]; + xin[ 0 ] = x0; + yin[ 0 ] = y0; + xin[ 1 ] = x1; + yin[ 1 ] = y1; + astTran2( stc, 2, xin, yin, 1, xout, yout ); + if( failed() ) return; + for( int i = 0; i < 2; i++ ) { + printf( "tran %.17g %.17g -> %.17g %.17g\n", xin[ i ], yin[ i ], xout[ i ], yout[ i ] ); + } +} + +static AstCircle *circle2( double x, double y, double r ) { + double c[ 2 ]; + c[ 0 ] = x; + c[ 1 ] = y; + return astCircle( astFrame( 2, " " ), 1, c, &r, NULL, " " ); +} + +static AstStcResourceProfile *plain( void ) { + return astStcResourceProfile( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); +} + +/* An Interval from "lo" to "hi" in a SpecFrame of frequency in "unit". */ +static AstInterval *spec_interval( const char *unit, double lo, double hi ) { + AstSpecFrame *sf = astSpecFrame( "System=FREQ" ); + astSet( sf, "Unit=%s", unit ); + return astInterval( sf, &lo, &hi, NULL, " " ); +} + +/* Prints astGetStcCoord( stc, i ) as a dump. */ +static void show_coord( AstStc *stc, int i ) { + AstKeyMap *km = astGetStcCoord( stc, i ); + if( failed() ) return; + printf( "-- coord %d\n", i ); + astShow( km ); + failed(); +} + +/* Prints the Negated, Closed, MeshSize and FillFactor values and whether + each is set. */ +static void show_attrs( const char *what, AstObject *obj ) { + printf( "%s Negated %d %d Closed %d %d MeshSize %d %d FillFactor %.17g %d\n", what, + astGetI( obj, "Negated" ), astTest( obj, "Negated" ), + astGetI( obj, "Closed" ), astTest( obj, "Closed" ), + astGetI( obj, "MeshSize" ), astTest( obj, "MeshSize" ), + astGetD( obj, "FillFactor" ), astTest( obj, "FillFactor" ) ); + failed(); +} + +/* astStcSetObs( stc, obs ), through the protected interface. */ +static void set_obs( AstStcObsDataLocation *stc, AstObject *obs ) { + int status = 0; + astStcSetObs_( astMakePointer( stc ), obs ? astMakePointer( obs ) : NULL, &status ); + printf( "set obs status %d\n", status ); +} + +/* Prints the dump of "obj", then reads that dump back as read_text does. */ +static AstObject *read_back( AstObject *obj ) { + int i; + dump_lines( obj ); + for( i = 0; i < nline; i++ ) text[ i ] = lines[ i ]; + text[ i ] = NULL; + return read_text(); +} + +/* astFindFrame( target, template, "" ) and astConvert( from, to, "" ), + whether each finds a FrameSet, and if so the classes of its Frames and + of its simplified Mapping. */ +static void show_fs( const char *what, AstFrameSet *fs ) { + printf( "%s %d", what, fs != NULL ); + if( fs ) { + AstMapping *map = astSimplify( astGetMapping( fs, AST__BASE, AST__CURRENT ) ); + printf( " %s %s %s", astGetC( astGetFrame( fs, AST__BASE ), "Class" ), + astGetC( astGetFrame( fs, AST__CURRENT ), "Class" ), astGetC( map, "Class" ) ); + } + printf( "\n" ); + failed(); +} + +static void find_and_convert( const char *what, AstObject *a, AstObject *b ) { + printf( "-- %s\n", what ); + show_fs( "findframe", astFindFrame( a, b, "" ) ); + show_fs( "convert", astConvert( a, b, "" ) ); +} + +static AstCircle *circle_in( const char *domain, double r ) { + double c[ 2 ] = { 0.0, 0.0 }; + return astCircle( astFrame( 2, "Domain=%s", domain ), 1, c, &r, NULL, " " ); +} + +/* An Stc made with one AstroCoords KeyMap, or the status. */ +static void make_with( AstRegion *reg, AstKeyMap *km ) { + AstStcResourceProfile *stc = astStcResourceProfile( reg, 1, &km, " " ); + if( !failed() ) printf( "made %s\n", astGetC( stc, "Class" ) ); +} + +int main( void ) { + AstStcResourceProfile *stc, *stc2, *copy; + AstKeyMap *km, *km2, *kms[ 2 ]; + AstRegion *reg; + AstObject *obj; + AstSkyFrame *sky; + int i, j; + + setvbuf( stdout, NULL, _IONBF, 0 ); + astBegin; + + /* Review Focus 2: an Stc used, then dumped, copied and compared. */ + head( "used_plain" ); + stc = plain(); + printf( "test Negated before %d\n", astTest( stc, "Negated" ) ); + tran2( (AstObject *) stc, 0.0, 0.0, 5.0, 0.0 ); + printf( "test Negated after %d\n", astTest( stc, "Negated" ) ); + astShow( stc ); + copy = astCopy( stc ); + printf( "copy test Negated %d\n", astTest( copy, "Negated" ) ); + printf( "equal copy %d\n", astEqual( stc, copy ) ); + printf( "equal fresh %d\n", astEqual( stc, plain() ) ); + printf( "equal fresh reversed %d\n", astEqual( plain(), stc ) ); + failed(); + + head( "used_negated" ); + stc = astCopy( plain() ); + astNegate( stc ); + tran2( (AstObject *) stc, 0.0, 0.0, 5.0, 0.0 ); + printf( "test Negated after %d\n", astTest( stc, "Negated" ) ); + astShow( stc ); + copy = astCopy( stc ); + printf( "equal copy %d\n", astEqual( stc, copy ) ); + stc2 = plain(); + astNegate( stc2 ); + printf( "equal fresh negated %d\n", astEqual( stc, stc2 ) ); + printf( "equal plain %d\n", astEqual( stc, plain() ) ); + failed(); + + head( "used_bounded" ); + stc = plain(); + printf( "Bounded %d\n", astGetI( stc, "Bounded" ) ); + printf( "test Negated after %d\n", astTest( stc, "Negated" ) ); + astShow( stc ); + failed(); + + /* Review Focus 4: AstroCoords elements. */ + head( "coords_empty" ); + km = astKeyMap( " " ); + stc = astStcResourceProfile( circle2( 0.0, 0.0, 1.0 ), 1, &km, " " ); + printf( "ncoord %d\n", astGetStcNCoord( stc ) ); + astShow( stc ); + show_coord( (AstStc *) stc, 1 ); + + head( "coords_value_only" ); + km = astKeyMap( " " ); + astMapPut0A( km, AST__STCVALUE, circle2( 0.5, 0.0, 0.25 ), NULL ); + km2 = astKeyMap( " " ); + { + const char *names[] = { "X", "Y" }; + astMapPut1C( km2, AST__STCNAME, 2, names, "axis names" ); + } + astMapPut0A( km2, AST__STCRES, circle2( 0.0, 0.0, 0.01 ), "resolution" ); + kms[ 0 ] = km; + kms[ 1 ] = km2; + stc = astStcResourceProfile( circle2( 0.0, 0.0, 1.0 ), 2, kms, " " ); + printf( "ncoord %d\n", astGetStcNCoord( stc ) ); + astShow( stc ); + show_coord( (AstStc *) stc, 1 ); + show_coord( (AstStc *) stc, 2 ); + printf( "-- given KeyMap after\n" ); + astShow( km ); + failed(); + + head( "coords_other_frame" ); + km = astKeyMap( " " ); + { + const char *names[] = { "Frequency" }; + astMapPut1C( km, AST__STCNAME, 1, names, NULL ); + } + astMapPut0A( km, AST__STCVALUE, spec_interval( "MHz", 1500.0, 1600.0 ), NULL ); + astMapPut0A( km, AST__STCSIZE, spec_interval( "GHz", 0.0, 0.25 ), NULL ); + stc = astStcResourceProfile( spec_interval( "GHz", 1.0, 2.0 ), 1, &km, " " ); + astShow( stc ); + show_coord( (AstStc *) stc, 1 ); + printf( "-- Unit=MHz, Adaptive\n" ); + astSet( stc, "Unit=MHz" ); + astShow( stc ); + show_coord( (AstStc *) stc, 1 ); + printf( "-- region\n" ); + astShow( astGetStcRegion( stc ) ); + failed(); + + head( "coords_index" ); + stc = plain(); + astGetStcCoord( stc, 0 ); + failed(); + astGetStcCoord( stc, 1 ); + failed(); + km = astKeyMap( " " ); + stc = astStcResourceProfile( circle2( 0.0, 0.0, 1.0 ), 1, &km, " " ); + astGetStcCoord( stc, 0 ); + failed(); + astGetStcCoord( stc, 2 ); + failed(); + kms[ 0 ] = km; + kms[ 1 ] = km; + stc = astStcResourceProfile( circle2( 0.0, 0.0, 1.0 ), 2, kms, " " ); + astGetStcCoord( stc, 3 ); + failed(); + astGetStcCoord( stc, -1 ); + failed(); + + head( "coords_bad_keys" ); + reg = (AstRegion *) circle2( 0.0, 0.0, 1.0 ); + printf( "-- unknown key\n" ); + km = astKeyMap( " " ); + astMapPut0A( km, "Colour", circle2( 0.0, 0.0, 1.0 ), NULL ); + make_with( reg, km ); + printf( "-- three names\n" ); + km = astKeyMap( " " ); + { + const char *names[] = { "X", "Y", "Z" }; + astMapPut1C( km, AST__STCNAME, 3, names, NULL ); + } + make_with( reg, km ); + printf( "-- names not strings\n" ); + km = astKeyMap( " " ); + { + int vals[] = { 1, 2 }; + astMapPut1I( km, AST__STCNAME, 2, vals, NULL ); + } + make_with( reg, km ); + printf( "-- two values\n" ); + km = astKeyMap( " " ); + { + AstObject *two[ 2 ]; + two[ 0 ] = (AstObject *) circle2( 0.0, 0.0, 1.0 ); + two[ 1 ] = (AstObject *) circle2( 0.0, 0.0, 2.0 ); + astMapPut1A( km, AST__STCVALUE, 2, two, NULL ); + } + make_with( reg, km ); + printf( "-- value not an Object\n" ); + km = astKeyMap( " " ); + astMapPut0D( km, AST__STCERROR, 1.0, NULL ); + make_with( reg, km ); + printf( "-- value a Frame\n" ); + km = astKeyMap( " " ); + astMapPut0A( km, AST__STCSIZE, astFrame( 2, " " ), NULL ); + make_with( reg, km ); + printf( "-- value in a Frame of three axes\n" ); + km = astKeyMap( " " ); + { + double lo[] = { 0.0, 0.0, 0.0 }, hi[] = { 1.0, 1.0, 1.0 }; + astMapPut0A( km, AST__STCPIXSZ, astBox( astFrame( 3, " " ), 1, lo, hi, NULL, " " ), NULL ); + } + make_with( reg, km ); + + /* Review Focus 5: attributes set on an Stc. */ + head( "attribs_sky" ); + { + double c[] = { 1.0, 0.5 }, r = 0.01, rerr = 0.0001; + const char *names[] = { "RA", "Dec" }; + sky = astSkyFrame( " " ); + km = astKeyMap( " " ); + astMapPut1C( km, AST__STCNAME, 2, names, NULL ); + astMapPut0A( km, AST__STCERROR, astCircle( sky, 1, c, &rerr, NULL, " " ), NULL ); + stc = astStcResourceProfile( astCircle( sky, 1, c, &r, NULL, " " ), 1, &km, " " ); + } + printf( "RegionClass %s\n", astGetC( stc, "RegionClass" ) ); + printf( "test RegionClass %d\n", astTest( stc, "RegionClass" ) ); + failed(); + astSet( stc, "RegionClass=Box" ); + failed(); + astClear( stc, "RegionClass" ); + failed(); + printf( "-- Adaptive=0, System=Galactic\n" ); + astSet( stc, "Adaptive=0" ); + astSet( stc, "System=Galactic" ); + astShow( stc ); + show_coord( (AstStc *) stc, 1 ); + printf( "-- region\n" ); + astShow( astGetStcRegion( stc ) ); + printf( "-- clear System\n" ); + astClear( stc, "System" ); + astShow( stc ); + show_coord( (AstStc *) stc, 1 ); + failed(); + + head( "attribs_region" ); + stc = plain(); + show_attrs( "stc", (AstObject *) stc ); + astSet( stc, "Negated=1" ); + show_attrs( "stc", (AstObject *) stc ); + show_attrs( "region", (AstObject *) astGetStcRegion( stc ) ); + astShow( stc ); + astSet( stc, "Closed=0,MeshSize=40,FillFactor=0.25" ); + show_attrs( "stc", (AstObject *) stc ); + show_attrs( "region", (AstObject *) astGetStcRegion( stc ) ); + astShow( stc ); + printf( "-- clear\n" ); + astClear( stc, "Negated,Closed,MeshSize,FillFactor" ); + show_attrs( "stc", (AstObject *) stc ); + show_attrs( "region", (AstObject *) astGetStcRegion( stc ) ); + astShow( stc ); + printf( "-- set on the region given\n" ); + reg = (AstRegion *) circle2( 0.0, 0.0, 1.0 ); + astSet( reg, "Negated=1,Closed=0,MeshSize=30,FillFactor=0.5" ); + stc = astStcResourceProfile( reg, 0, NULL, " " ); + show_attrs( "stc", (AstObject *) stc ); + astShow( stc ); + failed(); + + /* testregions.c checkStcNegated. */ + head( "check_stc_negated" ); + stc = plain(); + tran2( (AstObject *) stc, 0.0, 0.0, 5.0, 0.0 ); + astNegate( stc ); + tran2( (AstObject *) stc, 0.0, 0.0, 5.0, 0.0 ); + printf( "Bounded %d\n", astGetI( stc, "Bounded" ) ); + failed(); + + /* stc.c Simplify: the negation moved onto the encapsulated Region, and + the encapsulated and AstroCoords Regions mapped into the current + Frame (astMapRegion, which simplifies its result). */ + head( "simplify_negated" ); + stc = plain(); + printf( "plain same %d\n", astSame( astSimplify( stc ), stc ) ); + astNegate( stc ); + obj = (AstObject *) astSimplify( stc ); + printf( "same %d\n", astSame( obj, stc ) ); + show_attrs( "given", (AstObject *) stc ); + show_attrs( "stc", obj ); + show_attrs( "region", (AstObject *) astGetStcRegion( obj ) ); + astShow( obj ); + tran2( obj, 0.0, 0.0, 5.0, 0.0 ); + failed(); + + head( "simplify_remapped_coords" ); + km = astKeyMap( " " ); + { + const char *names[] = { "X", "Y" }; + astMapPut1C( km, AST__STCNAME, 2, names, NULL ); + } + astMapPut0A( km, AST__STCVALUE, circle2( 0.5, 0.0, 0.25 ), NULL ); + astMapPut0A( km, AST__STCERROR, circle2( 0.0, 0.0, 0.01 ), NULL ); + stc = astStcResourceProfile( circle2( 0.0, 0.0, 1.0 ), 1, &km, " " ); + obj = (AstObject *) astMapRegion( stc, astZoomMap( 2, 2.0, " " ), astFrame( 2, "Domain=ZOOM" ) ); + printf( "class %s\n", astGetC( obj, "Class" ) ); + astShow( obj ); + show_coord( (AstStc *) obj, 1 ); + printf( "-- region\n" ); + astShow( astGetStcRegion( obj ) ); + printf( "-- given\n" ); + show_coord( (AstStc *) stc, 1 ); + failed(); + + /* Dumps edited by hand and read. */ + head( "begin_stc" ); + dump_lines( (AstObject *) plain() ); + for( i = j = 0; i < nline; i++ ) { + if( !strcmp( lines[ i ], " Begin StcResourceProfile \t# Resource coverage" ) ) { + text[ j++ ] = " Begin Stc \t# An IVOA Space-Time-Coords object"; + } else if( !strcmp( lines[ i ], " End StcResourceProfile" ) ) { + text[ j++ ] = " End Stc"; + } else if( strncmp( lines[ i ], " IsA Stc", 8 ) ) { + text[ j++ ] = lines[ i ]; + } + } + text[ j ] = NULL; + obj = read_text(); + if( obj ) { + printf( "ncoord %d\n", astGetStcNCoord( obj ) ); + tran2( obj, 0.0, 0.0, 5.0, 0.0 ); + astShow( obj ); + failed(); + } + + head( "negative_ncoord" ); + dump_lines( (AstObject *) plain() ); + for( i = j = 0; i < nline; i++ ) { + if( !strncmp( lines[ i ], " IsA Stc", 8 ) ) text[ j++ ] = " Ncoord = -1"; + text[ j++ ] = lines[ i ]; + } + text[ j ] = NULL; + obj = read_text(); + if( obj ) { + printf( "ncoord %d\n", astGetStcNCoord( obj ) ); + astShow( obj ); + failed(); + } + + /* testregions.c checkStcObsDump. */ + head( "check_stc_obs_dump" ); + { + AstStcObsDataLocation *noobs = astStcObsDataLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + obj = read_back( (AstObject *) noobs ); + if( obj ) { + printf( "equal %d\n", astEqual( obj, noobs ) ); + astShow( obj ); + failed(); + } + } + + head( "obs_loc" ); + { + double obspt[ 3 ] = { 1.0, 2.0, 3.0 }; + AstStcObsDataLocation *noobs = astStcObsDataLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + AstStcObsDataLocation *obsdata = astStcObsDataLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + AstStcObsDataLocation *obscopy; + AstPointList *obs = astPointList( astFrame( 3, "Domain=GEO" ), 1, 3, 1, obspt, NULL, " " ); + set_obs( obsdata, (AstObject *) obs ); + astShow( obsdata ); + obscopy = astCopy( obsdata ); + printf( "-- Ident=given set on the PointList given\n" ); + astSet( obs, "Ident=given" ); + astShow( obsdata ); + printf( "-- the copy\n" ); + astShow( obscopy ); + printf( "equal without obs %d\n", astEqual( obsdata, noobs ) ); + printf( "equal without obs reversed %d\n", astEqual( noobs, obsdata ) ); + printf( "equal copy %d\n", astEqual( obsdata, obscopy ) ); + printf( "-- removed\n" ); + set_obs( obsdata, NULL ); + astShow( obsdata ); + printf( "-- the copy read back\n" ); + obj = read_back( (AstObject *) obscopy ); + if( obj ) { + printf( "equal %d\n", astEqual( obj, obscopy ) ); + astShow( obj ); + } + failed(); + } + + head( "obs_loc_any_class" ); + { + AstStcObsDataLocation *obsdata = astStcObsDataLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + set_obs( obsdata, (AstObject *) astZoomMap( 2, 4.0, " " ) ); + obj = read_back( (AstObject *) obsdata ); + if( obj ) { + astShow( obj ); + printf( "-- copy\n" ); + astShow( astCopy( obj ) ); + } + failed(); + } + + head( "stc_classes" ); + { + AstObject *search = (AstObject *) astStcSearchLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + AstObject *entry = (AstObject *) astStcCatalogEntryLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + AstObject *obsdata = (AstObject *) astStcObsDataLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + AstObject *profile = (AstObject *) plain(); + AstObject *search2 = (AstObject *) astStcSearchLocation( circle2( 0.0, 0.0, 1.0 ), 0, NULL, " " ); + AstObject *searcha = (AstObject *) astStcSearchLocation( circle_in( "A", 1.0 ), 0, NULL, " " ); + AstObject *searchb = (AstObject *) astStcSearchLocation( circle_in( "B", 1.0 ), 0, NULL, " " ); + AstObject *obsb = (AstObject *) astStcObsDataLocation( circle_in( "B", 1.0 ), 0, NULL, " " ); + AstObject *entryb = (AstObject *) astStcCatalogEntryLocation( circle_in( "B", 1.0 ), 0, NULL, " " ); + printf( "equal search search %d\n", astEqual( search, search2 ) ); + printf( "equal search entry %d\n", astEqual( search, entry ) ); + printf( "equal search obsdata %d\n", astEqual( search, obsdata ) ); + printf( "equal obsdata profile %d\n", astEqual( obsdata, profile ) ); + failed(); + find_and_convert( "search, search", search, search2 ); + find_and_convert( "search, obsdata", search, obsdata ); + find_and_convert( "obsdata, search", obsdata, search ); + find_and_convert( "entry, profile", entry, profile ); + find_and_convert( "search A, search B", searcha, searchb ); + find_and_convert( "search A, obsdata B", searcha, obsb ); + find_and_convert( "obsdata B, search A", obsb, searcha ); + find_and_convert( "search A, entry B", searcha, entryb ); + /* astConvert between these CmpFrames reaches region.c's Cast, which + crashes until a Region-class description has been read; it is + called in the last case. */ + printf( "-- CmpFrames of search B and search A\n" ); + show_fs( "findframe", astFindFrame( astCmpFrame( searchb, astFrame( 1, "Domain=C" ), " " ), + astCmpFrame( searcha, astFrame( 1, "Domain=C" ), " " ), "" ) ); + } + + /* Last: region.c's own vtab initialised by reading a Region, then the + CmpFrames of two StcSearchLocations in Domains A and B converted. */ + head( "cast_after_region_read" ); + text[ 0 ] = " Begin Region"; + text[ 1 ] = " End Region"; + text[ 2 ] = NULL; + obj = read_text(); + { + AstObject *searcha = (AstObject *) astStcSearchLocation( circle_in( "A", 1.0 ), 0, NULL, " " ); + AstObject *searchb = (AstObject *) astStcSearchLocation( circle_in( "B", 1.0 ), 0, NULL, " " ); + printf( "-- CmpFrames of search B and search A\n" ); + show_fs( "convert", astConvert( astCmpFrame( searchb, astFrame( 1, "Domain=C" ), " " ), + astCmpFrame( searcha, astFrame( 1, "Domain=C" ), " " ), "" ) ); + } + + astEnd; + return 0; +} diff --git a/src/test/resources/probes/stc_probe.json b/src/test/resources/probes/stc_probe.json new file mode 100644 index 0000000..393708b --- /dev/null +++ b/src/test/resources/probes/stc_probe.json @@ -0,0 +1,4 @@ +{ + "source": "probes/stc_probe.c", + "output": "== used_plain\ntest Negated before 0\ntran 0 0 -> 0 0\ntran 5 0 -> -1.7976931348623157e+308 -1.7976931348623157e+308\ntest Negated after 1\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\ncopy test Negated 1\nequal copy 1\nequal fresh 1\nequal fresh reversed 1\n== used_negated\ntran 0 0 -> -1.7976931348623157e+308 -1.7976931348623157e+308\ntran 5 0 -> 5 0\ntest Negated after 1\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\nequal copy 1\nequal fresh negated 1\nequal plain 0\n== used_bounded\nBounded 1\ntest Negated after 1\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n== coords_empty\nncoord 1\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 0 \t# Total member count\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 0 \t# Total member count\n End KeyMap\n== coords_value_only\nncoord 2\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 2 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 2 \t# Total member count\n Key1 = \"Value\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 0\n X3 = 0.75\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n Coord2 = \t# AstroCoords number 2\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 4 \t# Total member count\n Key1 = \"Name\" \t# Item name\n Com1 = \"axis names\" \t# Item comment\n Typ1 = 3 \t# Item data type (string)\n Nel1 = 2 \t# Vector length\n V1_1 = \"X\" \t# Item values\n V1_2 = \"Y\"\n Key2 = \"Resolution\" \t# Item name\n Com2 = \"resolution\" \t# Item comment\n Typ2 = 4 \t# Item data type (AST Object)\n Val2 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 0.01\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 3 \t# Total member count\n Key1 = \"Value\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 0\n X3 = 0.75\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n-- coord 2\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 5 \t# Total member count\n Key1 = \"Name\" \t# Item name\n Com1 = \"axis names\" \t# Item comment\n Typ1 = 3 \t# Item data type (string)\n Nel1 = 2 \t# Vector length\n V1_1 = \"X\" \t# Item values\n V1_2 = \"Y\"\n Key2 = \"Resolution\" \t# Item name\n Typ2 = 4 \t# Item data type (AST Object)\n Val2 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 0.01\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n-- given KeyMap after\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 2 \t# Total member count\n Key1 = \"Value\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 0\n X3 = 0.75\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n== coords_other_frame\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"GHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"GHz\" \t# Preferred units for frequency\n End SpecFrame\n RegAxes = 1 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Interval \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 7 \t# Total member count\n Key1 = \"Name\" \t# Item name\n Typ1 = 3 \t# Item data type (string)\n Nel1 = 1 \t# Vector length\n V1_1 = \"Frequency\" \t# Item values\n Key2 = \"Size\" \t# Item name\n Typ2 = 4 \t# Item data type (AST Object)\n Val2 = \t# Item value\n Begin Interval \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0.25\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Key3 = \"Value\" \t# Item name\n Typ3 = 4 \t# Item data type (AST Object)\n Val3 = \t# Item value\n Begin Box \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1.55 \t# Coordinate values...\n X2 = 1.6000000000000001\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 9 \t# Total member count\n Key1 = \"Name\" \t# Item name\n Typ1 = 3 \t# Item data type (string)\n Nel1 = 1 \t# Vector length\n V1_1 = \"Frequency\" \t# Item values\n Key2 = \"Size\" \t# Item name\n Typ2 = 4 \t# Item data type (AST Object)\n Val2 = \t# Item value\n Begin Interval \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"GHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"GHz\" \t# Preferred units for frequency\n End SpecFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0.25\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Key3 = \"Value\" \t# Item name\n Typ3 = 4 \t# Item data type (AST Object)\n Val3 = \t# Item value\n Begin Box \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"GHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"GHz\" \t# Preferred units for frequency\n End SpecFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1.55 \t# Coordinate values...\n X2 = 1.6000000000000001\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n End KeyMap\n-- Unit=MHz, Adaptive\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"MHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"MHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"GHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"GHz\" \t# Preferred units for frequency\n End SpecFrame\n Frm2 = \t# Frame number 2\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"MHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"MHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"MHz\" \t# Preferred units for frequency\n End SpecFrame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 1 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 999.99999999999989 \t# Zoom factor\n End ZoomMap\n End FrameSet\n RegAxes = 1 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Interval \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 7 \t# Total member count\n Key1 = \"Name\" \t# Item name\n Typ1 = 3 \t# Item data type (string)\n Nel1 = 1 \t# Vector length\n V1_1 = \"Frequency\" \t# Item values\n Key2 = \"Size\" \t# Item name\n Typ2 = 4 \t# Item data type (AST Object)\n Val2 = \t# Item value\n Begin Interval \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0.25\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n Key3 = \"Value\" \t# Item name\n Typ3 = 4 \t# Item data type (AST Object)\n Val3 = \t# Item value\n Begin Box \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1.55 \t# Coordinate values...\n X2 = 1.6000000000000001\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 9 \t# Total member count\n Key1 = \"Size\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Box \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"MHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"MHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"MHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"MHz\" \t# Preferred units for frequency\n End SpecFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 124.99999999999999 \t# Coordinate values...\n X2 = 249.99999999999997\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n Key2 = \"Value\" \t# Item name\n Typ2 = 4 \t# Item data type (AST Object)\n Val2 = \t# Item value\n Begin Box \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"MHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Closed = 1 \t# Boundary is inside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"MHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"MHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"MHz\" \t# Preferred units for frequency\n End SpecFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1550 \t# Coordinate values...\n X2 = 1600\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Box\n End KeyMap\n-- region\n Begin Interval \t# Axis intervals\n# Title = \"Frequency\" \t# Title of coordinate system\n# Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n# System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SpecFrame \t# Description of spectral coordinate system\n# Title = \"Frequency\" \t# Title of coordinate system\n Naxes = 1 \t# Number of coordinate axes\n# Domain = \"SPECTRUM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Frequency\" \t# Label for axis 1\n System = \"FREQ\" \t# Coordinate system type\n# Uni1 = \"GHz\" \t# Units for axis 1\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n Unit = \"GHz\" \t# Axis units\n End Axis\n IsA Frame \t# Coordinate system description\n# SoR = \"Heliocentric\" \t# Standard of rest\n UFreq = \"GHz\" \t# Preferred units for frequency\n End SpecFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 1 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Interval\n== coords_index\n!! AST: Error in routine main at line 316 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astGetStcCoord(StcResourceProfile): Supplied AstroCoords index (0) is invalid.\n! The index of the first AstroCoord element is one, not zero.\nstatus 233934146\n!! AST: Error in routine main at line 318 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astGetStcCoord(StcResourceProfile): Supplied AstroCoords index (1) is invalid.\n! There are no AstroCoords elements in the supplied StcResourceProfile.\nstatus 233934146\n!! AST: Error in routine main at line 322 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astGetStcCoord(StcResourceProfile): Supplied AstroCoords index (0) is invalid.\n! The index of the first AstroCoord element is one, not zero.\nstatus 233934146\n!! AST: Error in routine main at line 324 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astGetStcCoord(StcResourceProfile): Supplied AstroCoords index (2) is invalid.\n! There is 1 AstroCoords element in the supplied StcResourceProfile.\nstatus 233934146\n!! AST: Error in routine main at line 329 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astGetStcCoord(StcResourceProfile): Supplied AstroCoords index (3) is invalid.\n! There are 2 AstroCoords elements in the supplied StcResourceProfile.\nstatus 233934146\n!! AST: Error in routine main at line 331 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astGetStcCoord(StcResourceProfile): Supplied AstroCoords index (-1) is invalid.\n! The index of the first AstroCoord element is one, not zero.\nstatus 233934146\n== coords_bad_keys\n-- unknown key\n!! AST: Error in routine make_with at line 217 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astInitStc(StcResourceProfile): Unknown key \"Colour\" supplied in an AstroCoords list.\nstatus 233934138\n-- three names\n!! AST: Error in routine make_with at line 217 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astInitStc(StcResourceProfile): 3 \"Name\" values supplied in an AstroCoords list, but the Stc has 2 axes.\nstatus 233934138\n-- names not strings\n!! AST: Error in routine make_with at line 217 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astInitStc(StcResourceProfile): The \"Name\" values supplied in an AstroCoords list are not character strings.\nstatus 233934138\n-- two values\n!! AST: Error in routine make_with at line 217 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astInitStc(StcResourceProfile): 2 \"Value\" values supplied in an AstroCoords list, but only one is allowed.\nstatus 233934138\n-- value not an Object\n!! AST: Error in routine make_with at line 217 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astInitStc(StcResourceProfile): The \"Error\" value supplied in an AstroCoords list is not an AST Object pointer.\nstatus 233934138\n-- value a Frame\n!! AST: Error in routine make_with at line 217 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astInitStc(StcResourceProfile): The \"Size\" value supplied in an AstroCoords list is a Frame, not a Region.\nstatus 233934138\n-- value in a Frame of three axes\n!! AST: Error in routine make_with at line 217 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astInitStc(StcResourceProfile): The \"PixSize\" value supplied in an AstroCoords list cannot be converted to the coordinate system of its parent Stc object.\nstatus 233934138\n== attribs_sky\nRegionClass Circle\ntest RegionClass 0\n!! AST: Error in routine main at line 393 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astSet: The setting \"regionclass=Box\" is invalid for a StcResourceProfile.\n! This is a read-only attribute.\nstatus 233933578\n!! AST: Error in routine main at line 395 in file /Users/timj/work/astjava/src/test/resources/probes/stc_probe.c.\n! astClear: Invalid attempt to clear the \"regionclass\" value for a StcResourceProfile.\n! This is a read-only attribute.\nstatus 233933578\n-- Adaptive=0, System=Galactic\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n# System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 0 \t# Region does not adapt to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n# System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 4 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n# System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.0001139493927356\n X4 = 0.49999999966561526\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 5 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n# System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.0001139493927356\n X4 = 0.49999999966561526\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n-- region\n Begin Circle \t# Circular or spherical region\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n# System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n-- clear System\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 0 \t# Region does not adapt to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"ICRS coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Right ascension\" \t# Label for axis 1\n# Lbl2 = \"Declination\" \t# Label for axis 2\n# System = \"ICRS\" \t# Coordinate system type\n# Uni1 = \"hh:mm:ss.s\" \t# Units for axis 1\n# Uni2 = \"ddd:mm:ss\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.011394942398204\n X4 = 0.49999665611448513\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 4 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n# System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.0001139493927356\n X4 = 0.49999999966561526\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 5 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n# System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin SkyFrame \t# Description of celestial coordinate system\n# Title = \"IAU (1958) galactic coordinates\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Domain = \"SKY\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Galactic longitude\" \t# Label for axis 1\n# Lbl2 = \"Galactic latitude\" \t# Label for axis 2\n System = \"GALACTIC\" \t# Coordinate system type\n# Uni1 = \"degrees\" \t# Units for axis 1\n# Uni2 = \"degrees\" \t# Units for axis 2\n# Dir1 = 0 \t# Plot axis 1 in reverse direction\n# Bot2 = -1.5707963267948966 \t# Lowest legal axis value\n# Top2 = 1.5707963267948966 \t# Highest legal axis value\n Ax1 = \t# Axis number 1\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n Ax2 = \t# Axis number 2\n Begin SkyAxis \t# Celestial coordinate axis\n End SkyAxis\n IsA Frame \t# Coordinate system description\n# SkyTol = 0.001 \t# Smallest significant separation [arc-sec]\n End SkyFrame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 0.5\n X3 = 1.0001139493927356\n X4 = 0.49999999966561526\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"RA\" \t# Item values\n V2_2 = \"Dec\"\n End KeyMap\n== attribs_region\nstc Negated 0 0 Closed 1 0 MeshSize 200 0 FillFactor 1 0\nstc Negated 1 1 Closed 1 0 MeshSize 200 0 FillFactor 1 0\nregion Negated 1 1 Closed 1 0 MeshSize 200 0 FillFactor 1 0\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\nstc Negated 1 1 Closed 0 1 MeshSize 40 1 FillFactor 0.25 1\nregion Negated 1 1 Closed 0 1 MeshSize 40 1 FillFactor 0.25 1\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Fill = 0.25 \t# Region fill factor\n MeshSz = 40 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Fill = 0.25 \t# Region fill factor\n MeshSz = 40 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- clear\nstc Negated 0 0 Closed 1 0 MeshSize 200 0 FillFactor 1 0\nregion Negated 0 0 Closed 1 0 MeshSize 200 0 FillFactor 1 0\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- set on the region given\nstc Negated 1 1 Closed 0 1 MeshSize 30 1 FillFactor 0.5 1\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Fill = 0.5 \t# Region fill factor\n MeshSz = 30 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Fill = 0.5 \t# Region fill factor\n MeshSz = 30 \t# No. of points used to represent boundary\n Closed = 0 \t# Boundary is outside\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n== check_stc_negated\ntran 0 0 -> 0 0\ntran 5 0 -> -1.7976931348623157e+308 -1.7976931348623157e+308\ntran 0 0 -> -1.7976931348623157e+308 -1.7976931348623157e+308\ntran 5 0 -> 5 0\nBounded 0\n== simplify_negated\nplain same 1\nsame 0\ngiven Negated 1 1 Closed 1 0 MeshSize 200 0 FillFactor 1 0\nstc Negated 1 1 Closed 1 0 MeshSize 200 0 FillFactor 1 0\nregion Negated 1 1 Closed 1 0 MeshSize 200 0 FillFactor 1 0\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Negate = 1 \t# Region negated\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\ntran 0 0 -> -1.7976931348623157e+308 -1.7976931348623157e+308\ntran 5 0 -> 5 0\n== simplify_remapped_coords\nclass StcResourceProfile\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = 1 \t# Number of AstroCoords elements\n Coord1 = \t# AstroCoords number 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 8 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Com1 = \"AstroCoords error region\" \t# Item comment\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 0.01\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"X\" \t# Item values\n V2_2 = \"Y\"\n Key3 = \"Value\" \t# Item name\n Com3 = \"AstroCoords value region\" \t# Item comment\n Typ3 = 4 \t# Item data type (AST Object)\n Val3 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 0\n X3 = 0.75\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 10 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 0.01\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"X\" \t# Item values\n V2_2 = \"Y\"\n Key3 = \"Value\" \t# Item name\n Typ3 = 4 \t# Item data type (AST Object)\n Val3 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 0\n X3 = 0.75\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n-- region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n FrmSet = \t# Original & current coordinate systems\n Begin FrameSet \t# Set of inter-related coordinate systems\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n IsA Frame \t# Coordinate system description\n Nframe = 2 \t# Number of Frames in FrameSet\n# Base = 1 \t# Index of base Frame\n Currnt = 2 \t# Index of current Frame\n Lnk2 = 1 \t# Node 2 is derived from node 1\n Frm1 = \t# Frame number 1\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Frm2 = \t# Frame number 2\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n Domain = \"ZOOM\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Map2 = \t# Mapping between nodes 1 and 2\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsSimp = 1 \t# Mapping has been simplified\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 2 \t# Zoom factor\n End ZoomMap\n End FrameSet\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n-- given\n-- coord 1\n Begin KeyMap \t# Map of key/value pairs\n MapSz = 16 \t# Size of hash table\n MemCnt = 8 \t# Total member count\n Key1 = \"Error\" \t# Item name\n Typ1 = 4 \t# Item data type (AST Object)\n Val1 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 0.01\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Key2 = \"Name\" \t# Item name\n Typ2 = 3 \t# Item data type (string)\n Nel2 = 2 \t# Vector length\n V2_1 = \"X\" \t# Item values\n V2_2 = \"Y\"\n Key3 = \"Value\" \t# Item name\n Typ3 = 4 \t# Item data type (AST Object)\n Val3 = \t# Item value\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0.5 \t# Coordinate values...\n X2 = 0\n X3 = 0.75\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End KeyMap\n== begin_stc\n-- text\n Begin Stc \t# An IVOA Space-Time-Coords object\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End Stc\n-- end text\n-- read Stc\nncoord 0\ntran 0 0 -> 0 0\ntran 5 0 -> -1.7976931348623157e+308 -1.7976931348623157e+308\n Begin Stc \t# An IVOA Space-Time-Coords object\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n End Stc\n== negative_ncoord\n-- text\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n Ncoord = -1\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n-- end text\n-- read StcResourceProfile\nncoord 0\n Begin StcResourceProfile \t# Resource coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcResourceProfile\n== check_stc_obs_dump\n-- text\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcObsDataLocation\n-- end text\n-- read StcObsDataLocation\nequal 1\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcObsDataLocation\n== obs_loc\nset obs status 0\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\n-- Ident=given set on the PointList given\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n Ident = \"given\" \t# Permanent Object identification string\n IsA Object \t# AST Object\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\n-- the copy\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\nequal without obs 1\nequal without obs reversed 1\nequal copy 1\n-- removed\nset obs status 0\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n End StcObsDataLocation\n-- the copy read back\n-- text\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\n-- end text\n-- read StcObsDataLocation\nequal 1\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin PointList \t# Collection of points\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n# Naxes = 3 \t# Number of coordinate axes\n# Domain = \"GEO\" \t# Coordinate system domain\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"3-d coordinate system\" \t# Title of coordinate system\n Naxes = 3 \t# Number of coordinate axes\n Domain = \"GEO\" \t# Coordinate system domain\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# Lbl3 = \"Axis 3\" \t# Label for axis 3\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n Ax3 = \t# Axis number 3\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 1 \t# Number of points\n Ncoord = 3 \t# Number of coordinates per point\n X1 = 1 \t# Coordinate values...\n X2 = 2\n X3 = 3\n End PointSet\n IsA Region \t# An area within a coordinate system\n End PointList\n End StcObsDataLocation\n== obs_loc_any_class\nset obs status 0\n-- text\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 4 \t# Zoom factor\n End ZoomMap\n End StcObsDataLocation\n-- end text\n-- read StcObsDataLocation\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 4 \t# Zoom factor\n End ZoomMap\n End StcObsDataLocation\n-- copy\n Begin StcObsDataLocation \t# Observation coverage\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n RegAxes = 2 \t# Number of axes spanned by the Region\n IsA Region \t# An area within a coordinate system\n Region = \t# STC Region\n Begin Circle \t# Circular or spherical region\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n# Naxes = 2 \t# Number of coordinate axes\n# Epoch = 2000 \t# Julian epoch of observation\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n# System = \"Cartesian\" \t# Coordinate system type\n IsA Frame \t# Coordinate system description\n Adapt = 1 \t# Region adapts to coord sys changes\n Frm = \t# Coordinate system\n Begin Frame \t# Coordinate system description\n# Title = \"2-d coordinate system\" \t# Title of coordinate system\n Naxes = 2 \t# Number of coordinate axes\n# Lbl1 = \"Axis 1\" \t# Label for axis 1\n# Lbl2 = \"Axis 2\" \t# Label for axis 2\n Ax1 = \t# Axis number 1\n Begin Axis \t# Coordinate axis\n End Axis\n Ax2 = \t# Axis number 2\n Begin Axis \t# Coordinate axis\n End Axis\n End Frame\n Points = \t# Points defining the shape\n Begin PointSet \t# Container for a set of points\n Npoint = 2 \t# Number of points\n Ncoord = 2 \t# Number of coordinates per point\n X1 = 0 \t# Coordinate values...\n X2 = 0\n X3 = 1\n X4 = 0\n End PointSet\n IsA Region \t# An area within a coordinate system\n End Circle\n IsA Stc \t# An IVOA Space-Time-Coords object\n ObsLoc = \t# Observatory position\n Begin ZoomMap \t# Zoom about the origin\n Nin = 2 \t# Number of input coordinates\n IsA Mapping \t# Mapping between coordinate systems\n Zoom = 4 \t# Zoom factor\n End ZoomMap\n End StcObsDataLocation\n== stc_classes\nequal search search 1\nequal search entry 0\nequal search obsdata 0\nequal obsdata profile 0\n-- search, search\nfindframe 1 Frame Frame UnitMap\nconvert 1 Frame Frame UnitMap\n-- search, obsdata\nfindframe 1 Frame Frame UnitMap\nconvert 1 Frame Frame UnitMap\n-- obsdata, search\nfindframe 1 Frame Frame UnitMap\nconvert 1 Frame Frame UnitMap\n-- entry, profile\nfindframe 1 Frame Frame UnitMap\nconvert 1 Frame Frame UnitMap\n-- search A, search B\nfindframe 0\nconvert 0\n-- search A, obsdata B\nfindframe 0\nconvert 0\n-- obsdata B, search A\nfindframe 0\nconvert 0\n-- search A, entry B\nfindframe 0\nconvert 0\n-- CmpFrames of search B and search A\nfindframe 0\n== cast_after_region_read\n-- text\n Begin Region\n End Region\n-- end text\n-- read Region\n-- CmpFrames of search B and search A\nconvert 0\n" +} diff --git a/src/test/resources/selectormap/two_regions.ast b/src/test/resources/selectormap/two_regions.ast new file mode 100644 index 0000000..0178a5f --- /dev/null +++ b/src/test/resources/selectormap/two_regions.ast @@ -0,0 +1,61 @@ + Begin SelectorMap # Region identification Mapping + Nin = 2 # Number of input coordinates + Nout = 1 # Number of output coordinates + Inv = 0 # Inverse transformation not defined + IsA Mapping # Mapping between coordinate systems + Reg1 = # Region of input space + Begin Circle # Circular or spherical region +# Title = "2-d coordinate system" # Title of coordinate system +# Naxes = 2 # Number of coordinate axes +# Epoch = 2000 # Julian epoch of observation +# Lbl1 = "Axis 1" # Label for axis 1 +# Lbl2 = "Axis 2" # Label for axis 2 +# System = "Cartesian" # Coordinate system type + IsA Frame # Coordinate system description + Adapt = 1 # Region adapts to coord sys changes + Frm = # Coordinate system + Begin Frame # Coordinate system description +# Title = "2-d coordinate system" # Title of coordinate system + Naxes = 2 # Number of coordinate axes +# Lbl1 = "Axis 1" # Label for axis 1 +# Lbl2 = "Axis 2" # Label for axis 2 + Ax1 = # Axis number 1 + Begin Axis # Coordinate axis + End Axis + Ax2 = # Axis number 2 + Begin Axis # Coordinate axis + End Axis + End Frame + Points = # Points defining the shape + Begin PointSet # Container for a set of points + Npoint = 2 # Number of points + Ncoord = 2 # Number of coordinates per point + X1 = 0 # Coordinate values... + X2 = 0 + X3 = 1 + X4 = 0 + End PointSet + IsA Region # An area within a coordinate system + End Circle + Reg2 = # Region of input space + Begin Circle # Circular or spherical region +# Title = "2-d coordinate system" # Title of coordinate system +# Naxes = 2 # Number of coordinate axes +# Epoch = 2000 # Julian epoch of observation +# Lbl1 = "Axis 1" # Label for axis 1 +# Lbl2 = "Axis 2" # Label for axis 2 +# System = "Cartesian" # Coordinate system type + IsA Frame # Coordinate system description + Adapt = 1 # Region adapts to coord sys changes + Points = # Points defining the shape + Begin PointSet # Container for a set of points + Npoint = 2 # Number of points + Ncoord = 2 # Number of coordinates per point + X1 = 5 # Coordinate values... + X2 = 5 + X3 = 6 + X4 = 5 + End PointSet + IsA Region # An area within a coordinate system + End Circle + End SelectorMap