Skip to content

Fix 172#178

Merged
HannoSpreeuw merged 16 commits into
masterfrom
Fix_172
Nov 22, 2025
Merged

Fix 172#178
HannoSpreeuw merged 16 commits into
masterfrom
Fix_172

Conversation

@HannoSpreeuw
Copy link
Copy Markdown
Collaborator

  1. Fixes Include flux densities in regression test #172 : flux densities have been included in the "test_measured_vectorized_free_shape" regression test.
  2. Fixed a number of linter warnings: Relative import outside of a package.
  3. measuring.py --> measure.py to reflect the simple present of image.py and extract.py instead of the present participle.

Fixing 172, flux densities should be included in the "test_measured_vectorized_free_shape" regression test.
Flux densities are calculated as peak spectral brightness * semi-major axis * semi-minor axis * pi / beam size.
What is an appropriate maximum bias to impose? Peak spectral brightnesses are biased low while the axes are biased high, both from Gaussian fits as well as from tweaked moments.
The bias in the axes would have to be applied quadratically...complicated.
Not clear what should be imposed, but decided on "MAX_BIAS_AXES_SCALED", since "MAX_BIAS_AXES_SCALED=71.4286" while "t_stat_flux_density=70.4756", so this just passes.
We found "std_flux_density=1.0836", this is very reassuring.
1) Fix linter complaint "Relative import outside of a package".
2) Remove redundant import.
Reformatting from Black: single quotes to double quotes.
1) Fix linter complaint "Relative import outside of a package"
2) Reformatting from Black.
1) Fix linter complaint "Relative import outside of a package".
2) Reformatting from Black.
3) Remove redundant import: "pytest".
1) Fix linter complaint "Relative import outside of a package".
2) Reformatting from Black.
3) Remove redundant import.
1) Fix linter complaint "Relative import outside of a package".
2) Reformatting from Black.
1) Fix linter complaint "Relative import outside of a package".
2) Reformatting from Black.
1) Fix linter complaint "Relative import outside of a package".
2) Reformatting from Black.
1) Fix linter complaint "Relative import outside of a package".
2) Reformatting from Black.
Originally, this module was called "fitting.py". But it does more than Gaussian fits, it also computes (tweaked) moments. That is why it was renamed to "measuring.py". However, the other main modules use the simple present, as in "image.py" and "extract.py" instead of the present participle. That is why "measure.py" seems more appropriate.
Previously, the "moments method" returned peak brightnesses as the maximum pixel value times a fudge factor to correct statistically for the fact that a peak will generally be positioned with some subpixel offset relative to the center of the pixel with the maximum value. Currently, we apply "tweaked moments" and that means that if a source comprises enough pixels, we will not use the maximum pixel method times a fudge factor. This has now been reflected in these two comments.
@HannoSpreeuw HannoSpreeuw self-assigned this Nov 22, 2025
@HannoSpreeuw HannoSpreeuw merged commit 408dff9 into master Nov 22, 2025
9 checks passed
@HannoSpreeuw HannoSpreeuw deleted the Fix_172 branch November 22, 2025 18:25
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.

Include flux densities in regression test

1 participant