Git Product home page Git Product logo

sac.jl's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

sac.jl's Issues

Some ambiguity in rotate_to_gcp!

In rotate_to_gcp!, we could get the rotated result directly from the parameters that are input into the function. And it seems this function also returns the result. However, the order of radial and trans component is different in this two way.

As for function

function rotate_to_gcp!(s1::SACtr, s2::SACtr, reverse::Bool=false)
    s2_is_clockwise_of_s1 = angle_difference(s1[:cmpaz], s2[:cmpaz]) > 0
    s2_is_clockwise_of_s1 || ((s1, s2) = (s2, s1))
    !isundefined(s1[:baz]) && !isundefined(s2[:baz]) ||
        throw(ArgumentError("Backazimuth is not defined for both traces"))
    s1[:baz] โ‰ˆ s2[:baz] || throw(ArgumentError("Backazimuth not the same for both traces"))
    phi = mod(s1[:baz] + 180 - s1[:cmpaz], 360)
    rotate_through!(s2, s1, phi) # Checks for orthogonality
    reverse && flip_component!(s2)
    s1[:kcmpnm] = sacstring("Radial")
    s2[:kcmpnm] = sacstring((reverse ? "-" : "")*"Trans")
    s1, s2
end

This ambiguity may be related to

    s2_is_clockwise_of_s1 || ((s1, s2) = (s2, s1))

Problem in interpolate!

The function interpolate! seems to have some bug in expression
s.b + (0:(npts-1))*delta
raising an error
MethodError: no method matching +(::Float32, ::StepRangeLen{Float32,Float64,Float64})

And also it seems the test hasn't covered this function.

A bug in tshift!

In the function tshift!:

function tshift!(s::SACtr, tshift::Number, wrap=true)
    @info wrap,tshift
    n = round(Int, tshift/s.delta)
    @info wrap,n,tshift
    if n == 0
        sac_verbose && @info("SAC.tshift!: t ($tshift) is less than delta ($(s.delta)) so no shift applied")
        return
    end
    @info wrap,n,tshift,s.t[1:n]
    s.t = circshift(s.t, n)
    @info wrap,n,tshift,s.t[1:n]
    if !wrap
        n > 0 ? s.t[1:n] = 0. : s.t[end+n+1:end] = 0.
    end
    update_headers!(s)
end

There is a bug when wrap=false, as it seems in Julia 1.0, we could only set:

s.t[1:n] .= 0.

But not:

s.t[1:n]=0.

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.