Git Product home page Git Product logo

Comments (2)

hemmelig avatar hemmelig commented on May 29, 2024

I have added the following snippet to the default scan class:

c_precision = 1e6
precision = 1e6

and

        data["COA"] = coa.select(station="COA")[0].data / self.c_precision
        data["COA_N"] = coa.select(station="COA_N")[0].data / self.c_precision
        data["X"] = coa.select(station="X")[0].data / self.precision
        data["Y"] = coa.select(station="Y")[0].data / self.precision
        data["Z"] = coa.select(station="Z")[0].data / self.precision
        st = Stream(Trace(data=(np.array(data["COA"]) * self.c_precision).astype(np.int32),
                          header=stats_COA))
        st += Stream(Trace(data=(np.array(data["COA_N"]) * self.c_precision).astype(np.int32),
                           header=stats_COA_N))
        st += Stream(Trace(data=(np.array(data["X"]) * self.precision).astype(np.int32),
                           header=stats_X))
        st += Stream(Trace(data=(np.array(data["Y"]) * self.precision).astype(np.int32),
                           header=stats_Y))
        st += Stream(Trace(data=(np.array(data["Z"]) * self.precision).astype(np.int32),
                           header=stats_Z))

This is similar to the way in which obspy handles UTCDateTime precision (class variable that can be overwritten). Need to think of a way to double check the input from the user and tell them if this may cause them to exceed the capacity of np.int32 (as well as potentially giving them the option to change it to np.int64). Currently it's looking like it'll have to be by extending the signature of the SeisPlot class to take the precision and save dtype.

from quakemigrate.

hemmelig avatar hemmelig commented on May 29, 2024

Final solution described in commit that closes this issue.

from quakemigrate.

Related Issues (20)

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.