error estimates with montecarlo

78 views
Skip to first unread message

Letizia Stanghellini

unread,
May 17, 2024, 1:35:08 PM5/17/24
to PyNeb
Hi Christophe,

I hope everything is good with you.  I am running your new montecarlo notebook on some data with errors. As far as I understand, your program in https://github.com/Morisset/PyNeb_devel/blob/1.1.19/docs/Notebooks/MonteCarlo.ipynb produced additional data within a default error of 0.5 from the original data. I would like instead to use my own measured errors, writing  adata file such as:

%%writefile observations1.dat
Target 1
H1r_4341A 48.58780784858967  0.7604427588774331
H1r_4861A 100                0.00
O2_3726A 47.77835591490365   0.7604427588774331
O2_3729A 68.8240974164782    0.9876793793287749

etc

where the errors are in the the third column and they are relative to Hbeta. I read them with
obs = pn.Observation(obsFile='observations1.dat', fileFormat='lines_in_rows', errIsRelative=True)

Is this correct? Would the montecarlo propagation then produce addiitonal observations including errors whithin the errors given?

Many thanks! Sorry if all of this is trivial!

Best wishes,
Letizia


Christophe Morisset

unread,
May 31, 2024, 6:37:37 PM5/31/24
to PyNeb
Hi Letizia,
The different format for the observation files are described in the dedicated notebook, especially cell 21 for your case:

If you put: LINE     TT   err
as first row of your file and read it using (adapt the values of the keywords to your case):

obs = pn.Observation('obs_test.dat', fileFormat='lines_in_rows_err_cols', corrected=False, errIsRelative=False)

you can add MonteCarlo values using:

obs.addMonteCarloObs(N=100)

This will create 100 fake observations, named TT_MC_1 to TT_MC_100, taking into account the error of each line

You can have more than one observation in the original file, just be sure thier names are different.
To answer you r other question in this same email, you can also have the emissin lines in cols and the objects in row, have a look at the cell 19 in the same Notebook.

Hope it helps,
Saludos,
Christophe
Reply all
Reply to author
Forward
0 new messages