GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
225 stars 106 forks source link

Running galsim demo11.yaml gives │NameError: global name 'origpf' is not defined #945

Closed gijzelaerr closed 6 years ago

gijzelaerr commented 6 years ago
Traceback (most recent call last):
  File "/usr/bin/galsim", line 275, in <module>
    main()
  File "/usr/bin/galsim", line 256, in main
    except_abort=args.except_abort)
  File "/usr/lib/python2.7/dist-packages/galsim/config/process.py", line 780, in Process
    except_abort=except_abort)
  File "/usr/lib/python2.7/dist-packages/galsim/config/output.py", line 58, in BuildFiles
    galsim.config.ProcessInput(config, logger=logger, safe_only=True)
  File "/usr/lib/python2.7/dist-packages/galsim/config/input.py", line 175, in ProcessInput
    input_obj = getattr(config['input_manager'],tag)(**kwargs)
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 667, in temp
    token, exp = self._create(typeid, *args, **kwds)
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 567, in _create
    id, exposed = dispatch(conn, None, 'create', (typeid,)+args, kwds)
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 105, in dispatch
    raise convert_to_error(kind, result)
multiprocessing.managers.RemoteError: 
---------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 207, in handle_request
    result = func(c, *args, **kwds)
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 386, in create
    obj = callable(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/galsim/lensing_ps.py", line 198, in __init__
    self._convert_power_function(self.e_power_function,'e_power_function')
  File "/usr/lib/python2.7/dist-packages/galsim/lensing_ps.py", line 675, in _convert_power_function
    "Input provided: {0}\n".format(origpf)+
NameError: global name 'origpf' is not defined
---------------------------------------------------------------------------
gijzelaerr commented 6 years ago

looks like one of the paths in demo1.yaml are wrong in my case, but this error is a bit confusing

rmjarvis commented 6 years ago

At the very least, this is a bug in our error message. We seem to have lost the origpf definition (which is just used to try to give a more coherent error message), hence the NameError. So thank you very much for the report. I'll fix that ASAP.

As for the underlying problem, you can start trying to figure out the issue by increasing the verbosity of your run:

galsim -v3 demo11.yaml

Just before your error, you should see something along the lines of the following:

file 0: Start ProcessInput
file 0: Process input key power_spectrum
file 0: Current values for power_spectrum are None, safe = None
file 0: Build input type power_spectrum
file 0: power_spectrum kwargs = {'units': 'radians', 'e_power_function': 'data/cosmo-fid.zmed1.00.out'}

That last line has the file name that it's trying to open: 'data/cosmo-fid.zmed1.00.out'. See if it exists. There should be a data directory in your GalSim/examples directory with this file in it. So maybe that got corrupted. Or maybe you are trying to run this from a different directory, so this path isn't the right one to use. I don't know. But hopefully this gives you enough clues to figure out the problem.

gijzelaerr commented 6 years ago

hi @rmjarvis , thanks for your quick reply. indeed it was an incorrect path. Note that I'm using the Debian package of Galsim from http://kernsuite.info/, so some paths are different. I was also struggling a bit with the COSMOS dataset a bit, but in the end, i just downloaded the data manually and set it like this:

input :
    cosmos_catalog :
        dir: /home/gijs/gijs/COSMOS_23.5_training_sample
        file_name : real_galaxy_catalog_23.5_fits.fits

now I get a new error:

https://gist.github.com/gijzelaerr/e7cce62d42577f2fa45dfa1690bc310c

rmandelb commented 6 years ago

That's the wrong file name. It should be `real_galaxy_catalog_23.5.fits'.

gijzelaerr commented 6 years ago

yes, you are right, now it works!