Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
pawbz committed Aug 22, 2019
1 parent e01e00b commit c24954b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
julia: 1.0
os: linux
script:
- julia --project=docs/ -e 'using Pkg; Pkg.add("Documenter"); Pkg.add("Plots"); Pkg.add("Plotly"); Pkg.add(PackageSpec(name="Misfits",url="https://github.com/pawbz/Misfits.jl.git"));Pkg.add(PackageSpec(name="Conv",url="https://github.com/pawbz/Conv.jl.git"));Pkg.develop(PackageSpec(path=pwd()));Pkg.instantiate()'
- julia --project=docs/ -e 'using Pkg; Pkg.add("Documenter"); Pkg.add("Gadfly");Pkg.add(PackageSpec(name="Misfits",url="https://github.com/pawbz/Misfits.jl.git"));Pkg.add(PackageSpec(name="Conv",url="https://github.com/pawbz/Conv.jl.git"));Pkg.develop(PackageSpec(path=pwd()));Pkg.instantiate()'
- julia --project=docs/ docs/make.jl
after_success: skip

6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Pkg; Pkg.add("Plots"); Pkg.add("Plotly")
using Pkg; Pkg.add("Gadfly");

using Documenter, FocusedBlindDecon
using Plots
plotly()
using Gadfly

makedocs(
format = Documenter.HTML(
Expand Down
16 changes: 8 additions & 8 deletions docs/src/tut1.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Load packages.
```@example tut1
using Conv
using FocusedBlindDecon
using Plots
plotly()
using Gadfly
```

We consider an illustrative synthetic experiment with the following parameters.
Expand All @@ -30,15 +29,16 @@ depending on `bfrac`. Their amplitudes are determined by `afrac`.
gobs=zeros(ntg,nr) # allocate
FBD.toy_direct_green!(gobs, c=4.0, bfrac=0.20, afrac=1.0); # add arrival 1
FBD.toy_reflec_green!(gobs, c=1.5, bfrac=0.35, afrac=-0.6); # add arrival 2
plotg=(x;args...)->heatmap(x, size=(250,500), yflip=true, ylabel="time", xlabel="channel";args...) # define a plot recipe
p1=plotg(gobs, title="True g")
#plotg=(x;args...)->heatmap(x, size=(250,500), yflip=true, ylabel="time", xlabel="channel";args...) # define a plot recipe
#p1=plotg(gobs, title="True g")
```

The source signature `s` for the experiment is arbitrary: we simply use a Gaussian random signal.

```@example tut1
sobs=randn(nts)
plot(sobs, label="arbitrary source", size=(1000,200))
#plot(sobs, label="arbitrary source", size=(1000,200))
plot(x=1:10, y=randn(10))
```

The next task is to generate synthetic observed records `dobs`:
Expand Down Expand Up @@ -66,7 +66,7 @@ FBD.lsbd!(pa)
We extract `g` from `pa` and plot to notice that it doesn't match `gobs`.

```@example tut1
p2=plotg(pa[:g], title="LSBD g")
#p2=plotg(pa[:g], title="LSBD g")
```

Instead, we perform FBD that uses the focusing functionals to regularize `lsbd!`.
Expand All @@ -78,7 +78,7 @@ FBD.fbd!(pa)
Notice that the extract impulse responses are closer to `gobs`, except for a scaling factor and an overall translation in time.

```@example tut1
p3=plotg(pa[:g], title="FBD g")
plot(p1,p2,p3, size=(750,500), layout=(1,3))
#p3=plotg(pa[:g], title="FBD g")
#plot(p1,p2,p3, size=(750,500), layout=(1,3))
```

16 changes: 8 additions & 8 deletions test/tut1.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Load packages.
using Conv
using FocusedBlindDecon
using Plots
plotly()
using Gadfly

# We consider an illustrative synthetic experiment with the following parameters.
ntg=30 # number of time samples in `g`
Expand All @@ -19,12 +18,13 @@ nts=nt # samples in `s`
gobs=zeros(ntg,nr) # allocate
FBD.toy_direct_green!(gobs, c=4.0, bfrac=0.20, afrac=1.0); # add arrival 1
FBD.toy_reflec_green!(gobs, c=1.5, bfrac=0.35, afrac=-0.6); # add arrival 2
plotg=(x;args...)->heatmap(x, size=(250,500), yflip=true, ylabel="time", xlabel="channel";args...) # define a plot recipe
p1=plotg(gobs, title="True g")
#plotg=(x;args...)->heatmap(x, size=(250,500), yflip=true, ylabel="time", xlabel="channel";args...) # define a plot recipe
#p1=plotg(gobs, title="True g")

# The source signature `s` for the experiment is arbitrary: we simply use a Gaussian random signal.
sobs=randn(nts)
plot(sobs, label="arbitrary source", size=(1000,200))
#plot(sobs, label="arbitrary source", size=(1000,200))
plot(x=1:10, y=randn(10))

# The next task is to generate synthetic observed records `dobs`:
# first lets construct a linear operator `S`; then applying `S` on `g` will result in measurements `d`.
Expand All @@ -43,14 +43,14 @@ FBD.lsbd!(pa)
#+

# We extract `g` from `pa` and plot to notice that it doesn't match `gobs`.
p2=plotg(pa[:g], title="LSBD g")
#p2=plotg(pa[:g], title="LSBD g")

# Instead, we perform FBD that uses the focusing functionals to regularize `lsbd!`.
FBD.fbd!(pa)
#+

# Notice that the extract impulse responses are closer to `gobs`, except for a scaling factor and an overall translation in time.
p3=plotg(pa[:g], title="FBD g")
plot(p1,p2,p3, size=(750,500), layout=(1,3))
#p3=plotg(pa[:g], title="FBD g")
#plot(p1,p2,p3, size=(750,500), layout=(1,3))


0 comments on commit c24954b

Please sign in to comment.