{"id":20687916,"url":"https://github.com/cdilullo/beam_simulator","last_synced_at":"2026-05-25T23:39:42.319Z","repository":{"id":37787534,"uuid":"297395062","full_name":"cdilullo/beam_simulator","owner":"cdilullo","description":"Beam Simulator","archived":false,"fork":false,"pushed_at":"2024-03-07T05:49:41.000Z","size":85,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T16:52:46.311Z","etag":null,"topics":["antenna-array","beamforming","python3","radio-astronomy"],"latest_commit_sha":null,"homepage":"","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/cdilullo.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":"2020-09-21T16:18:11.000Z","updated_at":"2023-02-14T18:31:51.000Z","dependencies_parsed_at":"2025-01-17T16:43:25.135Z","dependency_job_id":"640ebbf8-c77c-41c6-b35e-089cb1a5ce9f","html_url":"https://github.com/cdilullo/beam_simulator","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/cdilullo%2Fbeam_simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdilullo%2Fbeam_simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdilullo%2Fbeam_simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdilullo%2Fbeam_simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdilullo","download_url":"https://codeload.github.com/cdilullo/beam_simulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242945838,"owners_count":20210762,"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":["antenna-array","beamforming","python3","radio-astronomy"],"created_at":"2024-11-16T22:58:36.566Z","updated_at":"2026-05-25T23:39:37.289Z","avatar_url":"https://github.com/cdilullo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Beam Simulator\n==============\n[![Build and Test](https://github.com/cdilullo/beam_simulator/actions/workflows/main.yml/badge.svg)](https://github.com/cdilullo/beam_simulator/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/cdilullo/beam_simulator/branch/master/graph/badge.svg?token=VHRPYN6Y98)](https://codecov.io/gh/cdilullo/beam_simulator)\n [![Documentation Status](https://readthedocs.org/projects/beam-simulator/badge/?version=latest)](https://beam-simulator.readthedocs.io/en/latest/?badge=latest)\n\n[![Paper](https://img.shields.io/badge/arXiv-2112.13899-blue.svg)](https://arxiv.org/abs/2112.13899)\n\nDescription\n-----------\nThis package contains tools for simulating the beam pattern of an arbitray phased array. It consists of 3 modules:\n* nec.py - Tools for reading in an output file from a NEC4 simulation and representing the gain pattern of an individual antenna.\n* station.py - Collection of classes used to build objects representing the different levels of an array.\n* beamformer.py - Beamforming related functions for a given `\u003cStation\u003e` object.\n* skymap.py - Collection of functions which can simulate the observed sky for a `\u003cStation\u003e` object and simulate the measured spectrum or driftcurve.\n\nInformation about a station can be supplied in a text file which can be loaded in to generate a fully populated `\u003cStation\u003e` object.\nA template for such text files is provided. LWA SSMIF's are also supported to quickly load in a full LWA station.\n\nRequirements\n------------\n* python \u003e= 3.8\n* numpy \u003e= 1.19.2\n* scipy \u003e= 1.5.4\n* astropy \u003e= 4.1\n* matplotlib \u003e= 3.3.2\n* numba \u003e= 0.51.2\n* pygdsm \u003e= 1.3.0\n* tqdm \u003e= 4.62.2\n* ephem \u003e= 4.1\n* healpy \u003e= 1.15.0\n* lsl \u003e= 2.0.2 (for LWA SSMIF compatability)\n\nExample\n-------\nBelow is an example showing how to:\n1. Populate a `\u003cStation\u003e` object describing LWA-SV using its Station Static MIB Initialization File (SSMIF).\n1. Represent the gain pattern of a LWA dipole.\n1. Simulate the beam pattern for LWA-SV for a given pointing center and frequency.\n\nNOTES:\n* \"lwasv-ssmif.txt\" can be found [within the LWA Software Library](https://github.com/lwa-project/lsl/tree/master/lsl/data).\n* The NEC4 output files for the LWA dipole can be found [here](http://fornax.phys.unm.edu/lwa/trac/browser/trunk/DipoleResponse)\n\n### Setting up the Station.\n```\nfrom beam_simulator import station\n\nlwasv = station.load_LWA(\"lwasv-ssmif.txt\")\n```\n\n### Representing the LWA dipole gain pattern and fitting spherical harmonics to it as a function of frequency.\nThe LWA dipole gain pattern has been modeled using NEC4 at multiple frequencies. These can be loaded into \nBeam Simulator in order to build a model of the dipole gain pattern.\n```\nfrom beam_simulator import nec\n\n#We need to read in all NEC4 output files for a series of frequencies.\nfreqs = [10, 20, 30, 40, 50, 60, 70, 80, 88] #MHz\n\np1 = [f'lwa1_xep_{freq}.out' for freq in freqs]\nt1 = [f'lwa1_xet_{freq}.out' for freq in freqs]\np2 = [f'lwa1_yep_{freq}.out' for freq in freqs]\nt2 = [f'lwa1_yet_{freq}.out' for freq in freqs]\n\n#Fit the spherical harmonic decomposition as a polynomial in frequency.\nnec.fit_antenna_response(freqs, p1, t1, p2, t2, lmax=12)  \n```\n\nThis will create a file named \"beam_cofficients.npz\" which can be used by the `beamformer` module.\n\n### Simulating the beam pattern of LWA-SV.\n```\nfrom beam_simulator import beamformer\n\n#Generate the weighting vector for the station.\nw = beamformer.generate_uniform_weights(lwasv) #All antennas have the same weighting of 1.0\n\n#Simulate the beam for a pointing center of az = 180 deg, el = 75 deg at 74 MHz with 1 degree resolution.\npwr = beamformer.beamform(lwasv, w, freq=74e6, azimuth=180.0, elevation=75.0, resolution=1.0,\n                          ant_gain_file='beam_coefficients.npz', dB=False)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdilullo%2Fbeam_simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdilullo%2Fbeam_simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdilullo%2Fbeam_simulator/lists"}