{"id":21186667,"url":"https://github.com/geontech/gr_tools","last_synced_at":"2025-03-14T20:18:21.765Z","repository":{"id":146038852,"uuid":"335973129","full_name":"Geontech/gr_tools","owner":"Geontech","description":"Python library to aid in running and debugging GNU Radio processes","archived":false,"fork":false,"pushed_at":"2021-03-24T18:02:40.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T12:48:45.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Geontech.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-04T14:07:40.000Z","updated_at":"2021-03-24T18:02:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"240ed044-c049-483b-b1e5-eac9d39a5c71","html_url":"https://github.com/Geontech/gr_tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fgr_tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fgr_tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fgr_tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fgr_tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Geontech","download_url":"https://codeload.github.com/Geontech/gr_tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639557,"owners_count":20323511,"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":[],"created_at":"2024-11-20T18:25:06.934Z","updated_at":"2025-03-14T20:18:21.730Z","avatar_url":"https://github.com/Geontech.png","language":"Python","readme":"# gr_tools\nPython library to aid in running and debugging GNU Radio processes\n\n| Module | Description |\n| --- | --- |\n| install_grc | Install a folder of GRC files |\n| run_sim | Run simulation with multiple combinations of parameters |\n| run_simulator_custom | Load a scenario from a json file |\n\n## Usage\n\n### Installing GRC\n\nThe [install_grc](gr_tools/install_grc.py) module supports installing a folder full of hierarchal blocks.  It uses the installed 'grcc' to compile the grc file.  A recursive loop is used to support installing GRC blocks that depend on one another.\n\n~~~bash\n$ python -m gr_tools.install_grc grc_folder --target ~/.grc_gnuradio\n~~~\n\n### Run Simulation\nThe [run_sim](gr_tools/run_sim.py) module is used to script running a hierarchal block.  It current supports input of (file source or message port in) and file sink on output.\n\nBatch functions are available to configure the component of interest.\n\n~~~python\n# at ~/.grc_gnuradio to path to gain access to installed components\nimport os\nimport sys\nsys.path.append(os.environ.get('GRC_HIER_PATH', os.path.expanduser('~/.grc_gnuradio')))\nfrom atsc_8vsb_transmit import atsc_8vsb_transmit\n\nfrom gr_tools.run_sim import batch_run_file_source\n\n# run with combinations of sample rate and snr levels\n# the keys should match the parameters of the component\nparam_dict = {\n    \"sample_rate\": [10e6, 20e6],\n    \"snr\": [10, 20, 30],\n}\n\n# specify input and output formats.\nin_spec = {\"path\":\"input_file.bytes\", \"type\":\"BYTE\", \"repeat\":True}\nout_spec = {\"path\":\"/tmp/out.32cf\", \"type\":\"COMPLEX\", \"n_items\":1000000}\n\n# run the batch of simulation\nbatch_run_file_source(\n    atsc_8vsb_transmit, param_dict, \"/tmp/base_name\",\n    in_spec, out_spec)\n~~~\n\n### Run Simulator Custom\n[run_simulator_custom](gr_tools/run_simulator_custom.py) supports running a scenario described in a json file.  Example json files available in the example folder.\n\n'components' is specified as a dict with \"unique id\" per component.\nEach component is a dictionary with 'key' specifying the component type and 'val', specifying the parameters of the component.\n\n'connections' is a list of connections.  A connection is a list of 4 elements.\n* Unique Id of the first component\n* Port of the first component\n* unique Id of the second component\n* port of the second component\n\n'simulation' specifies how to run the scene.\n* Data\n  * This requires a 'head' component to specify the number of samples to limit the simulation.\n* Time\n  * value should have 'duration', to specify time in seconds to run simulation\n* User\n  * User is prompted to hit enter to stop the simulation\n~~~bash\n$ python -m gr_tools.run_simulator_custom example/usrp_to_file.json\n~~~","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeontech%2Fgr_tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeontech%2Fgr_tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeontech%2Fgr_tools/lists"}