Changeset 64


Ignore:
Timestamp:
10/30/2008 11:07:23 PM (14 years ago)
Author:
marcus
Message:

r49 | svn | 2008-10-14 22:36:40 +0200 (Di, 14 Okt 2008) | 1 line

autoevt: filter depending on distance; appropriate variables in globalparams.h

Location:
SH_SHM/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/inputs/shm-config.txt

    r16 r64  
    384384keysym_arrow_right           268762963 
    385385 
     386!                            automatic evt files (used in detection lists) 
     387!                            --------------------------------------------- 
     388!                            when an autoevt contains a location, should the 
     389!                            trace automatically be sorted by distance? 
     390autosort_by_distance         true 
     391!                            translation of :LOC expression at station buttons: 
     392!                            if a autoevt file contains a location the station 
     393!                            set read in is determined from it: the location 
     394!                            is compared with the following list of lat,lon 
     395!                            areas specified in v$loc* variables (order: 
     396!                            <lat1>,<lon1>,<lat2>,<lon2>).  The first matching 
     397!                            area sets the station list.  The station list 
     398!                            itself may be a variable.  If no area matches 
     399!                            the list of v$loc is taken. 
     400!                            Vogtland area use station list v$e from above 
     401v$loc1                       50.0,11.0,52.0,13.0 $e 
     402!                            Saarbruecken area use station list v$sw 
     403v$loc2                       48.9,6.4,49.9,7.4 $sw 
     404!                            an arbitrary list of v$loc* lines may follow 
     405!                            the escape is list v$loc (if no area matches) 
     406v$loc                        $grsn 
     407!                            if an autoevt file contains a location, should the 
     408!                            default filter (on Read New) be determined from 
     409!                            the distance between the epicentre and the 
     410!                            reference station? 
     411autofilter_by_distance       true 
     412!                            if yes, what is the separation distance in degrees 
     413autofilter_sepdist           5.0 
     414!                            and what are the local and teleseismic filters, 
     415!                            respectively 
     416autofilter_local             SHM_BP_1HZ_8HZ_4 
     417autofilter_tele              S+G_WWSSN_SP 
     418 
    386419!!                            autofilter definitions 
    387420!v$autofilter                 cll-bh-z  SHM_HP_1HZ_3 
  • SH_SHM/trunk/source/globalparams.c

    r57 r64  
    33 *      ============== 
    44 * 
    5  * $Revision: 42 $, $Date: 2008-10-13 22:51:21 +0200 (Mo, 13 Okt 2008) $ 
     5 * $Revision: 49 $, $Date: 2008-10-14 22:36:40 +0200 (Di, 14 Okt 2008) $ 
    66 * 
    77 * Management of global parameters 
     
    211211        "idphases_tol_azim", 
    212212        "axis_label_rounding", 
     213        "autofilter_sepdist", 
    213214        "f_last_parameter" 
    214215}; 
     
    275276        20.0,      /* idphases_tol_azim */ 
    276277        0.01,      /* axis_label_rounding */ 
     278        5.0,       /* autofilter_sepdist */ 
    277279        0.0        /* last parameter */ 
    278280}; 
     
    334336        "sfdb_exec_qual", 
    335337        "sfdb_trailer", 
     338        "autofilter_local", 
     339        "autofilter_tele", 
    336340        "s_last_parameter" 
    337341}; 
     
    373377        "-B -e",                         /* sfdb_exec_qual */ 
    374378        "",                              /* sfdb_trailer */ 
     379        "SHM_BP_1HZ_8HZ_4",              /* autofilter_local */ 
     380        "S+G_WWSSN_SP",                  /* autofilter_tele */ 
    375381        "s_last_parameter"               /* last parameter */ 
    376382}; 
     
    396402        "reads_invhdr", 
    397403        "autosort_by_distance", 
     404        "autofilter_by_distance", 
    398405        "b_last_parameter" 
    399406}; 
     
    405412        (1 << cGpB_own_accelerators)       | 
    406413        (1 << cGpB_autosort_by_distance)   | 
     414        (1 << cGpB_autofilter_by_distance) | 
    407415        (1 << cGpB_reads_swap) 
    408416; 
  • SH_SHM/trunk/source/globalparams.h

    r57 r64  
    33 *      ============== 
    44 * 
    5  * $Revision: 42 $, $Date: 2008-10-13 22:51:21 +0200 (Mo, 13 Okt 2008) $ 
     5 * $Revision: 49 $, $Date: 2008-10-14 22:36:40 +0200 (Di, 14 Okt 2008) $ 
    66 * 
    77 * Management of global parameters 
     
    159159        cGpF_idphases_tol_azim, 
    160160        cGpF_axis_label_rounding, 
     161        cGpF_autofilter_sepdist, 
    161162        cGpF_last 
    162163} TGpFloatIndex; 
     
    213214        cGpS_sfdb_exec_qual, 
    214215        cGpS_sfdb_trailer, 
     216        cGpS_autofilter_local, 
     217        cGpS_autofilter_tele, 
    215218        cGpS_last 
    216219} TGpStringIndex; 
     
    236239        cGpB_reads_invhdr, 
    237240        cGpB_autosort_by_distance, 
     241        cGpB_autofilter_by_distance, 
    238242        cGpB_last 
    239243} TGpBooleanIndex; 
  • SH_SHM/trunk/source/motif/mfexec.c

    r63 r64  
    33 *      ======== 
    44 * 
    5  * version 63, 21-Nov-2007 
     5 * $Revision: 49 $, $Date: 2008-10-14 22:36:40 +0200 (Di, 14 Okt 2008) $ 
    66 * 
    77 * execution of SH commands 
     
    5757#include "shvars.h" 
    5858#include "glusrdef.h" 
     59#include "earthloc.h" 
    5960#include "phaseinf.h" 
    6061#include "phasemgr.h" 
     
    436437 
    437438} /* end of mxh_translate_button_name */ 
     439 
     440 
     441 
     442/*--------------------------------------------------------------------------*/ 
     443 
     444 
     445 
     446void mx_filter_from_autoevt( char autoevt[], char filtername[], float *autocut ) 
     447 
     448/* Determines filter using distance between autoevt location and reference 
     449 * station 
     450 * 
     451 * parameters of routine 
     452 * char autoevt[]; input;      name of autoevt file 
     453 * char filtername[]; output;  name of filter to use 
     454 * float *autocut; output;     cut off that many seconds after filtering 
     455 */ 
     456{ 
     457        /* local variables */ 
     458        float    epilat, epilon;         /* location from autoevt */ 
     459        TSyBoolean epifound;             /* epicentre found? */ 
     460        GLT_STATINF *statinf;            /* station info of reference station */ 
     461        TSyStatus locstat;               /* local status variable */ 
     462        double dist, az, baz;            /* for distance computation */ 
     463 
     464        /* executable code */ 
     465 
     466        /* preset output vars in case of error returns */ 
     467        *filtername = '\0'; 
     468        *autocut = 5.0; 
     469 
     470        /* read the automatic location from the evt text file */ 
     471        mxh_read_location_from_evt( autoevt, &epilat, &epilon, &epifound ); 
     472        if  (!epifound)  return; 
     473 
     474        /* get the station location of the reference station */ 
     475        locstat = cBcNoError; 
     476        statinf = gl_store_station( GpGetString(cGpS_refstation), TRUE, &locstat ); 
     477        if  (SySevere(&locstat))  return; 
     478 
     479        /* distance of automatic ocation from reference station */ 
     480        mb_locdiff( statinf->lat, statinf->lon, epilat, epilon, &dist, &az, &baz ); 
     481 
     482        /* take one of two possible filters, depending on the distance */ 
     483        if  (dist < GpGetFloat(cGpF_autofilter_sepdist))  { 
     484                strcpy( filtername, GpGetString(cGpS_autofilter_local) ); 
     485        } else { 
     486                strcpy( filtername, GpGetString(cGpS_autofilter_tele) ); 
     487        } /*endif*/ 
     488 
     489} /* end of mx_filter_from_autoevt */ 
    438490 
    439491 
  • SH_SHM/trunk/source/motif/mfexec.h

    r58 r64  
    332332 
    333333/*--------------------------------------------------------------------------*/ 
     334 
     335 
     336void mx_filter_from_autoevt( char autoevt[], char filtername[], 
     337        float *autocut ); 
     338 
     339/* Determines filter using distance between autoevt location and reference 
     340 * station 
     341 * 
     342 * parameters of routine 
     343 * char autoevt[]; input;      name of autoevt file 
     344 * char filtername[]; output;  name of filter to use 
     345 * float *autocut; output;     cut off that many seconds after filtering 
     346 */ 
     347 
     348 
     349/*--------------------------------------------------------------------------*/ 
  • SH_SHM/trunk/source/motif/shm.c

    r63 r64  
    33 *      ===== 
    44 * 
    5  * $Revision: 48 $, $Date: 2008-10-14 18:19:33 +0200 (Di, 14 Okt 2008) $ 
     5 * $Revision: 49 $, $Date: 2008-10-14 22:36:40 +0200 (Di, 14 Okt 2008) $ 
    66 * 
    77 * main module of shm 
     
    14441444                strcpy( xmv_phase.name, GpGetString(cGpS_auto_phase) ); 
    14451445                cu_phase_box_defaults( xmv_w, &xmv_phase ); 
    1446                 xmv_cmd_filter.autocut = 5.0;  /* shv_globals not yet implemented */ 
    1447                 strcpy( xmv_cmd_filter.name, GpGetString(cGpS_default_filter) ); 
     1446                if  (TRUE)  { 
     1447                        mx_filter_from_autoevt( autoevt, xmv_cmd_filter.name, 
     1448                                &xmv_cmd_filter.autocut ); 
     1449                        if  (*xmv_cmd_filter.name == '\0')  { 
     1450                                xmv_cmd_filter.autocut = 5.0;  /* shv_globals not yet implemented */ 
     1451                                strcpy( xmv_cmd_filter.name, GpGetString(cGpS_default_filter) ); 
     1452                        } /*endif*/ 
     1453                } else { 
     1454                        xmv_cmd_filter.autocut = 5.0;  /* shv_globals not yet implemented */ 
     1455                        strcpy( xmv_cmd_filter.name, GpGetString(cGpS_default_filter) ); 
     1456                } /*endif*/ 
    14481457                mx_filter_box_defaults( xmv_w, &xmv_cmd_filter ); 
    14491458                xmv_dspctrl.zoom = 1.0; 
Note: See TracChangeset for help on using the changeset viewer.