Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/04/2012 in all areas

  1. I also like the Savitsky-Golay, but it only works for uniformly spaced data, whereas the above utility is also good for non-uniform X spacing. I had already rewritten this utility for my own use, and checking it against the original I see it has a ~15x speedup on a single-core, and ~25-30x on my 2-core laptop -- should be even greater with more cores. Here's the main things I changed: passing individual X and Y arrays rather than a cluster replacing the Power function in the weighting routine with a multiply - this makes the most difference, about 8x turning off debugging - gives almost another doubling in speed moving some functions outside the loops, and sometimes removing loops altogether using parallel loops and sharing clones for subVIs inside parallel loops If you can get away with SGLs rather than DBLs, you'll get a further speedup, and if your data is evenly spaced but you still want to use this algorithm, then you shouldn't need to recompute the weighting function throughout your data - it only changes towards the start and end. SmoothCurveFit.zip You're welcome to use this rewritten code.
    3 points
  2. I tried to use this tool. And it looks great, however the function 'Variant to JSON' fails with a variant inside an object. I made the following changes: -Added support for Variant. By using 'Unwrap Variant' -If a <Null> Variant is found, replace this with a Null-Cluster -When Flattening the Cluster and number of elements is 0 then output '{}' (note that without this change an empty cluster would flatten to '}') This allowed me to have a cluster with optional variant Arguments flatten well: into: {"api_key":"xx","args":{"owner":"ton","repo_name":"repository","repo_type":"hg"},"id":915,"method":"create_repo"} (with args) or {"api_key":"xx","args":{},"id":378,"method":"get_users"} (no args) I added a method for 'Object' to list all element names: This will return the names of all the elements in an Object (Cluster), so you can scan them and retrieve them by name. Ton
    2 points
  3. View File JSON LabVIEW JSON is a data interchange format (sometimes compared to XML, but simpler). There are multiple projects to create a JSON package for LabVIEW. This is yet another one motivated by this hijacked conversation originally about a different project to convert JSON into LabVIEW Variants. This project uses a set of LVOOP classes to match the recursive structure of JSON, rather than variants. It allows conversation to and from JSON. All functionality is available through two polymorphic VIs: Set and Get. In addition to Get and Set VIs for common data types, one can also convert directly to or from complex clusters via variant-JSON tools. Copyright 2012-2016 James David Powell, Shaun Rumbell, Ton Plomp and James McNally. [Note: if you are using LabVIEW 2017, please also see the JSONtext library as a an alternative.] Submitter drjdpowell Submitted 10/04/2012 Category General LabVIEW Version
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.