Comments (3)
I added the new version of smooth
to the master branch. Let me know if you have any problems.
from seisnoise.jl.
Thanks for pointing this out. I think the smooth function as currently implemented assumes a 2D array. I added a new version of the smooth
function to the GPU branch a54a642. This removes the dependence on movingaverage
and should work for any dimension. It's also faster (for 2D arrays) and works on the GPU! Since this is a bug, I'll push this commit to master.
Here is the new version of smooth:
function smooth!(A::AbstractArray, half_win::Int=3, dims::Int=1)
T = eltype(A)
window_len = 2 * half_win + 1
csumsize = tuple(collect(size(A)) .+ [i==1 for i in 1:ndims(A)]...)
csum = similar(A,T,csumsize)
csum[1,:] .= zero(T)
csum[2:end,:] = cumsum(A,dims=dims)
A[half_win+1:end-half_win,:] .= (csum[window_len+1:end,:] .- csum[1:end-window_len,:]) ./ window_len
return nothing
end
smooth(A::AbstractArray,half_win::Int=3, dims::Int=1) =
(U = deepcopy(A);smooth!(U,half_win,dims);return U)
Now it should keep the same size
smooth!(A);
len1 = length(A)
# second time
smooth!(A);
len2 = length(A)
# third time
smooth!(A);
len3 = length(A)
println((len1,len2,len3))
(1201, 1201, 1201)
from seisnoise.jl.
This is fixed in the newest branch. Closing.
from seisnoise.jl.
Related Issues (20)
- shorten! sets wrong maxlag
- io.jl HOT 9
- Load and process multiple traces HOT 3
- Error: rfft not defined HOT 5
- TagBot trigger issue HOT 15
- SeisNoise.correlate corr_type arguments HOT 2
- Autocorrelations HOT 2
- SeisNoise v0.5.3 fails to compile on M1 Mac HOT 3
- Plots/HDF5: Add dependency HOT 3
- FFTW: Pre-calculation of plans HOT 2
- InexactError HOT 1
- process_raw! fails on NodalData HOT 2
- nodalxcorr output HOT 2
- resample! is slow on the gpu HOT 3
- resample! is slow on NodalData HOT 3
- Can't install the package SeisNoise.jl in the Julia.exe for version 1.8.5 HOT 3
- get_date()function get some error HOT 1
- The meaning and usage of each parameter in a function HOT 1
- seeking for help in SeisIO.jl's read_data() function HOT 2
- If the SeisNoise.jl and SeisIO can batch process cross-correlation function between lots of station Seisdata? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seisnoise.jl.