本文整理汇总了Python中pyrocko.guts.Object类的典型用法代码示例。如果您正苦于以下问题:Python Object类的具体用法?Python Object怎么用?Python Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Object类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, m=None, m_up_south_east=None, strike=0., dip=0., rake=0., scalar_moment=1.,
mnn=None, mee=None, mdd=None, mne=None, mnd=None, med=None,
strike1=None, dip1=None, rake1=None, strike2=None, dip2=None, rake2=None, magnitude=None, moment=None):
Object.__init__(self, init_props=False)
if any(mxx is not None for mxx in (mnn, mee, mdd, mne, mnd, med)):
m = symmat6(mnn, mee, mdd, mne, mnd, med)
strike = d2r*strike
dip = d2r*dip
rake = d2r*rake
if m_up_south_east is not None:
m = self._to_up_south_east * m_up_south_east * self._to_up_south_east.T
if m is None:
if any(x is not None for x in (strike1, dip1, rake1, strike2, dip2, rake2)):
raise Exception('strike1, dip1, rake1, strike2, dip2, rake2 are read-only properties')
if moment is not None:
scalar_moment = moment
if magnitude is not None:
scalar_moment = magnitude_to_moment(magnitude)
rotmat1 = euler_to_matrix( dip, strike, -rake )
m = rotmat1.T * MomentTensor._m_unrot * rotmat1 * scalar_moment
self._m = m
self._update()
开发者ID:gomes310,项目名称:pyrocko,代码行数:31,代码来源:moment_tensor.py
示例2: __init__
def __init__(
self,
approx_ticks=7.0,
mode='auto',
exp=None,
snap=False,
inc=None,
space=0.0,
exp_factor=3,
no_exp_interval=(-3, 5)):
'''
Create new AutoScaler instance.
The parameters are described in the AutoScaler documentation.
'''
Object.__init__(
self,
approx_ticks=approx_ticks,
mode=mode,
exp=exp,
snap=snap,
inc=inc,
space=space,
exp_factor=exp_factor,
no_exp_interval=no_exp_interval)
开发者ID:emolch,项目名称:pyrocko,代码行数:27,代码来源:__init__.py
示例3: __init__
def __init__(self, **kwargs):
self._do_auto_updates = False
Object.__init__(self, **kwargs)
self._index_function = None
self._indices_function = None
self._vicinity_function = None
self._do_auto_updates = True
self.update()
开发者ID:josephwinston,项目名称:pyrocko,代码行数:8,代码来源:meta.py
示例4: __init__
def __init__(self, xmin, ymin, dx, dy, data):
Object.__init__(self, init_props=False)
self.xmin = float(xmin)
self.ymin = float(ymin)
self.dx = float(dx)
self.dy = float(dy)
self.data = data
self._set_maxes()
开发者ID:gladkovvalery,项目名称:pyrocko,代码行数:8,代码来源:automap.py
示例5: __setattr__
def __setattr__(self, name, value):
Object.__setattr__(self, name, value)
try:
self.T.get_property(name)
if self._do_auto_updates:
self.update()
except ValueError:
pass
开发者ID:josephwinston,项目名称:pyrocko,代码行数:9,代码来源:meta.py
示例6: __init__
def __init__(self, name, azimuth=None, dip=None, gain=1.0):
if azimuth is None:
azimuth = guess_azimuth_from_name(name)
if dip is None:
dip = guess_dip_from_name(name)
Object.__init__(
self,
name=name,
azimuth=float_or_none(azimuth),
dip=float_or_none(dip),
gain=float(gain))
开发者ID:HerrMuellerluedenscheid,项目名称:pyrocko,代码行数:12,代码来源:station.py
示例7: __init__
def __init__(self, name, lat, lon, population=None, asciiname=None):
name = newstr(name)
lat = float(lat)
lon = float(lon)
if asciiname is None:
asciiname = name.encode('ascii', errors='replace')
if population is None:
population = 0
else:
population = int(population)
Object.__init__(self, name=name, lat=lat, lon=lon,
population=population, asciiname=asciiname)
开发者ID:hvasbath,项目名称:pyrocko,代码行数:14,代码来源:automap.py
示例8: __init__
def __init__(self, network='', station='', location='', lat=0.0, lon=0.0,
elevation=0.0, depth=0.0, name='', channels=None):
Object.__init__(self,
network=network, station=station, location=location,
lat=float(lat), lon=float(lon),
elevation=elevation and float(elevation) or 0.0,
depth=depth and float(depth) or 0.0,
name=name or '',
channels=channels or [])
self.dist_deg = None
self.dist_m = None
self.azimuth = None
self.backazimuth = None
开发者ID:iceseismic,项目名称:pyrocko,代码行数:15,代码来源:model.py
示例9: __init__
def __init__(self, *args, **kwargs):
kwargs.update(self.args2kwargs(args))
sources = kwargs.pop('sources', [])
targets = kwargs.pop('targets', [])
reductions = kwargs.pop('reductions', [])
if isinstance(sources, Source):
sources = [sources]
if isinstance(targets, Target):
targets = [targets]
if isinstance(reductions, Reduction):
reductions = [reductions]
Object.__init__(self, sources=sources, targets=targets,
reductions=reductions, **kwargs)
开发者ID:josephwinston,项目名称:pyrocko,代码行数:17,代码来源:seismosizer.py
示例10: __init__
def __init__(self, *args, **kwargs):
Object.__init__(self, *args, **kwargs)
self.h = num.abs(self.d - num.roll(self.d, -1))
self.h[-1] = 0
self.nlayers = self.h.size
self.geographical_location = '%s (%s)' % (
provinceKey(self.geographical_location),
self.geographical_location)
self.vs[self.vs == 0] = num.nan
self.vp[self.vp == 0] = num.nan
self._step_vp = num.repeat(self.vp, 2)
self._step_vs = num.repeat(self.vs, 2)
self._step_d = num.roll(num.repeat(self.d, 2), -1)
self._step_d[-1] = self._step_d[-2] + THICKNESS_HALFSPACE
开发者ID:HerrMuellerluedenscheid,项目名称:pyrocko,代码行数:18,代码来源:crustdb.py
示例11: __init__
def __init__(self, lat=0., lon=0., time=0., name='', depth=None,
magnitude=None, magnitude_type=None, region=None, load=None,
loadf=None, catalog=None, moment_tensor=None, duration=None):
vals = None
if load is not None:
vals = Event.oldload(load)
elif loadf is not None:
vals = Event.oldloadf(loadf)
if vals:
lat, lon, time, name, depth, magnitude, magnitude_type, region, \
catalog, moment_tensor, duration = vals
Object.__init__(self, lat=lat, lon=lon, time=time, name=name, depth=depth,
magnitude=magnitude, magnitude_type=magnitude_type,
region=region, catalog=catalog,
moment_tensor=moment_tensor, duration=duration)
开发者ID:gladkovvalery,项目名称:pyrocko,代码行数:18,代码来源:model.py
示例12: __init__
def __init__(self, m=None, m_up_south_east=None, strike=0., dip=0., rake=0., scalar_moment=1.,
mnn=None, mee=None, mdd=None, mne=None, mnd=None, med=None,
strike1=None, dip1=None, rake1=None, strike2=None, dip2=None, rake2=None, magnitude=None, moment=None):
'''Create moment tensor object based on 3x3 moment tensor matrix or orientation of
fault plane and scalar moment.
In:
m -- Matrix in north-east-down convention
m_up_south_east -- Matrix in up-south-east convention
strike, dip, rake -- Fault plane angles in [degrees]
scalar_moment -- Scalar moment in [Nm]
'''
Object.__init__(self, init_props=False)
if any(mxx is not None for mxx in (mnn, mee, mdd, mne, mnd, med)):
m = symmat6(mnn, mee, mdd, mne, mnd, med)
strike = d2r*strike
dip = d2r*dip
rake = d2r*rake
if m_up_south_east is not None:
m = self._to_up_south_east * m_up_south_east * self._to_up_south_east.T
if m is None:
if any(x is not None for x in (strike1, dip1, rake1, strike2, dip2, rake2)):
raise Exception('strike1, dip1, rake1, strike2, dip2, rake2 are read-only properties')
if moment is not None:
scalar_moment = moment
if magnitude is not None:
scalar_moment = magnitude_to_moment(magnitude)
rotmat1 = euler_to_matrix( dip, strike, -rake )
m = rotmat1.T * MomentTensor._m_unrot * rotmat1 * scalar_moment
self._m = m
self._update()
开发者ID:gladkovvalery,项目名称:pyrocko,代码行数:40,代码来源:moment_tensor.py
示例13: __init__
def __init__(self, **kwargs):
Object.__init__(self, **kwargs)
self._path = None
self._pile = None
self._engine = None
self._scenes = None
开发者ID:HerrMuellerluedenscheid,项目名称:pyrocko,代码行数:6,代码来源:collection.py
示例14: __init__
def __init__(self, *args, **kwargs):
Object.__init__(self, *args, **kwargs)
self._cov_mat = None
self._cor_mat = None
开发者ID:emolch,项目名称:pyrocko,代码行数:4,代码来源:gnss.py
示例15: dump
def dump(self, *args, **kwargs):
self.regularize()
return Object.dump(self, *args, **kwargs)
开发者ID:emolch,项目名称:pyrocko,代码行数:3,代码来源:gnss.py
示例16: __setattr__
def __setattr__(self, name, value):
if name in ('lat', 'lon', 'north_shift', 'east_shift'):
self.__dict__['_latlon'] = None
Object.__setattr__(self, name, value)
开发者ID:HerrMuellerluedenscheid,项目名称:pyrocko,代码行数:5,代码来源:location.py
示例17: __init__
def __init__(self, **kwargs):
Object.__init__(self, **kwargs)
self._latlon = None
开发者ID:HerrMuellerluedenscheid,项目名称:pyrocko,代码行数:3,代码来源:location.py
示例18: __init__
def __init__(self, **kwargs):
last[0] = len(kwargs)
Object.__init__(self, **kwargs)
开发者ID:emolch,项目名称:pyrocko,代码行数:3,代码来源:test_guts.py
示例19: __init__
def __init__(self, *args, **kwargs):
Object.__init__(self, *args, **kwargs)
self._mask_water = None
开发者ID:emolch,项目名称:pyrocko,代码行数:3,代码来源:insar.py
示例20: __init__
def __init__(self, **kwargs):
Object.__init__(self, **kwargs)
self._seed = None
self._parent = None
self.update_hierarchy()
self._retry_offset = 0
开发者ID:HerrMuellerluedenscheid,项目名称:pyrocko,代码行数:6,代码来源:base.py
注:本文中的pyrocko.guts.Object类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论