(file) Return to sw_functions.c CVS log (file) (dir) Up to [Development] / JSOC / proj / sharp / apps

Diff for /JSOC/proj/sharp/apps/sw_functions.c between version 1.14 and 1.18

version 1.14, 2013/07/04 02:16:52 version 1.18, 2013/10/01 01:57:44
Line 78  int computeAbsFlux(float *bz_err, float
Line 78  int computeAbsFlux(float *bz_err, float
     int i=0;     int i=0;
     int j=0;     int j=0;
     int count_mask=0;     int count_mask=0;
     float sum=0.0;      double sum = 0.0;
     float err=0.0;      double err = 0.0;
     *absFlux = 0.0;     *absFlux = 0.0;
     *mean_vf_ptr = 0.0;     *mean_vf_ptr = 0.0;
  
Line 102  int computeAbsFlux(float *bz_err, float
Line 102  int computeAbsFlux(float *bz_err, float
      *mean_vf_ptr     = sum*cdelt1*cdelt1*(rsun_ref/rsun_obs)*(rsun_ref/rsun_obs)*100.0*100.0;      *mean_vf_ptr     = sum*cdelt1*cdelt1*(rsun_ref/rsun_obs)*(rsun_ref/rsun_obs)*100.0*100.0;
      *mean_vf_err_ptr = (sqrt(err))*fabs(cdelt1*cdelt1*(rsun_ref/rsun_obs)*(rsun_ref/rsun_obs)*100.0*100.0); // error in the unsigned flux      *mean_vf_err_ptr = (sqrt(err))*fabs(cdelt1*cdelt1*(rsun_ref/rsun_obs)*(rsun_ref/rsun_obs)*100.0*100.0); // error in the unsigned flux
      *count_mask_ptr  = count_mask;      *count_mask_ptr  = count_mask;
      printf("cdelt1=%f\n",cdelt1);       //printf("cdelt1=%f\n",cdelt1);
      printf("rsun_obs=%f\n",rsun_obs);       //printf("rsun_obs=%f\n",rsun_obs);
      printf("rsun_ref=%f\n",rsun_ref);       //printf("rsun_ref=%f\n",rsun_ref);
      printf("CMASK=%g\n",*count_mask_ptr);       //printf("CMASK=%g\n",*count_mask_ptr);
      printf("USFLUX=%g\n",*mean_vf_ptr);       //printf("USFLUX=%g\n",*mean_vf_ptr);
      printf("sum=%f\n",sum);       //printf("sum=%f\n",sum);
      printf("USFLUX_err=%g\n",*mean_vf_err_ptr);       //printf("USFLUX_err=%g\n",*mean_vf_err_ptr);
      return 0;      return 0;
 } }
  
Line 126  int computeBh(float *bx_err, float *by_e
Line 126  int computeBh(float *bx_err, float *by_e
     int i=0;     int i=0;
     int j=0;     int j=0;
     int count_mask=0;     int count_mask=0;
     float sum=0.0;      double sum = 0.0;
     *mean_hf_ptr = 0.0;     *mean_hf_ptr = 0.0;
  
     if (nx <= 0 || ny <= 0) return 1;     if (nx <= 0 || ny <= 0) return 1;
Line 162  int computeGamma(float *bz_err, float *b
Line 162  int computeGamma(float *bz_err, float *b
     int i=0;     int i=0;
     int j=0;     int j=0;
     int count_mask=0;     int count_mask=0;
     float sum=0.0;      double sum = 0.0;
     float err=0.0;      double err = 0.0;
     float err_value=0.0;  
     *mean_gamma_ptr=0.0;     *mean_gamma_ptr=0.0;
  
     if (nx <= 0 || ny <= 0) return 1;     if (nx <= 0 || ny <= 0) return 1;
Line 189  int computeGamma(float *bz_err, float *b
Line 188  int computeGamma(float *bz_err, float *b
  
      *mean_gamma_ptr = sum/count_mask;      *mean_gamma_ptr = sum/count_mask;
      *mean_gamma_err_ptr = (sqrt(err*err))/(count_mask*100.0); // error in the quantity (sum)/(count_mask)      *mean_gamma_err_ptr = (sqrt(err*err))/(count_mask*100.0); // error in the quantity (sum)/(count_mask)
      printf("MEANGAM=%f\n",*mean_gamma_ptr);       //printf("MEANGAM=%f\n",*mean_gamma_ptr);
      printf("MEANGAM_err=%f\n",*mean_gamma_err_ptr);       //printf("MEANGAM_err=%f\n",*mean_gamma_err_ptr);
      return 0;      return 0;
 } }
  
Line 234  int computeBtotalderivative(float *bt, i
Line 233  int computeBtotalderivative(float *bt, i
     int i=0;     int i=0;
     int j=0;     int j=0;
     int count_mask=0;     int count_mask=0;
     float sum=0.0;      double sum = 0.0;
     float err = 0.0;      double err = 0.0;
     *mean_derivative_btotal_ptr = 0.0;     *mean_derivative_btotal_ptr = 0.0;
  
     if (nx <= 0 || ny <= 0) return 1;     if (nx <= 0 || ny <= 0) return 1;
Line 300  int computeBtotalderivative(float *bt, i
Line 299  int computeBtotalderivative(float *bt, i
  
         *mean_derivative_btotal_ptr     = (sum)/(count_mask); // would be divided by ((nx-2)*(ny-2)) if shape of count_mask = shape of magnetogram         *mean_derivative_btotal_ptr     = (sum)/(count_mask); // would be divided by ((nx-2)*(ny-2)) if shape of count_mask = shape of magnetogram
         *mean_derivative_btotal_err_ptr = (sqrt(err))/(count_mask); // error in the quantity (sum)/(count_mask)         *mean_derivative_btotal_err_ptr = (sqrt(err))/(count_mask); // error in the quantity (sum)/(count_mask)
         printf("MEANGBT=%f\n",*mean_derivative_btotal_ptr);          //printf("MEANGBT=%f\n",*mean_derivative_btotal_ptr);
         printf("MEANGBT_err=%f\n",*mean_derivative_btotal_err_ptr);          //printf("MEANGBT_err=%f\n",*mean_derivative_btotal_err_ptr);
         return 0;         return 0;
 } }
  
Line 317  int computeBhderivative(float *bh, float
Line 316  int computeBhderivative(float *bh, float
      int i=0;      int i=0;
      int j=0;      int j=0;
      int count_mask=0;      int count_mask=0;
      float sum=0.0;       double sum= 0.0;
      float err =0.0;       double err =0.0;
      *mean_derivative_bh_ptr = 0.0;      *mean_derivative_bh_ptr = 0.0;
  
         if (nx <= 0 || ny <= 0) return 1;         if (nx <= 0 || ny <= 0) return 1;
Line 383  int computeBhderivative(float *bh, float
Line 382  int computeBhderivative(float *bh, float
  
         *mean_derivative_bh_ptr     = (sum)/(count_mask); // would be divided by ((nx-2)*(ny-2)) if shape of count_mask = shape of magnetogram         *mean_derivative_bh_ptr     = (sum)/(count_mask); // would be divided by ((nx-2)*(ny-2)) if shape of count_mask = shape of magnetogram
         *mean_derivative_bh_err_ptr = (sqrt(err))/(count_mask); // error in the quantity (sum)/(count_mask)         *mean_derivative_bh_err_ptr = (sqrt(err))/(count_mask); // error in the quantity (sum)/(count_mask)
         printf("MEANGBH=%f\n",*mean_derivative_bh_ptr);          //printf("MEANGBH=%f\n",*mean_derivative_bh_ptr);
         printf("MEANGBH_err=%f\n",*mean_derivative_bh_err_ptr);          //printf("MEANGBH_err=%f\n",*mean_derivative_bh_err_ptr);
  
         return 0;         return 0;
 } }
Line 400  int computeBzderivative(float *bz, float
Line 399  int computeBzderivative(float *bz, float
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float sum = 0.0;          double sum = 0.0;
         float err = 0.0;          double err = 0.0;
         *mean_derivative_bz_ptr = 0.0;         *mean_derivative_bz_ptr = 0.0;
  
         if (nx <= 0 || ny <= 0) return 1;         if (nx <= 0 || ny <= 0) return 1;
Line 475  int computeBzderivative(float *bz, float
Line 474  int computeBzderivative(float *bz, float
  
         *mean_derivative_bz_ptr = (sum)/(count_mask); // would be divided by ((nx-2)*(ny-2)) if shape of count_mask = shape of magnetogram         *mean_derivative_bz_ptr = (sum)/(count_mask); // would be divided by ((nx-2)*(ny-2)) if shape of count_mask = shape of magnetogram
         *mean_derivative_bz_err_ptr = (sqrt(err))/(count_mask); // error in the quantity (sum)/(count_mask)         *mean_derivative_bz_err_ptr = (sqrt(err))/(count_mask); // error in the quantity (sum)/(count_mask)
         printf("MEANGBZ=%f\n",*mean_derivative_bz_ptr);          //printf("MEANGBZ=%f\n",*mean_derivative_bz_ptr);
         printf("MEANGBZ_err=%f\n",*mean_derivative_bz_err_ptr);          //printf("MEANGBZ_err=%f\n",*mean_derivative_bz_err_ptr);
  
         return 0;         return 0;
 } }
Line 528  int computeJz(float *bx_err, float *by_e
Line 527  int computeJz(float *bx_err, float *by_e
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float curl=0.0;  
         float us_i=0.0;  
         float test_perimeter=0.0;  
         float mean_curl=0.0;  
  
         if (nx <= 0 || ny <= 0) return 1;         if (nx <= 0 || ny <= 0) return 1;
  
Line 585  int computeJz(float *bx_err, float *by_e
Line 580  int computeJz(float *bx_err, float *by_e
              dery[j * nx + i] = ( (3*bx[j * nx + i]) + (-4*bx[(j-1) * nx + i]) - (-bx[(j-2) * nx + i]) )*0.5;              dery[j * nx + i] = ( (3*bx[j * nx + i]) + (-4*bx[(j-1) * nx + i]) - (-bx[(j-2) * nx + i]) )*0.5;
           }           }
  
           for (i = 1; i <= nx-2; i++)
         for (i = 0; i <= nx-1; i++)  
           {           {
             for (j = 0; j <= ny-1; j++)              for (j = 1; j <= ny-2; j++)
             {             {
                // calculate jz at all points                // calculate jz at all points
   
                jz[j * nx + i] = (derx[j * nx + i]-dery[j * nx + i]);       // jz is in units of Gauss/pix                jz[j * nx + i] = (derx[j * nx + i]-dery[j * nx + i]);       // jz is in units of Gauss/pix
   
                  // the next 7 lines can be used with a for loop that goes from i=0;i<=nx-1 and j=0;j<=ny-1.
                  //int i1, j1,i2, j2;
                  //i1 = i + 1 ; if (i1 >nx-1){i1=nx-1;}
                  //j1 = j + 1 ; if (j1 >ny-1){j1=ny-1;}
                  //i2 = i - 1; if (i2 < 0){i2 = 0;}
                  //j2 = j - 1; if (j2 < 0){i2 = 0;}
                  //jz_err[j * nx + i]        = 0.5*sqrt( (bx_err[j1 * nx + i]*bx_err[j1 * nx + i]) + (bx_err[j2 * nx + i]*bx_err[j2 * nx + i]) +
                  //                                     (by_err[j * nx + i1]*by_err[j * nx + i1]) + (by_err[j * nx + i2]*by_err[j * nx + i2]) ) ;
   
                jz_err[j * nx + i]=0.5*sqrt( (bx_err[(j+1) * nx + i]*bx_err[(j+1) * nx + i]) + (bx_err[(j-1) * nx + i]*bx_err[(j-1) * nx + i]) +                jz_err[j * nx + i]=0.5*sqrt( (bx_err[(j+1) * nx + i]*bx_err[(j+1) * nx + i]) + (bx_err[(j-1) * nx + i]*bx_err[(j-1) * nx + i]) +
                                             (by_err[j * nx + (i+1)]*by_err[j * nx + (i+1)]) + (by_err[j * nx + (i-1)]*by_err[j * nx + (i-1)]) ) ;                                             (by_err[j * nx + (i+1)]*by_err[j * nx + (i+1)]) + (by_err[j * nx + (i-1)]*by_err[j * nx + (i-1)]) ) ;
                jz_err_squared[j * nx + i]=(jz_err[j * nx + i]*jz_err[j * nx + i]);                jz_err_squared[j * nx + i]=(jz_err[j * nx + i]*jz_err[j * nx + i]);
                count_mask++;                count_mask++;
   
             }             }
           }           }
   
         return 0;         return 0;
 } }
  
Line 619  int computeJzsmooth(float *bx, float *by
Line 624  int computeJzsmooth(float *bx, float *by
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float curl=0.0;          double curl = 0.0;
         float us_i=0.0;          double us_i = 0.0;
         float test_perimeter=0.0;          double err = 0.0;
         float mean_curl=0.0;  
         float err=0.0;  
  
         if (nx <= 0 || ny <= 0) return 1;         if (nx <= 0 || ny <= 0) return 1;
  
Line 643  int computeJzsmooth(float *bx, float *by
Line 646  int computeJzsmooth(float *bx, float *by
             }             }
           }           }
  
         /* Calculate mean vertical current density (mean_curl) and total unsigned vertical current (us_i) using smoothed Jz array and continue conditions above */          /* Calculate mean vertical current density (mean_jz) and total unsigned vertical current (us_i) using smoothed Jz array and continue conditions above */
         *mean_jz_ptr     = curl/(count_mask);        /* mean_jz gets populated as MEANJZD */         *mean_jz_ptr     = curl/(count_mask);        /* mean_jz gets populated as MEANJZD */
         *mean_jz_err_ptr = (sqrt(err))*fabs(((rsun_obs/rsun_ref)*(0.00010)*(1/MUNAUGHT)*(1000.))/(count_mask)); // error in the quantity MEANJZD         *mean_jz_err_ptr = (sqrt(err))*fabs(((rsun_obs/rsun_ref)*(0.00010)*(1/MUNAUGHT)*(1000.))/(count_mask)); // error in the quantity MEANJZD
  
         *us_i_ptr        = (us_i);                   /* us_i gets populated as TOTUSJZ */         *us_i_ptr        = (us_i);                   /* us_i gets populated as TOTUSJZ */
         *us_i_err_ptr    = (sqrt(err))*fabs((cdelt1/1)*(rsun_ref/rsun_obs)*(0.00010)*(1/MUNAUGHT)); // error in the quantity TOTUSJZ         *us_i_err_ptr    = (sqrt(err))*fabs((cdelt1/1)*(rsun_ref/rsun_obs)*(0.00010)*(1/MUNAUGHT)); // error in the quantity TOTUSJZ
  
         printf("MEANJZD=%f\n",*mean_jz_ptr);          //printf("MEANJZD=%f\n",*mean_jz_ptr);
         printf("MEANJZD_err=%f\n",*mean_jz_err_ptr);          //printf("MEANJZD_err=%f\n",*mean_jz_err_ptr);
  
         printf("TOTUSJZ=%g\n",*us_i_ptr);          //printf("TOTUSJZ=%g\n",*us_i_ptr);
         printf("TOTUSJZ_err=%g\n",*us_i_err_ptr);          //printf("TOTUSJZ_err=%g\n",*us_i_err_ptr);
  
         return 0;         return 0;
  
Line 695  int computeAlpha(float *jz_err, float *b
Line 698  int computeAlpha(float *jz_err, float *b
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float a=0.0;          double a = 0.0;
         float b=0.0;          double b = 0.0;
         float c=0.0;          double c = 0.0;
         float d=0.0;          double d = 0.0;
         float bznew=0.0;          double sum1 = 0.0;
         float alpha2=0.0;          double sum2 = 0.0;
         float sum1=0.0;          double sum3 = 0.0;
         float sum2=0.0;          double sum4 = 0.0;
         float sum3=0.0;          double sum = 0.0;
         float sum4=0.0;          double sum5 = 0.0;
         float sum=0.0;          double sum6 = 0.0;
         float sum5=0.0;          double sum_err = 0.0;
         float sum6=0.0;  
         float sum_err=0.0;  
  
         if (nx <= 0 || ny <= 0) return 1;         if (nx <= 0 || ny <= 0) return 1;
  
Line 744  int computeAlpha(float *jz_err, float *b
Line 745  int computeAlpha(float *jz_err, float *b
         *mean_alpha_ptr = sum; /* Units are 1/Mm */         *mean_alpha_ptr = sum; /* Units are 1/Mm */
         *mean_alpha_err_ptr    = (sqrt(sum_err*sum_err)) / ((a+b+c+d)*100.0); // error in the quantity (sum)/(count_mask); factor of 100 comes from converting percent         *mean_alpha_err_ptr    = (sqrt(sum_err*sum_err)) / ((a+b+c+d)*100.0); // error in the quantity (sum)/(count_mask); factor of 100 comes from converting percent
  
           //printf("MEANALP=%f\n",*mean_alpha_ptr);
           //printf("MEANALP_err=%f\n",*mean_alpha_err_ptr);
         printf("MEANALP=%f\n",*mean_alpha_ptr);  
         printf("MEANALP_err=%f\n",*mean_alpha_err_ptr);  
  
         return 0;         return 0;
 } }
Line 772  int computeHelicity(float *jz_err, float
Line 771  int computeHelicity(float *jz_err, float
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float sum=0.0;          double sum = 0.0;
         float sum2=0.0;          double sum2 = 0.0;
         float sum_err=0.0;          double sum_err = 0.0;
  
         if (nx <= 0 || ny <= 0) return 1;         if (nx <= 0 || ny <= 0) return 1;
  
Line 802  int computeHelicity(float *jz_err, float
Line 801  int computeHelicity(float *jz_err, float
         *total_us_ih_err_ptr  = (sqrt(sum_err*sum_err)) / (100.0)               ;  // error in the quantity TOTUSJH         *total_us_ih_err_ptr  = (sqrt(sum_err*sum_err)) / (100.0)               ;  // error in the quantity TOTUSJH
         *total_abs_ih_err_ptr = (sqrt(sum_err*sum_err)) / (100.0)               ;  // error in the quantity ABSNJZH         *total_abs_ih_err_ptr = (sqrt(sum_err*sum_err)) / (100.0)               ;  // error in the quantity ABSNJZH
  
         printf("MEANJZH=%f\n",*mean_ih_ptr);          //printf("MEANJZH=%f\n",*mean_ih_ptr);
         printf("MEANJZH_err=%f\n",*mean_ih_err_ptr);          //printf("MEANJZH_err=%f\n",*mean_ih_err_ptr);
  
         printf("TOTUSJH=%f\n",*total_us_ih_ptr);          //printf("TOTUSJH=%f\n",*total_us_ih_ptr);
         printf("TOTUSJH_err=%f\n",*total_us_ih_err_ptr);          //printf("TOTUSJH_err=%f\n",*total_us_ih_err_ptr);
  
         printf("ABSNJZH=%f\n",*total_abs_ih_ptr);          //printf("ABSNJZH=%f\n",*total_abs_ih_ptr);
         printf("ABSNJZH_err=%f\n",*total_abs_ih_err_ptr);          //printf("ABSNJZH_err=%f\n",*total_abs_ih_err_ptr);
  
         return 0;         return 0;
 } }
Line 834  int computeSumAbsPerPolarity(float *jz_e
Line 833  int computeSumAbsPerPolarity(float *jz_e
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float sum1=0.0;          double sum1=0.0;
         float sum2=0.0;          double sum2=0.0;
         float err=0.0;          double err=0.0;
         *totaljzptr=0.0;         *totaljzptr=0.0;
  
         if (nx <= 0 || ny <= 0) return 1;         if (nx <= 0 || ny <= 0) return 1;
Line 847  int computeSumAbsPerPolarity(float *jz_e
Line 846  int computeSumAbsPerPolarity(float *jz_e
               {               {
                 if ( mask[j * nx + i] < 70 || bitmask[j * nx + i] < 30 ) continue;                 if ( mask[j * nx + i] < 70 || bitmask[j * nx + i] < 30 ) continue;
                 if isnan(bz[j * nx + i]) continue;                 if isnan(bz[j * nx + i]) continue;
                   if isnan(jz[j * nx + i]) continue;
                 if (bz[j * nx + i] >  0) sum1 += ( jz[j * nx + i])*(1/cdelt1)*(0.00010)*(1/MUNAUGHT)*(rsun_ref/rsun_obs);                 if (bz[j * nx + i] >  0) sum1 += ( jz[j * nx + i])*(1/cdelt1)*(0.00010)*(1/MUNAUGHT)*(rsun_ref/rsun_obs);
                 if (bz[j * nx + i] <= 0) sum2 += ( jz[j * nx + i])*(1/cdelt1)*(0.00010)*(1/MUNAUGHT)*(rsun_ref/rsun_obs);                 if (bz[j * nx + i] <= 0) sum2 += ( jz[j * nx + i])*(1/cdelt1)*(0.00010)*(1/MUNAUGHT)*(rsun_ref/rsun_obs);
                 err += (jz_err[j * nx + i]*jz_err[j * nx + i]);                 err += (jz_err[j * nx + i]*jz_err[j * nx + i]);
Line 856  int computeSumAbsPerPolarity(float *jz_e
Line 856  int computeSumAbsPerPolarity(float *jz_e
  
         *totaljzptr    = fabs(sum1) + fabs(sum2);  /* Units are A */         *totaljzptr    = fabs(sum1) + fabs(sum2);  /* Units are A */
         *totaljz_err_ptr = sqrt(err)*(1/cdelt1)*fabs((0.00010)*(1/MUNAUGHT)*(rsun_ref/rsun_obs));         *totaljz_err_ptr = sqrt(err)*(1/cdelt1)*fabs((0.00010)*(1/MUNAUGHT)*(rsun_ref/rsun_obs));
         printf("SAVNCPP=%g\n",*totaljzptr);          //printf("SAVNCPP=%g\n",*totaljzptr);
         printf("SAVNCPP_err=%g\n",*totaljz_err_ptr);          //printf("SAVNCPP_err=%g\n",*totaljz_err_ptr);
  
         return 0;         return 0;
 } }
Line 885  int computeFreeEnergy(float *bx_err, flo
Line 885  int computeFreeEnergy(float *bx_err, flo
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float sum=0.0;          double sum = 0.0;
         float sum1=0.0;          double sum1 = 0.0;
         float err=0.0;          double err = 0.0;
         *totpotptr=0.0;         *totpotptr=0.0;
         *meanpotptr=0.0;         *meanpotptr=0.0;
  
Line 914  int computeFreeEnergy(float *bx_err, flo
Line 914  int computeFreeEnergy(float *bx_err, flo
         *totpotptr       = (sum)/(8.*PI);         *totpotptr       = (sum)/(8.*PI);
         *totpot_err_ptr  = (sqrt(err))*fabs(cdelt1*cdelt1*(rsun_ref/rsun_obs)*(rsun_ref/rsun_obs)*100.0*100.0*(1/(8.*PI)));         *totpot_err_ptr  = (sqrt(err))*fabs(cdelt1*cdelt1*(rsun_ref/rsun_obs)*(rsun_ref/rsun_obs)*100.0*100.0*(1/(8.*PI)));
  
         printf("MEANPOT=%g\n",*meanpotptr);          //printf("MEANPOT=%g\n",*meanpotptr);
         printf("MEANPOT_err=%g\n",*meanpot_err_ptr);          //printf("MEANPOT_err=%g\n",*meanpot_err_ptr);
  
         printf("TOTPOT=%g\n",*totpotptr);          //printf("TOTPOT=%g\n",*totpotptr);
         printf("TOTPOT_err=%g\n",*totpot_err_ptr);          //printf("TOTPOT_err=%g\n",*totpot_err_ptr);
  
         return 0;         return 0;
 } }
Line 934  int computeShearAngle(float *bx_err, flo
Line 934  int computeShearAngle(float *bx_err, flo
         int i=0;         int i=0;
         int j=0;         int j=0;
         int count_mask=0;         int count_mask=0;
         float dotproduct = 0.0;          double dotproduct = 0.0;
         float magnitude_potential = 0.0;          double magnitude_potential = 0.0;
         float magnitude_vector=0.0;          double magnitude_vector = 0.0;
         float shear_angle=0.0;          double shear_angle = 0.0;
         float err=0.0;          double err = 0.0;
         float sum = 0.0;          double sum = 0.0;
         float count=0.0;          double count = 0.0;
         *area_w_shear_gt_45ptr=0.0;         *area_w_shear_gt_45ptr=0.0;
         *meanshear_angleptr=0.0;         *meanshear_angleptr=0.0;
  
Line 974  int computeShearAngle(float *bx_err, flo
Line 974  int computeShearAngle(float *bx_err, flo
         *meanshear_angle_err_ptr = (sqrt(err*err))/(count);  // error in the quantity (sum)/(count_mask)         *meanshear_angle_err_ptr = (sqrt(err*err))/(count);  // error in the quantity (sum)/(count_mask)
         *area_w_shear_gt_45ptr   = (count_mask/(count))*(100.0);/* The area here is a fractional area -- the % of the total area */         *area_w_shear_gt_45ptr   = (count_mask/(count))*(100.0);/* The area here is a fractional area -- the % of the total area */
  
         printf("MEANSHR=%f\n",*meanshear_angleptr);          //printf("MEANSHR=%f\n",*meanshear_angleptr);
         printf("MEANSHR_err=%f\n",*meanshear_angle_err_ptr);          //printf("MEANSHR_err=%f\n",*meanshear_angle_err_ptr);
  
         return 0;         return 0;
 } }


Legend:
Removed from v.1.14  
changed lines
  Added in v.1.18

Karen Tian
Powered by
ViewCVS 0.9.4