Coder Social home page Coder Social logo

pharminv's People

Contributors

aaren avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

pharminv's Issues

Add Cython as a requirement

I had difficulties installing pharminv...
Semms like Cython is a requirement. Can you include that into the documentation?

Wrong Answers

Edit: the errors below have to do with the settings in the example code. Changing fmin or setting dt helps. Not I'm getting the real sinusoid divided up into two entries, one with the same frequence but negative, both at half the amplitude. Is there some setting I'm missing?


Using Ubuntu 14.04, I installed harminv from apt-get, and pharminv using pip.

The example provided here runs without error, but does not appear to return the correct answer. The output of >> inversion is:

rec.array([ (-8.6253957423602e-11, 2.0112201361652824, 4.0738465133229765e-10, -0.009925186956024614, -2.7301732469689393e-08, 0.5000000012106294)],
dtype=[('frequency', '<f8'), ('amplitude', '<f8'), ('phase', '<f8'), ('decay', '<f8'), ('Q', '<f8'), ('error', '<f8')])

I tried removing one of the sinusoids and the result is similar.

By the way, thanks for writing what looks like a very useful tool.

Scaling of frequency and decay rate

There seems to be some issues with the output calculation of frequency and decay rate. The "number" coming out of the code are correct, but with a 10^3 order of magnitude mistake. The fact that both the (real) frequency and decay rate comes wrong with the same order of magnitude makes sense, since:

complex frequency = real frequency + i * decay rate

I have a test code that I'm sending over through your email if you want to see!

Best regards,

Alex

harminv does not import in python 3.5

harminv does not import in python 3.5 (ubuntu 16.04) with error

In [1]: import harminv
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-2da652359f4a> in <module>()
----> 1 import harminv

/usr/local/lib/python3.5/dist-packages/pharminv-0.3-py3.5-linux-x86_64.egg/harminv/__init__.py in <module>()
----> 1 from harminv import Harminv, invert

ImportError: cannot import name 'Harminv'

This can be fixed by the following patch

From 5bd2352cf4a055fee6b4e19849e99395e1614dab Mon Sep 17 00:00:00 2001
From: Stepan Roucka <[email protected]>
Date: Wed, 12 Oct 2016 10:54:57 +0200
Subject: [PATCH] Fix imports for python3

---
 harminv/__init__.py | 2 +-
 harminv/harminv.py  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/harminv/__init__.py b/harminv/__init__.py
index a234b26..45f4fb2 100644
--- a/harminv/__init__.py
+++ b/harminv/__init__.py
@@ -1 +1 @@
-from harminv import Harminv, invert
+from .harminv import Harminv, invert
diff --git a/harminv/harminv.py b/harminv/harminv.py
index f56cc1f..c00cbce 100644
--- a/harminv/harminv.py
+++ b/harminv/harminv.py
@@ -1,6 +1,6 @@
 import numpy as np

-import charminv
+from . import charminv


 class Harminv(charminv.Harminv):
-- 
2.7.4

But it may break python 2 compatibility.

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.