flaresimulations / synthesizer

Synthesizer - a code for creating synthetic astrophysical observables
https://flaresimulations.github.io/synthesizer/
GNU General Public License v3.0
17 stars 9 forks source link

Vel shift spectra marco #783

Closed marcoleonardi97 closed 3 days ago

marcoleonardi97 commented 1 week ago

Issue Type

Checklist

marcoleonardi97 commented 1 week ago

Added flags from the front-end (component.get_spectra) to the stars generate_lnu and generate_particle_lnu. Won't work yet because we need to parse velocities as an argument in prepare_sed_args. Generate_lnu also uses compute_integrated_sed instead of compute_particle_sed, need to modify that too?

WillJRoper commented 1 week ago

Generate_lnu also uses compute_integrated_sed instead of compute_particle_sed, need to modify that too?

I was thinking about this on my drive this morning. The easiest way to handle this would actually be to call your spectra generation function from within either compute_integrated_sed or compute_particle_sed if the velocity flag is true. (rather than have the whole separate script). That way we don't need such extensive edits and you don't need to worry so much about the front end (only what you've already done).

To be clear I mean having something like this in the compute_integrated_sed and compute_particle_sed functions:

if (with_vel_shift) {
   <call your function>
 } else {
   <call_the_old_function>
}
marcoleonardi97 commented 3 days ago

added double const c and check for ilam < 0

marcoleonardi97 commented 3 days ago

modified the particle_spectra.c directly so we can choose which functions to call when, i just duplicated the ngp and cic wrappers and made the respective shifted versions. (Not sure if having 2 functions for task is more of less efficient than having 1 with a flag, but should work anyways).

added flag to generate_particle_lnu for black holes,

only thing left to do (i think) should be reworking compute_integrated_sed in the same way of compute_particle_sed, then see how these all work when they are called in a galaxy object