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

Diff for /JSOC/proj/sharp/apps/sharp.c between version 1.7 and 1.9

version 1.7, 2013/01/03 03:53:18 version 1.9, 2013/01/14 19:51:56
Line 749  int mapScaler(DRMS_Record_t *sharpRec, D
Line 749  int mapScaler(DRMS_Record_t *sharpRec, D
 //      drms_array_convert_inplace(outSeg->info->type, 0, 1, outArray);         // Jan 02 2013 //      drms_array_convert_inplace(outSeg->info->type, 0, 1, outArray);         // Jan 02 2013
  
         outSeg->axis[0] = outArray->axis[0]; outSeg->axis[1] = outArray->axis[1];         outSeg->axis[0] = outArray->axis[0]; outSeg->axis[1] = outArray->axis[1];
         outArray->parent_segment = outSeg;  //      outArray->parent_segment = outSeg;
 //      outArray->israw = 0;            // always compressed          outArray->israw = 0;            // always compressed
         outArray->bzero = outSeg->bzero;         outArray->bzero = outSeg->bzero;
         outArray->bscale = outSeg->bscale;         outArray->bscale = outSeg->bscale;
  
Line 825  int mapVectorB(DRMS_Record_t *sharpRec,
Line 825  int mapVectorB(DRMS_Record_t *sharpRec,
                 outSeg = drms_segment_lookup(sharpRec, segName[iSeg]);                 outSeg = drms_segment_lookup(sharpRec, segName[iSeg]);
                 outArray = drms_array_create(DRMS_TYPE_FLOAT, 2, dims, data_prt[iSeg], &status);                 outArray = drms_array_create(DRMS_TYPE_FLOAT, 2, dims, data_prt[iSeg], &status);
                 outSeg->axis[0] = outArray->axis[0]; outSeg->axis[1] = outArray->axis[1];                 outSeg->axis[0] = outArray->axis[0]; outSeg->axis[1] = outArray->axis[1];
                 outArray->parent_segment = outSeg;  //              outArray->parent_segment = outSeg;
 //              outArray->israw = 0;                  outArray->israw = 0;
                 outArray->bzero = outSeg->bzero;                 outArray->bzero = outSeg->bzero;
                 outArray->bscale = outSeg->bscale;                 outArray->bscale = outSeg->bscale;
                 status = drms_segment_write(outSeg, outArray, 0);                 status = drms_segment_write(outSeg, outArray, 0);
Line 877  int mapVectorBErr(DRMS_Record_t *sharpRe
Line 877  int mapVectorBErr(DRMS_Record_t *sharpRe
                 outSeg = drms_segment_lookup(sharpRec, segName[iSeg]);                 outSeg = drms_segment_lookup(sharpRec, segName[iSeg]);
                 outArray = drms_array_create(DRMS_TYPE_FLOAT, 2, dims, data_prt[iSeg], &status);                 outArray = drms_array_create(DRMS_TYPE_FLOAT, 2, dims, data_prt[iSeg], &status);
                 outSeg->axis[0] = outArray->axis[0]; outSeg->axis[1] = outArray->axis[1];                 outSeg->axis[0] = outArray->axis[0]; outSeg->axis[1] = outArray->axis[1];
                 outArray->parent_segment = outSeg;  //              outArray->parent_segment = outSeg;
 //              outArray->israw = 0;                  outArray->israw = 0;
                 outArray->bzero = outSeg->bzero;                 outArray->bzero = outSeg->bzero;
                 outArray->bscale = outSeg->bscale;                 outArray->bscale = outSeg->bscale;
                 status = drms_segment_write(outSeg, outArray, 0);                 status = drms_segment_write(outSeg, outArray, 0);
Line 1628  int writeCutout(DRMS_Record_t *outRec, D
Line 1628  int writeCutout(DRMS_Record_t *outRec, D
 //      drms_array_convert_inplace(outSeg->info->type, 0, 1, cutoutArray);      // Jan 02 2013 //      drms_array_convert_inplace(outSeg->info->type, 0, 1, cutoutArray);      // Jan 02 2013
         outSeg->axis[0] = cutoutArray->axis[0];         outSeg->axis[0] = cutoutArray->axis[0];
         outSeg->axis[1] = cutoutArray->axis[1];         outSeg->axis[1] = cutoutArray->axis[1];
         cutoutArray->parent_segment = outSeg;  //      cutoutArray->parent_segment = outSeg;
 //      cutoutArray->israw = 0;         // always compressed          cutoutArray->israw = 0;         // always compressed
     cutoutArray->bzero = outSeg->bzero;     cutoutArray->bzero = outSeg->bzero;
     cutoutArray->bscale = outSeg->bscale;               // Same as inArray's     cutoutArray->bscale = outSeg->bscale;               // Same as inArray's
         status = drms_segment_write(outSeg, cutoutArray, 0);         status = drms_segment_write(outSeg, cutoutArray, 0);
Line 1704  void computeSWIndex(struct swIndex *swKe
Line 1704  void computeSWIndex(struct swIndex *swKe
         float *bh = (float *) (malloc(nxny * sizeof(float)));         float *bh = (float *) (malloc(nxny * sizeof(float)));
         float *bt = (float *) (malloc(nxny * sizeof(float)));         float *bt = (float *) (malloc(nxny * sizeof(float)));
         float *jz = (float *) (malloc(nxny * sizeof(float)));         float *jz = (float *) (malloc(nxny * sizeof(float)));
           float *jz_smooth = (float *) (malloc(nxny * sizeof(float)));
         float *bpx = (float *) (malloc(nxny * sizeof(float)));         float *bpx = (float *) (malloc(nxny * sizeof(float)));
         float *bpy = (float *) (malloc(nxny * sizeof(float)));         float *bpy = (float *) (malloc(nxny * sizeof(float)));
         float *bpz = (float *) (malloc(nxny * sizeof(float)));         float *bpz = (float *) (malloc(nxny * sizeof(float)));
Line 1716  void computeSWIndex(struct swIndex *swKe
Line 1717  void computeSWIndex(struct swIndex *swKe
         float *derx_bz = (float *) (malloc(nxny * sizeof(float)));         float *derx_bz = (float *) (malloc(nxny * sizeof(float)));
         float *dery_bz = (float *) (malloc(nxny * sizeof(float)));         float *dery_bz = (float *) (malloc(nxny * sizeof(float)));
  
         // Compute          // The Computations
  
         if (computeAbsFlux(bz, dims, &(swKeys_ptr->absFlux), &(swKeys_ptr->mean_vf),         if (computeAbsFlux(bz, dims, &(swKeys_ptr->absFlux), &(swKeys_ptr->mean_vf),
                                            mask, bitmask, cdelt1, rsun_ref, rsun_obs)){                                            mask, bitmask, cdelt1, rsun_ref, rsun_obs)){
Line 1743  void computeSWIndex(struct swIndex *swKe
Line 1744  void computeSWIndex(struct swIndex *swKe
         if (computeBzderivative(bz, dims, &(swKeys_ptr->mean_derivative_bz), mask, bitmask, derx_bz, dery_bz))         if (computeBzderivative(bz, dims, &(swKeys_ptr->mean_derivative_bz), mask, bitmask, derx_bz, dery_bz))
                 swKeys_ptr->mean_derivative_bz = DRMS_MISSING_FLOAT; // If fail, fill in NaN                 swKeys_ptr->mean_derivative_bz = DRMS_MISSING_FLOAT; // If fail, fill in NaN
  
           computeJz(bx, by, dims, jz, mask, bitmask, cdelt1, rsun_ref, rsun_obs, derx, dery);
  
           struct fresize_struct convolution_array;
           init_fresize_gaussian(&convolution_array, 4.0f, 12, 1);
           fresize(&convolution_array, jz, jz_smooth, nx, ny, nx, nx, ny, nx, 0, 0, 0.0f);
  
         if(computeJz(bx, by, dims, jz, &(swKeys_ptr->mean_jz), &(swKeys_ptr->us_i), mask, bitmask,          if(computeJzsmooth(bx, by, dims, jz_smooth, &(swKeys_ptr->mean_jz), &(swKeys_ptr->us_i), mask, bitmask,
                                  cdelt1, rsun_ref, rsun_obs, derx, dery)) {                                   cdelt1, rsun_ref, rsun_obs, derx, dery))
           {
                 swKeys_ptr->mean_jz = DRMS_MISSING_FLOAT;                 swKeys_ptr->mean_jz = DRMS_MISSING_FLOAT;
                 swKeys_ptr->us_i = DRMS_MISSING_FLOAT;                 swKeys_ptr->us_i = DRMS_MISSING_FLOAT;
         }         }
   
         printf("swKeys_ptr->mean_jz=%f\n",swKeys_ptr->mean_jz);         printf("swKeys_ptr->mean_jz=%f\n",swKeys_ptr->mean_jz);
  
         if (computeAlpha(bz, dims, jz, &(swKeys_ptr->mean_alpha), mask, bitmask, cdelt1, rsun_ref, rsun_obs))  
           if (computeAlpha(bz, dims, jz_smooth, &(swKeys_ptr->mean_alpha), mask, bitmask, cdelt1, rsun_ref, rsun_obs))
                 swKeys_ptr->mean_alpha = DRMS_MISSING_FLOAT;                 swKeys_ptr->mean_alpha = DRMS_MISSING_FLOAT;
  
         if (computeHelicity(bz, dims, jz, &(swKeys_ptr->mean_ih),          if (computeHelicity(bz, dims, jz_smooth, &(swKeys_ptr->mean_ih),
                                                 &(swKeys_ptr->total_us_ih), &(swKeys_ptr->total_abs_ih),                                                 &(swKeys_ptr->total_us_ih), &(swKeys_ptr->total_abs_ih),
                                                 mask, bitmask, cdelt1, rsun_ref, rsun_obs)) {                                                 mask, bitmask, cdelt1, rsun_ref, rsun_obs)) {
                 swKeys_ptr->mean_ih = DRMS_MISSING_FLOAT;                 swKeys_ptr->mean_ih = DRMS_MISSING_FLOAT;
Line 1764  void computeSWIndex(struct swIndex *swKe
Line 1770  void computeSWIndex(struct swIndex *swKe
                 swKeys_ptr->total_abs_ih = DRMS_MISSING_FLOAT;                 swKeys_ptr->total_abs_ih = DRMS_MISSING_FLOAT;
         }         }
  
         if (computeSumAbsPerPolarity(bz, jz, dims, &(swKeys_ptr->totaljz),          if (computeSumAbsPerPolarity(bz, jz_smooth, dims, &(swKeys_ptr->totaljz),
                                                                  mask, bitmask, cdelt1, rsun_ref, rsun_obs))                                                                  mask, bitmask, cdelt1, rsun_ref, rsun_obs))
                 swKeys_ptr->totaljz = DRMS_MISSING_FLOAT;                 swKeys_ptr->totaljz = DRMS_MISSING_FLOAT;
  
Line 1794  void computeSWIndex(struct swIndex *swKe
Line 1800  void computeSWIndex(struct swIndex *swKe
         drms_free_array(byArray);         drms_free_array(byArray);
         drms_free_array(bzArray);         drms_free_array(bzArray);
  
         free(bh); free(bt); free(jz);          free(bh); free(bt); free(jz); free(jz_smooth);
         free(bpx); free(bpy); free(bpz);         free(bpx); free(bpy); free(bpz);
         free(derx); free(dery);         free(derx); free(dery);
         free(derx_bt); free(dery_bt);         free(derx_bt); free(dery_bt);
         free(derx_bz); free(dery_bz);         free(derx_bz); free(dery_bz);
         free(derx_bh); free(dery_bh);         free(derx_bh); free(dery_bh);
  
           free_fresize(&convolution_array);
 } }
  
  


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

Karen Tian
Powered by
ViewCVS 0.9.4