
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
MAVIS Differential Astrometric Calibration. This image processing pipeline is designed to ingest images acquired during astrometric calibration of (e.g.) MAVIS, and output the estimated distortion field derived from these images. The bulk of the pipeline is written in Rust, but the most useful functions and the CLI tool are wrapped in Python.
pip install mavdac
To check that everything is set up correctly, test the CLI, e.g.,:
mavdac --help
You should see something like:
$ mavdac --help
usage: mavdac [-h] [--radius RADIUS] [--thresh THRESH] [--grid GRID] [--yes] [--degree DEGREE] pattern [coordinates]
mavis differential astrometric calibrator. For more info, see https://github.com/jcranney/mavdac
positional arguments:
pattern glob pattern for matching fits files to use for calibration
coordinates file containing coordinates to map through distortions
options:
-h, --help show this help message and exit
--radius RADIUS radius around nominal pinhole position to perform centroiding
--thresh THRESH threshold of summed flux under which a centroid is ignored
--grid GRID yaml file containing grid geometry definition, creates default if not present
--yes, -y answer "Yes" by default (e.g., when using non-interactive shells)
--degree DEGREE maximum order of bivariate polynomial used in distortion fitting
The simplest usage of this software is by calling
mavdac "./some/pattern*.fits" ./coordinates.csv
which tries to parse all images on disk matching the glob pattern argument, and the coordinates in the comma separated human-readable coordinates file. If the calibrations are succesful, then the recovered distortions will be sampled at the specified coordinates and printed to stdout. So, to capture the output, you can do (e.g.):
mavdac "./some/pattern*.fits" ./coordinates.csv > output.csv
There are a few ways to use mavdac
, e.g.,:
I'll assume you are a standard user, hoping to perform astrometric calibration of an optical system using the MAVIS Differential Astrometric Calibration technique. In that case, the workflow is as follows:
./some/dir/img_0*.fits
,./some/dir/coords
:0,0,
0,8,
0,16,
0,32,
...
4096,4088,
4096,4096,
grid.yaml
file, specifying the geometry of the pinhole mask/calibration source.mavdac
pipeline, specifying image filename pattern and coordinates filename path, piping stdout
to some ./results
file.Below we provide the requirements for each of the above tasks.
{u8, f32, f64, i32, u32}
type. Note that internally, all images are converted to f64
upon loading.XSHIFT
: shift in pixels along x-axis of the calibration mask for that exposure (from some nominal "home" position),YSHIFT
: shift in pixels along y-axis of the calibration mask for that exposure (from some nominal "home" position),mavdac "./some/dir/imgs_*.fits"
then the software will print some status updates to stderr, and eventually the coefficients of the fitted basis functions to stdout. This is mostly unusable, unless you write your own software to parse these coefficients. The intended usage is to provide a set of coordinates in pixel space, in which case you will get the distortions at those coordinates printed to stdout. E.g., with a coordinates file, ./some/coords
:
0,0,
0,2000,
2000,0,
2000,2000,
you can run:
mavdac "./some/dir/imgs_*.fits" ./some/coords
which will output:
0,0,0.0966850540113886,0.3300609989212976,
0,2000,0.07252484678180265,0.007773570343281411,
2000,0,0.004342546567941594,0.26372826456406706,
2000,2000,-0.0018909241959087534,-0.0036487693998900166,
to stdout. The expected usage is something like:
mavdac "./imgs_*.fits" ./coords > ./out
which cats only the stdout to a file, ./out
. I've spent a bit of time thinking about the simplest user interface with this software, and that is the best I can come up with, but if you have a better idea (perhaps inspired by experience using similar pipelines), please contact me or raise an issue in this repo.
grid.yaml
fileThe coordinates of the pinhole grid are specified by a grid.yaml
file, which currently only supports the "Hex" geometry. Here is an example:
!Hex
pitch: 133.33333333333334
rotation: 0.0
offset:
x: 0.0
y: 0.0
All of these parameters are required, they are described below:
pitch
: distance between adjacent pinholes (in pixel units),rotation
: orientation of hexagonal pinhole geometry (in radians),offset
: shift of overall grid in pixel units, in x
and y
dimensions. Note that for x=0
and y=0
, there is a point in the grid at the exact middle of the image.Note that if you specify a grid file that does not exist, you will be asked if you want the default one. If you're feeling lazy, just say yes and then modify the default one that gets created.
mavdac
Finally, once you have:
./some/dir
,grid.yaml
file,./coords
text file,you can run mavdac from the command line by:
mavdac "./some/dir/*.fits" ./coords > ./out
All versions of mavdac < 1.0.0 are subject to breaking changes between any two releases. The tests and validations are being developed side-by-side with the software, so will become populated as the pipeline matures. It is envisioned that there will be 3 levels of validation for the software that should be re-satisfied for any release:
Unit tests for the rust package will be found within each rust module, e.g., within ./rust/src/lib.rs
, under mod tests {...}
.
System tests for the rust + python package (e.g., the CLI), can be found in ./src/tests
. These will include tests that generate images with known distortions that are piped through mavdac, and the measured distortion field can be checked for quality. These are already quite mature, and can be tested in any version >=0.1.1
by running
pytest
in the root directory of this repo.
The final validation of this software package is through it's use on data acquired in a real optical system with introduced distortions. To demonstrate the challenges associated with this kind of validation - try to construct an experiment which can verify that the software works as intended. The following are the most direct:
FAQs
MAVIS Differential Astrometric Calibrator
We found that mavdac demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.