Fix up for modern Nim, add comment about beamline#22
Open
Vindaar wants to merge 39 commits intojovoy:masterfrom
Open
Fix up for modern Nim, add comment about beamline#22Vindaar wants to merge 39 commits intojovoy:masterfrom
Vindaar wants to merge 39 commits intojovoy:masterfrom
Conversation
- almostEqual now leads to an ambiguous identifier error for some
reason
- the import of `parsetoml` suddenly breaks the `mutate` formulas due
to its definition of `{}`
Something broke, using weave on modern Nim causes segfaults. The code is fast enough nowadays to not really need serious multithreading for most applications. We'll fix it in the future.
This allows to run the code with the ranges required by our code or
for REST.
To generate the file for our code, run without arguments. For REST run
via
```sh
./llnl_layer_reflectivity \
--numEnergy 500 \
--angleMax 9.0.° \
--numAngle 901 \
--outfile llnl_layer_reflectivities_rest.h5 \
--outpath /path/to/foo
```
This still needs to be converted to raw binary files.
Sigh, the "Pt/C" refers to C on top of Pt and not the other way around. :(
Oops, I wasn't consciously aware that this change wasn't done before. I think I did that locally at some point and forgot to commit it?
Due to large possible variation, user might want to adjust this
DarpanX needs Ångström instead of nano meters as inputs...
The X-ray source can now also be used together with the Sun as an emission source. The idea is to be able to use the geometric properties as the Sun as a source, but use a fixed energy instead of also sampling the energy. This is the basis for computing the effective area for a realistic emission model. The effective area scan walks all given input energies and computes the mean of the photon weights after tracing. For that all additional factors (conversion probability, detector window, absorption) are ignored of course and only the telescope reflectivity (and obv. loss of X-rays completely) are included.
Instead of Pt/C use C/Pt (correct order!) and use Ångström instead of nano meters for the layer thicknesses.
The numbers previously used were accidentally the numbers of how many *layers each shell coating* has!!
This plot is informative, because it should reflect the area of each shell (for a fully illuminated bore)
This is not needed generally when one wants to use a generic X-ray source. Only if one wants to do some acceptance studies etc
Primakoff only, axion-electron only etc.
The previous distance was the distance from the coordinate system origin, which is pretty useless.
This is how I noticed the sampling bug in the new raytracer.
Fixes the bug I uncovered when writing TrAXer.
The CSVs were also written to the output path. But it makes more sense to write only them to outpath. For the plots we now have a `plotPath`. The input comes from `resources` (the solar model file)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes it compile on modern Nim and comments on the LLNL beamline. In addition one can now hand a suffix that will be added to the axion image CSV and plot files.
Also makes it generate a CSV file for the differential flux.
Finally, the multithreading is taken out for now, because on modern Nim it seems to cause a segfault. The code is fast enough for the required statistics for the time being and I don't feel like debugging the issue.
edit:
Also updates the LLNL reflectivity generation tool to support generating the data in the ranges as required by REST.
To generate the correct file run:
./llnl_layer_reflectivity \ --numEnergy 500 \ --angleMax 9.0.° \ --numAngle 901 \ --outfile llnl_layer_reflectivities_rest.h5 \ --outpath /path/to/fooThe HDF5 file then needs to be converted to the raw binary format. This can be done with the following snippet utilizing
nio(https://github.com/c-blake/nio):(Adjust the PATH as needed of course). I don't add this code to this repostiory, as it is a bit out of scope and this is just one possible implementation. I don't expect anyone else to actually use this approach anyway.
IMPORTANT: While implementing multilayer reflectivity coatings in
xrayAttenuationI've realized that I've been usingDarpanXwrong. Thed_minandd_maxvalues need to be handed to it in Ångström instead of nano meters. Also their code is a mess, so I'm going to finish the multilayer code and then we compute it ourselves.