00001 /* 00002 * roi_stats_mag_defs: definitions for ROI statistics 00003 * 00004 * This list was a starting point determined by Michael Turmon, 00005 * Todd Hoeksema, Xudong Sun, and others, in May 2010. 00006 * Updated October 2010. 00007 * 00008 * Intended to be included from various source files, so, 00009 * we use include guards to prevent double inclusion. 00010 */ 00011 00012 #include <limits.h> // for INT_MAX 00013 00014 #ifndef ROI_STATS_MAG_DEFS_H 00015 #define ROI_STATS_MAG_DEFS_H 1 00016 00017 /* 00018 * RS_rgn_* are whole-region accumulators (all over the ROI) 00019 * RS_ar_* are ar-only accumulators 00020 * the convention is to precede lat and lon with `_' 00021 */ 00022 00023 typedef enum { 00024 // size 00025 RS_rgn_num = 0, // # pixels tagged (all may not be active) 00026 RS_rgn_size, // projected (flat) area in microhemispheres (0..1e6) 00027 RS_rgn_area, // un-projected (solid-angle) area in microhemispheres (0..1e6) 00028 // extent 00029 RS_rgn_min_lat, // lower corner of (lat,lon) bounding box for region 00030 RS_rgn_min_lon, 00031 RS_rgn_max_lat, // upper corner of (lat,lon) bounding box for region 00032 RS_rgn_max_lon, 00033 // return time 00034 RS_rgn_daysgone, // #days until ROI bounding box vanishes from disk front 00035 RS_rgn_daysback, // #days until ROI bounding box first reappears on front 00036 // flux 00037 RS_rgn_btot, // sum of absolute LoS flux within the identified region 00038 RS_rgn_bnet, // net LoS flux within the identified region 00039 RS_rgn_bpos, // absolute value of total positive ROI LoS flux 00040 RS_rgn_bneg, // absolute value of total negative ROI LoS flux 00041 // flux moments 00042 RS_rgn_bsum1, // sum of LoS flux within the identified region (== bnet) 00043 RS_rgn_bsum2, // sum of (LoS flux)^2 within the identified region 00044 RS_rgn_bsum3, // sum of (LoS flux)^3 within the identified region 00045 RS_rgn_bsum4, // sum of (LoS flux)^4 within the identified region 00046 // flux moments, standardized 00047 RS_rgn_bmean, // mean of LoS flux within the region 00048 RS_rgn_bsdev, // standard deviation of LoS flux within the region 00049 RS_rgn_bskew, // skewness of LoS flux within the region 00050 RS_rgn_bkurt, // kurtosis (subtracting 3) of LoS flux within the region 00051 // size 00052 RS_ar_num, // # active pixels 00053 RS_ar_size, // projected (flat) active area in microhemispheres (0..1e6) 00054 RS_ar_area, // unprojected (solid-angle) active area in microhemis (0..1e6) 00055 // flux 00056 RS_ar_btot, // sum of absolute LoS flux within the active region 00057 RS_ar_bnet, // net LoS flux within the active region 00058 RS_ar_bpos, // absolute value of total positive AR LoS flux 00059 RS_ar_bneg, // absolute value of total negative AR LoS flux 00060 // mean location 00061 RS_ar_area_lat, // area-weighted center of active pixels (norm: RS_ar_area) 00062 RS_ar_area_lon, 00063 RS_ar_fwt_lat, // flux-weighted center of active pixels (norm: RS_ar_btot) 00064 RS_ar_fwt_lon, 00065 RS_ar_fwtpos_lat, // flux-weighted center of positive AR flux (norm: RS_ar_bpos) 00066 RS_ar_fwtpos_lon, 00067 RS_ar_fwtneg_lat, // flux-weighted center of negative AR flux (norm: RS_ar_bneg) 00068 RS_ar_fwtneg_lon, 00069 // bookkeeping 00070 RS_num_stats, // number of statistics 00071 RS_MAX = INT_MAX // ensure it's as big as an int 00072 } rs_stat_index_t; 00073 00074 // autogenerated from the above list with shell-command-on-region using: 00075 // sed -e 's/RS_/\"/' -e 's/,.*/\",/' 00076 00077 static const char *RS_index2name[] = { 00078 // size 00079 "rgn_num", 00080 "rgn_size", 00081 "rgn_area", 00082 // extent 00083 "rgn_min_lat", 00084 "rgn_min_lon", 00085 "rgn_max_lat", 00086 "rgn_max_lon", 00087 // return time 00088 "rgn_daysgone", 00089 "rgn_daysback", 00090 // flux 00091 "rgn_btot", 00092 "rgn_bnet", 00093 "rgn_bpos", 00094 "rgn_bneg", 00095 // flux moments 00096 "rgn_bsum1", 00097 "rgn_bsum2", 00098 "rgn_bsum3", 00099 "rgn_bsum4", 00100 // flux moments, standardized 00101 "rgn_bmean", 00102 "rgn_bsdev", 00103 "rgn_bskew", 00104 "rgn_bkurt", 00105 // size 00106 "ar_num", 00107 "ar_size", 00108 "ar_area", 00109 // flux 00110 "ar_btot", 00111 "ar_bnet", 00112 "ar_bpos", 00113 "ar_bneg", 00114 // mean location 00115 "ar_area_lat", 00116 "ar_area_lon", 00117 "ar_fwt_lat", 00118 "ar_fwt_lon", 00119 "ar_fwtpos_lat", 00120 "ar_fwtpos_lon", 00121 "ar_fwtneg_lat", 00122 "ar_fwtneg_lon", 00123 // bookkeeping 00124 NULL, 00125 NULL, 00126 }; 00127 00128 // how to combine two or more summary statistics 00129 // into a pooled statistic: sum, min, max, or 00130 // weighted average 00131 00132 static const char *RS_index2combo[] = { 00133 // size 00134 "sum", // rgn_num 00135 "sum", // rgn_size 00136 "sum", // rgn_area 00137 // extent 00138 "min", // rgn_min_lat 00139 "min", // rgn_min_lon 00140 "max", // rgn_max_lat 00141 "max", // rgn_max_lon 00142 // return time 00143 "max", // rgn_daysgone 00144 "min", // rgn_daysback 00145 // flux 00146 "sum", // rgn_btot 00147 "sum", // rgn_bnet 00148 "sum", // rgn_bpos 00149 "sum", // rgn_bneg 00150 // flux moments 00151 "sum", // rgn_bsum1 00152 "sum", // rgn_bsum2 00153 "sum", // rgn_bsum3 00154 "sum", // rgn_bsum4 00155 // flux moments, standardized 00156 "recomp", // rgn_bmean 00157 "recomp", // rgn_bsdev 00158 "recomp", // rgn_bskew 00159 "recomp", // rgn_bkurt 00160 // size 00161 "sum", // ar_num 00162 "sum", // ar_size 00163 "sum", // ar_area 00164 // flux 00165 "sum", // ar_btot 00166 "sum", // ar_bnet 00167 "sum", // ar_bpos 00168 "sum", // ar_bneg 00169 // mean location 00170 "avg.ar_area", // ar_area_lat 00171 "avg.ar_area", // ar_area_lon 00172 "avg.ar_btot", // ar_fwt_lat 00173 "avg.ar_btot", // ar_fwt_lon 00174 "avg.ar_bpos", // ar_fwtpos_lat 00175 "avg.ar_bpos", // ar_fwtpos_lon 00176 "avg.ar_bneg", // ar_fwtneg_lat 00177 "avg.ar_bneg", // ar_fwtneg_lon 00178 // bookkeeping 00179 NULL, 00180 NULL, 00181 }; 00182 00183 // correspondence of statistics above to HMI "patch" keywords 00184 // NULL means, no such keyword in patch series 00185 // first char gives type of HMI keyword 00186 00187 static const char *RS_index2patch_keyname[] = { 00188 // size 00189 "iNPIX", // RS_rgn_num 00190 "fSIZE", // RS_rgn_size 00191 "fAREA", // RS_rgn_area 00192 // extent 00193 "fMIN_LAT", // RS_rgn_min_lat 00194 "fMIN_LON", // RS_rgn_min_lon 00195 "fMAX_LAT", // RS_rgn_max_lat 00196 "fMAX_LON", // RS_rgn_max_lon 00197 // return time 00198 NULL, // RS_rgn_daysgone 00199 NULL, // RS_rgn_daysback 00200 // flux 00201 "fMTOT", // RS_rgn_btot 00202 "fMNET", // RS_rgn_bnet 00203 "fMPOS_TOT", // RS_rgn_bpos 00204 "fMNEG_TOT", // RS_rgn_bneg 00205 // flux moments 00206 NULL, // RS_rgn_bsum1 00207 NULL, // RS_rgn_bsum2 00208 NULL, // RS_rgn_bsum3 00209 NULL, // RS_rgn_bsum4 00210 // flux moments, standardized 00211 "fMMEAN", // RS_rgn_bmean 00212 "fMSTDEV", // RS_rgn_bsdev 00213 "fMSKEW", // RS_rgn_bskew 00214 "fMKURT", // RS_rgn_bkurt 00215 // size 00216 "iNACR", // RS_ar_num 00217 "fSIZE_ACR", // RS_ar_size 00218 "fAREA_ACR", // RS_ar_area 00219 // flux 00220 NULL, // RS_ar_btot 00221 NULL, // RS_ar_bnet 00222 NULL, // RS_ar_bpos 00223 NULL, // RS_ar_bneg 00224 // mean location 00225 NULL, // RS_ar_area_lat 00226 NULL, // RS_ar_area_lon 00227 "fFWT_LAT", // RS_ar_fwt_lat 00228 "fFWT_LON", // RS_ar_fwt_lon 00229 "fFWTPOS_LAT", // RS_ar_fwtpos_lat 00230 "fFWTPOS_LON", // RS_ar_fwtpos_lon 00231 "fFWTNEG_LAT", // RS_ar_fwtneg_lat 00232 "fFWTNEG_LON", // RS_ar_fwtneg_lon 00233 // end 00234 }; 00235 00236 // correspondence of statistics above to HMI "mask" keywords 00237 // NULL means, no such keyword in mask series 00238 // first char gives type of HMI keyword 00239 00240 static const char *RS_index2mask_keyname[] = { 00241 // size 00242 "iAR_NPIX", // RS_rgn_num 00243 "fAR_SIZE", // RS_rgn_size 00244 "fAR_AREA", // RS_rgn_area 00245 // extent 00246 NULL, // RS_rgn_min_lat 00247 NULL, // RS_rgn_min_lon 00248 NULL, // RS_rgn_max_lat 00249 NULL, // RS_rgn_max_lon 00250 // return time 00251 NULL, // RS_rgn_daysgone 00252 NULL, // RS_rgn_daysback 00253 // flux 00254 "fAR_MTOT", // RS_rgn_btot 00255 "fAR_MNET", // RS_rgn_bnet 00256 "fAR_MPOS", // RS_rgn_bpos 00257 "fAR_MNEG", // RS_rgn_bneg 00258 // flux moments 00259 NULL, // RS_rgn_bsum1 00260 NULL, // RS_rgn_bsum2 00261 NULL, // RS_rgn_bsum3 00262 NULL, // RS_rgn_bsum4 00263 // flux moments, standardized 00264 "fAR_MMEAN", // RS_rgn_bmean 00265 "fAR_MSDEV", // RS_rgn_bsdev 00266 "fAR_MSKEW", // RS_rgn_bskew 00267 "fAR_MKURT", // RS_rgn_bkurt 00268 // size 00269 NULL, // RS_ar_num 00270 NULL, // RS_ar_size 00271 NULL, // RS_ar_area 00272 // flux 00273 NULL, // RS_ar_btot 00274 NULL, // RS_ar_bnet 00275 NULL, // RS_ar_bpos 00276 NULL, // RS_ar_bneg 00277 // mean location 00278 NULL, // RS_ar_area_lat 00279 NULL, // RS_ar_area_lon 00280 NULL, // RS_ar_fwt_lat 00281 NULL, // RS_ar_fwt_lon 00282 NULL, // RS_ar_fwtpos_lat 00283 NULL, // RS_ar_fwtpos_lon 00284 NULL, // RS_ar_fwtneg_lat 00285 NULL, // RS_ar_fwtneg_lon 00286 // end 00287 }; 00288 00289 #endif // include once