Calculating galactic parameters for multiple galaxies with statmorph package

Viewed 43

I'm new to python and programming in general. I would like to calculate some parameters for galaxies and for that purpose I'm using a python package statmorph. On the official website there is an example for a model of a galaxy image (https://statmorph.readthedocs.io/en/latest/notebooks/tutorial.html) with following input values: amplitude, r_eff, n, x_0, y_0, ellip, and theta.

y, x = np.mgrid[0:ny, 0:nx]
sersic_model = models.Sersic2D(amplitude=1, r_eff=20, n=2.5, x_0=120.5, y_0=96.5, ellip=0.5, theta=-0.5)
image = sersic_model(x, y)

I have gathered these input values for other 5000 galaxies and created an excel table:

ObjectID amplitude r_eff n x_0 y_0 ellip theta
7797 20.0681 3.50546 1.9175 49.6125 51.4709 0.7654 16.4438
7839 17.449 7.11842 2.9529 60.2622 71.6927 0.3057 -51.9465

I successfully loaded it with pandas:

import pandas as pd
df = pd.read_excel('galaxies.xlsx')

I would like to use the statmorph package to calculate the desired parameters for each galaxy in the table, but I'm having trouble making the input values run through the fitting columns instead of being fixed numbers.

I tried finding the answers on the internet, but nothing so far helped me solve this specific problem.

Thank you in advance!

0 Answers
Related