Changeset 8321


Ignore:
Timestamp:
02/02/21 13:54:41 (2 months ago)
Author:
paulf
Message:

updated to sort arrivals...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reporting/ewhtmlemail/ewhtmlemail.c

    r8310 r8321  
    4646/* 1.3.5 - 2020-12-22 - added OPTIONAL FromAddress setting for sendmail (UNIX only) */ 
    4747/* 1.3.6 - 2020-12-28 - added REGION name to ShowDetailedSubject, if part of a region decision */ 
    48  
    49 #define VERSION_STR "1.3.6 - 2021-01-02" 
     48/* 1.3.7 - 2021-02-02 - sorted phases by distance as some hypoinverse files from dbselect output were SCNL sorted */ 
     49 
     50#define VERSION_STR "1.3.7 - 2021-02-02" 
    5051 
    5152#define MAX_GE_MARKERS 20 
     
    254255static unsigned char      TypeTraceBuf2 = 0; 
    255256 
     257/*-- this was in main, but now as a global variable --*/ 
     258HypoArc          *arc;             // a hypoinverse ARC message currently being processed 
     259static int phase_dist_compare( const void* a, const void* b ) { 
     260    int ret_value = 0; 
     261    struct Hpck *a_pick = (struct Hpck *) a, *b_pick = (struct Hpck *) b; 
     262    if (a_pick->dist < b_pick->dist) { 
     263       ret_value=-1; 
     264    } else if (a_pick->dist > b_pick->dist) { 
     265       ret_value=1; 
     266    } 
     267    return ret_value; 
     268} 
     269 
     270 
    256271 
    257272/* Error messages used by ewhtmlemail 
     
    278293   unsigned char seq; 
    279294   int           i, j, res; 
    280    HypoArc               *arc;             // a hypoinverse ARC message 
    281295   MAG_INFO      mag_l;            // a magnitude message containing ML, after ARC 
    282296   MAG_INFO      mag_w;            // a magnitude message containing Mw 
     
    623637         arc = calloc(1, sizeof(HypoArc)); 
    624638         parse_arc(msgbuf, arc); 
     639         qsort(arc->phases, arc->num_phases,  sizeof(struct Hpck *), phase_dist_compare); 
    625640         if (!UseML && !UseMW) { 
    626641             process_message(arc, NULL, NULL, reclogo); 
     
    17631778        char            phases[MAX_STATIONS][3];                        /* Phase types of each trace */ 
    17641779        double          arrivalTimes[MAX_STATIONS];             /* Arrival times of each trace */ 
    1765     double              residual[MAX_STATIONS];                 /* phase residual */ 
     1780        double          residual[MAX_STATIONS];                 /* phase residual */ 
    17661781        int             coda_lengths[MAX_STATIONS];             /* Coda lengths of each trace */ 
    17671782        double          coda_mags[MAX_STATIONS];                /* station coda mags > 0 if used */ 
Note: See TracChangeset for help on using the changeset viewer.