(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.21 and 1.23

version 1.21, 2014/02/18 23:35:31 version 1.23, 2014/03/05 19:39:32
Line 27 
Line 27 
  *              v0.6 Aug 12 2013  *              v0.6 Aug 12 2013
  *              v0.7 Jan 02 2014  *              v0.7 Jan 02 2014
  *              v0.8 Feb 12 2014  *              v0.8 Feb 12 2014
    *                              v0.9 Mar 04 2014
  *  *
  *      Notes:  *      Notes:
  *              v0.0  *              v0.0
Line 59 
Line 60 
  *              Added disambig to azimuth during error propagation  *              Added disambig to azimuth during error propagation
  *              Changed usage for disambig: bit 2 (radial acute) for full disk, bit 0 for patch  *              Changed usage for disambig: bit 2 (radial acute) for full disk, bit 0 for patch
  *              Fixed disambig cutout for patch: 0 for even, 7 for odd  *              Fixed disambig cutout for patch: 0 for even, 7 for odd
    *              v0.9
    *              Fixed unit
    *              Check whether in PATCH of FD mode, so the error propagation uses disambiguated azimuth or not
  *  *
  *  *
  *      Example Calls:  *      Example Calls:
Line 344  char *CutBunits[] = {"Mx/cm^2", " ", "cm
Line 348  char *CutBunits[] = {"Mx/cm^2", " ", "cm
     " ", " ", " ",     " ", " ", " ",
     " ", " ", " ",     " ", " ", " ",
     " ", " "};     " ", " "};
 char *CEABunits[] = {"Mx/cm^2", " ", "cm/s", "DN/s", " ",  char *CEABunits[] = {"Mx/cm^2", " ", "cm/s", "DN/s",
     "Mx/cm^2", "Mx/cm^2", "Mx/cm^2", "Mx/cm^2", "Mx/cm^2", "Mx/cm^2"};      "Mx/cm^2", "Mx/cm^2", "Mx/cm^2", "Mx/cm^2", "Mx/cm^2", "Mx/cm^2", " "};      // Mar 4 2014 XS
  
 /* ========================================================================================================== */ /* ========================================================================================================== */
  
Line 353  char *module_name = "sharp";
Line 357  char *module_name = "sharp";
 int seed; int seed;
  
 int fullDisk;       // full disk mode int fullDisk;       // full disk mode
   int amb4err;      // Use azimuth disambiguation for error propagation, default is 0 for patch and 1 for FD
  
 ModuleArgs_t module_args[] = ModuleArgs_t module_args[] =
 { {
Line 364  ModuleArgs_t module_args[] =
Line 369  ModuleArgs_t module_args[] =
         {ARG_STRING, "sharp_cea", kNotSpecified, "Output Sharp CEA series."},         {ARG_STRING, "sharp_cea", kNotSpecified, "Output Sharp CEA series."},
         {ARG_STRING, "sharp_cut", kNotSpecified, "Output Sharp cutout series."},         {ARG_STRING, "sharp_cut", kNotSpecified, "Output Sharp cutout series."},
     {ARG_INT,    "seed", "987654", "Seed for the random number generator."},     {ARG_INT,    "seed", "987654", "Seed for the random number generator."},
       {ARG_INT,   "f_amb4err", "0", "Force using disambiguation in error propagation"},     // Mar 4 2014 XS
         {ARG_END}         {ARG_END}
 }; };
  
Line 393  int DoIt(void)
Line 399  int DoIt(void)
         sharpCutQuery = (char *) params_get_str(&cmdparams, "sharp_cut");         sharpCutQuery = (char *) params_get_str(&cmdparams, "sharp_cut");
  
     seed = params_get_int(&cmdparams, "seed");     seed = params_get_int(&cmdparams, "seed");
       int f_amb4err = params_get_int(&cmdparams, "f_amb4err");
  
         /* Get input data, check everything */         /* Get input data, check everything */
  
Line 407  int DoIt(void)
Line 414  int DoIt(void)
         SHOW("Harp mode\n");         SHOW("Harp mode\n");
     }     }
  
       // Mar 4 2014
       if (f_amb4err == 0) {         // no forcing, 0 for patch and 1 for FD
           amb4err = fullDisk ? 1 : 0;
       } else {
           amb4err = 1;
       }
       printf("amb4err=%d\n", amb4err);
   
     // Bharp point to B if full disk     // Bharp point to B if full disk
     if (getInputRS(&mharpRS, &bharpRS, mharpQuery, bharpQuery))     if (getInputRS(&mharpRS, &bharpRS, mharpQuery, bharpQuery))
         DIE("Input harp data error.");         DIE("Input harp data error.");
Line 1593  int readVectorBErr(DRMS_Record_t *inRec,
Line 1608  int readVectorBErr(DRMS_Record_t *inRec,
  
         // Add disambig, Feb 12 2014         // Add disambig, Feb 12 2014
  
         DRMS_Segment_t *inSeg = drms_segment_lookup(inRec, "disambig");          DRMS_Segment_t *inSeg;
         DRMS_Array_t *inArray_ambig = drms_segment_read(inSeg, DRMS_TYPE_CHAR, &status);      DRMS_Array_t *inArray_ambig;
   
       if (amb4err) {              // Mar 4 2014
   
           inSeg = drms_segment_lookup(inRec, "disambig");
           inArray_ambig = drms_segment_read(inSeg, DRMS_TYPE_CHAR, &status);
         if (status) return 1;         if (status) return 1;
         char *ambig = (char *)inArray_ambig->data;         char *ambig = (char *)inArray_ambig->data;
  
Line 1624  int readVectorBErr(DRMS_Record_t *inRec,
Line 1644  int readVectorBErr(DRMS_Record_t *inRec,
         }         }
   }   }
  
       }
   
         // Convert errors to variances, correlation coefficients to covariances         // Convert errors to variances, correlation coefficients to covariances
  
         for (int i = 0; i < FOURK2; i++) {         for (int i = 0; i < FOURK2; i++) {
Line 1648  int readVectorBErr(DRMS_Record_t *inRec,
Line 1670  int readVectorBErr(DRMS_Record_t *inRec,
         //         //
  
         for (int iSeg = 0; iSeg < 9; iSeg++) drms_free_array(inArrays[iSeg]);         for (int iSeg = 0; iSeg < 9; iSeg++) drms_free_array(inArrays[iSeg]);
         drms_free_array(inArray_ambig);         // Feb 12 2014          if (amb4err) drms_free_array(inArray_ambig);            // Feb 12; Mar 04 2014
  
         return 0;         return 0;
  


Legend:
Removed from v.1.21  
changed lines
  Added in v.1.23

Karen Tian
Powered by
ViewCVS 0.9.4