00001 /* 00002 * soi_fun.h ~soi/(version)/include 00003 * 00004 * Prototype decalarations required for SOI functions. 00005 * 00006 * Source files are on directory ~soi/(version)/src/functions unless 00007 * otherwise noted. 00008 * Additional information is in the following man pages: 00009 * 00010 * Responsible: Rick Bogart RBogart@solar.Stanford.EDU 00011 * 00012 * Bugs: 00013 * 00014 * Revision history is at the end of the file. 00015 */ 00016 #ifndef SOI_FUN_INCL 00017 /****************************************************************************/ 00018 /************************** INCLUDE STATEMENTS ****************************/ 00019 /****************************************************************************/ 00020 00021 #ifndef SOI_VERSION_INCL 00022 #include "soi_version.h" 00023 #endif 00024 00025 #ifndef SOI_SDS_INCL 00026 #include "soi_sds.h" 00027 #endif 00028 00029 /****************************************************************************/ 00030 /**************************** DEFINE STATEMENTS ***************************/ 00031 /****************************************************************************/ 00032 00033 #define BILINEAR (0) 00034 #define CUBIC_CONVOLUTION (1) 00035 00036 #define VCOR_SIGN_ONLY (0) 00037 00038 /* TBD by Schou or ??? - document meaning and supply more descriptive names */ 00039 #define VCOR_LEVEL1 (1) 00040 #define VCOR_LEVEL2 (2) 00041 00042 #define MCOR_LEVEL0 (0) 00043 /* nocorrection */ 00044 #define MCOR_LEVEL1 (1) 00045 /* line-of-sight correction for Br assuming observer at infinite distance */ 00046 00047 #define TILE_FMT "V_pox_%d-%d_%d%c" 00048 /* example tile names: V_pox_0-49_01h V_pox_0-100_04h */ 00049 00050 #define LMAX 1500 00051 #define MODES(L) ((((L)+1)*(L))/2) 00052 #define MINIMUM(X,Y) (((X)<(Y))?(X):(Y)) 00053 #define MAXIMUM(X,Y) (((X)>(Y))?(X):(Y)) 00054 #define TNEXT(X) (((X)->tstart)+((X)->twidth)) 00055 #define LNEXT(X) (((X)->lstart)+((X)->lwidth)) 00056 00057 #define PLATFORM_UNKNOWN (0) 00058 #define PLATFORM_UNRECOGNIZED (1) 00059 #define PLATFORM_SOHO (2) 00060 #define PLATFORM_GONGPLUS (3) 00061 #define PLATFORM_MWO60 (4) 00062 #define PLATFORM_BBSO (5) 00063 #define PLATFORM_TRACE (6) 00064 #define PLATFORM_SPOLE_JSO (10) 00065 #define PLATFORM_GONG (30) 00066 #define PLATFORM_OBSPM (40) 00067 00068 #define INSTRUMENT_UNKNOWN (0) 00069 #define INSTRUMENT_UNRECOGNIZED (1) 00070 #define INSTRUMENT_SOHO_MDI (10) 00071 #define INSTRUMENT_SOHO_EIT (11) 00072 #define INSTRUMENT_GONG_TD (20) 00073 #define INSTRUMENT_GONG_CT (21) 00074 #define INSTRUMENT_GONG_TC (22) 00075 #define INSTRUMENT_GONG_BB (23) 00076 #define INSTRUMENT_GONG_ML (24) 00077 #define INSTRUMENT_GONG_LE (25) 00078 #define INSTRUMENT_GONG_UD (26) 00079 #define INSTRUMENT_GONG_MERGE (29) 00080 #define INSTRUMENT_MWO60_MOF (30) 00081 #define INSTRUMENT_BBSO_SINGER (40) 00082 #define INSTRUMENT_TRACE (50) 00083 #define INSTRUMENT_MOTH (60) 00084 #define INSTRUMENT_OBSPM_SPHG (70) 00085 00086 #define NO_DATA_DICT (0x0001) 00087 #define NO_SEMIDIAMETER (0x0002) 00088 #define NO_XSCALE (0x0004) 00089 #define NO_YSCALE (0x0008) 00090 #define NO_XCENTERLOC (0x0010) 00091 #define NO_YCENTERLOC (0x0020) 00092 #define NO_HELIO_LATC (0x0040) 00093 #define NO_HELIO_LONC (0x0080) 00094 #define NO_HELIO_PA (0x0100) 00095 #define NO_OBSERVER_LAT (0x0002) 00096 #define NO_OBSERVER_LON (0x0004) 00097 00098 #define SOI_FUN_VERSION_NUM (4.8) 00099 #define SOI_FUN_INCL 1 00100 00101 /****************************************************************************/ 00102 /******************************* TYPEDEFS *********************************/ 00103 /****************************************************************************/ 00104 00105 typedef struct tile_info { 00106 struct tile_info *next; /* just in case we want to make a list */ 00107 char *name; /* name of tile is series name */ 00108 int index; /* index of tile is series number */ 00109 int tstart; /* start time in minutes */ 00110 int twidth; /* width of tile in minutes */ 00111 int lstart; /* start value of l */ 00112 int lwidth; /* width/height of tile in l */ 00113 int modes; /* modes in lwidth starting at lstart */ 00114 } TILE; 00115 00116 typedef struct gradinfo { 00117 float a[3]; 00118 int np; 00119 double p; 00120 double e; 00121 double V; 00122 } GRADINFO; 00123 00124 00125 /****************************************************************************/ 00126 /*************************** FUNCTION PROTOTYPES **************************/ 00127 /****************************************************************************/ 00128 00129 /* source file: apodize.c */ 00130 /* Note: If this is a general function it belongs in lib_M.d */ 00131 /* Probably the input array should be in an SDS */ 00132 /* extern int apodize(float *data, int cols, int rows, int apod); */ 00133 extern int apodize( 00134 float *data, /* input/output data array */ 00135 double B0, /* heliographic latitude of disk center */ 00136 int cols, int rows, /* width and height of input array */ 00137 double Lmin, /* start of longitude range */ 00138 double Ldelta, /* increment in longitude pre col */ 00139 double sinBdelta, /* increment in sin latitude per row */ 00140 int apodlevel, /* type of apodization */ 00141 /* 0 to do no apodization */ 00142 /* 1 to apodize in true solar coordinates */ 00143 /* 2 to apodize in ideal solar coordinates */ 00144 double apinner, /* fractional radius to start apodization at */ 00145 double apwidth, /* width of apodization */ 00146 int apel, /* do elliptical apodization as described by */ 00147 /* apx and apy */ 00148 double apx, /* divide the x position by this before applying */ 00149 /* apodization */ 00150 double apy /* divide the y position by this before applying */ 00151 /* apodization */ 00152 ); 00153 00154 /* source file: data_stats.c */ 00155 extern int data_stats (SDS *in, SDS_STATS *in_out); 00156 extern void fget_stats (float *data, int ntot, int *nv, double *min, 00157 double *max, double *mean, double *stdv, double *skew, double *kurt, 00158 double *med, double *min_abs); 00159 00160 /* source file: keywords.c */ 00161 extern double GONG_correct_pa (SDS *img); 00162 /* note: the above belongs in soi_GONG.h */ 00163 extern int observer_loc_params (SDS *rec, double *obs_lat, double *obs_lon); 00164 extern int observing_source (SDS *rec, int *platform, int *instrument); 00165 extern TIME observing_time (SDS *rec); 00166 extern int solar_image_params (SDS *rec, double *xscl, double *yscl, 00167 double *ctrx, double *ctry, double *latc, double *lonc, 00168 double *apsd, double *pang, double *eecc, double *eang, 00169 int *xinv, int *yinv); 00170 extern char *platform_name (int platform); 00171 extern char *instrument_name (int instrument); 00172 00173 /* source file: masking.c */ 00174 extern int ordered_mask_compare (unsigned int a, unsigned int b, 00175 int nmasks, ...); 00176 00177 /* source file: matrix_sum.c */ 00178 extern int matrix_sum (double a, SDS *am, double b, SDS *bm, SDS *cm); 00179 00180 00181 typedef struct RotRate_struct 00182 { 00183 float lat; 00184 float r; 00185 } RotRate_t; 00186 /* source file: obs2helio.c */ 00187 extern int obs2helio ( 00188 float *V, /* Input velocity array */ 00189 /* assumed declared V[ypixels][xpixels] */ 00190 float *U, /* Output projected array */ 00191 int xpixels, /* x width of input array */ 00192 int ypixels, /* y width of input array */ 00193 double x0, /* x pixel address of disk center */ 00194 double y0, /* y pixel address of disk center */ 00195 double B0, /* Heliographic Latitude of disk center */ 00196 double P, /* Angle between CCD y-axis and solar vertical */ 00197 /* positive to the east (CCW) */ 00198 double S, /* Subtended radius of the sun (in radians) */ 00199 double rsun, /* pixels */ 00200 double Rmax, /* Maximum disk radius to use (e.g. 0.95) */ 00201 00202 int interpolation, 00203 int cols, /* width of output array */ 00204 int rows, /* height of output array */ 00205 double Lmin, /* start of longitude range */ 00206 double Ldelta, /* increment of longitude per col */ 00207 double Ladjust, 00208 double sinBdelta, /* increment of sin latitude per row */ 00209 00210 double smajor, double sminor, double sangle, double xscale, 00211 double yscale, char *orientation, int mag_correction, 00212 int velocity_correction, 00213 double obs_vr, double obs_vw, double obs_vn, double vsign, 00214 int NaN_beyond_rmax, 00215 int carrStretch, 00216 float diffrotA, 00217 float diffrotB, 00218 float diffrotC, 00219 RotRate_t *rRates, 00220 int size); 00221 00222 /* source file: plm1.f */ 00223 extern int setplm_ (int *lmin, int *lmax, int *m, int *nx, int *indx, 00224 double *x, int *nplm, double *plm); 00225 00226 /* source file: sds_bin_extract.c */ 00227 extern int sds_bin_average (SDS *sds, int *binsize); 00228 extern int sds_bin_sum (SDS *sds, int *binsize); 00229 extern int sds_extract_subset (SDS *sds, int *offset, int *size); 00230 extern SDS *SDS_bin_average (SDS *sds, int *binsize); 00231 extern SDS *SDS_bin_sum (SDS *sds, int *binsize); 00232 00233 /* source file: sds_interp.c */ 00234 extern int sds_regrid (SDS *sds, int *length, int scheme); 00235 float SDSimaginterp (SDS *image, double x, double y); 00236 00237 /* source file: sds_rowfft842.c */ 00238 extern int sds_rowfft842 ( int isign, SDS * real, SDS * imag); 00239 00240 /* source file: shc_inner_pro.c */ 00241 extern int shc_inner_product ( 00242 SDS *even_real, /* Folded row FFTs of remapped data */ 00243 SDS *even_imag, /* Even parity */ 00244 SDS *odd_real, SDS *odd_imag, /* Odd parity */ 00245 SDS *masks, int l_min, int l_max, int delta_m, 00246 double d_m, /* ratio of column of data to m */ 00247 SDS *i_p_real, SDS *i_p_imag); 00248 00249 /* source file: tile.c */ 00250 extern int lchunks (int lwidth); 00251 extern int mchunks (int mwidth); 00252 extern int linfo (int lindex, int mwidth, int *start, int *width); 00253 extern TILE *get_tile (KEY *params, char *root, int tstep); 00254 extern TILE *intersect_tiles (TILE *tile1, TILE *tile2); 00255 extern int sds_calc_stats (SDS *sds); 00256 00257 #endif 00258 00259 /* 00260 * Revision History 00261 * v 1.5 96.08.07 R Bogart added prototype for fget_stats() 00262 * v 1.6 96.09.10 R Bogart added min_abs argument to fget_stats() 00263 * v 2.0 96.11.21 R Bogart removed sds_gongprep declaration 00264 * 96.11.22 R Bogart added declarations from sds_bin_extract 00265 * 96.11.27 R Bogart added temporary declaration for 00266 * mdi_bin_avg () 00267 * v 2.1 96.12.13 R Bogart added declarations from sds_bin_extract 00268 * for sds_bin_sum, SDS_bin_average, SDS_bin_sum; removed temporary 00269 * 97.04.16 K Chu added include of <soi_version.h> 00270 * 97.05.24 P Scherrer removed show_tile() spec 00271 * 98.02.04 K Chu added NaN_beyond_rmax to obs2helio() 00272 * parameter list 00273 * v 2.10 98.03.25 R Bogart added declaration from masking; removed 00274 * history prior to v.1; removed unused sds_remap and obsolete 00275 * sds_makemasks declarations and declarations of functions prototyped 00276 * in MDI.h 00277 * 99.04.27 J Schou added GONG style elliptical apodization 00278 * 99.12.09 K Chu added argument rm_limbdark to 00279 * obs2helio() 00280 * 99.12.16 J Aloise removed limbdark from obs2helio() 00281 * 00.05.15 K Chu added mag_correction to obs2helio() 00282 * v 4.8 01.12.06 R Bogart added declarations for keywords.c 00283 * 02.09.10 R Bogart added more " 00284 * 05.01.05 R Bogart added more " 00285 * 05.09.19 R Bogart added more " 00286 */ 00287 00288 /* 00289 $Id: soi_fun.h,v 1.1 2009/04/24 21:52:49 production Exp $ 00290 $Source: /home/cvsuser/cvsroot/JSOC/proj/jpe/apps/soi_fun.h,v $ 00291 $Author: production $ 00292 */ 00293 /* 00294 * $Log: soi_fun.h,v $ 00295 * Revision 1.1 2009/04/24 21:52:49 production 00296 * *** empty log message *** 00297 * 00298 * Revision 1.36 2007/09/24 16:22:27 arta 00299 * Add structure definition to hold rotation rate v. latitude data, change signature of obs2helio to pass rotation rate data back to caller. 00300 * 00301 * Revision 1.35 2007/08/22 18:15:04 arta 00302 * Fix the build - wrong declaration of obs2helio(), also missing semicolon in obs2helio.c 00303 * 00304 * Revision 1.34 2007/02/02 22:11:15 arta 00305 * Adjust longitude for differential rotation. 00306 * 00307 * Revision 1.33 2005/09/19 23:21:20 rick 00308 * added Meudon identifiers 00309 * 00310 * Revision 1.32 2005/01/06 00:44:38 rick 00311 * see above 00312 * 00313 * Revision 1.31 2004/06/11 18:43:22 rick 00314 * added MOTH identifiers 00315 * 00316 * Revision 1.30 2003/11/06 01:45:02 rick 00317 * added argument to sds_regrid 00318 * 00319 * Revision 1.29 2003/03/03 18:51:24 rick 00320 * see above 00321 * 00322 * Revision 1.28 2002/10/08 17:41:53 rick 00323 * see above 00324 * 00325 * Revision 1.27 2002/05/24 00:09:29 rick 00326 * see above 00327 * 00328 * Revision 1.26 2002/02/21 20:04:05 rick 00329 * see above 00330 * 00331 * Revision 1.25 2001/12/10 18:49:16 rick 00332 * see above 00333 * 00334 * Revision 1.24 2000/05/15 17:19:12 kehcheng 00335 * added mag_correction to obs2helio() 00336 * 00337 * Revision 1.23 1999/12/16 19:44:41 CM 00338 * remove limbdark in obs2helio 00339 * 00340 * Revision 1.22 1999/12/09 23:26:21 kehcheng 00341 * added argument rm_limbdark to obs2helio() 00342 * 00343 * Revision 1.21 1999/04/27 18:43:40 schou 00344 * Added GONG style elliptical apodization. 00345 * 00346 * Revision 1.20 1998/04/02 22:02:26 rick 00347 * see above 00348 * 00349 * Revision 1.19 1998/02/24 18:45:40 kehcheng 00350 * added NaN_beyond_rmax to obs2helio() parameter list 00351 * 00352 * Revision 1.18 1997/05/24 01:28:14 phil 00353 * removed show_tile spec 00354 * 00355 * Revision 1.17 1997/04/16 21:52:35 kehcheng 00356 * added #include <soi_version.h> 00357 * 00358 * Revision 1.16 1997/01/13 18:44:56 rick 00359 * see above 00360 * 00361 * Revision 1.15 1996/11/27 19:05:17 rick 00362 * as above 00363 * 00364 * Revision 1.14 1996/11/22 22:25:07 rick 00365 * see above 00366 * 00367 * Revision 1.13 1996/11/02 00:48:48 phil 00368 * added sds_calc_stats 00369 * 00370 * Revision 1.12 1996/09/12 09:49:18 rick 00371 * see above 00372 * 00373 */