GithubHelp home page GithubHelp logo

Add functions for QC data about act HOT 12 CLOSED

arm-doe avatar arm-doe commented on August 16, 2024
Add functions for QC data

from act.

Comments (12)

AdamTheisen avatar AdamTheisen commented on August 16, 2024

They are not bit-packed. I'm wondering if the base function we need is just a bit decoder. After thinking about other data sources, I don't know if we can make a one size fits all. We might need to do an arm_qc_utils.py and put arm specific in there. I do think that a standard bit-packed decoder would work well in qc_utils though

from act.

kenkehoe avatar kenkehoe commented on August 16, 2024

OK let's chat at the meeting next week. I think we can use flag_values for non-bitpacked and it will work. It would just be an extension of CF and the functions could auto detect type based on attributes set if we follow CF convention. If you have an example file can you load it here?

from act.

AdamTheisen avatar AdamTheisen commented on August 16, 2024

I don't have any examples offhand. I do remember that neon had a separate csv file that had qc information in and I don't know if ameriflux had any. I think they tend to interpolate data when they know it's bad. Not sure though

from act.

kenkehoe avatar kenkehoe commented on August 16, 2024

I'm currently working on migrating some of the DQ QC functions over to ACT. Right now I plan to keep the number of functions to a small number as most users will only need a few. But my question to the group is what will a user typically use them to do and what sort of functions will help them the most. I've got the setting and removing of bits for tests and the display of test numbers from a bit packed number implemented.

I think the most likely use of QC from a user is to mask data. But the bigger question is how will we create the functions to get the data in the format they will use/want. Since there will be a flag_assessments attribute set to standard "Bad", "Indeterminate" we can use that for filtering as well as individual tests. Eventually we'll add DQR support as well. I see Suspect = Indeterminate so we can filter the same. We can return a mask from a function call to either set the values to NaN or return an array with requested data removed (changing the shape of the array). I see both having their place. To do any of this I'm thinking of a generic reader for getting data from the object with the reader doing the work of querying the QC data and DQRs to return an array with filtered data set to NaN. Initially I was thinking of Masked Arrays but I don't think that will work for plotting since we are reading from the object directly with xarray calls. I'm thinking the preferred method is to manipulate the object to get the data the way the user wants and then do plotting, research, ... They can make a copy of the object if they don't want to make changes to the original data.

Any thoughts?

from act.

AdamTheisen avatar AdamTheisen commented on August 16, 2024

Hi @kenkehoe

I am going to ping @rcjackson @zssherman and @scollis as well.

As for what would be useful to the end users, I think a mask or way to get back the indices of where specific bits are tripped is useful. For plotting purposes, PyART has a gate filter keyword for many of the variables, but is there a more standard way to do this based on masked data as Ken is wanting to do?

from act.

rcjackson avatar rcjackson commented on August 16, 2024

from act.

scollis avatar scollis commented on August 16, 2024

from act.

kenkehoe avatar kenkehoe commented on August 16, 2024

OK can you give me some more information on Gatefilters?

from act.

rcjackson avatar rcjackson commented on August 16, 2024

from act.

kenkehoe avatar kenkehoe commented on August 16, 2024

OK thanks for the update. This seems very similar to numpy masked array functions already available.

I like the method to do the masking but I think we should use QC variables to store the result. That way multiple masks can be applied and retrieved independently by storing the result of a test ( or mask) in a bit-packed array format. Otherwise the result will be impossible to reverse or untangle if the user decided to do something else. Also if we save the result internally as a CF QC variable it can be written to a file and used later or shared with others.

I would prefer we have a function that uses the flage_meanings or flag_assessments under a QC variable to determine what should be added to the numpy mask and returns the result. I see QC as more complicated and more user variable than the corollary gatefilter ideas.

from act.

kenkehoe avatar kenkehoe commented on August 16, 2024

I'm moving away from a qc_utility.py module and used a method approach instead. It should be able to handle both bit-packed and integer QC styles as long as they follow CF. If they don't we can add some additional methods to clean method to update the other institutions to our internal standard that closely follows CF.

from act.

kenkehoe avatar kenkehoe commented on August 16, 2024

With the recent merge of #81 into the repo I think this issue can be closed. We will continue to add more QC tests.

from act.

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.