{"id":19270670,"url":"https://github.com/emanuelhuber/rpgprpy","last_synced_at":"2025-04-21T20:33:53.254Z","repository":{"id":97064089,"uuid":"492749153","full_name":"emanuelhuber/RPGPRpy","owner":"emanuelhuber","description":"Python wrapper for RGPR (ground-penetrating radar visualisation \u0026 processing)","archived":false,"fork":false,"pushed_at":"2024-05-24T20:45:04.000Z","size":6,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T16:07:48.144Z","etag":null,"topics":["dsp","geophysics","gpr","ground-penetrating-radar","processing","python","radar","rgpr"],"latest_commit_sha":null,"homepage":"https://github.com/emanuelhuber/pyGPR","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emanuelhuber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-16T08:35:30.000Z","updated_at":"2024-12-09T14:13:17.000Z","dependencies_parsed_at":"2024-11-09T20:37:32.975Z","dependency_job_id":null,"html_url":"https://github.com/emanuelhuber/RPGPRpy","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"85ec49a4a68ed8b983be21cd311531d5a0b583f4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelhuber%2FRPGPRpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelhuber%2FRPGPRpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelhuber%2FRPGPRpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelhuber%2FRPGPRpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emanuelhuber","download_url":"https://codeload.github.com/emanuelhuber/RPGPRpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250128518,"owners_count":21379530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dsp","geophysics","gpr","ground-penetrating-radar","processing","python","radar","rgpr"],"created_at":"2024-11-09T20:26:25.028Z","updated_at":"2025-04-21T20:33:53.031Z","avatar_url":"https://github.com/emanuelhuber.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# RPGPRpy\nPython wrapper for RGPR (ground-penetrating radar visualisation \u0026amp; processing).\n\n*** \n**Work in progress!**\n\nCheck this project: https://github.com/emanuelhuber/pyGPR\n***\n\nYou find RGPR an interesting package for GPR (ground-penetrating radar) data processing but you do not like the R language... `RGPRpy` may be an alternative for you...\n\n\n```py\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu May 12 20:47:05 2022\n\nhttps://github.com/davidthaler/Python-wrapper-for-R-Forecast/blob/master/rforecast/converters.py\nhttps://github.com/theislab/anndata2ri/tree/master/anndata2ri\n\n@author: Hubere\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport rpy2\nprint(rpy2.__version__)\n\n\nfrom rpy2.robjects.packages import importr\n# import R's \"base\" package\nbase = importr('base')\n\n# import R's utility package\ndevtools = importr('devtools')\n\ndevtools.install_github(\"emanuelhuber/RGPR\")\n\nrgpr = importr('RGPR')\n\nx = rgpr.readGPR(\"C:/Users/Hubere/Documents/GPR/BUF2____0001_1.rd3\")\n\nrgpr.plot_GPR(x)\n\n# x = R object of type S4\ntype(x)\n\n# class\ntuple(x.rclass)\n\ndir(x)\n\n# Slots\ntuple(x.slotnames())\n\n\n# The attributes can also be accessed through the rpy2 property slots. slots is a mapping between attributes names (keys) and their associated R object (values). It can be used as Python dict:\n\n# print keys\nprint(tuple(x.slots.keys()))\n\n# fetch `phenoData`\nxdat = x.slots['data']\n\ntuple(xdat.rclass)\n\n# Mapping S4 classes to Python classes\nfrom rpy2.robjects.methods import RS4\nclass GPR(RS4):\n    pass\n\nx_myclass = GPR(x)\n\n\ndef rpy2py_s4(obj):\n    if 'GPR' in obj.rclass:\n        res = GPR(obj)\n    else:\n        res = robj\n    return res\n\n# try it\nrpy2py_s4(x)\n\n\n# The conversion system can also be made aware our new class by customizing the handling of S4 objects.\n\n# A simple implementation is a factory function that will conditionally wrap the object in our Python class ExpressionSet:\nfrom rpy2.robjects import default_converter\nfrom rpy2.robjects.conversion import Converter, localconverter\n\nmy_converter = Converter('ExpressionSet-aware converter',\n                         template=default_converter)\n\nfrom rpy2.rinterface import SexpS4\nmy_converter.rpy2py.register(SexpS4, rpy2py_s4)\n\n\n\nfrom multipledispatch import dispatch\nfrom functools import partial\n\nmy_namespace = dict()\ndispatch = partial(dispatch, namespace=my_namespace)\n\n@dispatch(GPR)\ndef gainAGC(x, \n            w = 10, \n            p = 2, \n            r = 0.5, \n            track = False):\n    res = rgpr.gainAGC(x,\n                       w = w,\n                       p = p,\n                       r = r,\n                       track = track)\n    return res\n\nres = gainAGC(x_myclass)\n\nxdata = res.slots['data']\npydata = np.array(xdata)\nplt.plot(pydata[:,10])\n\nplt.imshow(pydata, interpolation='nearest', aspect = 'auto')\nplt.show()\n\n\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanuelhuber%2Frpgprpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femanuelhuber%2Frpgprpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanuelhuber%2Frpgprpy/lists"}