Skip to content

Blackmannharris beams and update functional decomposition#339

Open
nicholebarry wants to merge 8 commits intomasterfrom
blackmannharris_beams
Open

Blackmannharris beams and update functional decomposition#339
nicholebarry wants to merge 8 commits intomasterfrom
blackmannharris_beams

Conversation

@nicholebarry
Copy link
Contributor

Beams can now be represented as a Blackman-Harris using the infrastructure of the Gaussian decomposition code. Functions have been renamed to more general, and a new structure called beam_decomp_info contains all the required variables needed and is located in the psf structure. Some better flexibility was also added to the Gaussian decomposition code as well, allowing for transferred variables that were not made at the same resolution/extent as the current run.

Fitting the beams with Blackman-Harris is not currently feasible, and is left up to the user to figure out. For example, I made beam images and externally used a MCMC to fit the most likely Blackman-Harris on the main lobe -- I can't imagine this being fast enough to perform on the fly in IDL.

There is new functionality to provide a beam width in degrees on the sky, given a specified functional decomposition. It currently only points up at zenith, but that is easily changeable if that functionality is desired.

Please see new keywords in dictionary.

Added new parameters for beam function decomposition and width.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces Blackman-Harris window functions as an alternative to Gaussian decomposition for beam modeling, and refactors the beam decomposition infrastructure to support multiple functional forms. The changes generalize the previous Gaussian-specific code into a more flexible framework where beams can be represented using different mathematical functions.

Changes:

  • Adds new Blackman-Harris decomposition function with both analytic FT and real-space implementations
  • Refactors beam decomposition code from beam_gaussian_decomp.pro into more general beam_decomp.pro supporting multiple function types
  • Renames parameters throughout (e.g., beam_gaussian_decompbeam_function_decomp, beam_gauss_param_transferbeam_param_transfer)
  • Introduces new beam_decomp_info structure to store beam decomposition parameters in a unified way
  • Adds beam_width_deg keyword to specify beam width in degrees for simple beam creation
  • Updates parameter handling in gaussian_decomp.pro to support overresolution and improved grid transformation

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
gaussian_decomp.pro Refactored grid transformation logic, replaced volume_beam outputs with max_amp, added over_res parameter
fhd_struct_init_psf.pro Removed beam_gaussian_params_arr field, added image_res_scale parameter to support new infrastructure
fhd_struct_init_antenna.pro Renamed beam decomposition parameters to be function-agnostic, removed PSF dimension matching logic
blackmanharris_decomp.pro NEW: Implements 7-term Blackman-Harris window decomposition with separable 2D support
beam_setup.pro Major refactoring to use new beam_decomp_info structure, simplified beam volume calculations
beam_power.pro Updated to call new beam_decomp function with revised parameter names
beam_gaussian_decomp.pro DELETED: Functionality moved into generalized beam_decomp.pro
beam_decomp.pro NEW: Unified beam decomposition supporting gaussian and blackmanharris functions, includes parameter transfer and beam_width_deg functionality
dictionary.md Added documentation for beam_function_decomp, beam_param_transfer, and beam_width_deg keywords

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to +45
FUNCTION blackmanharris_decomp, x, y, p, $
ftransform=ftransform, model_npix=model_npix, model_res=model_res, over_res=over_res,$
volume_beam=volume_beam, sq_volume_beam=sq_volume_beam, max_amp=max_amp, $
conserve_memory=conserve_memory
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused parameter: conserve_memory is declared in the function signature but never used in the function body. Consider removing it from the parameter list or implementing memory conservation logic if needed.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

nicholebarry and others added 5 commits February 13, 2026 15:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Feb 13, 2026

@nicholebarry I've opened a new pull request, #340, to work on those changes. Once the pull request is ready, I'll request review from you.

)

* Initial plan

* Remove unused conserve_memory parameter from blackmanharris_decomp

Co-authored-by: nicholebarry <5588290+nicholebarry@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nicholebarry <5588290+nicholebarry@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants