00001 #ifndef __CARTOGRAPHY_H__
00002 #define __CARTOGRAPHY_H__
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008
00009 #define PLATFORM_UNKNOWN (0)
00010 #define PLATFORM_UNRECOGNIZED (1)
00011 #define PLATFORM_SOHO (2)
00012 #define PLATFORM_GONGPLUS (3)
00013 #define PLATFORM_MWO60 (4)
00014 #define PLATFORM_BBSO (5)
00015 #define PLATFORM_TRACE (6)
00016 #define PLATFORM_SPOLE_JSO (10)
00017 #define PLATFORM_GONG (30)
00018 #define PLATFORM_OBSPM (40)
00019
00020 #define INSTRUMENT_UNKNOWN (0)
00021 #define INSTRUMENT_UNRECOGNIZED (1)
00022 #define INSTRUMENT_SOHO_MDI (10)
00023 #define INSTRUMENT_SOHO_EIT (11)
00024 #define INSTRUMENT_GONG_TD (20)
00025 #define INSTRUMENT_GONG_CT (21)
00026 #define INSTRUMENT_GONG_TC (22)
00027 #define INSTRUMENT_GONG_BB (23)
00028 #define INSTRUMENT_GONG_ML (24)
00029 #define INSTRUMENT_GONG_LE (25)
00030 #define INSTRUMENT_GONG_UD (26)
00031 #define INSTRUMENT_GONG_MERGE (29)
00032 #define INSTRUMENT_MWO60_MOF (30)
00033 #define INSTRUMENT_BBSO_SINGER (40)
00034 #define INSTRUMENT_TRACE (50)
00035 #define INSTRUMENT_MOTH (60)
00036 #define INSTRUMENT_OBSPM_SPHG (70)
00037
00038 #define NO_DATA_DICT (0x0001)
00039 #define NO_SEMIDIAMETER (0x0002)
00040 #define NO_XSCALE (0x0004)
00041 #define NO_YSCALE (0x0008)
00042 #define NO_XCENTERLOC (0x0010)
00043 #define NO_YCENTERLOC (0x0020)
00044 #define NO_HELIO_LATC (0x0040)
00045 #define NO_HELIO_LONC (0x0080)
00046 #define NO_HELIO_PA (0x0100)
00047 #define NO_XUNITS (0x0200)
00048 #define NO_YUNITS (0x0400)
00049 #define NO_OBSERVER_LAT (0x0002)
00050 #define NO_OBSERVER_LON (0x0004)
00051
00052 #define KEYSCOPE_VARIABLE (0x80000000)
00053 #define LOCALHS_IMGINFO_VERSION ("1.0")
00054
00055
00056
00057
00058
00059 typedef struct paramdef {
00060 double scale;
00061 double offset;
00062 double defval;
00063 unsigned int statusbit;
00064 char name[32];
00065 } ParamDef;
00066
00067
00068 int img2sphere(double x, double y, double ang_r, double latc, double lonc, double pa, double *rho, double *lat, double *lon, double *sinlat, double *coslat, double *sig, double *mu, double *chi);
00069 int plane2sphere (double x, double y, double latc, double lonc, double *lat, double *lon, int projection);
00070 int sphere2img (double lat, double lon, double latc, double lonc, double *x, double *y, double xcenter, double ycenter, double rsun, double peff, double ecc, double chi,int xinvrt, int yinvrt);
00071 int sphere2plane (double lat, double lon, double latc, double lonc, double *x, double *y, int projection);
00072
00073 void mtrack_MDI_correct_pa(double *pa);
00074 void mtrack_MDI_correct_imgctr(double *xc, double *yc, double rsun);
00075 void mtrack_MDI_image_stretch(double *x, double *y, int n, int direct);
00076 void mtrack_MDI_image_tip(double *x, double *y, int n, int direct);
00077
00078 int solar_image_info(DRMS_Record_t *img, double *xscl, double *yscl, double *ctrx, double *ctry, double *apsd, const char *rsun_key, const char *apsd_key, double *pang, double *ellipse_e, double *ellipse_pa, int *x_invrt, int *y_invrt, int *need_ephem, int AIPS_convention);
00079
00080 int check_and_set_key_short(DRMS_Record_t *new, const char *key, short val);
00081 int check_and_set_key_int(DRMS_Record_t *new, const char *key, int val);
00082 int check_and_set_key_longlong (DRMS_Record_t *new, const char *key, long long val);
00083 int check_and_set_key_float(DRMS_Record_t *new, const char *key, float val);
00084 int check_and_set_key_double(DRMS_Record_t *new, const char *key, double val);
00085 int check_and_set_key_str(DRMS_Record_t *new, const char *key, char *val);
00086 int check_and_set_key_time(DRMS_Record_t *new, const char *key, TIME tval);
00087 int check_and_copy_key(DRMS_Record_t *new, DRMS_Record_t *old, const char *key);
00088 int drms_appendstr_tokey(DRMS_Record_t *rec, const char *key, const char *str, int addline);
00089 void append_args_tokey(DRMS_Record_t *rec, const char *key);
00090 int construct_stringlist(const char *request, char token, char ***stringlist);
00091 int copy_prime_keys(DRMS_Record_t *new, DRMS_Record_t *old);
00092 void string_insert_escape_char(char **str, const char esc);
00093 int append_keyval_to_primekeyval(char **pkey, DRMS_Record_t *rec, const char *key);
00094 char *create_primekey_from_keylist (DRMS_Record_t *rec, char **keylist, int keyct);
00095 int propagate_keys(DRMS_Record_t *to, DRMS_Record_t *from, char **keylist, int keyct);
00096 char *iau_units_parse_unit(char *unit, double *scale);
00097 int drms_iau_units_scale(char *unit, double *scale);
00098 int drms_wcs_timestep(DRMS_Record_t *rec, int axis, double *tstep);
00099
00100 #ifdef __cplusplus
00101 }
00102 #endif
00103
00104 #endif