CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
69 stars 68 forks source link

Missing gas density distribution file 'H2_dens_mean_BEG03.txt' #432

Closed oanguner closed 1 year ago

oanguner commented 1 year ago

I'm trying to follow your 'Example of grid based densities of the Milky Way and sampling source position' tutorial [1]. I could not find the 'H2_dens_mean_BEG03.txt' H2 density distribution file neither on the 'additional resources' link you provided [2] nor in the CRPropa3-data [3]. Could you please let me know where I can find this txt file ?

Related to this, I would also like to ask the following questions:

[1] https://crpropa.github.io/CRPropa3/pages/example_notebooks/density/density_grid_sampling.html [2] https://desycloud.desy.de/index.php/f/451988900 [3] https://github.com/CRPropa/CRPropa3-data [4] https://zenodo.org/record/5501196#.ZGy0OxlBxkh

JulienDoerner commented 1 year ago

Hey @oanguner,

you can find the galactic mass distributions for both models here: https://syncandshare.desy.de/index.php/s/aR8wkqYYkDyfWgs

I will prepare a PR to add this to the documentation.

oanguner commented 1 year ago

Hi @JulienDoerner

Thanks for your swift response.

I have just noticed the following two problems while trying to follow your example notebook:

1-) grid = Grid1f(origin, nX, nY, nZ, spacing) grid.setClipVolume(True) # return 0 outside of the volume

AttributeError: 'crpropa.Grid1f' object has no attribute 'setClipVolume'

2-) isHI = False, isH2 = True, isHII = False dens = DensityGrid(grid, isHI, isHII, isH2)

NameError: name 'DensityGrid' is not defined

I'm using the latest stable release (CRPropa3-3.2). I wonder if these errors are related to my installation (I use Ubuntu). For example, I could not really find the 'DensityGrid' class in the code, but there is another one called 'SourceDensityGrid'.

JulienDoerner commented 1 year ago

Hey @oanguner, The feature ClipVolume was introduced after the last stable release and will be included in 3.2.1. You can use the current master branch to use this feature.