source icon indicating copy to clipboard operation
source copied to clipboard

Is there a way to set a custom `wavelengths` array in `SpectralPowerPipeline0D`?

Open leferi99 opened this issue 1 year ago • 5 comments

I am using Cherab to model AXUV diodes which are sensitive in a very wide spectral range (from 1eV to 1keV+) and I would need a way to define logarithmically spaced spectral bins. Simply trying to set pipeline.wavelengths results in the following error:

AttributeError: attribute 'wavelengths' of 'raysect.optical.observer.pipeline.spectral.power.SpectralPowerPipeline0D' objects is not writable

Can I solve this problem without modifying the Raysect source code?

leferi99 avatar Oct 15 '24 11:10 leferi99

No, it is not. I would also suggest against changing this in Raysect. The definition of a constant spectral bin width can be assumed by emission models which could in turn return wrong values.

You could separate your problem into multiple observations with different spectral resolutions. It is difficult to suggest anything else since the description you provided doesn't include the description of the simulation you would like to make.

Mateasek avatar Oct 15 '24 13:10 Mateasek

Thanks for the answer @Mateasek! I will share more details on what I would like to do.

In Cherab I created synthetic diagnostics of the AXUV diodes in ASDEX-Upgrade. See the paper by Matthias Bernert. These diodes have a very hectic spectral response function as seen in the figure I included here.

image

The responsivity also degrades with plasma operation, and different diodes may degrade differently. Therefore, we need spectrally resolved measurement data in the 1-1000+ eV range, and in post-processing, we can apply different degraded responsivity functions to get the actual diode signals.

The idea is to take 2D or 3D plasma simulation data (from JOREK) of Ne-doped SPI discharges and take spectral measurements with Cherab BolometerFoils. This I could do by externally passing the SpectralPowerPipeline0D to be used by the BolometerFoil class. However, I would need to have around 2500 spectral bins to get decently resolved spectra towards high photon energies. This works for a few lines of sight, but I have 96 in one poloidal cross-section I want to simulate.

The number of rays I would need to trace to get a reasonably low variance on the spectrum values is quite high in this case. But I do not need the overall huge resolution, in photon energies I would need logarithmically on the order of 250 spectral bins or so. This would make the observations much faster, and this is the main motivation for me asking about this. I am also aware of the possibility of passing spectral responsivity functions to Cherab or Raysect, but as I mentioned we would like to process the data with multiple different responsivity functions, so it would be better to have the spectral data saved.

That would be the gist of it, but if you need further clarification I can elaborate.

leferi99 avatar Oct 15 '24 14:10 leferi99

While Raysect doesn't allow you to set a non-constant spectral resolution (this would affect dispersion rendering and other features), Cherab does have a tool that can do some pre- and post-calculations for you: https://www.cherab.info/tools/spectroscopy.html#cherab.tools.spectroscopy.Spectrometer

Please note that this tool does not reduce the resolution of the actual rendered spectrum.

vsnever avatar Oct 15 '24 15:10 vsnever

Do I understand correctly that the spectral resolution you require is imposed by the plasma radiation properties rather than by the AXUV response function?

if yes, I would go back to my previous suggestion. Separate your spectral band into multiple observations with different spectral resolution. Then you can stitch it together, interpolate and do your magic.

if not, I would suggest performing a simulation with spectral resolution acceptable for your plasma radiation and then using interpolation to match the requirements of the diod response function. You could InterpolatedSF, if it suits your needs.

Mateasek avatar Oct 15 '24 15:10 Mateasek

@Mateasek I require a spectral resolution of the observed results which then can be used to be multiplied by the spectral responsivity function. It is not optimal if the spectral response changes a lot in one spectral bin.

I think I will use this separation of the spectral band idea, thank you for that. You mention needing to interpolate after sticthing together the different spectra. What do you mean by that?

leferi99 avatar Oct 16 '24 11:10 leferi99