Skip to content

Add 2D Gaussian fitter to fit module - #192

Open
ShinjiFujita wants to merge 6 commits into
mainfrom
issue109
Open

Add 2D Gaussian fitter to fit module#192
ShinjiFujita wants to merge 6 commits into
mainfrom
issue109

Conversation

@ShinjiFujita

@ShinjiFujitaShinjiFujita commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

Closes#109.

@astropenguinastropenguin changed the title Update qlook.py (issue109)Add 2D Gaussian fitter to qlook commandsAug 3, 2024
@astropenguinastropenguin changed the title Add 2D Gaussian fitter to qlook commandsAdd 2D Gaussian fitter to fit moduleAug 3, 2024

@astropenguinastropenguin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for splitting the updates. It seems that this PR is still in progress, but I would like to put our decision according to the previous DESHIMA meetings anyway. The goal of the issue #109 is to create a function decode.fit.cube that takes a cube DataArray (dimensions of (lon, lat, chan)) as an input, and return a DataArray of 2D Gaussian models as an output (with the same shape and dimensions as the input). We also discussed that we could use DataArray.curvefit so that a simple 2D Gaussian function can be applied to each channel simultaneously. So the possible design of the function would be:

defcube(
cube: xr.DataArray,
/,
*,
init_amp: float=1.0,
init_x0: float=0.0,
init_y0: float=0.0,
...
) ->xr.DataArray:
"""Apply 2D Gaussian fit to each channel of a 3D spectral cube."""returncube.curvefit(
coords=("lon", "lat"),
func=gaussian_2d,
p0=(init_amp, init_x0, init_y0, ...),
)

I am not fully sure whether we could implement like this, but it would be appreciated if you could consider such function-oriented implementation for readability and reproducibility.

@astropenguinastropenguin added the feature New feature or request label Aug 5, 2024
@astropenguinastropenguin added this to the v2024.8 milestone Aug 5, 2024
@astropenguin
astropenguin self-requested a review August 6, 2024 11:20
@astropenguinastropenguin modified the milestones: v2024.8, v2024.9Aug 7, 2024
@astropenguinastropenguin removed this from the v2024.9 milestone Apr 10, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

featureNew feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add 2D Gaussian fitter to fit module

2 participants

@ShinjiFujita@astropenguin