Closed PrantikS closed 3 years ago
Hi @PrantikS, please download the latest version of CRPropa as the example that you tried is based on it.
Thanks, the latest version solved this issue. However, the latest version is showing the following error for the module, sim.add(PhotoPionProduction(CMB)) :
sim.add(PhotoPionProduction(CMB)) File "/home/prantik/.virtualenvs/crpropa/lib/python2.7/site-packages/crpropa/crpropa.py", line 7564, in init _crpropa.PhotoPionProduction_swiginit(self, _crpropa.new_PhotoPionProduction(photonField, photons, neutrinos, electrons, antiNucleons, limit, haveRedshiftDependence)) TypeError: Wrong number or type of arguments for overloaded function 'new_PhotoPionProduction'. Possible C/C++ prototypes are: crpropa::PhotoPionProduction::PhotoPionProduction(crpropa::ref_ptr< crpropa::PhotonField >,bool,bool,bool,bool,double,bool) crpropa::PhotoPionProduction::PhotoPionProduction(crpropa::ref_ptr< crpropa::PhotonField >,bool,bool,bool,bool,double) crpropa::PhotoPionProduction::PhotoPionProduction(crpropa::ref_ptr< crpropa::PhotonField >,bool,bool,bool,bool) crpropa::PhotoPionProduction::PhotoPionProduction(crpropa::ref_ptr< crpropa::PhotonField >,bool,bool,bool) crpropa::PhotoPionProduction::PhotoPionProduction(crpropa::ref_ptr< crpropa::PhotonField >,bool,bool) crpropa::PhotoPionProduction::PhotoPionProduction(crpropa::ref_ptr< crpropa::PhotonField >,bool) crpropa::PhotoPionProduction::PhotoPionProduction(crpropa::ref_ptr< crpropa::PhotonField >)
Is there any error installation error or something else?
Use CMB()
instead of CMB
. Photon fields are now classes, not an enumerator. We have changed this recently (it is written in the changelog). I'll fix this in example notebooks soon.
Thanks a lot
from crpropa import *
set up random turbulent field
vgrid = Grid3f(Vector3d(0), 512, 30 kpc) initTurbulence(vgrid, 8 nG, 60 kpc, 800 kpc, -11. / 3, 42) Bfield = MagneticFieldGrid(vgrid)
When I am running this, I am getting the following error:
vgrid = Grid3f(Vector3d(0), 512, 30 * kpc) NameError: name 'Grid3f' is not defined
Can you help me out to resolve this issue?