17 |
|
MEANPOT Mean photospheric excess magnetic energy density in ergs per cubic centimeter |
18 |
|
TOTPOT Total photospheric magnetic energy density in ergs per cubic centimeter |
19 |
|
MEANSHR Mean shear angle (measured using Btotal) in degrees |
20 |
+ |
R_VALUE Karel Schrijver's R parameter |
21 |
|
|
22 |
|
The indices are calculated on the pixels in which the conf_disambig segment is greater than 70 and |
23 |
|
pixels in which the bitmap segment is greater than 30. These ranges are selected because the CCD |
1036 |
|
} |
1037 |
|
|
1038 |
|
/*===========================================*/ |
1039 |
+ |
/* Example function 15: R parameter as defined in Schrijver, 2007 */ |
1040 |
+ |
// |
1041 |
+ |
// Note that there is a restriction on the function fsample() |
1042 |
+ |
// If the following occurs: |
1043 |
+ |
// nx_out > floor((ny_in-1)/scale + 1) |
1044 |
+ |
// ny_out > floor((ny_in-1)/scale + 1), |
1045 |
+ |
// where n*_out are the dimensions of the output array and n*_in |
1046 |
+ |
// are the dimensions of the input array, fsample() will usually result |
1047 |
+ |
// in a segfault (though not always, depending on how the segfault was accessed.) |
1048 |
+ |
|
1049 |
|
int computeR(float *bz_err, float *los, int *dims, float *Rparam, float cdelt1, |
1050 |
|
float *rim, float *p1p0, float *p1n0, float *p1p, float *p1n, float *p1, |
1051 |
|
float *pmap, int nx1, int ny1) |
1052 |
< |
{ |
1042 |
< |
|
1052 |
> |
{ |
1053 |
|
int nx = dims[0]; |
1054 |
|
int ny = dims[1]; |
1055 |
|
int i = 0; |
1066 |
|
|
1067 |
|
// set up convolution kernel |
1068 |
|
init_fresize_gaussian(&fresgauss,sigma,20,1); |
1069 |
< |
|
1069 |
> |
|
1070 |
|
fsample(los, rim, nx, ny, nx, nx1, ny1, nx1, scale, 0, 0, 0.0); |
1071 |
+ |
|
1072 |
|
for (i = 0; i < nx1; i++) |
1073 |
|
{ |
1074 |
|
for (j = 0; j < ny1; j++) |
1084 |
|
p1n0[index]=0.0; |
1085 |
|
} |
1086 |
|
} |
1087 |
< |
|
1087 |
> |
|
1088 |
|
fresize(&fresboxcar, p1p0, p1p, nx1, ny1, nx1, nx1, ny1, nx1, 0, 0, 0.0); |
1089 |
|
fresize(&fresboxcar, p1n0, p1n, nx1, ny1, nx1, nx1, ny1, nx1, 0, 0, 0.0); |
1090 |
|
|