(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.5 and 1.7

version 1.5, 2013/01/14 18:27:45 version 1.7, 2013/02/08 23:41:13
Line 456  int computeBzderivative(float *bz, int *
Line 456  int computeBzderivative(float *bz, int *
 // //
 //  The units of total unsigned vertical current (us_i) are simply in A. In this case, we would have the following: //  The units of total unsigned vertical current (us_i) are simply in A. In this case, we would have the following:
 //  (Gauss/pix)(1/CDELT1)(RSUN_OBS/RSUN_REF)(0.00010)(1/MUNAUGHT)(RSUN_REF/RSUN_OBS)(RSUN_REF/RSUN_OBS)(1000.) //  (Gauss/pix)(1/CDELT1)(RSUN_OBS/RSUN_REF)(0.00010)(1/MUNAUGHT)(RSUN_REF/RSUN_OBS)(RSUN_REF/RSUN_OBS)(1000.)
 //  =(Gauss/pix)(1/CDELT1)(0.0010)(1/MUNAUGHT)(RSUN_REF/RSUN_OBS)(1000.)  
 //  =(Gauss/pix)(1/0.5)(10^-4)(4*PI*10^7)(722500)(1000.) //  =(Gauss/pix)(1/0.5)(10^-4)(4*PI*10^7)(722500)(1000.)
 //  =(Gauss/pix)(1/CDELT1)(0.00010)(1/MUNAUGHT)(RSUN_REF/RSUN_OBS)(1000.) //  =(Gauss/pix)(1/CDELT1)(0.00010)(1/MUNAUGHT)(RSUN_REF/RSUN_OBS)(1000.)
  
Line 543  int computeJz(float *bx, float *by, int
Line 542  int computeJz(float *bx, float *by, int
  
 /* Example function 9:  Compute quantities on smoothed Jz array */ /* Example function 9:  Compute quantities on smoothed Jz array */
  
   // All of the subsequent functions, including this one, use a smoothed Jz array. The smoothing is performed by Jesper's
   // fresize routines. These routines are located at /cvs/JSOC/proj/libs/interpolate. A Gaussian with a FWHM of 4 pixels
   // and truncation width of 12 pixels is used to smooth the array; however, a quick analysis shows that the mean values
   // of qualities like Jz and helicity do not change much as a result of smoothing. The smoothed array will, of course,
   // give a lower total Jz as the stron field pixels have been smoothed out to neighboring weaker field pixels.
   
 int computeJzsmooth(float *bx, float *by, int *dims, float *jz_smooth, int computeJzsmooth(float *bx, float *by, int *dims, float *jz_smooth,
                           float *mean_jz_ptr, float *us_i_ptr, int *mask, int *bitmask,                           float *mean_jz_ptr, float *us_i_ptr, int *mask, int *bitmask,
                           float cdelt1, double rsun_ref, double rsun_obs,float *derx, float *dery)                           float cdelt1, double rsun_ref, double rsun_obs,float *derx, float *dery)
Line 568  int computeJzsmooth(float *bx, float *by
Line 573  int computeJzsmooth(float *bx, float *by
                if isnan(dery[j * nx + i]) continue;                if isnan(dery[j * nx + i]) continue;
                if isnan(jz_smooth[j * nx + i]) continue;                if isnan(jz_smooth[j * nx + i]) continue;
                //printf("%d,%d,%f\n",i,j,jz_smooth[j * nx + i]);                //printf("%d,%d,%f\n",i,j,jz_smooth[j * nx + i]);
                curl +=     (jz_smooth[j * nx + i])*(1/cdelt1)*(rsun_obs/rsun_ref)*(0.00010)*(1/MUNAUGHT)*(1000.); /* curl is in units of mA / m^2 */                 curl +=     (jz_smooth[j * nx + i])*(1/cdelt1)*(rsun_ref/rsun_obs)*(0.00010)*(1/MUNAUGHT)*(1000.); /* curl is in units of mA / m^2 */
                us_i += fabs(jz_smooth[j * nx + i])*(1/cdelt1)*(rsun_ref/rsun_obs)*(0.00010)*(1/MUNAUGHT);         /* us_i is in units of A  / m^2 */                us_i += fabs(jz_smooth[j * nx + i])*(1/cdelt1)*(rsun_ref/rsun_obs)*(0.00010)*(1/MUNAUGHT);         /* us_i is in units of A  / m^2 */
                count_mask++;                count_mask++;
             }             }
Line 596  int computeJzsmooth(float *bx, float *by
Line 601  int computeJzsmooth(float *bx, float *by
        // (abs(sum of all Jz at positive Bz) + abs(sum of all Jz at negative Bz)) = avg Jz        // (abs(sum of all Jz at positive Bz) + abs(sum of all Jz at negative Bz)) = avg Jz
        // avg alpha = avg Jz / avg Bz        // avg alpha = avg Jz / avg Bz
  
   // The sign is assigned as follows:
   // If the sum of all Bz is greater than 0, then evaluate the sum of Jz at the positive Bz pixels.
   // If this value is > 0, then alpha is > 0.
   // If this value is < 0, then alpha is <0.
   //
   // If the sum of all Bz is less than 0, then evaluate the sum of Jz at the negative Bz pixels.
   // If this value is > 0, then alpha is < 0.
   // If this value is < 0, then alpha is > 0.
   
 // The units of alpha are in 1/Mm // The units of alpha are in 1/Mm
 // The units of Jz are in Gauss/pix; the units of Bz are in Gauss. // The units of Jz are in Gauss/pix; the units of Bz are in Gauss.
 // //


Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

Karen Tian
Powered by
ViewCVS 0.9.4