Example #1
0
def in_sdr( ifile ):
    """
    Read in from strike, dip, rake format
    """
    mtlist = iofuncs.read_sdrlist( ifile )
    return mtlist
Example #2
0
parser.add_argument("-v" , "--verbose", action="store_true", dest="isVb", default=False,
                    help="Verbose output")

args = parser.parse_args()

#------------------------------

# check some info was provided
if args.ifile.isatty():
    print >> sys.stderr, "Error: No ifile and nothing in stdin. Exiting..."
    sys.exit()

# read the moment tensors
if( args.ifmt == 1 ):
    if( args.isVb ): sys.stderr.write('Reading Strike/dip/rake.\n' )
    (mtlist, allin) = read_sdrlist( args.ifile )

    # convert
    for i in range(0,len(mtlist)): 
        mtlist[i] = dc2SymMT( mtlist[i] )

else:
    (mtlist, allin) = read_psmecalist( args.ifile, isEig=False )

ndata = len(mtlist)
if( args.isVb ): sys.stderr.write('%i events read in.\n' % ndata )

# normalise correction
if( args.stype == 1):  
    for i in range( 0, ndata ): mtlist[i].Norm = 1
Example #3
0
                    default=False,
                    help="Verbose output")

args = parser.parse_args()

#------------------------------

# check some info was provided
if args.ifile.isatty():
    print >> sys.stderr, "Error: No ifile and nothing in stdin. Exiting..."
    sys.exit()

# read the moment tensors
if (args.ifmt == 1):
    if (args.isVb): sys.stderr.write('Reading Strike/dip/rake.\n')
    (mtlist, allin) = read_sdrlist(args.ifile)

    # convert
    for i in range(0, len(mtlist)):
        mtlist[i] = dc2SymMT(mtlist[i])

else:
    (mtlist, allin) = read_psmecalist(args.ifile, isEig=False)

ndata = len(mtlist)
if (args.isVb): sys.stderr.write('%i events read in.\n' % ndata)

# normalise correction
if (args.stype == 1):
    for i in range(0, ndata):
        mtlist[i].Norm = 1
Example #4
0
                    default=False,
                    help="Verbose output [False]")

args = parser.parse_args()

#------------------------------

# check some info was provided
if args.ifile.isatty():
    print >> sys.stderr, "Error: No ifile and nothing in stdin. Exiting..."
    sys.exit()

# read the moment tensors
if (args.ifmt == 1):
    if (args.isVb): sys.stderr.write('Reading Strike/dip/rake.\n')
    (mtlist, alltxt) = IO.read_sdrlist(args.ifile)
else:
    (mtlist, alltxt) = IO.read_psmecalist(args.ifile, isEig=True)

ndata = len(mtlist)
if (args.isVb): sys.stderr.write('%i events read in.\n' % ndata)

# convert min plunge to min abs val of z component
if (args.pmin != None):
    if (args.isVb): sys.stderr.write('p_min = %f.\n' % args.pmin)
    minZ = sin(abs(args.pmin) * pi / 180)
    if (args.isVb): sys.stderr.write('minZ = %f.\n' % minZ)
else:
    # no oblique category if pmin is not defined
    minZ = 0.0
Example #5
0
parser.add_argument("-v" , "--verbose", action="store_true", dest="isVb", default=False,
                    help="Verbose output [False]")

args = parser.parse_args()

#------------------------------

# check some info was provided
if args.ifile.isatty():
    print >> sys.stderr, "Error: No ifile and nothing in stdin. Exiting..."
    sys.exit()

# read the moment tensors
if( args.ifmt == 1 ):
    if( args.isVb ): sys.stderr.write('Reading Strike/dip/rake.\n' )
    (mtlist, alltxt) = IO.read_sdrlist( args.ifile )
else:
    (mtlist, alltxt) = IO.read_psmecalist( args.ifile , isEig=True )

ndata = len(mtlist)
if( args.isVb ): sys.stderr.write('%i events read in.\n' % ndata )

# convert min plunge to min abs val of z component
if( args.pmin != None ):
    if( args.isVb ): sys.stderr.write('p_min = %f.\n' % args.pmin )
    minZ = sin(abs(args.pmin)*pi/180)
    if( args.isVb ): sys.stderr.write('minZ = %f.\n' % minZ )
else:
    # no oblique category if pmin is not defined
    minZ = 0.0