(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.15

version 1.14, 2013/07/04 02:16:52 version 1.15, 2013/07/08 23:02:22
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 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 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 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 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 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 619  int computeJzsmooth(float *bx, float *by
Line 614  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 636  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
  
Line 695  int computeAlpha(float *jz_err, float *b
Line 688  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 735  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=%f\n",*mean_alpha_ptr);
         printf("MEANALP_err=%f\n",*mean_alpha_err_ptr);         printf("MEANALP_err=%f\n",*mean_alpha_err_ptr);
  
Line 772  int computeHelicity(float *jz_err, float
Line 761  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 834  int computeSumAbsPerPolarity(float *jz_e
Line 823  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 885  int computeFreeEnergy(float *bx_err, flo
Line 874  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 934  int computeShearAngle(float *bx_err, flo
Line 923  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;
  


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

Karen Tian
Powered by
ViewCVS 0.9.4