//--------------------------------------------------------------------------- #ifndef globalH #define globalH //--------------------------------------------------------------------------- #include "fclasses.h" #include "novas.h" //#define simple_dist #ifndef wolf #define EXTERN extern #else #define EXTERN #endif #define FITS #define WOLF_VERSION "2.12" EXTERN double MID_X; EXTERN double MID_Y; #ifdef FITS #define CLOUD_AREA_SIZE 35 /* the size of cloud rectangle is (2*CLOUD_AREA_SIZE X 2*CLOUD_AREA_SIZE) */ #define STARS_NUM_CO 1 /* 2 */ #define MIN_CLOUD_VALUE 25 /* in sigmas over background */ #define MAX_DIST_DIFS 10.0 /* maximum distance of a star in the image from a the calculated position */ #define AUTO_DETECT_SIGMA 15 #define INVERTED_IMAGE 0 #else #define CLOUD_AREA_SIZE 20 #define MIN_COLOR 145 /*125*/ #define MIN_DEF_COLOR 40 /*25*/ #define CENTER_COLOR_DIST 60 #define MIN_CENTER_COLOR 160 #define MIN_AVERAGE_COLOR 140 #define MIN_CLOUD_VALUE 2.5 #define STARS_NUM_CO 2 /*1*/ #define INVERTED_IMAGE 0 #endif #define DELTA_T 65.47 /* observatories */ #define STARS_NUM 3500 #define MAX_STARS_POINTS 6000 #define MAX_BASELINE_PEAKS 7000 #define STRIPES_NUM 100 #define LOCATIONS_NUM 20 #define SHOW_STARS_NUM 100 #define PLANETS_NUM 11 #define SKY_OBJECTS_NUM 100 #define LABELS_NUM 100 #define RAMON 0 #define RHO 1 #define KITT_PEAK 2 #define WILSON 3 #define MAUNA_KEA 4 #define CANARY_ISLAND 5 #define SOUTH_AFRICA 6 #define SIDING_SPRING 7 #define HALEAKALA 8 #define CERRO_PACHON 9 #define SAPIR_COLLEGE 10 #define HANLE 11 #define CUSTOM 12 /* star point type */ #define STAR_TYPE_CONSTELLATION 0 #define STAR_TYPE_BRIGHTSTAR 1 #define STAR_TYPE_PLANET 2 #define STAR_TYPE_SKY_OBJECT 3 #define STAR_TYPE_UNEXPECTED 4 /* planets */ #define MERCURY 1 #define VENUS 3 #define EARTH 2 #define MARS 4 #define JUPITER 5 #define SATURN 6 #define ORANUS 7 #define NEPTUN 8 #define PLUTO 9 #define SUN 10 #define MOON 11 /* constants used by the transient detection by comparing to a canonical frame */ #define NOT_BRIGHT 0 /* a "normal" star (less or equal in brightness to the canonical frame) */ #define BRIGHT_STAR 1 /* a star that is brighter than in the canonical frame */ #define TRANSIENT 2 /* a star that does not appear in the canonical frame */ typedef unsigned char byte; /* a star that should be displayed on the picture the list contains bright stars names and constellation names */ typedef struct { char starname[20]; char dispname[20]; }showstar; /* a point in the image that is a peak peak points are considered to be the center point of a star */ typedef struct { short x,y; /* star coordinates in the picture */ cat_entry *star; /* a star that is associated with that point */ double dist; /* the closest distance from the matched point */ unsigned char bright_star; /* 1 if the point is recognized as a bright star */ unsigned short color; /* the pixel count of the star */ unsigned short C1,C5,C9,C16,C25; unsigned short background; /* the background pixel count of the star */ short cloud; /* a value between 0 - 255 that indicates how much the star is covered by clouds (0 - no clouds. -1 ignore this star when drawing emissivity maps)*/ float cloud_opacity; /* cloud opacity value of this star point (based on some baseline image taken at the same sidereal time) */ unsigned short cloud_glow; /* cloud opacity value of this star point (based on some baseline image taken at the same sidereal time) */ // float TimesAvg; /* the ratio between the star's color and the average color */ }star_point; /* a label that should be types on the image */ typedef struct { short x,y; short type; char text[30]; }label; /* a point that has a stripe on it. this structure is not used in the fits version of WOLF */ typedef struct { long x,y; /* star coordinates in the picture */ long min_x,max_x,min_y,max_y; /* bounding rect of the stripe */ }stripe_point; /* an object that should be painted on the image (from an external file) */ typedef struct { double ra; double dec; double az; double alt; short azalt; /* switch the select ra/dec or az/alt */ char name[30]; /* content to be printed */ }sky_object; EXTERN FuzzyModelBody BodyModel; EXTERN ThreeDimModel GamaRaysModel; EXTERN TwoDimModel MagnitudeModel; EXTERN OneDimModel AltitudeModel; EXTERN OneDimModel AzimuthModel; EXTERN OneDimModel AltModel0; EXTERN OneDimModel AltModel90; EXTERN OneDimModel AltModel180; EXTERN OneDimModel AltModel270; EXTERN OneDimModel DistModel; EXTERN OneDimModel AngModel; EXTERN cat_entry stars[STARS_NUM]; EXTERN body planets[PLANETS_NUM+1]; EXTERN site_info locations[LOCATIONS_NUM]; EXTERN body earth; EXTERN showstar showstars[SHOW_STARS_NUM]; EXTERN star_point star_points[MAX_STARS_POINTS]; EXTERN label labels[LABELS_NUM]; EXTERN stripe_point stripes[STRIPES_NUM]; EXTERN sky_object sky_objects[SKY_OBJECTS_NUM]; /* these variables are for the "flf_get_star" in calstars.cpp */ EXTERN site_info current_location; EXTERN double current_date; EXTERN int star_index; EXTERN int search_planets; EXTERN int search_objects; EXTERN double ang_offset; EXTERN double dist_coefficient; EXTERN double MAX_DIST_FROM_CENTER; EXTERN double MAX_DIST_FOR_AUTO_DETECT; /* swe prototyped */ void swe_set_topo(double geolon, double geolat, double geoalt); //long swe_calc_ut(double tjd, int ipl, long iflag,double *xx, char *serr); long swe_calc_ut(double tjd, long ipl, long iflag,double *xx, char *serr); /* global function */ long altaz2xy(double zd,double az,long *x,long *y); void xy2altaz(long x,long y,double *alt,double *az); void altaz2radec(site_info *location,double alt, double az, double *RA, double *DEC); void GetDate(double jdt, char *buffer); double GetFileDate(char *filename); int Draw_RA_DEC(int hBITMAP,site_info *location,double tjd,int font); double julian2sidereal(double tjd,site_info *location); char *FindClosestFile(char *filename,site_info *location,char *targetfile); short LoadObservatory(); int DrawStaticLabels(int bitmap, char *input_image, long resize, double exposure_time); void ShowHelp(); #endif