togezo 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c6a839255715bf9c7c9d7b558220ae81f4d85ea
4
- data.tar.gz: 84f3ad8e1f6758e01f44812afbc2f12e6b15980d
3
+ metadata.gz: bc92e9a8ab4e39e3f44eee796f3ae90d35df05ad
4
+ data.tar.gz: 3e5fc9a16f61521770e4d2cf9260c704a7d197a3
5
5
  SHA512:
6
- metadata.gz: 3c69585db2d9db500f4b477dc7b56be8fadd5106b18e2e1acf97eb7b6c303d6623394ee11e910faa7e14ad4561923bb13d35b0163a30bf20587b5c286a83d0b1
7
- data.tar.gz: 05e0fcc25e0025f8bf0315f02230696fbbdba4f1d5a75a9cf0683dfc6c83043eb951fc825cfe7d79359a04db3ce77a088b7ac45581484d939b81d340cc74fc07
6
+ metadata.gz: d0ab1b930819e28413b810e1ecad1be979b49be3c2d38c0ff4819c89b529d9c325fe025ba2d62fe90fbdfe4b391785985091bc7687f3b516572f86cae269376a
7
+ data.tar.gz: 70faf552ee540066d30d2dc114a72b4ab2b38a875d003e17a46f50ef347da36755f3d2dfcc2db11f3ba263f25c397bc33132effbe1b6f3faa662bbdd348ebe0c
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Shinichi Tokunaga
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -2,15 +2,47 @@
2
2
 
3
3
  This is a gem for getting extreme values on a chart via Gaussian/Pearson.
4
4
 
5
+ ![togezo](https://github.com/deepneko/togezo/blob/master/img/togezo.gif "togezo")
6
+
5
7
  ## Installation
6
8
 
9
+ You need to install [fityk](http://fityk.nieto.pl/ "fityk") at first.
10
+
11
+ $ apt-get install fityk
12
+
13
+ Then, please install togezo from rubygems.
14
+
7
15
  $ gem install togezo
8
16
 
9
17
  ## Usage
10
18
 
11
- togezo = Togezo.init("hoge.dat")
12
- peaks = togezo.fit
13
- p peaks
19
+ Prepare a data file describing x,y coordinates.
20
+
21
+ $ cat sample.dat
22
+ 0 46.177
23
+ 1 46.177
24
+ 2 46.168
25
+ 3 46.157
26
+ 4 46.151
27
+ :
28
+ :
29
+
30
+ Read the data file.
31
+
32
+ require 'togezo'
33
+ togezo = Togezo.init("sample.dat")
34
+
35
+ Fit with Gaussian or Pearson.
36
+
37
+ togezo.fit(Togezo::GAUSSIAN, 4) # 4 is the number of times of fitting.
38
+
39
+ Get extreme values as an array of x,y coordinates.
40
+
41
+ p togezo.peaks # All peaks
42
+ p togezo.positives # Positive peaks from the median of all data.
43
+ p togezo.negatives # Negative peaks from the median of all data.
44
+
45
+ ![peaks](https://github.com/deepneko/togezo/blob/master/img/peaks.png "peaks")
14
46
 
15
47
  ## Contributing
16
48
 
Binary file
Binary file
@@ -7,9 +7,21 @@ module Togezo
7
7
  PEARSON = 1
8
8
 
9
9
  def self.init(filename, debug=false)
10
+ unless fityk_installed?
11
+ puts "Please install fityk at first. http://fityk.nieto.pl/"
12
+ exit 0
13
+ end
10
14
  Togezo.new(filename, debug)
11
15
  end
12
16
 
17
+ def self.fityk_installed?
18
+ fityk_ver = `cfityk -V 2>&1`
19
+ if fityk_ver =~ /^fityk/
20
+ return true
21
+ end
22
+ false
23
+ end
24
+
13
25
  class Togezo
14
26
  attr_accessor :debug
15
27
  attr_reader :positives, :negatives, :peaks
@@ -1,3 +1,3 @@
1
1
  module Togezo
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'togezo'
2
2
 
3
3
  togezo = Togezo.init(ARGV[0])
4
- p togezo.fit(Togezo::GAUSSIAN, 5)
4
+ p togezo.fit(Togezo::GAUSSIAN, 4)
5
5
  p togezo.positives
6
6
  p togezo.negatives
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: togezo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - deepneko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-12 00:00:00.000000000 Z
11
+ date: 2015-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -49,10 +49,13 @@ files:
49
49
  - ".rspec"
50
50
  - ".travis.yml"
51
51
  - Gemfile
52
+ - LICENSE
52
53
  - README.md
53
54
  - Rakefile
54
55
  - bin/console
55
56
  - bin/setup
57
+ - img/peaks.png
58
+ - img/togezo.gif
56
59
  - lib/togezo.rb
57
60
  - lib/togezo/version.rb
58
61
  - sample/sample.dat