Functions related to reporting a the bounding box of certain inputs are declared in gnuastro/box.h. All coordinates in this header are in the FITS format (first axis is the horizontal and the second axis is vertical).
Any ellipse can be enclosed into a rectangular box. The purpose of this
function is to give the height and width of that box assuming the center of
the ellipse is in the box center.
a is the ellipse major axis,
b is the minor axis,
theta_deg is the position angle in
width array will contain the output size in long
width are the number of pixels
along the first and second FITS axis. Since the ellipse center is assumed
to be in the center of the box, all the values in
width will be an
Given the center coordinates in
center and the
each dimension) of a box, return the coordinates of the first
fpixel) and last (
lpixel) pixels. All arrays must have
ndim elements (one for each dimension).
ndim-dimensional dataset of size
naxes (along each
dimension, in FITS order) and a box with first and last (inclusive)
lpixel_i is given. This box
doesn’t necessarily have to lie within the dataset, it can be outside of
it, or only patially overlap. This function will change the values of
lpixel_i to exactly cover the overlap in the
input dataset’s coordinates.
This function will return 1 if there is an overlap and 0 if there
isn’t. When there is an overlap, the coordinates of the first and last
pixels of the overlap will be put in