Closed cosimoNigro closed 3 years ago
Hi @cosimoNigro :),
no it is not hardcoded. The grid is the grid used in the python interface to interpolate the values from all the components, in such a way that you can sum them without any problem. But there are two grids, one at level of the C code, and one at level of the python interface. the pwl_synch_sed = pwl_jet.get_spectral_component_by_name("Sync").get_SED_points()
is returning the synch from the C code, evaluated over seed photons grid size=100
and interpolated over the full C-level grid of 200. To get the SED interpolated over python code use pwl_jet.spectral_components.Sync.SED.nu
.
from jetset.jet_model import Jet
pwl_jet = Jet(name="", electron_distribution="pl")
pwl_jet.set_nu_grid_size(50)
pwl_jet.show_model()
pwl_jet.eval()
pwl_synch_sed = pwl_jet.get_spectral_component_by_name("Sync").get_SED_points()
# check how many SED points the we get
print(len(pwl_synch_sed[0]))
print(len(pwl_jet.spectral_components.Sync.SED.nu))`
you get
size of C-grid array 200
size of python-grid 50
The method .get_SED_points()
is not reported in the documentation and I should move it as protected, because it should be used only internally to the code.
Ok perfect, this is what I wanted. Thanks! You can close the issue.
Hello @andreatramacere,
I would like to generate an SED with a fixed grid in nu, now if I try to set a value lower than 200 it is just ignored and an SED of 200 points is returned. Here a snippet:
I get
despite in the
show_model
overview 50 is correctly reportedIs 200 a hardcoded minimum you set? Thank you!