Changeset 303 for SH_SHM/trunk


Ignore:
Timestamp:
01/11/2011 11:21:30 PM (13 years ago)
Author:
marcus
Message:

r145 | walther | 2011-01-11 23:18:02 +0100 (Di, 11 Jan 2011) | 12 lines

  • Extended sfdline for output of additional information about network and location code (on by default). Setting the new option "-nonetloc" will reveal the old behaviour. This change should be transparent for any Seismic Handler installations, since this extra information is ignored by default. To access a code using network and location code, simply change for station MOX (network GR and empty location code):

reads . 10-APR-2010_00:00:19 5 mox z bh

to

reads . 10-APR-2010_00:00:19 5 mox.gr.. z bh

Please note: SHM doesn't yet support these schema.

  • Added python version of sfdline (only subset of options supported).
Location:
SH_SHM/trunk/source/seed_io
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/source/seed_io/sfdline.c

    r16 r303  
    2727 
    2828#define TIMECORRUNIT 1000.0 
    29  
    3029 
    3130 
     
    4645        int      sfd_recno;                 /* number of records in file */ 
    4746        char     sfd_stream[BC_LINELTH+1];  /* stream string */ 
     47        char     sfd_netloc[5];             /* network and location code string */ 
    4848        BOOLEAN  sfd_swap_hdr;              /* swap header necessary */ 
    4949        int      i;                         /* counter */ 
     
    5858        TSyBoolean include_bad;             /* include bad data files */ 
    5959        TSyBoolean use_timecorr;            /* use time correction */ 
     60        TSyBoolean netloc;                  /* display network/location code */ 
    6061 
    6162        /* executable code */ 
     
    109110        if  (pa_qspecified("-timecorr")) 
    110111                use_timecorr = TRUE; 
     112 
     113        /* output network and location code */ 
     114        netloc = TRUE; 
     115        if (pa_qspecified("-nonetloc")) 
     116                netloc = FALSE; 
    111117 
    112118        /* open seed file */ 
     
    204210        if  (chanstr[1] <= ' ' || chanstr[1] > 'z')  chanstr[1] = '\0'; 
    205211        ut_uncap( chanstr ); 
    206 #ifdef XXX 
    207         if  (strcmp(chanstr,"bh") == 0)  {         strcat( sfd_stream, "vbb-" ); 
    208         } else if  (strcmp(chanstr,"hh") == 0)  {  strcat( sfd_stream, "vsp-" ); 
    209         } else if  (strcmp(chanstr,"lh") == 0)  {  strcat( sfd_stream, "lp-" ); 
    210         } else { 
    211                 strcat( sfd_stream, chanstr ); 
    212                 strcat( sfd_stream, "-" ); 
    213         } /*endif*/ 
    214 #endif 
    215         strcat( sfd_stream, chanstr ); 
     212 
     213        strcat( sfd_stream, chanstr ); 
    216214        strcat( sfd_stream, "-" ); 
    217215        i = (int)strlen( sfd_stream ); 
     
    221219        sfd_stream[i+1] = '\0'; 
    222220        ut_uncap( sfd_stream ); 
     221 
     222        /* network and location code */ 
     223        sfd_netloc[0] = Cap(seedhdr->network[0]); 
     224        sfd_netloc[1] = Cap(seedhdr->network[1]); 
     225        sfd_netloc[2] = Cap(seedhdr->locid[0]); 
     226        sfd_netloc[3] = Cap(seedhdr->locid[1]); 
     227        sfd_netloc[4] = '\0'; 
     228 
     229        /* blanks are masked by dots */ 
     230        for (i=0; i<4; i++) 
     231            if (sfd_netloc[i] == ' ') 
     232                sfd_netloc[i] = '.'; 
    223233 
    224234        /* get sample distance */ 
     
    305315        fclose( fp ); 
    306316 
    307         fprintf( out, "%c>%s %c>%s %c>%s %c>%s %c>%d %c>%d %c>%d %c>%d\n", 
     317        fprintf( out, "%c>%s %c>%s %c>%s %c>%s %c>%d %c>%d %c>%d %c>%d", 
    308318                Seed_C_SfdStream, sfd_stream, Seed_C_SfdName, seedfile, 
    309319                Seed_C_SfdTStart, sfd_t_start, Seed_C_SfdTEnd, sfd_t_end, 
    310320                Seed_C_SfdRecno, sfd_recno, Seed_C_SfdSwapH, sfd_swap_hdr, 
    311321                Seed_C_SfdReclth, recsize, Seed_C_SfdOffset, byteoff ); 
     322         
     323        if (netloc) 
     324            fprintf( out, " %c>%s", 
     325                Seed_C_SfdAddinf, sfd_netloc); 
     326 
     327        fprintf(out, "\n"); 
    312328 
    313329        if  (out != stdout)  fclose( out ); 
Note: See TracChangeset for help on using the changeset viewer.