{"id":34694870,"url":"https://github.com/geekysuavo/nusutils","last_synced_at":"2026-05-27T05:37:37.042Z","repository":{"id":34800255,"uuid":"38785275","full_name":"geekysuavo/nusutils","owner":"geekysuavo","description":"Utilities for seed-independent multidimensional nonuniform sampling","archived":false,"fork":false,"pushed_at":"2025-10-29T14:16:58.000Z","size":66,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T10:44:25.034Z","etag":null,"topics":["compressed-sensing","nmr-spectroscopy","nonuniform-sampling"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geekysuavo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-08T23:25:19.000Z","updated_at":"2025-10-29T14:17:02.000Z","dependencies_parsed_at":"2022-09-15T10:01:28.719Z","dependency_job_id":null,"html_url":"https://github.com/geekysuavo/nusutils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geekysuavo/nusutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekysuavo%2Fnusutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekysuavo%2Fnusutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekysuavo%2Fnusutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekysuavo%2Fnusutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geekysuavo","download_url":"https://codeload.github.com/geekysuavo/nusutils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekysuavo%2Fnusutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33553127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compressed-sensing","nmr-spectroscopy","nonuniform-sampling"],"created_at":"2025-12-24T22:31:32.931Z","updated_at":"2026-05-27T05:37:37.015Z","avatar_url":"https://github.com/geekysuavo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nusutils\n\nA set of command-line utilities for deterministically (_i.e._ without\npseudorandom numbers) constructing nonuniform sampling schedules on\nmultidimensional Nyquist grids. The **gaputil** is a utility to construct\nschedules using the generalized gap sampling framework published in:\n\n\u003e Worley, B., Powers, R., _Deterministic Multidimensional Nonuniform\n\u003e Gap Sampling_, Journal of Magnetic Resonance, 2015, 261: 19-26.\n\nThe **rejutil** and **jitutil** are utilities to construct schedules from\ndensity functions using a quasirandom accept-reject sampling method\npublished in:\n\n\u003e Worley, B., _Subrandom Methods for Multidimensional Nonuniform\n\u003e Sampling_, Journal of Magnetic Resonance, 2016, 269: 128-137.\n\n## Introduction\n\nGap sampling came into vogue in the field of Nuclear Magnetic Resonance (NMR)\nwhen Hyberts and Wagner introduced their Poisson-gap (PG) sampler for building\nNonuniform Sampling (NUS) schedules. This project is the software realization\nof a full generalization of their PG method to admit _any_ gap equation.\n\nInitial versions of **gaputil** contained hard-coded Poisson-gap, sine-gap,\nand sine-burst (_cf._ Worley and Powers, above) gap equations. The generality\nof the proposed framework was a tempting opportunity for me to embed the\n[Julia programming language](http://julialang.org/) into one of my software\nprojects. By embedding Julia into my existing gap sampling algorithm, this\nutility enables the construction of NUS schedules from _completely arbitrary_\ngap equations.\n\n### Examples using **gaputil**\n\nThe **gaputil** program reads a gap equation from the command line in string\nform, passes it to Julia for just-in-time compilation, and then evaluates it\nas needed until an optimal schedule is arrived at. The function prototype\nused by **gaputil** looks like this in Julia:\n\n```julia\ng(x::Float64, d::Int32,\n  O::Array{Float64,1},\n  N::Array{Float64,1},\n  L::Float64)\n```\n\nwhere **x** holds the current gap sequence term, **d** is the currently\nsampled grid dimension, **O** is the current origin in the grid, **N**\nis the size of the grid, and **L** is a scaling factor that **gaputil**\nwill optimize in its attempts to create a schedule of the correct\nglobal sampling density.\n\nThe simplest possible gap equation merely uses the scaling factor,\nresulting in a uniform lattice:\n\n```julia\ng(x, d, O, N, L) = L\n```\n\nThe sine-gap equation is fairly simple as well:\n\n```julia\ng(x, d, O, N, L) =\n  L * sin((pi/2) * (x + sum(O)) / sum(N))\n```\n\nThe sine-burst equation gets a bit more complicated:\n\n```julia\ng(x, d, O, N, L) =\n  L * sin((pi/2) * (x + sum(O)) / sum(N)) *\n  sin((pi/4) * N[d] * (x + sum(O)) / sum(N))^2\n```\n\nIn short, **gaputil** accepts almost any inline function having\nJulia syntax.\n\n### Examples using **rejutil** and **jitutil**\n\nThe **rejutil** and **jitutil** programs also use Julia to interpret their\ndensity function, but this function is of a simpler form:\n\n```julia\nf(x::Array{Float64,1}, N::Array{Float64,1})\n```\n\nwhere **x** now holds the _current_ grid index, and **N** still holds the\ntotal grid size. No optimization is performed: **rejutil** simply draws a\nset number of points (grid indices) from the distribution specified in the\ndensity function. On the other hand, **jitutil** draws the same number of\npoints using a jittered rejection sampling algorithm.\n\nThe simplest possible density function is a uniform grid:\n\n```julia\nf(x, N) = 1.0\n```\n\nAn exponentially weighted function would look like this:\n\n```julia\nf(x, N) = exp(-sum(x ./ N))\n```\n\nLike **gaputil**, **rejutil** and **jitutil** will accept any inline\nfunction having Julia syntax and conforming to the interface specified\nabove.\n\n### Installing\n\nYou will need to have Julia compiled and installed in order to build\n**nusutils**. It is recommended that you download the latest version\nfrom your distribution's package manager. In my hands, v1.12.1 from\nHomebrew works great.\n\nOnce Julia is installed into the path, you can compile and install\n**gaputil**, **rejutil** and **jitutil** as follows:\n\n```bash\ngit clone git://github.com/geekysuavo/nusutils.git\ncd nusutils\nmake\nsudo make install\n```\n\n## Licensing\n\nThis project is released under the [GNU GPL 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekysuavo%2Fnusutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeekysuavo%2Fnusutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekysuavo%2Fnusutils/lists"}