ACCarnall / bagpipes

Bagpipes is a state of the art code for generating realistic model galaxy spectra and fitting these to spectroscopic and photometric observations. Users should install with pip, not by cloning the repository.
http://bagpipes.readthedocs.io
GNU General Public License v3.0
71 stars 37 forks source link

Some questions about fitting spectroscopic data and catalogue fitting #41

Closed markliuchina closed 1 year ago

markliuchina commented 1 year ago

Hi, Adam! These days, I have been working on studying your papers and code, which really help me a lot. First of all, thanks for your code and efforts in this field. And I would like to ask you some questions in hope for more details. First question: As described in the stz2544, when fitting spectroscopic data, there are two additional model component to be set well: 1. Gaussian process noise model 2. Polynomial calibration model This is illustrated in your example:

mlpoly = {}
mlpoly["type"] = "polynomial_max_like"
mlpoly["order"] = 2

and

noise = {}
noise["type"] = "white_scaled"
noise["scaling"] = (1., 10.)
noise["scaling_prior"] = "log_10"

In the fitting parameter table given by your paper: image I just cannot figure out how to set my parameters as described in your paper for I can't find corresponding dictionary in your documentation. So I write this way:

# calibration
calib = {}
calib["type"] = "polynomial_bayesian"

calib["0"] = (0.5, 1.5)
calib["0_prior"] = "Gaussian"
calib["0_prior_mu"] = 1.0
calib["0_prior_sigma"] = 0.25

calib["1"] = (-0.5, 0.5)
calib["1_prior"] = "Gaussian"
calib["1_prior_mu"] = 0.
calib["1_prior_sigma"] = 0.25

calib["2"] = (-0.5, 0.5)
calib["2_prior"] = "Gaussian"
calib["2_prior_mu"] = 0.
calib["2_prior_sigma"] = 0.25

# mpoly model 
mlpoly = {}
mlpoly["type"] = "polynomial_max_like"
mlpoly["order"] = 2
# noise model
noise = {}
noise["type"] = "white_scaled"
noise["scaling"] = (0.1, 10.)
noise["scaling_prior"] = "log_10"
noise["amplitude"] = (0.0001, 1)
noise["amplitude_prior"] = "log_10"
noise["length"] = (0.01, 1)
noise["length_prior"] = "log_10"

There is no warning information and the fitting run smoothly but I am not sure whethere this is the proper way of setting up these 2 models. Second question: I think this is the last one question that I can think of. Is there any possibility that we can modify and define the output parameter columns in the future? For example, I was fitting a catalog of 151 massive galaxies, and I want to select some QGs candidates. Then I need to check certain percentile of sSFR of each target. But the default output full catalogue columns just cannot provide such information. Surely, I know there are some methods to get this parameter and integrate it into my catalog but it is, to some extent, laborious.

Anything from you will be appreciated! Thanks again for making this wonderful code available!

Mingfeng Liu

Nanjing Normal University

markliuchina commented 1 year ago

image Anyway, is this parameter described here the same thing to dust["eta"] = 1in the dust model dictionary? (I guess, this corresponds to the birth clouds property. Well, the ratio between Av of bc and ISM is exactly the Multiplicative factor on Av for stars in birth clouds) I am not sure about it. Could you just give a confirmation? Thanks.

markliuchina commented 1 year ago

I am sorry! I noticed where to set up the mask range just now. Now I get a fine chi-square. : )