Crates.io | moc |
lib.rs | moc |
version | 0.17.0 |
source | src |
created_at | 2021-10-18 07:40:20.490498 |
updated_at | 2024-10-16 10:33:08.181629 |
description | Library made to create and manipulate HEALPix Multi-Order Coverages maps (MOCs), see https://ivoa.net/documents/MOC/ |
homepage | https://github.com/cds-astro/cds-moc-rust/ |
repository | https://github.com/cds-astro/cds-moc-rust/ |
max_upload_size | |
id | 466666 |
size | 963,119 |
moc
Read, write, create and manipulate HEALPix Multi-Order Coverage maps (MOCs), i.e. discretized geomatrical surfaces on the unit sphere.
MOC Lib Rust, the Rust MOC library used in:
MOC Lib Rust rely on the CDS HEALPix Rust library.
This Rust library implements the v2.0 of the MOC standard,
including (S-)MOCs, T-MOCs and ST-MOCs.
It also implements a still experimental F-MOC (F for Frequency).
MOC Lib Rust is used in:
For tools able to display MOCs, see:
The github releases section number is the MOCCli, MOCSet and MOCWasm release number.
Install rust
(and check that ~/.cargo/bin/
is in your path),
or update the Rust compiler with:
rustup update
Run tests (with or without seeing stdout
):
cargo test
cargo test -- --nocapture
Run benches:
cargo bench
Build documentation
cargo doc --open
Build the library for fast test or final build
# Fast build (large not optimized file)
cargo build
# Optimized file
cargo build --release
// Signature of the Union operation between 2 2D-MOCs
pub fn or<T, Q, U, R, I1, J1, K1, I2, J2, K2>(
left_it: K1,
right_it: K2
) -> OrRange2Iter<T, Q, I1, I2>
where
T: Idx, // Type of the 1st quantity (e.g. u32 or u64)
Q: MocQty<T>, // First quantity type, e.g Time
U: Idx, // Type of the 2nd quantity (e.g. u32 or u64)
R: MocQty<U>, // Second quantity type, e.g Space (we use Hpx for HEALPix)
I1: RangeMOCIterator<T, Qty=Q>,
J1: RangeMOCIterator<U, Qty=R>,
K1: RangeMOC2ElemIt<T, Q, U, R, It1=I1, It2=J1>,
I2: RangeMOCIterator<T, Qty=Q>,
J2: RangeMOCIterator<U, Qty=R>,
K2: RangeMOC2ElemIt<T, Q, U, R, It1=I2, It2=J2>
Add operations on RangeMOC2
or
and
, complement
, fold
, ...Implement a function dividing a disjoint MOCs into a list of joint MOCs (tip: use the order and the flag of a BMOC, the flag telling is the cell has already been visited).
Implement the compact notation (bits coding quad-tree traversal) for S-MOCs (binary + ASCII Base 64)
Implement compact S-MOC: single z-order curve sorted array of indices with a 2 bits flag telling whether the index is a single index, a range lower bound or a range upper bound
Make a PostgresQL wrapper using e.g. pgx?
STC-S parsing is ensured by the STC crate.
Current discrepancies between the STC standard and this implementation:
DIFFERENCE
operation has been implemented as being a symmetric difference
XOR
(exclusive OR
or symmetric difference) but no Difference
XOR
is already implemented in cdshleapix, but DIFFERENCE
is not.R1 – R2 = R1 AND (NOT R2))
;
but also: R1 - R2 = R1 AND (R1 XOR R2)
, and
XOR = (R1 OR R2) AND (NOT (R1 AND R2))
is more complex that DIFFERENCE
(so is worth having implented?).Polygon
: we do not use the STC convention
NOT
to get its complement!)Box
: a position angle can be added as a last parameter, right after bsize
.So far, we reject STC-S having:
ICRS
Spher2
degrees
Like most projects in Rust, this project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
The code is formatted using 2 tab spaces instead of the regular 4:
cargo fmt -- --config tab_spaces=2
This work has been partly supported by the ESCAPE project.
ESCAPE - The European Science Cluster of Astronomy & Particle Physics ESFRI Research Infrastructures -
has received funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement no. 824064.