Changeset 46


Ignore:
Timestamp:
10/30/2008 10:54:18 PM (14 years ago)
Author:
marcus
Message:

r31 | svn | 2008-03-03 20:47:24 +0100 (Mo, 03 Mär 2008) | 1 line

first working version for reading ingres sfdb; new check for origin in 1970; fixed ps output of locate_by_ttfit

Location:
SH_SHM/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/command/SHSTRTUP.SHC

    r16 r46  
    134134fct ferindex |"path|fereg.dat| 
    135135fct inci_table |"path|pinci.dat| 
    136 fct locfile |"path|statinf.dat| 
     136!fct locfile |"path|statinf.dat| 
    137137 
    138138! define logicals 
     
    160160fct ferindex shc_inputs:fereg.dat 
    161161fct inci_table shc_inputs:pinci.dat 
    162 fct locfile shc_inputs:statinf.dat 
     162!fct locfile shc_inputs:statinf.dat 
    163163fct tt_table shc_inputs: 
    164164fct path inputs shc_inputs: 
  • SH_SHM/trunk/errors/ERR_1400.MSG

    r16 r46  
    88! 
    99*** SQL-01 error creating unique scratch file *** 
    10 *** SQL-02 string oveflow *** 
     10*** SQL-02 string overflow *** 
     11*** SQL-03 error parsing sftab line *** 
     12*** SQL-04 error reading from scratch file *** 
    1113 
  • SH_SHM/trunk/source/seed_io/seed_lib.c

    r45 r46  
    33 *      ========== 
    44 * 
    5  * $Revision: 30 $, $Date: 2008-02-23 23:36:22 +0100 (Sa, 23 Feb 2008) $ 
     5 * $Revision: 31 $, $Date: 2008-03-03 20:47:24 +0100 (Mo, 03 MÀr 2008) $ 
    66 * 
    77 * SEED library 
     
    683683        char     xaddinf[Seed_C_AddinfLth+1];   /* netcode+locid searched */ 
    684684        TSyBoolean from_db;                     /* DB file instead of sfdfile */ 
     685        TSyBoolean is_ingres;                   /* we have here wordy ingres output */ 
    685686        TSyBoolean firstline;                   /* first line of sfdfile */ 
    686687 
     
    737738        min_tdiff = 1.0e10; 
    738739        fdescr->t_start[0] = '\0'; 
     740        is_ingres = FALSE; 
    739741        while  (fgets(line,Seed_C_SFDLINELTH,sfd) != NULL)  { 
    740742                if  (*line == '!')  continue; 
     743                /* if ingres writes something like (223 rows) then stop */ 
     744                if  (is_ingres && strstr(line," rows)\n"))  break; 
    741745                if  (firstline)  { 
    742746                        firstline = FALSE; 
     747                        is_ingres = FALSE; 
    743748                        if  (strncmp(line,"station",7) == 0)  { 
    744749                                from_db = TRUE; 
     750                                is_ingres = FALSE; 
    745751                                continue; /* first line in db file contains no data */ 
    746752                        } else if  (strncmp(line,"INGRES TERMINAL",15) == 0)  { 
    747753                                from_db = TRUE; 
     754                                is_ingres = TRUE; 
    748755                                /* this is ingres output; skip this stupid header */ 
    749756                                fgets(line,Seed_C_SFDLINELTH,sfd);  /* this is: Ingres 2006 Linux ... */ 
  • SH_SHM/trunk/source/sqliface.c

    r44 r46  
    33 *      ========== 
    44 * 
    5  * $Revision: 29 $, $Date: 2008-02-23 23:02:22 +0100 (Sa, 23 Feb 2008) $ 
     5 * $Revision: 31 $, $Date: 2008-03-03 20:47:24 +0100 (Mo, 03 MÀr 2008) $ 
    66 * 
    77 * Interface to SQL databases 
     
    308308        char     *rootpath;                   /* pointer to root path */ 
    309309        char     tmpfileb[cBcFileLth+1];      /* second scratch file */ 
    310         char     xline[cBcLineLth+1];         /* current line of file */ 
     310        char     xline[cBcLongStrLth+1];      /* current line of file */ 
     311        char     tmpstr[cBcLongStrLth+1];     /* strip blanks from original string */ 
    311312        char     shellcmd[cBcVeryLongStrLth+1];   /* shell command */ 
    312313        FILE     *fp;                         /* pointer to file */ 
    313314        int      i;                           /* counter */ 
     315        TSyBoolean is_ingres;                 /* talk to an ingres database */ 
    314316 
    315317        /* executable code */ 
     
    396398                } /*endif*/ 
    397399                /* read off header */ 
    398                 fgets( xline, cBcLineLth, fp ); 
     400                is_ingres = FALSE; 
     401                fgets( xline, cBcLongStrLth, fp ); 
     402                if  (strncmp(xline,"INGRES TERMINAL ",16) == 0)  { 
     403                        is_ingres = TRUE; 
     404                        /* there are several lines to read off for INGRES ... */ 
     405                        fgets( xline, cBcLongStrLth, fp );  /* this is: Ingres 2006 Linux ... */ 
     406                        fgets( xline, cBcLongStrLth, fp );  /* this is: date */ 
     407                        fgets( xline, cBcLongStrLth, fp );  /* this is: blank line */ 
     408                        fgets( xline, cBcLongStrLth, fp );  /* this is: continue */ 
     409                        fgets( xline, cBcLongStrLth, fp );  /* this is: * Executing ... */ 
     410                        fgets( xline, cBcLongStrLth, fp );  /* this is: blank line */ 
     411                        fgets( xline, cBcLongStrLth, fp );  /* this is: blank line */ 
     412                        fgets( xline, cBcLongStrLth, fp );  /* this is: header */ 
     413                } /*endif*/ 
    399414                fgets( descr->name, cBcFileLth, fp ); 
    400415                i = strlen( descr->name ); 
    401416                if  (i > 0 && descr->name[i-1] == '\n')  descr->name[i-1] = '\0'; 
    402417                fclose( fp ); 
     418                if  (is_ingres)  { 
     419                        /* strip blanks */ 
     420                        sscanf( descr->name, "%s", tmpstr ); 
     421                        strcpy( descr->name, tmpstr ); 
     422                } /*endif*/ 
    403423                /* put it to cache */ 
     424                if  (GpGetInt(cGpI_debug_level) > 5) 
     425                        printf( "SH-dbg6: caching rootpath >%s<\n", descr->name ); 
    404426                SqlCacheRootPath( pathid, descr->name, status ); 
    405427                sy_fdelete( tmpfileb ); 
  • SH_SHM/trunk/util/check_evt.c

    r16 r46  
    3939#include BC_SYSBASE 
    4040#include "eventdsc.h" 
     41#include "tcusrdef.h" 
    4142 
    4243 
     
    6869static float   efv_magn=0.0;              /* max. magnitude found */ 
    6970static int     efv_pkp_count=0;           /* number of PKP phases */ 
     71static BOOLEAN efv_illegal_origin;        /* illegal origin time */ 
    7072 
    7173 
     
    99101        /* efv_infile is used for messages, directory will be removed */ 
    100102        i = strlen( infile ) - 1; 
    101         while  (infile[i] != '/' && i > 0)  i--; 
    102                 strcpy( efv_infile, infile+i+1 ); 
     103        while  (infile[i] != '/' && i > 0) 
     104                i--; 
     105        strcpy( efv_infile, infile+i ); 
    103106 
    104107        status = EveNOERROR; 
     
    133136        BOOLEAN  is_p_phase;              /* phase is P or (P) */ 
    134137        BOOLEAN  loc_given;               /* location given in this record */ 
     138        NTIME    ntime;                   /* numeric origin time */ 
    135139 
    136140        /* executable code */ 
     
    181185                efv_uncorr_loc = TRUE; 
    182186                strcpy( efv_uncorrphase, event->phase ); 
     187        } /*endif*/ 
     188 
     189        /* is there an origin time from 1970? */ 
     190        if  (loc_given)  { 
     191                tc_t2n( event->origin_time, &ntime, status ); 
     192                if  (SySevere(status))  { 
     193                        efv_illegal_origin = TRUE; 
     194                } else if  (ntime.year == 1970)  { 
     195                        efv_illegal_origin = TRUE; 
     196                } /*endif*/ 
    183197        } /*endif*/ 
    184198 
  • SH_SHM/trunk/util/ev2view.c

    r16 r46  
    240240                if  (event->mag[EvcMagMs] != EvEMPTY_MAGNITUDE)  { 
    241241                        fprintf( view, "  MS: %3.1f", event->mag[EvcMagMs] ); 
     242                } /*endif*/ 
     243                if  (event->mag[EvcMagMbb] != EvEMPTY_MAGNITUDE)  { 
     244                        fprintf( view, "  Mbb: %3.1f", event->mag[EvcMagMbb] ); 
    242245                } /*endif*/ 
    243246        } /*endif*/ 
  • SH_SHM/trunk/util/locate_by_ttfit.csh

    r16 r46  
    44#      =================== 
    55# 
    6 # version 14, 4-Jun-2007 
     6# $Revision: 31 $, $Date: 2008-03-03 20:47:24 +0100 (Mo, 03 MÀr 2008) $ 
    77# 
    88# Locate event via travel time fit. 
     
    5252 
    5353chdir $SH_SCRATCH 
     54# set units for plot, want to change this to cm 
     55gmtdefaults -Du >.gmtdefaults 
    5456 
    5557# delete previously existing result file 
     
    296298#$PSVIEW -right $PWD/$psfile & # this dies after the shell terminates (on Sun) 
    297299 
    298 set xtmp=`whoami | cut -c1-6` 
    299  
    300 if  ("$xtmp" == "tmpusr")  then 
    301  
    302         $PSVIEW $PWD/$psfile & 
    303  
    304 else 
    305  
    306         set pos="" 
    307         if  ("`hostname`" == "ersn24")  set pos="-geometry 940x780+0+0" 
    308  
    309         rsh -n `hostname` "$PSVIEW -right -display $DISPLAY $pos $PWD/$psfile" & 
    310  
    311 endif 
     300$PSVIEW $PWD/$psfile & 
    312301 
    313302#\rm $fitxyz 
Note: See TracChangeset for help on using the changeset viewer.