jacopo-chevallard / BEAGLE-general

Basic information to get started with the galaxy spectral modelling tool Beagle
https://www.iap.fr/beagle/
9 stars 0 forks source link

Cannot Find Spectrum Error #108

Closed chavezoscar009 closed 6 months ago

chavezoscar009 commented 6 months ago

I am using BEAGLE v0.29.2 and am running into an issue where the program cannot seem to find the spectrum when I am trying to do spectro-photometric fitting.

I used the following command to call BEAGLE:

docker run --rm -it -v /Users/oac466/Desktop/BEAGLE-general:/BEAGLE_virtual_workdir --env-file Docker_env.list --user $(id -u):$(id -g) beagletool/beagle:0.29.2 --parameter-file /BEAGLE_virtual_workdir/params/Jorges_Fit.param --fit

And got the following output errors.

---> fitted: mass
 ---> fitted: nebular_logu
 ---> fitted: nebular_z
 ---> fitted: tauv_eff
 ---> fitted: tau
 ---> fitted: metallicity
 ---> fitted: specific_sfr
 ---> fitted: current_sfr_timescale
 ---> fitted: formation_redshift
 n_fitted:            9
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[ERROR: Cannot find the spectrum for the object ID `1395` ! ]
 [FUNCTION: "load_observation_spectrum" ]
 [MODULE: "io_spectra" ]
 [BACKTRACE:   
#0  0x7f39fa1fbad0 in ???
#1  0x55dc12b91e12 in print_backtrace
    at /home/runner/work/BEAGLE/BEAGLE/build/dependencies/astrofortran-src/src/lib_messages.f90:873
#2  0x55dc12b93dce in __lib_messages_MOD_print_error
    at /home/runner/work/BEAGLE/BEAGLE/build/dependencies/astrofortran-src/src/lib_messages.f90:822
#3  0x55dc12d88cea in __io_spectra_MOD_load_observation_spectrum
    at /home/runner/work/BEAGLE/BEAGLE/src/io_spectra.f90:406
#4  0x55dc128f3d74 in beagle
    at /home/runner/work/BEAGLE/BEAGLE/src/BEAGLE.f90:540
#5  0x55dc128efca6 in main
    at /home/runner/work/BEAGLE/BEAGLE/src/BEAGLE.f90:6

I am having trouble figuring out why it does not find it as I am giving it the file path of the spectra in the .param file as shown below:

# ******************* PHOTOMETRY *****************************
#****************************************************************

FILTERS THROUGHPUTS = $BEAGLE_FILTERS/Jorge_Filters_Throughput.fits

FILTERS CONFIGURATION = $BEAGLE_FILTERS/Jorges_Filters.dat

PHOTOMETRIC CATALOGUE = $BEAGLE_DATA/Jorge_Photom_BEAGLE.fits

#****************************************************************
# ******************* SPECTROSCOPY *****************************
#****************************************************************

LIST OF SPECTRA = $BEAGLE_DATA/spectra/spectra_Jorge.list

# Example: FITS table
SPECTRUM FILE DESCRIPTION =   wl:colName:wav wl:conversion:1.E+10 flux:colName:flux  fluxerr:colName:fluxerr

Where the file spectra_Jorge.list has the following entry:

$BEAGLE_DATA/spectra/Jorge_Galaxy_Spectrum_1395.fits

Which points to the spectrum I want to do the spectro-photometric fitting. Any insights would be greatly appreciated.

jacopo-chevallard commented 6 months ago

hello @chavezoscar009, the issue is likely related to the naming of your spectra, section 4.1 of Beagle's manual:

NB: note that when combining spectroscopic and photometric data, the matching between photometry and spectrum, for the same object, is performed by means of the object ID defined in the photometric catalogue. In particular, for an object with photometric ID , the file name of the corresponding spectrum must start with the string , followed by the separator _. As an example, if the photometric catalogue contains the ID 123456, the file containing the list of spectra (passed by means of the keyword LIST OF SPECTRA in the parameter file) can contain a line /123456_spectrum.fits.

chavezoscar009 commented 6 months ago

Okay cool, that seems to have fixed the issues here, glad it was a little naming convention and nothing more serious. So then I take it for the example script to work as well I would need to change the spectra name from example_spec_0.fits to 0_example_spec.fits.