(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.2 and 1.3

version 1.2, 2012/08/27 19:56:00 version 1.3, 2012/09/07 02:14:02
Line 19 
Line 19 
  *      Version:  *      Version:
  *              v0.0    Jul 02 2012  *              v0.0    Jul 02 2012
  *              v0.1    Jul 23 2012  *              v0.1    Jul 23 2012
    *              v0.2    Sep 04 2012
  *  *
  *      Notes:  *      Notes:
  *              v0.0  *              v0.0
Line 31 
Line 32 
  *              Fixed char I/O thanks to Art  *              Fixed char I/O thanks to Art
  *              SW indices fixed  *              SW indices fixed
  *              Added doppler and continuum  *              Added doppler and continuum
    *              Added other keywords: HEADER (populated by cvs build version), DATE_B
  *  *
  *      Example:  *      Example:
  *      sharp "mharp=hmi.Mharp_720s[1404][2012.02.20_10:00]" \  *      sharp "mharp=hmi.Mharp_720s[1404][2012.02.20_10:00]" \
Line 564  int createCeaRecord(DRMS_Record_t *mharp
Line 566  int createCeaRecord(DRMS_Record_t *mharp
  
         // Get ephemeris         // Get ephemeris
  
         if (getEphemeris(mharpRec, &(mInfo.ephem))) return 1;          if (getEphemeris(mharpRec, &(mInfo.ephem))) {
                   SHOW("CEA: get ephemeris error\n");
                   return 1;
           }
  
         // Find position         // Find position
  
         if (findPosition(mharpRec, &mInfo)) return 1;          if (findPosition(mharpRec, &mInfo)) {
                   SHOW("CEA: find position error\n");
                   return 1;
           }
  
         // Create xi_out, zeta_out array in mInfo:         // Create xi_out, zeta_out array in mInfo:
         // Coordinates to sample in original full disk image         // Coordinates to sample in original full disk image
Line 584  int createCeaRecord(DRMS_Record_t *mharp
Line 592  int createCeaRecord(DRMS_Record_t *mharp
  
         // Mapping single segment: Mharp, etc.         // Mapping single segment: Mharp, etc.
  
         if (mapScaler(sharpRec, mharpRec, mharpRec, &mInfo, "magnetogram")) return 1;          if (mapScaler(sharpRec, mharpRec, mharpRec, &mInfo, "magnetogram")) {
         if (mapScaler(sharpRec, mharpRec, mharpRec, &mInfo, "bitmap")) return 1;                  SHOW("CEA: mapping magnetogram error\n");
                   return 1;
           }
           if (mapScaler(sharpRec, mharpRec, mharpRec, &mInfo, "bitmap")) {
                   SHOW("CEA: mapping bitmap error\n");
                   return 1;
           }
         printf("Magnetogram mapping done.\n");         printf("Magnetogram mapping done.\n");
  
         if (mapScaler(sharpRec, dopRec, mharpRec, &mInfo, "Dopplergram")) return 1;          if (mapScaler(sharpRec, dopRec, mharpRec, &mInfo, "Dopplergram")) {
                   SHOW("CEA: mapping dopplergram error\n");
                   return 1;
           }
         printf("Dopplergram mapping done.\n");         printf("Dopplergram mapping done.\n");
  
         if (mapScaler(sharpRec, contRec, mharpRec, &mInfo, "continuum")) return 1;          if (mapScaler(sharpRec, contRec, mharpRec, &mInfo, "continuum")) {
                   SHOW("CEA: mapping continuum error\n");
                   return 1;
           }
         printf("Intensitygram mapping done.\n");         printf("Intensitygram mapping done.\n");
  
         if (mapScaler(sharpRec, bharpRec, mharpRec, &mInfo, "conf_disambig")) return 1;          if (mapScaler(sharpRec, bharpRec, mharpRec, &mInfo, "conf_disambig")) {
                   SHOW("CEA: mapping conf_disambig error\n");
                   return 1;
           }
         printf("Conf disambig mapping done.\n");         printf("Conf disambig mapping done.\n");
  
         // Mapping vector B         // Mapping vector B
  
         if (mapVectorB(sharpRec, bharpRec, &mInfo)) return 1;          if (mapVectorB(sharpRec, bharpRec, &mInfo)) {
                   SHOW("CEA: mapping vector B error\n");
                   return 1;
           }
         printf("Vector B mapping done.\n");         printf("Vector B mapping done.\n");
  
         // Mapping vector B errors         // Mapping vector B errors
  
         if (mapVectorBErr(sharpRec, bharpRec, &mInfo)) return 1;          if (mapVectorBErr(sharpRec, bharpRec, &mInfo)) {
                   SHOW("CEA: mapping vector B uncertainty error\n");
                   return 1;
           }
         printf("Vector B error done.\n");         printf("Vector B error done.\n");
  
         // Keywords & Links         // Keywords & Links
Line 618  int createCeaRecord(DRMS_Record_t *mharp
Line 647  int createCeaRecord(DRMS_Record_t *mharp
         if (bHarpLink) drms_link_set("BHARP", sharpRec, bharpRec);         if (bHarpLink) drms_link_set("BHARP", sharpRec, bharpRec);
  
         setKeys(sharpRec, bharpRec);            // Set all other keywords         setKeys(sharpRec, bharpRec);            // Set all other keywords
           drms_copykey(sharpRec, mharpRec, "QUALITY");            // copied from los records
  
         // Space weather         // Space weather
  
Line 1454  int createCutRecord(DRMS_Record_t *mharp
Line 1484  int createCutRecord(DRMS_Record_t *mharp
                         break;                         break;
                 }                 }
         }         }
         if (iHarpSeg != nMharpSegs) return 1;           // if failed          if (iHarpSeg != nMharpSegs) {
                   SHOW("Cutout: segment number unmatch\n");
                   return 1;               // if failed
           }
         printf("Magnetogram cutout done.\n");         printf("Magnetogram cutout done.\n");
  
         // Cutout Doppler         // Cutout Doppler
Line 1793  void setKeys(DRMS_Record_t *outRec, DRMS
Line 1826  void setKeys(DRMS_Record_t *outRec, DRMS
    copy_patch_keys(inRec, outRec);    copy_patch_keys(inRec, outRec);
    copy_geo_keys(inRec, outRec);    copy_geo_keys(inRec, outRec);
    copy_ambig_keys(inRec, outRec);    copy_ambig_keys(inRec, outRec);
   
      char timebuf[1024];
      float UNIX_epoch = -220924792.000; /* 1970.01.01_00:00:00_UTC */
      double val;
      int status = DRMS_SUCCESS;
   
      val = drms_getkey_double(inRec, "DATE",&status);
      drms_setkey_double(outRec, "DATE_B", val);
      sprint_time(timebuf, (double)time(NULL) + UNIX_epoch, "ISO", 0);
      drms_setkey_string(outRec, "DATE", timebuf);
   
      // set cvs commit version into keyword HEADER
      char *cvsinfo = strdup("$Header$");
      status = drms_setkey_string(outRec, "HEADER", cvsinfo);
   
 }; };
  
 // //


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

Karen Tian
Powered by
ViewCVS 0.9.4