astrofrog / sedfitter

Python version of the SED fitter from Robitaille et al., 2007, ApJS 169 328
http://sedfitter.readthedocs.org
BSD 2-Clause "Simplified" License
20 stars 22 forks source link

Specifying a monochromatic flux #43

Closed watsonv closed 7 years ago

watsonv commented 8 years ago

I am faced with some difficulties while trying to use a monochromatic flux in the sedfitter. As long as I use one of the pre-defined filters, it works fine. Looks like I am doing something wrong with defining the wavelength and including that along with other named filters. e.g. If I need to use the flux density at a wavelength like 20.5 micron, what is the best way to do it? Specifying it like: qwav = 20.5 * u.micron filters = [qwav, 'S2', 'S3', 'S4', 'W1', 'W2'] results in error when the program is run. The program seems to be looking for the filter named qwav in the "convolved" directory where the named filters reside. Great if you could give some inputs on how to proceed.

johnarban commented 8 years ago

I have gotten around this by convolving the SEDs with the appropriate filter. If it is truly monochromatic (like a point from a spectra), you can make a monochromatic filter using convolve_model_dir_monochromatic. I'm haven't tried this, but it looks like it should do what you want.

Check it out in the docs: Monochromatic Convolution

astrofrog commented 7 years ago

@johnarban's soluton is correct, and you should then specify the monochromatic filter using a filter with a name like e.g. MO033. But there is a new format for the models that I am producing new models in, and for those it will be possible to do what you did above with qwav.

watsonv commented 7 years ago

Thank you John and Thomas for the comments. I had been trying with convolve_model_dir_monochromatic. As it was taking more than 2 hrs to execute, I thought I was doing something wrong while passing the parameters to convolve_model_dir_monochromatic and was terminating it early. If I let it run, I see that it is writing a bunch of files MO001.fits to MO212.fits covering 4870 mic to 0.075 mic in the "convolved" directory where the filters are located. I can't see a file named "filters" with the details of the filters created as mentioned in the document. I pick up the right filter looking at the wavelength of the filter in the FILTWAV header parameter of the filter. I am also able to restrict the wavelength range while creating the filters, but don't seem to have a way of specifying a wavelength and asking the code to create a filter at that wavelength. Is it intended to use the filter at the closest wavelength?

astrofrog commented 7 years ago

@watsonv - yes, you should use the filter at the closest wavelength