Giter Site home page Giter Site logo

mopad's Introduction

MoPaD

the MoPaD repository

Put to GITHUB in version 09b

Python source:

mopad.py

License:

MoPaD is an open source program. It has been developed under the LGPL license. The license agreement should always be kept together with the code. (License.txt)

Copyright by Lars Krieger and Sebastian Heimann 2010.

mopad's People

Contributors

emolch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mopad's Issues

bug report - plot vs decompose

Plotting the DC component of the moment tensor via plot function outputs a different beach ball, compared to running the decompose function and plotting the DC matrix. (The former results to an all-red explosion beach ball, while the latter plots the correct DC beach ball.)

Figures attached. Script below:

% mopad plot 713668000000000,12428000000000,-726096000000000,-654200000000000,332200000000000,8175000000000 -P dc -f sampledc.png

% mopad decompose 713668000000000,12428000000000,-726096000000000,-654200000000000,332200000000000,8175000000000 -p dc

Double Couple part in NED-coordinates:

/ 0.78 -0.59 0.49
| -0.59 0.22 0.18 | x 435092335422952.562500
\ 0.49 0.18 -1.00 /

% mopad plot 0.78,0.22,-1,-0.59,0.49,0.18 -f sampledc2.png

sampledc
sampledc2

python3 compatibility

I think it would be great if this was python 3 compatible. I've submitted a pull request ([#5]) that has all of the necessary conversions (which are minor), and installs without errors on both python 3.4 and 2.7 (all that I use).

Thanks,
Richard

Is this the official repro for MoPaD?

Shouldn't MoPaD not be part of @emolch's repros? Don't know if Lars has a GitHub account. No offence meant - just curiosity ;)

Main reason is that there are a few patches to MoPaD within ObsPy which should be incorporated into the "official" repository.

Also personally I would like to refactor this file a bit (removing unsed vars / introduce PEP8). A bit problematic is that there are no tests written to ensure that refactoring does not break functionality :/

Cheers,
Robert

bug report

mopad plot -0.897,-0.820,-0.487,-0.373,-0.042,-0.038 -I -f a.png

and

makecpt -Cpolar -Z > psxy_fill.cpt
mopad gmt -0.897,-0.820,-0.487,-0.373,-0.042,-0.038 -I -t fill -p s | psxy -Jx4/4 -R-2/2/-2/2 -P -Cpsxy_fill.cpt -M -L > b.ps

get different pics

Big cleanup and todo

Mopad in its present form is not very useful as a Python module and many things could be improved. Here just a few suggestions in random order:

  • the BeachBall methods ploBB(), save_BB(), pa_plot, full_shere_plot() should be renamed into a consistent naming scheme

  • these methods take kwargs not **kwargs, why? This is not very intuitiv to use (and the documentation of the method is even wrong):

     beach.save_BB(dict(plot_outfile='mopad.png', plot_outfile_format='png'))
    
  • the string/value hybrid behaviour of the getter functions in MomentTensor should be avoided

  • exceptions raiseid in the code should contain proper information about what has gone wrong

  • error messages should never be printed to stdout

  • remove print statements in the getter functions of MomentTensor (this should be fixed quickly, because, whoever sees this will never again want to have a single look at mopad).

  • is there any good reason for using realpath() and abspath() when dealing with filenames in this code?

  • many of the excessive if-elif-else-orgies could be replaced with simple dict mappings. This would heavily shorten the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.