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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.