Hi,
I am excited to use Bagpipes - thank you for making this code accessible!
I am new to using Bagpipes, and trying to perform a fit on NIRCam observations of a redshift ~ 7 galaxy. I am using filter files from the JWST documentation where the filters are in Angstroms. This is my input photometry:
FILTER FLUX_[muJY] FLUX_ERROR_[muJY]
F090W 0.046524 0.023233
F115W 0.313166 0.059797
F150W 0.326406 0.061017
F200W 0.387495 0.066461
F277W 0.469915 0.077651
F356W 0.992203 0.112826
F410M 1.503777 0.138910
F444W 0.829922 0.103326
I have managed to run the fit successfully with an exponential SFH model, but when I change the fit instructions by adding nebular emission or using a different SFH model, it fails. Copied below is an example of the errors that I get from these fits.
Any advice for resolving this problem would be appreciated, I have seen similar errors in previous Github issues (eg #9) but I have not been able to fix the issue myself from referring to the previous answers.
Thank you!
ln(ev)= -7.3335434946919520E-016 +/- 1.3540258024398900E-009
Total Likelihood Evaluations: 400
Completed in 4.2 seconds.
Sampling finished. Exiting MultiNest
ValueError Traceback (most recent call last)
Input In [25], in <cell line: 3>()
1 fit = pipes.fit(galaxy, fit_instructions, run='git_test_constant_burst_sfh')
----> 3 fit.fit(verbose=False)
File ~/opt/anaconda3/envs/bagpipesenv/lib/python3.10/site-packages/bagpipes/fitting/fit.py:136, in fit.fit(self, verbose, n_live, use_MPI)
133 print("\nCompleted in " + str("%.1f" % runtime) + " seconds.\n")
135 # Load MultiNest outputs and save basic quantities to file.
--> 136 samples2d = np.loadtxt(self.fname + "post_equal_weights.dat")
137 lnz_line = open(self.fname + "stats.dat").readline().split()
139 self.results["samples2d"] = samples2d[:, :-1]
File ~/opt/anaconda3/envs/bagpipesenv/lib/python3.10/site-packages/numpy/lib/npyio.py:1338, in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows, quotechar, like)
1335 if isinstance(delimiter, bytes):
1336 delimiter = delimiter.decode('latin1')
-> 1338 arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
1339 converters=converters, skiplines=skiprows, usecols=usecols,
1340 unpack=unpack, ndmin=ndmin, encoding=encoding,
1341 max_rows=max_rows, quote=quotechar)
1343 return arr
File ~/opt/anaconda3/envs/bagpipesenv/lib/python3.10/site-packages/numpy/lib/npyio.py:999, in _read(fname, delimiter, comment, quote, imaginary_unit, usecols, skiplines, max_rows, converters, ndmin, unpack, dtype, encoding)
996 data = _preprocess_comments(data, comments, encoding)
998 if read_dtype_via_object_chunks is None:
--> 999 arr = _load_from_filelike(
1000 data, delimiter=delimiter, comment=comment, quote=quote,
1001 imaginary_unit=imaginary_unit,
1002 usecols=usecols, skiplines=skiplines, max_rows=max_rows,
1003 converters=converters, dtype=dtype,
1004 encoding=encoding, filelike=filelike,
1005 byte_converters=byte_converters)
1007 else:
1008 # This branch reads the file into chunks of object arrays and then
1009 # casts them to the desired actual dtype. This ensures correct
1010 # string-length and datetime-unit discovery (like arr.astype()).
1011 # Due to chunking, certain error reports are less clear, currently.
1012 if filelike:
ValueError: could not convert string '0.521501846754526715-309' to float64 at row 0, column 2.
Hi,
I am excited to use Bagpipes - thank you for making this code accessible!
I am new to using Bagpipes, and trying to perform a fit on NIRCam observations of a redshift ~ 7 galaxy. I am using filter files from the JWST documentation where the filters are in Angstroms. This is my input photometry:
FILTER FLUX_[muJY] FLUX_ERROR_[muJY]
F090W 0.046524 0.023233
F115W 0.313166 0.059797
F150W 0.326406 0.061017
F200W 0.387495 0.066461
F277W 0.469915 0.077651
F356W 0.992203 0.112826
F410M 1.503777 0.138910
F444W 0.829922 0.103326
I have managed to run the fit successfully with an exponential SFH model, but when I change the fit instructions by adding nebular emission or using a different SFH model, it fails. Copied below is an example of the errors that I get from these fits.
Any advice for resolving this problem would be appreciated, I have seen similar errors in previous Github issues (eg #9) but I have not been able to fix the issue myself from referring to the previous answers.
Thank you!
ln(ev)= -7.3335434946919520E-016 +/- 1.3540258024398900E-009
Total Likelihood Evaluations: 400
Completed in 4.2 seconds.
Sampling finished. Exiting MultiNest
ValueError Traceback (most recent call last)
Input In [25], in <cell line: 3>()
1 fit = pipes.fit(galaxy, fit_instructions, run='git_test_constant_burst_sfh')
----> 3 fit.fit(verbose=False)
File ~/opt/anaconda3/envs/bagpipesenv/lib/python3.10/site-packages/bagpipes/fitting/fit.py:136, in fit.fit(self, verbose, n_live, use_MPI)
133 print("\nCompleted in " + str("%.1f" % runtime) + " seconds.\n")
135 # Load MultiNest outputs and save basic quantities to file.
--> 136 samples2d = np.loadtxt(self.fname + "post_equal_weights.dat")
137 lnz_line = open(self.fname + "stats.dat").readline().split()
139 self.results["samples2d"] = samples2d[:, :-1]
File ~/opt/anaconda3/envs/bagpipesenv/lib/python3.10/site-packages/numpy/lib/npyio.py:1338, in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows, quotechar, like)
1335 if isinstance(delimiter, bytes):
1336 delimiter = delimiter.decode('latin1')
-> 1338 arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
1339 converters=converters, skiplines=skiprows, usecols=usecols,
1340 unpack=unpack, ndmin=ndmin, encoding=encoding,
1341 max_rows=max_rows, quote=quotechar)
1343 return arr
File ~/opt/anaconda3/envs/bagpipesenv/lib/python3.10/site-packages/numpy/lib/npyio.py:999, in _read(fname, delimiter, comment, quote, imaginary_unit, usecols, skiplines, max_rows, converters, ndmin, unpack, dtype, encoding)
996 data = _preprocess_comments(data, comments, encoding)
998 if read_dtype_via_object_chunks is None:
--> 999 arr = _load_from_filelike(
1000 data, delimiter=delimiter, comment=comment, quote=quote,
1001 imaginary_unit=imaginary_unit,
1002 usecols=usecols, skiplines=skiplines, max_rows=max_rows,
1003 converters=converters, dtype=dtype,
1004 encoding=encoding, filelike=filelike,
1005 byte_converters=byte_converters)
1007 else:
1008 # This branch reads the file into chunks of object arrays and then
1009 # casts them to the desired actual dtype. This ensures correct
1010 # string-length and datetime-unit discovery (like
arr.astype()).1011 # Due to chunking, certain error reports are less clear, currently.
1012 if filelike:
ValueError: could not convert string '0.521501846754526715-309' to float64 at row 0, column 2.