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

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

version 1.7, 2014/06/02 19:47:26 version 1.8, 2014/06/05 21:27:32
Line 121  int DoIt(void)
Line 121  int DoIt(void)
         float totpot_err;         float totpot_err;
         float Rparam;         float Rparam;
         float meanshear_angle_err;         float meanshear_angle_err;
           float totfx;
           float totfy;
           float totfz;
           float totbsq;
           float epsx;
           float epsy;
           float epsz;
   
         char *sharpseriesin = (char *) params_get_str(&cmdparams, "sharpseriesin");         char *sharpseriesin = (char *) params_get_str(&cmdparams, "sharpseriesin");
         char *sharpceaseriesin = (char *) params_get_str(&cmdparams, "sharpceaseriesin");         char *sharpceaseriesin = (char *) params_get_str(&cmdparams, "sharpceaseriesin");
         char *sharpseriesout = (char *) params_get_str(&cmdparams, "sharpseriesout");         char *sharpseriesout = (char *) params_get_str(&cmdparams, "sharpseriesout");
Line 198  int DoIt(void)
Line 206  int DoIt(void)
         int meanshrflag = (strstr(keylist,"MEANSHR") != NULL);         int meanshrflag = (strstr(keylist,"MEANSHR") != NULL);
         int shrgt45flag = (strstr(keylist,"SHRGT45") != NULL);         int shrgt45flag = (strstr(keylist,"SHRGT45") != NULL);
         int r_valueflag = (strstr(keylist,"R_VALUE") != NULL);         int r_valueflag = (strstr(keylist,"R_VALUE") != NULL);
           int totbsqflag  = (strstr(keylist,"TOTBSQ")  != NULL);
           int totfxflag   = (strstr(keylist,"TOTFX")   != NULL);
           int totfyflag   = (strstr(keylist,"TOTFY")   != NULL);
           int totfzflag   = (strstr(keylist,"TOTFZ")   != NULL);
           int epsxflag    = (strstr(keylist,"EPSX")    != NULL);
           int epsyflag    = (strstr(keylist,"EPSY")    != NULL);
           int epszflag    = (strstr(keylist,"EPSZ")    != NULL);
   
         DRMS_Record_t *sharpinrec = sharpinrecset->records[0];         DRMS_Record_t *sharpinrec = sharpinrecset->records[0];
         DRMS_Record_t *sharpceainrec = sharpceainrecset->records[0];         DRMS_Record_t *sharpceainrec = sharpceainrecset->records[0];
         DRMS_Segment_t *inseg = drms_segment_lookup(sharpceainrec, "Br");         DRMS_Segment_t *inseg = drms_segment_lookup(sharpceainrec, "Br");
Line 287  int DoIt(void)
Line 303  int DoIt(void)
         float *p1pad   = (float *)malloc(nxp*nyp*sizeof(float));         float *p1pad   = (float *)malloc(nxp*nyp*sizeof(float));
         float *pmapn   = (float *)malloc(nx1*ny1*sizeof(float));         float *pmapn   = (float *)malloc(nx1*ny1*sizeof(float));
  
           // define some arrays for the lorentz force calculation
           float *fx = (float *) (malloc(nxny * sizeof(float)));
           float *fy = (float *) (malloc(nxny * sizeof(float)));
           float *fz = (float *) (malloc(nxny * sizeof(float)));
   
   
         for (irec=0;irec<nrecs;irec++)         for (irec=0;irec<nrecs;irec++)
         {         {
            // Get emphemeris            // Get emphemeris
Line 673  int DoIt(void)
Line 695  int DoIt(void)
               drms_setkey_float(sharpceaoutrec, "ERRMSHA", meanshear_angle_err);               drms_setkey_float(sharpceaoutrec, "ERRMSHA", meanshear_angle_err);
            }            }
  
             /***** TOTFX, TOTFY, TOTFX, TOTBSQ, EPSX, EPSY, EPSZ , Example Function 16 (Lorentz forces) **********/
   
              if (totfxflag || totfyflag || totfzflag || totbsqflag || epsxflag || epsyflag || epszflag)
              {
   
                   // Compute Lorentz forces
                   if (computeLorentz(bx, by, bz, fx, fy, fz, dims, &totfx, &totfy, &totfz, &totbsq,
                       &epsx, &epsy, &epsz, mask, bitmask, cdelt1, rsun_ref, rsun_obs))
                   {
                      totfx             = DRMS_MISSING_FLOAT;
                      totfy             = DRMS_MISSING_FLOAT;
                      totfz             = DRMS_MISSING_FLOAT;
                      totbsq            = DRMS_MISSING_FLOAT;
                      epsx              = DRMS_MISSING_FLOAT;
                      epsy              = DRMS_MISSING_FLOAT;
                      epsz              = DRMS_MISSING_FLOAT;
                   }
   
                 // Set sharp keys
                 drms_setkey_float(sharpoutrec, "TOTFX", totfx);
                 drms_setkey_float(sharpoutrec, "TOTFY", totfy);
                 drms_setkey_float(sharpoutrec, "TOTFZ", totfz);
                 drms_setkey_float(sharpoutrec, "TOTBSQ",totbsq);
                 drms_setkey_float(sharpoutrec, "EPSX",  epsx);
                 drms_setkey_float(sharpoutrec, "EPSY",  epsy);
                 drms_setkey_float(sharpoutrec, "EPSZ",  epsz);
   
                 // Set sharp cea keys
                 drms_setkey_float(sharpceaoutrec, "TOTFX", totfx);
                 drms_setkey_float(sharpceaoutrec, "TOTFY", totfy);
                 drms_setkey_float(sharpceaoutrec, "TOTFZ", totfz);
                 drms_setkey_float(sharpceaoutrec, "TOTBSQ",totbsq);
                 drms_setkey_float(sharpceaoutrec, "EPSX",  epsx);
                 drms_setkey_float(sharpceaoutrec, "EPSY",  epsy);
                 drms_setkey_float(sharpceaoutrec, "EPSZ",  epsz);
   
              }
   
            /******************************* END FLAGS **********************************/            /******************************* END FLAGS **********************************/
  
            drms_free_array(bitmaskArray);            drms_free_array(bitmaskArray);
Line 713  int DoIt(void)
Line 773  int DoIt(void)
         free(p1pad);         free(p1pad);
         free(pmapn);         free(pmapn);
  
           // free the arrays that are related to the lorentz calculation
           free(fx); free(fy); free(fz);
   
 return 0; return 0;
 }       // DoIt }       // DoIt


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

Karen Tian
Powered by
ViewCVS 0.9.4