Changeset 334


Ignore:
Timestamp:
03/02/2011 05:59:37 PM (12 years ago)
Author:
marcus
Message:

r173 | klaus | 2011-02-23 12:24:31 +0100 (Mi, 23 Feb 2011) | 1 line

format of EMSC file has changed some time ago; adjusted reading program for identify_phase

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/source/motif/seismics.c

    r319 r334  
    10941094                                curdep = 33.0; 
    10951095                        } /*endif*/ 
    1096                         if  (lptr[0] == 'm' && lptr[1] == 'b' && lptr[2] == ' ')  { 
    1097                                 lptr += 3; 
     1096                        while  (*lptr == ' ')  lptr++;  /* now we should come to magnitude */ 
     1097                        if  (*lptr >= '0' && *lptr <= '9')  { 
     1098                                /* here we found magnitude */ 
    10981099                                sscanf( lptr, "%f", &curmag ); 
    1099                                 while  (*lptr != ' ' && *lptr != '\n')  lptr++;  /* skip over magnitude */ 
    1100                                 while  (*lptr == ' ')  lptr++; 
     1100                        } else { 
     1101                                curmag = -1.0; 
    11011102                        } /*endif*/ 
    1102                         if  (lptr[0] == 'M' && lptr[1] == 'L' && lptr[2] == ' ')  { 
    1103                                 lptr += 3; 
    1104                                 sscanf( lptr, "%f", &curmag ); 
    1105                                 while  (*lptr != ' ' && *lptr != '\n')  lptr++;  /* skip over magnitude */ 
    1106                                 while  (*lptr == ' ')  lptr++; 
    1107                         } /*endif*/ 
    1108                         if  (lptr[0] == 'M' && lptr[1] == 'S' && lptr[2] == ' ')  { 
    1109                                 lptr += 3; 
    1110                                 sscanf( lptr, "%f", &curmag ); 
    1111                                 while  (*lptr != ' ' && *lptr != '\n')  lptr++;  /* skip over magnitude */ 
    1112                                 while  (*lptr == ' ')  lptr++; 
    1113                         } /*endif*/ 
    1114                         if  (lptr[0] == 'M' && lptr[1] == ' ' && lptr[2] >= '0' && lptr[2] <= '9')  { 
    1115                                 lptr += 2; 
    1116                                 sscanf( lptr, "%f", &curmag ); 
    1117                                 while  (*lptr != ' ' && *lptr != '\n')  lptr++;  /* skip over magnitude */ 
    1118                                 while  (*lptr == ' ')  lptr++; 
    1119                         } /*endif*/ 
     1103                        while  (*lptr != ' ' && *lptr != '\n')  lptr++;  /* skip over mangitude */ 
     1104                        while  (*lptr == ' ')  lptr++;  /* now we should come to magnitude type */ 
     1105                        while  (*lptr != ' ' && *lptr != '\n')  lptr++;  /* skip over mangitude type */ 
    11201106                        tchar = *lptr; 
    11211107                        if  (tchar == 'A')  {  
     
    11481134                                /* if exclusive agency is set, accept only this */ 
    11491135                                if  (*excl_agency != '\0' 
    1150                                         && strcasecmp(excl_agency,infsrc[*evno]) != 0) 
     1136                                        && strcasecmp(excl_agency,infsrc[*evno]) != 0)  { 
     1137                                        if  (GpGetInt(cGpI_debug_level) > 3) 
     1138                                                printf( "SHM-dbg4: skipped agency %s\n", infsrc[*evno] ); 
    11511139                                        continue; 
    1152                                 sprintf( tmpstr, "-%c", tchar ); 
    1153                                 strcat( infsrc[*evno], tmpstr ); 
     1140                                } /*endif*/ 
     1141                                if  (tchar == 'M' || tchar == 'A')  { 
     1142                                        sprintf( tmpstr, "-%c", tchar ); 
     1143                                        strcat( infsrc[*evno], tmpstr ); 
     1144                                } /*endif*/ 
    11541145                                trav[*evno] = curtrav; 
    11551146                                lat[*evno] = curlat; 
Note: See TracChangeset for help on using the changeset viewer.