geoist.catalog package¶
Submodules¶
geoist.catalog.AsciiTools module¶
A simple tool to manipulate data from/to ascii files.
-
class
geoist.catalog.AsciiTools.
AsciiTable
(header=[])[源代码]¶ 基类:
object
-
AddElement
(data=[])[源代码]¶ Add an element (with header's format) to the data structure. Element can be empty or filled with data.
-
AddKey
(key, data=[], index=- 1)[源代码]¶ Add header key at given position (default is last element). Data structure can optionally be inflated.
-
Append
(new_table)[源代码]¶ Method to merge two data structures consecutively. (Header structure must be identical).
-
Export
(ascii_file, write_header='yes', delimiter=',')[源代码]¶ Method to export data object into an ascii file.
-
ExportEQT
(ascii_file, write_header='no', delimiter=' ')[源代码]¶ Method to export data object into an ascii file.
-
Filter
(key, filter_key)[源代码]¶ Method to filter the data table by key value. Value can be a string to amtch (* and ? allowed) or a numerical range (as a list of floats). In output it is returned a new table.
-
Import
(ascii_file, header=[], dtype='float', delimiter=',', skipline=0, comment='#', empty=[])[源代码]¶ Method to import data from ascii file (tabular)
-
geoist.catalog.CatUtils module¶
-
class
geoist.catalog.CatUtils.
Polygon
[源代码]¶ 基类:
object
-
AddBuffer
(Delta)[源代码]¶ TO DO: Tempory implementation using Shapely. In the future, all Polygon objects will be defined this way
-
Area
(Wgs=True)[源代码]¶ Using Shoelace formula to compute area. Optionally, Wgs coordinates can be approximated to Km using sinusoidal projection (default).
-
CartGrid
(Dx=0.1, Dy=0.1, Bounds=[])[源代码]¶ Produce a lat/lon cartesian grid. Dx and Dy distances are degrees (area is not preserved). Bounds are [MinX, MinY, MaxX, MaxY]
-
Load
(XY)[源代码]¶ Input polygon can be defined in two possible ways:
- list of x-y float pairs, e.g.
[[22.0, -15.0],[24.0, -15.0],[24.0, -10.0],[22.0, -15.0]]
- wkt formatted string, e.g.
'POLYGON((22. -15.,24. -15.,24. -10.,22. -15.))'
-
-
geoist.catalog.CatUtils.
SphericalMesh
(Delta, Km=False)[源代码]¶ Produce a shperical mesh using golder spiral algorithm. Distance is the average beween nearby points (degree by default).
-
class
geoist.catalog.CatUtils.
Trace
[源代码]¶ 基类:
object
-
Load
(XY)[源代码]¶ Input trace line can be defined in two possible ways:
- list of x-y float pairs, e.g.
[[22.0, -15.0],[24.0, -15.0],[24.0, -10.0],[22.0, -15.0]]
- wkt formatted string, e.g.
'LINESTRING((22. -15.,24. -15.,24. -10.,22. -15.))'
-
Resample
(Delta)[源代码]¶ Original code by Christian K (modified) https://stackoverflow.com/users/2588210/christian-k
-
-
geoist.catalog.CatUtils.
WgsDistance
(Lat1, Lon1, Lat2, Lon2)[源代码]¶ Author: Salvador Dali http://stackoverflow.com/users/1090562/salvador-dali
-
geoist.catalog.CatUtils.
WgsToXY
(Lat, Lon, Km=True)[源代码]¶ Approximate conversion using sinusoidal projection.
geoist.catalog.Catalogue module¶
Module for Earthquake Catalogue Storage and Manipulation. Examples of earthquake catalogue format: eventID,Agency,year,month,day,hour,minute,second,longitude,latitude,SemiMajor90,SemiMinor90,ErrorStrike,depth,depthError,magnitude,sigmaMagnitude,moment,scaling,source,mpp,mpr,mrr,mrt,mtp,mtt
-
class
geoist.catalog.Catalogue.
Database
(Name=[], Info=[])[源代码]¶ 基类:
object
EARTHQUAKE CATALOGUE DATABASE OBJECT Initialisation parameters:
Name [str, Optional] = Catalogue identifier string Info [str, Optional] = Additional catalogue information
-
.Header [dict] = Container for catalogue information
-
.Events [list] = Container for earthquake events
-
.AddEvent = Add an earthquake event to the database
-
.DelEvent = Remove an earthquake avent from the database
-
.Import = Import catalogue from file (csv format)
-
.ImportEQT = Import catalogue form file(eqt format)
-
.Export = Export catalogue to file (csv format)
-
.ExportEQT = Export catalogue to file (eqt format)
-
.Load = Import database structure from binary file (cPickle compressed)
-
.Dump = Exprot database structure to binary file (cPickle compressed)
-
.Filter = Filter earthquake events by key field and rule
-
.Extract = Extract database information by key field
-
.KeyStat = Compute statistics on key field occurrence
-
.Copy = Create hardcopy of the database
-
.Append = Concatenate event list of two databases
-
.Size = Output number of earthquake events
-
.Print = Print event information on screen (by ID or index)
-
.Sort = Sort events according to origin time
- [to check]:
.SetField = Set database key field to a specific value .GetIndex = Get event index from ID string .SetID = Regenerate progressive IDs
-
geoist.catalog.Declusterer module¶
geoist.catalog.Exploration module¶
-
geoist.catalog.Exploration.
DuplicateCheck
(Log, Tmax=[], Smax=[], Tnum=[], Snum=[], Smooth=[], OutFile=[])[源代码]¶
-
geoist.catalog.Exploration.
GetKeyHisto
(Db, Key, Bins=[], Bmin=[], Bmax=[], Bnum=10, Blog=False, Norm=True, Plot=True, OutFile=[])[源代码]¶
-
geoist.catalog.Exploration.
KeyTimeHisto
(Db, Code, Key=[], Year0=[], Year1=[], Delta=5, Threshold=0, OutFile=[])[源代码]¶
-
geoist.catalog.Exploration.
MagTimeBars
(Db, Mag0=[], Mag1=[], MBin=0.5, Year0=[], Year1=[], Delta=5, OutFile=[])[源代码]¶
geoist.catalog.MagRules module¶
geoist.catalog.MapTools module¶
-
class
geoist.catalog.MapTools.
GeoMap
(Cfg=[])[源代码]¶ 基类:
object
INFO:
Map boundary edges order: [LeftLowerLon,LeftLowerLat,UpperRightLon,UpperRightLat]
- Background type:
'none' 'etopo' 'esri' --> background source
- Background sources available for 'esri':
ESRI_Imagery_World_2D (MapServer) ESRI_StreetMap_World_2D (MapServer) I3_Imagery_Prime_World (GlobeServer) NASA_CloudCover_World (GlobeServer) NatGeo_World_Map (MapServer) NGS_Topo_US_2D (MapServer) Ocean_Basemap (MapServer) USA_Topo_Maps (MapServer) World_Imagery (MapServer) World_Physical_Map (MapServer) World_Shaded_Relief (MapServer) World_Street_Map (MapServer) World_Terrain_Base (MapServer) World_Topo_Map (MapServer)
geoist.catalog.Parsers module¶
Module for Specific Catalogue Parsers
geoist.catalog.QCmulti module¶
Code for creating figures comparing two catalogs spanning the same time frame. Run QCmulti.py -h for command line options.
geoist.catalog.QCreport module¶
geoist.catalog.QCutils module¶
-
geoist.catalog.QCutils.
WW2000
(mcval, mags, binsize)[源代码]¶ Wiemer and Wyss (2000) method for determining a and b values.
-
geoist.catalog.QCutils.
draw_grid
(lats, lons, col, alpha=1)[源代码]¶ Draw rectangle with vertices given in degrees.
-
geoist.catalog.QCutils.
get_azs_and_dists
(cat1, cat2, cat1mids, cat2mids)[源代码]¶ Calculate azimuths for all matches between two catalogs.
-
geoist.catalog.QCutils.
get_data
(catalog, dirname, startyear=2000, endyear=2000, minmag=- 5, maxmag=12)[源代码]¶ Download catalog data from earthquake.usgs.gov
-
geoist.catalog.QCutils.
group_lat_lons
(catalog, minmag=- 5)[源代码]¶ Group detections by nearest grid-square center and return min/max of counts.
-
geoist.catalog.QCutils.
progress_bar
(count, total, status='')[源代码]¶ Show progress bar for the desired task.
-
geoist.catalog.QCutils.
range2rgb
(rmin, rmax, numcolors)[源代码]¶ Create a list of red RGB values using colmin and colmax with numcolors number of colors.
-
geoist.catalog.QCutils.
round2bin
(number, binsize, direction)[源代码]¶ Round number to nearest histogram bin edge (either 'up' or 'down').
geoist.catalog.Regressor module¶
geoist.catalog.Seismicity module¶
-
geoist.catalog.Seismicity.
GetEventRates
(Db, CompTable, Area=1.0)[源代码]¶ Method to compute observed annual rates (incremental and cumulative) from a given completeness table. In this implementation, completeness is one window per magnitude bin in M. Example: CompTable = [[4.50, 0.25, 2000., 2013.],
[4.75, 0.25, 1980., 2013.], [5.00, 0.25, 1970., 2013.], [5.25, 0.25, 1960., 2013.], [5.50, 0.50, 1950., 2013.], [6.00, 1.50, 1901., 2013.]]
-
geoist.catalog.Seismicity.
MfdCum
(a, b, Mbin, Mmax)[源代码]¶ Cumulative MFD (Truncated Gutenberg-Richter)
-
geoist.catalog.Seismicity.
MfdFit
(ab, Enum, Mbin, Minc, Mmax, Merr, bfix=[])[源代码]¶ Misfit function (log normal)
-
geoist.catalog.Seismicity.
MfdInc
(a, b, Mbin, Minc, Mmax)[源代码]¶ Incremental MFD (for discrete magnitude intervals).
-
geoist.catalog.Seismicity.
MfdOptimize
(Enum, Mbin, Minc, Mmax, Merr=[], a0=[], b0=[], bfix=[])[源代码]¶ Optimisation function Note: Minc and Merr can be single (constant) values or array
geoist.catalog.Selection module¶
-
geoist.catalog.Selection.
AreaSelect
(Db, XY, File=[], Owrite=False, Any=False, Buffer=[], Unwrap=False)[源代码]¶
-
geoist.catalog.Selection.
MagConvert
(Db, MagAgency, MagOld, MagNew, ConvFun, Coeff=None, Owrite=True)[源代码]¶
-
geoist.catalog.Selection.
MagRangeSelect
(Db, MinMag, MaxMag, Owrite=False, Any=False, TopEdge=False)[源代码]¶
-
geoist.catalog.Selection.
MergeDuplicate
(DbA, DbB=[], Twin=60.0, Swin=50.0, Mwin=[], Zwin=[], Tunit='Second', Owrite=True, Log=False, LogFile=[])[源代码]¶
geoist.catalog.Smoothing module¶
geoist.catalog.decorators module¶
geoist.catalog.findDuplicates module¶
-
geoist.catalog.findDuplicates.
detect_duplicates
(catfile, otwindow=16, distwindow=100, diffnet=True)[源代码]¶ Return possible duplicate events within a catalog.