Changeset 306 for SH_SHM/trunk


Ignore:
Timestamp:
01/13/2011 05:00:19 PM (12 years ago)
Author:
marcus
Message:

r148 | walther | 2011-01-13 16:46:31 +0100 (Do, 13 Jan 2011) | 2 lines

seed_tidy now is able to alter the location code.

File:
1 edited

Legend:

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

    r168 r306  
    7474#define F_YQFIXNAMES    0x100000 
    7575#define F_TBFIXNAMES    0x200000 
     76#define F_SETLOCATION   0x400000 
    7677 
    7778 
     
    8485static char tdv_newchan[cBcLineLth+1]=""; /* new channel name */ 
    8586static char tdv_newnetwork[cBcLineLth+1]=""; /* new network code */ 
     87static char tdv_newlocation[cBcLineLth+1]=""; /* new location code */ 
    8688static int tdv_max_recsamp=0;             /* maximum number of samples per rec*/ 
    8789static int tdv_timecorr=0;                /* time correction */ 
     
    155157                fprintf( stderr, "   -chan=<chan>  replaces channel by <chan> (bhz)\n" ); 
    156158                fprintf( stderr, "   -network=<net> replaces network code by <net>\n" ); 
     159                fprintf( stderr, "   -location=<loc> replaces location code by <loc>\n" ); 
    157160                fprintf( stderr, "   -b1000        insert blockette 1000 (Sparc=big-endian)\n" ); 
    158161                fprintf( stderr, "   -b1000l       insert blockette 1000 (intel=little-endian)\n" ); 
     
    202205        if  (pa_qspecified( "-network" ))    { 
    203206                flags |= F_SETNETWORK; 
    204                 strcpy( tdv_newnetwork, pa_qvalue("-network") ); 
     207                strncpy( tdv_newnetwork, pa_qvalue("-network"), 2 ); 
     208        } /*endif*/ 
     209        if  (pa_qspecified( "-location" ))    { 
     210                flags |= F_SETLOCATION; 
     211                strncpy( tdv_newlocation, pa_qvalue("-location"), 2 ); 
    205212        } /*endif*/ 
    206213        if  (pa_qspecified( "-maxgapfac" )) 
     
    824831        } /*endif*/ 
    825832        if  (F_SETNETWORK & flags)  { 
    826                 shdr->network[0] = tdv_newnetwork[0]; 
    827                 shdr->network[1] = tdv_newnetwork[1]; 
     833                shdr->network[0] = Cap(tdv_newnetwork[0]); 
     834                shdr->network[1] = Cap(tdv_newnetwork[1]); 
     835        } /*endif*/ 
     836        if  (F_SETLOCATION & flags)  { 
     837                shdr->locid[0] = Cap(tdv_newlocation[0]); 
     838                shdr->locid[1] = Cap(tdv_newlocation[1]); 
    828839        } /*endif*/ 
    829840        /* set time correction if requested */ 
     
    886897                switch_days = switch_hours = FALSE; 
    887898 
    888     /* new file if the record lenth changes */ 
     899    /* new file if the record length changes */ 
    889900    this_reclth = SeedGetReclth( (SeedDataHeaderT *)rec, FALSE ); 
    890901    if  (last_reclth > 0 && this_reclth != last_reclth) 
Note: See TracChangeset for help on using the changeset viewer.