aboutsummaryrefslogtreecommitdiff
path: root/src/include/region.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-03-05 12:53:09 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-03-05 12:53:09 -0500
commit832b4b34ff8ce84a13751883c0822c16c152fe48 (patch)
treeedb4d7050c37ade55bc543de80e76e58c4486908 /src/include/region.h
parent8f848043369b49e861942ce132181fed2c53c2d3 (diff)
downloadcalfuse-832b4b34ff8ce84a13751883c0822c16c152fe48.tar.gz
Massive rework
Diffstat (limited to 'src/include/region.h')
-rw-r--r--src/include/region.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/include/region.h b/src/include/region.h
new file mode 100644
index 0000000..4d7c96c
--- /dev/null
+++ b/src/include/region.h
@@ -0,0 +1,80 @@
+/***************************************************************/
+/* REGION STUFF */
+/***************************************************************/
+
+#define myPI 3.1415926535897932385
+
+typedef struct {
+ int exists;
+ double xrefval, yrefval;
+ double xrefpix, yrefpix;
+ double xinc, yinc;
+ double rot;
+ char type[6];
+} WCSdata;
+
+typedef enum {
+ point_rgn,
+ line_rgn,
+ circle_rgn,
+ annulus_rgn,
+ ellipse_rgn,
+ elliptannulus_rgn,
+ box_rgn,
+ rectangle_rgn,
+ diamond_rgn,
+ sector_rgn,
+ poly_rgn
+} shapeType;
+
+typedef enum { pixel_fmt, degree_fmt, hhmmss_fmt } coordFmt;
+
+typedef struct {
+ char sign; /* Include or exclude? */
+ shapeType shape; /* Shape of this region */
+
+ union { /* Parameters - In pixels */
+
+ /**** Generic Shape Data ****/
+
+ struct {
+ double p[8]; /* Region parameters */
+ double sinT, cosT; /* For rotated shapes */
+ double a, b; /* Extra scratch area */
+ } gen;
+
+ /**** Polygon Data ****/
+
+ struct {
+ int nPts; /* Number of Polygon pts */
+ double *Pts; /* Polygon points */
+ double xmin,xmax; /* Polygon bounding box */
+ double ymin,ymax;
+ } poly;
+
+ } param;
+
+} RgnShape;
+
+typedef struct {
+ int nShapes;
+ RgnShape *Shapes;
+ WCSdata wcs;
+} SAORegion;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ffrrgn( const char *filename, WCSdata *wcs, SAORegion **Rgn, int *status );
+int fftrgn( double X, double Y, SAORegion *Rgn );
+void fffrgn( SAORegion *Rgn );
+
+#ifdef __cplusplus
+ }
+#endif
+
+#define fits_read_rgnfile ffrrgn
+#define fits_in_region fftrgn
+#define fits_free_region fffrgn
+