Code Monkey home page Code Monkey logo

agnfitter's Introduction

AGNfitter 2.0 (AGNfitter-rx release)

A Bayesian MCMC approach to fitting Spectral Energy Distributions of AGN and galaxies

(Calistro-Rivera et al. 2016, Martínez-Ramírez et al. 2024)

Welcome to AGNfitter!

AGNfitter is a Python algorithm implementing a Bayesian methods to fit the spectral energy distributions (SEDs) of active galactic nuclei (AGN) and galaxies from the radio to X-rays. Through this method, you will be able to robustly disentangle the physical processes responsible for the emission of your sources.

You only need a catalog of photometric data (wavelengths, fluxes and errors), take a few decisions (if you wish), and you are ready to go (see Example). You can find detailed documentation soon here.

AGNfitter makes use of a large library of theoretical, empirical, and semi-empirical models to characterize both the nuclear and host galaxy emission simultaneously. The model consists of four physical emission components: the X-ray corona, an accretion disk, a torus of AGN heated dust, stellar populations, cold dust in star forming regions and synchroton emission from the AGN and star forming regions.

Requirements

  • Numpy
  • Matplotlib
  • Scipy
  • Astropy
  • emcee
  • ultranest

Installation

Installation can be done by cloning this Github repository.

After installation, let's do a quick test:

1) In example/SETTINGS_AGNfitter.py, go to def CATALOG_settings() and change

cat['path'] ='/Users/USER/AGNfitter/'

to your AGNfitter path. These test settings point to the example catalog contained in data/catalog_example.txt.

2) In the terminal, go to your AGNfitter path and start

./RUN_AGNfitter_multi.py  example/SETTINGS_AGNfitter.py

You should have a nice example in your cat['path']/OUTPUT folder.

Either make sure that the root AGNfitter directory is on your PATH or specify the full path to RUN_AGNfitter_multi.py.

Quick start

TASK 0 (optional): If you wish to have a working path other than the AGNfitter code path, please change

cat['workingpath'] = cat['path']

to your costumized working path.

TASK 1: In your working path, configure your settings creating a file my_SETTINGS_AGNfitter.py. This file should be created based on the example in example/SETTINGS_AGNfitter.py (copy+paste). To get AGNfitter running this is the ONLY file you need to modify.

TASK 1a: Specify your catalog's format in:

def CATALOG_settings()
    cat['path'] ='/Users/USER/AGNfitter/'
    cat['filename'] = 'data/catalog_example.txt
    cat['filetype'] = 'ASCII' ## catalog file type: 'ASCII' or 'FITS'. 
    cat['name'] = 0#'ID'            ## If ASCII: Column index (int) of source IDs
    cat...

TASK 1b: To construct the dictionary please go to

def FILTERS_settings():
    filters['dict_zarray'] = np.arange(zmin, zmax, zinterval)

Here you can specify the redshift ranges or a redshift array you need for you catalog. The DICT_default only includes z=[0.283, 1.58] for the test. Please, consider this process takes around 0.1 minute per redshift element. This process might be lengthy but you only have to do it once.

You can use the default combination of photometric bands by leaving

    filters['Bandset'] = 'BANDSET_default'.

Otherwise, if you like, you can specify the photometric bands included in your catalog by setting

def FILTERS_settings():
    ...
    filters['Bandset'] = 'BANDSET_settings' 
    
    filters['SPIRE500']= False
    filters['SPIRE350']= True        

and assigning 'True' to the keys corresponding to the photometric bands in your catalog.

TASK 2: Run AGNfitter with

./RUN_AGNfitter_multi.py my_SETTINGS_AGNfitter.py

This will run AGNfitter in series. In general there are a few more runtime options (see below).

Done!

Documentation

A careful documentation will be soon available. In the meantime, some notes are available in the Wiki as response to questions asked by users.

Citation and License

Please cite Calistro Rivera et al. (2016) and Martinez-Ramirez et al (2024, submitted) if this code has achieved its purpose and contributed to your research. The BibTeX entry for the paper is:

@ARTICLE{2016ApJ...833...98C,
       author = {{Calistro Rivera}, Gabriela and {Lusso}, Elisabeta and {Hennawi}, Joseph F. and {Hogg}, David W.},
        title = "{AGNfitter: A Bayesian MCMC Approach to Fitting Spectral Energy Distributions of AGNs}",
      journal = {\apj},
     keywords = {galaxies: active, galaxies: nuclei, galaxies: statistics, methods: statistical, quasars: general, Astrophysics - Astrophysics of Galaxies, Astrophysics - Instrumentation and Methods for Astrophysics},
         year = 2016,
        month = dec,
       volume = {833},
       number = {1},
          eid = {98},
        pages = {98},
          doi = {10.3847/1538-4357/833/1/98},
archivePrefix = {arXiv},
       eprint = {1606.05648},
 primaryClass = {astro-ph.GA},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2016ApJ...833...98C},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

AGNfitter is an open-source software made available under the MIT License. See the LICENSE file for details.

agnfitter's People

Contributors

gabrielacr avatar wndywllms avatar lauramr112 avatar

Stargazers

Abdurro'uf avatar  avatar Vitor Avelaneda avatar Thomas Harvey avatar Rui Zhu avatar Navaneeth P K avatar Merve Sahin avatar zbsu.cn avatar nmatsumoto avatar Chetna Duggal avatar  avatar Lauren Higgins avatar Andra Stroe avatar  avatar  avatar Yuming Fu avatar Sagar Sethi avatar Yohei Togami avatar Colin J. Burke avatar  avatar 潘志伟 (Zhiwei Pan) avatar Yan-Rong Li avatar  avatar Daniel Morcuende avatar Amrit Rau avatar  avatar  avatar Rachel Cochrane avatar Mike Walmsley avatar Mattia Vaccari avatar Hannah avatar Adam Carnall avatar Gabe Brammer avatar  avatar Zhu Fei-Fan avatar Elisabeta Lusso avatar  avatar Rohan Naidu avatar  avatar  avatar Shangguan Jinyi avatar Ciska Kemper avatar  avatar Johannes Buchner avatar ZSLin avatar Chienting Chen avatar

Watchers

Moustakas avatar Gabe Brammer avatar  avatar  avatar Elisabeta Lusso avatar  avatar  avatar Teng Liu avatar Lauren Higgins avatar paper2code - bot avatar

agnfitter's Issues

forced photometry values

How are negative forced photometry values handled? The documentation seems to imply that forced photometry values are handled simply as data but then plotted differently.

new_modelsystem error with python multiprocessing

The new_modelsystem raises an error in the every end, both when use runtime option --ncpu and not:

Traceback (most recent c342all last):
File "./RUN_AGNfitter_multi.py", line 327, in
RUN_AGNfitter_multiprocessing(args.ncpu, data_ALL, models)
File "./RUN_AGNfitter_multi.py", line 262, in RUN_AGNfitter_multiprocessing
catalog_fitting = pool.map(multi_run_wrapper, itertools.izip(range(nsources), itertools.repeat(data_obj), itertools.repeat(modelsdict)))
File "/usr/lib64/python2.7/multiprocessing/pool.py", line 250, in map
return self.map_async(func, iterable, chunksize).get()
File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get
raise self._value
KeyError: ('0', '.', '0.0')

Problem installing `acor` dependency

I'm experiencing problem in using AGNfitter because of the acor dependency.

I tried with pip, and the output is as follows:

sudo pip install acor
root's password:
Collecting acor
  Using cached acor-1.1.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib64/python3.4/site-packages (from acor)
Installing collected packages: acor
  Running setup.py install for acor
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-v7m27boj/acor/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gu_jiq4k-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.4
    creating build/lib.linux-x86_64-3.4/acor
    copying acor/__init__.py -> build/lib.linux-x86_64-3.4/acor
    copying acor/acor.py -> build/lib.linux-x86_64-3.4/acor
    running build_ext
    building 'acor._acor' extension
    creating build/temp.linux-x86_64-3.4
    creating build/temp.linux-x86_64-3.4/acor
    gcc -pthread -Wno-unused-result -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -Iacor -I/usr/lib64/python3.4/site-packages/numpy/core/include -I/usr/include/python3.4m -c acor/_acor.c -o build/temp.linux-x86_64-3.4/acor/_acor.o
    acor/_acor.c:6:31: fatal error: numpy/arrayobject.h: No such file or directory
     #include <numpy/arrayobject.h>
                                   ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-v7m27boj/acor/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gu_jiq4k-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-v7m27boj/acor
You are using pip version 7.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
000  sudo pip install acor 

The pip list is as follows:

pip list
apparmor (2.10.2)
Babel (1.3)
beautifulsoup4 (4.4.0)
bottle (0.12.8)
certifi (2015.9.6.2)
cffi (1.1.2)
CommonMark (0.5.4)
coverage (3.7.1)
cssselect (0.9.1)
cupshelpers (1.0)
docutils (0.12)
ecdsa (0.13)
Genshi (0.7)
html5lib (0.999999)
httplib2 (0.9.1)
LibAppArmor (2.10.2)
lxml (3.4.4)
Markdown (2.6.2)
Markups (2.0.0)
nose (1.3.7)
numpy (1.9.3)
openshot-qt (2.3.1)
paramiko (1.15.2)
pexpect (3.3)
Pillow (2.9.0)
pip (7.1.2)
py (1.4.30)
pyasn1 (0.1.8)
pycparser (2.14)
pycrypto (2.6.1)
pycups (1.9.72)
pycurl (7.19.5.1)
pyenchant (1.6.6)
Pygments (2.0.2)
pygobject (3.20.1)
pyOpenSSL (0.15.1)
pyserial (2.7)
pysmbc (1.0.15.4)
pytz (2015.6)
pyxdg (0.25)
pyzmq (14.7.0)
requests (2.7.0)
ReText (6.0.0)
setuptools (18.3.2)
simplejson (3.8.0)
six (1.9.0)
tornado (4.2.1)
Twisted (16.3.0)
zope.interface (4.1.2)

Problem in running the example after installation

Hi,
I'm just installed the AGNfitter and try to run the example code by following the readme. However, I got this error:

Traceback (most recent call last):
  File "./RUN_AGNfitter_multi.py", line 258, in <module>
    Modelsdict = MAKE_model_dictionary(cat, filters, clobbermodel=clobbermodel)
  File "./RUN_AGNfitter_multi.py", line 83, in MAKE_model_dictionary
    MODELFILES.construct(cat['path'])
  File "/home/irhamta/Documents/Research/Finding_Quasar/Software/AGNfitter/functions/CONSTRUCT_modelobjects.py", line 182, in construct
    SB.build()
  File "/home/irhamta/Documents/Research/Finding_Quasar/Software/AGNfitter/functions/CONSTRUCT_modelobjects.py", line 140, in build
    irlum,sb_wave, sb_SED = npzfile['arr_0'], npzfile['arr_1'], npzfile['arr_2']
  File "/home/irhamta/anaconda3/envs/agnfit/lib/python2.7/site-packages/numpy/lib/npyio.py", line 262, in __getitem__
    pickle_kwargs=self.pickle_kwargs)
  File "/home/irhamta/anaconda3/envs/agnfit/lib/python2.7/site-packages/numpy/lib/format.py", line 696, in read_array
    raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False

Do you know how to solve it? Any advice you have would be appreciated! Thanks!

non-tuple sequence for multidimensional indexing is deprecated for PLOTandWRITE_AGNfitter.py & MODEL_AGNfitter.py

I receive this warning:
FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
k[w0] = k[x1] + ((wl[w0] - 0.12) * (k[x1] - k[x2]) / (wl[x1] - wl[x2])) +RV

along with others FutureWarnings for the same non-tuple sequence indexing conflict.

and then this output:
Error: something is wrong in the calculation of STARBURST flux
Error: something is wrong in the calculation of BBB flux
Error: something is wrong in the calculation of TORUS flux

I believe this outdated syntax is ruining the creation of the model dictionary because my output has not been meaningful or consistent.

This error also comes up when trying to plot errorbars.
FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
(_, caps, _) = ax1.errorbar(data_nus[det], data_nuLnu_rest[det], yerr= data_errors_rest[det], capsize=4, linestyle="None", linewidth=1.5, marker='o',markersize=5, color="black", alpha = 1)

Has this issue been addressed and worked around yet? I think it is the source of my inaccurate output.

Working with the new version of AGNfitter

Hi, I tried running the new AGNfitter using the example file and data provided, and I got the following error. I also tried running it using default filters and i still get the same error.

Traceback (most recent call last):
File "/idia/users/thando/.venv/AGNfitter/v2/AGNfitter/RUN_AGNfitter_multi.py", line 344, in
RUN_AGNfitter_onesource_independent(i, data_ALL, filters_settings, models_settings, mc_settings, clobbermodel=clobbermodel)
File "/idia/users/thando/.venv/AGNfitter/v2/AGNfitter/RUN_AGNfitter_multi.py", line 204, in RUN_AGNfitter_onesource_independent
zdict.build()
File "/idia/users/thando/.venv/AGNfitter/v2/AGNfitter/functions/DICTIONARIES_AGNfitter.py", line 149, in build
dict_modelsfiltered = self.construct_dictionaryarray_filtered(z, filterdict) #Models SEDs are redshifted and filtered
File "/idia/users/thando/.venv/AGNfitter/v2/AGNfitter/functions/DICTIONARIES_AGNfitter.py", line 110, in construct_dictionaryarray_filtered
self.TORUSFdict_4plot, torus_parnames, torus_partypes ,self.TORUSfunctions = model.TORUS(self.path, self.modelsettings)
TypeError: 'NoneType' object is not iterable

python version?

Hello, could you clarify which python version should be used for AGNFitter please?

regarding the AGNfitter SED fitting

I have successfully run the code for my sources, but my fitting of some data points is not so good, can you suggest to me, where I am lagging. What things I should keep in mind while running the code single source. How do these fittings affect the values of the parameters in the output file? I am attaching the pdf file of one of the sed that I fit.
SED_manyrealizations_11111.pdf

Plotting issues with upgrade to Mac OS X El Capitan

After an upgrade to Mac OS X El capitan the code breaks at the plotting stage, due to an issue related to Matplotlib and Latex.
It looks like El Capitan has made some changes for security, so that the existing latex installs, which probably used /usr/texbin, are no longer allowed, while this should be in /Library/TeX/texbin.

Issue with writing output

Hello- I am running the example code, and am having an issue with the code output. It writes files "samples_mcmc.sav" and "samples_burn1-2-3.sav", and there is a file called "traces_mcmc.pdf" that I cannot open. The terminal output (before and including the error) is below. Any advice you have would be appreciated! Thanks!

Running MCMC with 10000 steps
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
3.6 min elapsed


Properties of the sampling results:

  • Mean acceptance fraction 0.12125699999999999
  • Mean autocorrelation time 496.05364887436644
    Traceback (most recent call last):
    File "./RUN_AGNfitter_multi.py", line 264, in
    RUN_AGNfitter_multiprocessing(args.ncpu, data_ALL, Modelsdict)
    File "./RUN_AGNfitter_multi.py", line 203, in RUN_AGNfitter_multiprocessing
    catalog_fitting = pool.map(multi_run_wrapper, itertools.izip(range(nsources), itertools.repeat(data_obj), itertools.repeat(modelsdict)))
    File "/Users/vbaldassare/anaconda2/lib/python2.7/multiprocessing/pool.py", line 253, in map
    return self.map_async(func, iterable, chunksize).get()
    File "/Users/vbaldassare/anaconda2/lib/python2.7/multiprocessing/pool.py", line 572, in get
    raise self._value
    RuntimeError: latex was not able to process the following string:
    'lp'

Here is the full report generated by latex:
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/MacPorts 2018.47642_8) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(/Users/vbaldassare/.matplotlib/tex.cache/3bbc0f8d536770a62891b7cc8788c317.tex
LaTeX2e <2017-04-15>
Babel <3.10> and hyphenation patterns for 46 language(s) loaded.
(/opt/local/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/opt/local/share/texmf-texlive/tex/latex/base/size10.clo))

! LaTeX Error: File `type1cm.sty' not found.

Type X to quit or to proceed,
or enter new name. (Default extension: sty)

Enter file name:
! Emergency stop.
<read *>

l.4 ^^M

No pages of output.
Transcript written on 3bbc0f8d536770a62891b7cc8788c317.log.

SED_manyrealizations pdf doesn't have template observations?

My SED pdf output doesn't look like the expected pdf that I am supposed to get from AGNfitter. I have no y-error bars and the template components (BBB, torus, stellar, cold dust) can't be made out. Here's what it looks like:
AGNfitter_4592

Any suggestions? by the way I am running this with python2.7 so maybe that's the problem?

New AGNfitter-rx_v0.1: operands could not be broadcast together with shapes (10,10) (9,)

Hi, I am using the new AGNfitterversion and I am facing this problem. I have used 9 data points and filters.
Properties of the sampling results:

  • Mean acceptance fraction 0.27182
  • Mean autocorrelation time 0.8996390361395165
    /home/ritish/Documents/AGNfitter/functions/PLOTandWRITE_AGNfitter.py:608: RuntimeWarning: divide by zero encountered in log10
    TOinterp = scipy.interpolate.interp1d(all_tor_nus, np.log10(tor_Fnus.flatten()), kind = 'linear', bounds_error=False, fill_value=-100) #quadratic
    Traceback (most recent call last):
    File "./RUN_AGNfitter_multi.py", line 226, in RUN_AGNfitter_onesource_independent
    PLOTandWRITE_AGNfitter.main(data, models, P, out, models_settings)
    File "/home/ritish/Documents/AGNfitter/functions/PLOTandWRITE_AGNfitter.py", line 58, in main
    print( '- Mean acceptance fraction', chain_mcmc.mean_accept)
    AttributeError: 'CHAIN' object has no attribute 'mean_accept'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./RUN_AGNfitter_multi.py", line 386, in
RUN_AGNfitter_onesource_independent(args.sourcenumber, data_ALL, filters_settings, models_settings, clobbermodel=clobbermodel)
File "./RUN_AGNfitter_multi.py", line 231, in RUN_AGNfitter_onesource_independent
PLOTandWRITE_AGNfitter.main(data, models, P, out, models_settings)
File "/home/ritish/Documents/AGNfitter/functions/PLOTandWRITE_AGNfitter.py", line 61, in main
output = OUTPUT(chain_mcmc, data, models, P, models_settings)
File "/home/ritish/Documents/AGNfitter/functions/PLOTandWRITE_AGNfitter.py", line 155, in init
fluxobj_4SEDplots.fluxes(self.data, self.models)
File "/home/ritish/Documents/AGNfitter/functions/PLOTandWRITE_AGNfitter.py", line 668, in fluxes
self.filtered_modelpoints_nuLnu = (filtered_modelpoints lumfactor 10**(data.nus))
ValueError: operands could not be broadcast together with shapes (10,10) (9,)

Triangle plots and plotting issues on Mac -- continued

Regarding the closed issue on Plotting and the Mac, I wonder if that issue relates to my other problem which is:

When I set

out['plot_posteriortrianglewithluminosities'] = True # requires out['calc_intlum']=True

In the SETTINGS file for the example (which runs perfectly fine when it is set to False except for no labels on the plot, see below) and I get the following error running on my Mac (OS Sierra 10.12.6).

Traceback (most recent call last):
File "./RUN_AGNfitter_multi.py", line 264, in
RUN_AGNfitter_multiprocessing(args.ncpu, data_ALL, Modelsdict)
File "./RUN_AGNfitter_multi.py", line 203, in RUN_AGNfitter_multiprocessing
catalog_fitting = pool.map(multi_run_wrapper, itertools.izip(range(nsources), itertools.repeat(data_obj), itertools.repeat(modelsdict)))
File "/Users/eglikman/anaconda2/lib/python2.7/multiprocessing/pool.py", line 253, in map
return self.map_async(func, iterable, chunksize).get()
File "/Users/eglikman/anaconda2/lib/python2.7/multiprocessing/pool.py", line 572, in get
raise self._value
ValueError: Contour levels must be increasing

I checked all the python package versions and those seem fine. My python version is anaconda2-5.0.1

In addition, (not sure if this is related or separate) when running AGNfitter on my Mac, I get output plots that are missing the late that notes XID and redshift. Is this also related?

I have installed the MacTex package as suggested above and there is a symbolic link in /Library/TeX/texbin to the relevant tasks.

Both appear to work fine on a linux machine that I have tested.

Any suggestions or thoughts?

Originally posted by @eilatg in #4 (comment)

building a large dictionary -- memory limitation?

When building the dictionary, is there a way to gracefully limit the memory? When running AGNfitter on a cluster, the program is exceeding the memory limits when it gets through about 22 per cent of building the dictionary. It would be extremely useful to be able to cap the amount of memory used.

Issue with acor

Hey, I'm having an issue getting this working because acor doesn't seem to get installed. Taking the issue to acor github I was told:
"Also: I'd recommend checking out the autocorr module in emcee http://dan.iel.fm/emcee/current/api/#autocorrelation-analysis because it's a bit more reliable. acor will be marginally faster but it will probably only be worth it if you need to compute many autocorrelation times on datasets with billions of points."

Thoughts?

Operands could not be broadcast together with shapes (10,18) (12,)

We are using your AGNFitter code to study the SEDs of red quasars from Glikman et al. (2012) as it is the only one that mixes galaxies and AGN with dust reddening.

Using our defined photometry file (following the syntax in the example), the code executes, goes through various burn in iterations, but as the code finishes running, we get the following error:

Traceback (most recent call last):
File "/astro/linux/64/agnfitter/current/RUN_AGNfitter_multi.py", line 262, in
RUN_AGNfitter_multiprocessing(args.ncpu, data_ALL, Modelsdict)
File "/astro/linux/64/agnfitter/current/RUN_AGNfitter_multi.py", line 201, in RUN_AGNfitter_multiprocessing
catalog_fitting = pool.map(multi_run_wrapper, itertools.izip(range(nsources), itertools.repeat(data_obj), itertools.repeat(modelsdict)))
File "/astro/linux/64/anaconda/python2/current/lib/python2.7/multiprocessing/pool.py", line 251, in map return self.map_async(func, iterable, chunksize).get()
File "/astro/linux/64/anaconda/python2/current/lib/python2.7/multiprocessing/pool.py", line 558, in get raise self._value
ValueError: operands could not be broadcast together with shapes (10,18) (12,)

The code does produce output directories for our two sources, but they lack PDF plots.

We tried the suggestions in thread #6 (i.e., overwriting the model libraries with '--overwrite' and we deleted the MODELSDICT_default file manually as well). Neither solved the problem.

Help!!

MODELSDICT_default is empty and hard-coded paths

Hi Gabriela!
I saw your paper on arxiv today and wanted to try it out on my sample of low-redshift AGN. AGNfitter looks awesome but I wanted to let you know a couple of issues I've run into while trying it out.

1.) The MODELSDICT_default file you provided is empty which is fine because I figured out if I just deleted it the code would create a new one. However...

2.) When trying to create a new model dictionary, it looks like when the pickle files are being loaded, the code is importing 'CONSTRUCT_modelobjects' which then causes it to run lines 109-126. This would be fine however you have some hard-coded paths within this function in lines 60 and 105. I changed those but then also realized you didn't provide 'DALE.list', 'CHARY_ELBAZ.list', 'torus_templates_list.dat', or 'richardsbbb.dat'. So in the end I ended up just commenting out lines 109-126.

After those small issues, everything worked great in the test run!

Running example code

Hi, I am trying to run an example code and I get this error:

Traceback (most recent call last):
File "/idia/users/thando/AGNfitter/RUN_AGNfitter_multi.py", line 258, in
Modelsdict = MAKE_model_dictionary(cat, filters, clobbermodel=clobbermodel)
File "/idia/users/thando/AGNfitter/RUN_AGNfitter_multi.py", line 83, in MAKE_model_dictionary
MODELFILES.construct(cat['path'])
File "/idia/users/thando/AGNfitter/functions/CONSTRUCT_modelobjects.py", line 182, in construct
SB.build()
File "/idia/users/thando/AGNfitter/functions/CONSTRUCT_modelobjects.py", line 140, in build
irlum,sb_wave, sb_SED = npzfile['arr_0'], npzfile['arr_1'], npzfile['arr_2']
File "/users/thando/.local/lib/python2.7/site-packages/numpy/lib/npyio.py", line 262, in getitem
pickle_kwargs=self.pickle_kwargs)
File "/users/thando/.local/lib/python2.7/site-packages/numpy/lib/format.py", line 696, in read_array
raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.