Comments (5)
def str(self):
'''
STUFF GOES HERE
'''
from quakemigrate.
Magic method__str__() returns a printable string representation of any user defined class when str(object) is called.
from quakemigrate.
I have a print string suggestion for class LUT:
def __str__(self):
"""
Return short summary string of the LUT object
It will provide the defining properties of the LUT - location, underlying
grid properties and the simple 1D velocity structure.
"""
out = "QuakeMigrate traveltime look-up table"
out += "\n\tGrid centre\t:\t{lat:10.5f}\u00b0N {lon:10.5f}\u00b0E {dep:6.3f} km"
out += "\n\tNumber of cells\t:\t{xn:4d} {yn:4d} {zn:4d}"
out += "\n\tCell size\t:\t{xs:6.3f} km {ys:6.3f} km {zs:6.3f} km"
out += "\n\t1D velocity model:"
out += "\n\t\tDepth\tVp\tVs"
out = out.format(xn=self.cell_count[0], yn=self.cell_count[1],
zn=self.cell_count[2], xs=self.cell_size[0] / 1000.,
ys=self.cell_size[1] / 1000., zs=self.cell_size[2] / 1000.,
lat=self.latitude, lon=self.longitude, dep=self.elevation / 1000.)
for i, layer in self.velocity_model.iterrows():
vel = "\t\t{:6.3f}\t{:6.3f}\t{:6.3f}"
vel = vel.format(layer["depth"] / 1000., layer["vp"] / 1000.,
layer["vs"] / 1000.)
out += "\n{}".format(vel)
return out
from quakemigrate.
Print string suggestion for class mSEED:
def __str__(self):
"""
Return short summary string of the mSEED object
It will provide information about the archive location and structure,
data sampling rate and time period over which the archive is being queried.
"""
out = "QuakeMigrate mSEED object"
out += "\n\tHost path\t:\t{}".format(self.MSEED_path)
out += "\n\tPath structure\t:\t{}".format(self.format)
out += "\n\tResampling\t:\t{}".format(self.resample)
out += "\n\tSampling rate\t:\t{}".format(self.sampling_rate)
out += "\n\tStart time\t:\t{}".format(str(self.start_time))
out += "\n\tEnd time\t:\t{}".format(str(self.end_time))
out += "\n\tStations:"
for station in self.stations:
out += "\n\t\t{}".format(station)
return out
On initialisation, the object only contains the host path and stations - the path structure is set by a user function call. The start time, end time and sampling rate are altered on the fly for each time step of detect.
from quakemigrate.
Print string suggestion for class SeisScan:
def __str__(self):
"""
Return short summary string of the SeisScan object
It will provide information on all of the various parameters that the
user can/has set.
"""
out = "QuakeMigrate parameters"
out += "\n\tTime step\t\t:\t{}".format(self.time_step)
out += "\n\n\tData sampling rate\t:\t{}".format(self.sampling_rate)
out += "\n\tOutput sampling rate\t:\t{}".format(
self.output_sampling_rate)
out += "\n\n\tDecimation\t\t:\t[{}, {}, {}]".format(
self.decimate[0], self.decimate[1], self.decimate[2])
out += "\n\n\tBandpass filter P\t:\t[{}, {}, {}]".format(
self.p_bp_filter[0], self.p_bp_filter[1], self.p_bp_filter[2])
out += "\n\tBandpass filter S\t:\t[{}, {}, {}]".format(
self.s_bp_filter[0], self.s_bp_filter[1], self.s_bp_filter[2])
out += "\n\n\tOnset P [STA, LTA]\t:\t[{}, {}]".format(
self.p_onset_win[0], self.p_onset_win[1])
out += "\n\tOnset S [STA, LTA]\t:\t[{}, {}]".format(
self.s_onset_win[0], self.s_onset_win[1])
out += "\n\n\tPre-pad\t\t\t:\t{}".format(self.pre_pad)
out += "\n\tPost-pad\t\t:\t{}".format(self.post_pad)
out += "\n\n\tMarginal window\t\t:\t{}".format(self.marginal_window)
out += "\n\tMinimum repeat\t\t:\t{}".format(self.minimum_repeat)
out += "\n\tDetection threshold\t:\t{}".format(self.detection_threshold)
out += "\n\tPick threshold\t\t:\t{}".format(self.pick_threshold)
out += "\n\tPicking mode\t\t:\t{}".format(self.picking_mode)
out += "\n\tPercent ttime\t\t:\t{}".format(self.percent_tt)
out += "\n\tLocation error\t\t:\t{}".format(self.location_error)
out += "\n\n\tCentred onset\t\t:\t{}".format(self._onset_centred)
out += "\n\tNormalise coalescence\t:\t{}".format(
self.normalise_coalescence)
out += "\n\n\tNumber of CPUs\t\t:\t{}".format(self.n_cores)
return out
This could be improved - currently I just put out every parameter that can be set by the user with some basic grouping and formatting.
from quakemigrate.
Related Issues (20)
- Error when no earthquke in trigger step. HOT 2
- BUG: Add "units" arg to to_mfast.py
- ImportError: Could not load extension library 'qmlib'. HOT 10
- [BUG]: All traces rejected where one pair can't be merged due to "Incompatible traces" error.
- error in compute_traveltimes HOT 4
- Issue Import QuakeMigrate in Python (AttributeError) HOT 2
- No files found in archive for this time period : No detection HOT 4
- Overlapping waveforms in locate plot summary HOT 4
- PickTimes export to Obspy HOT 7
- [BUG]: skfmm LUT generation doesn't work for the southern hemisphere HOT 2
- AttributeError: module 'numpy' has no attribute 'bool'. HOT 6
- FEAT: Make picking optional.
- BUG: 'discarded' events not being plotted in Trigger summary
- BUG: Binder notebooks do not work. HOT 1
- Allow multiple channels for P phase in event & pick plots
- FEAT: Build QuakeMigrate travel-time lookup tables from 3-D velocity models
- BUG: plotting failure with matplotlib 3.8 HOT 2
- Data failed to pass the specified data quality criteria HOT 3
- Tests failing due to change in NonLinLoc source directory HOT 2
- BUG: cibuildwheel fails to build wheels for Windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quakemigrate.