Skip to content

Commit 412244f

Browse files
thjsalsguillot
andauthored
Atmosphere switching - release v2.1.0 (#303)
* Atmosphere wrapper introduced for switching between extensions without re-installing X-PSI * Adding the wrapper file missing from the previous commit * Making basic numerical test run working as well. * Atmosphere options passed as a string from the user instead of an integer. * Function renamings and beaming moved the wrapper. Beaming modification is now mooved to the wrapper function, and it can be used for many atmosphere extensions (instead of having it as a separate extension). Setting it on or off is now based on an additional input argument. * Switching between elsewhere atmosphere extensions implemented. * Error handling if atmosphere data not provided. Exception raised now in Python if atmosphere data were not provided, even though using numerical atmosphere extension. * Passing atmosphere also for cede=True. * Surface radiation field tools upgraded. Tutorial and the related intensity functions in X-PSI upgraded for the atmosphere switching without re-installing X-PSI. * Atmosphere options implented also to Everywhere and integrator.py. * Added option for user extension. An option added for user to provide their own atmosphere extension by replacing some files. In addition, atmosphere options included now also for imaging in Photosphere and pixelmesh. * Installation+documentation updates, and cleaning. * Version numbers and setup description updated. * Doc updates 1 * Now unnecessary archives removed. * Doc updates 2 Tutorials re-run and comments updated. * Doc updates 3 More tutorials re-run and updated. * Module generator tutorial updated. * CHANGELOG and small doc updates. * Adding beam_opt value checks in everywhere and in `HotRegion.py` and in `Everywhere.py` * Adding elsewhere_user in the wrapper * required versions of cython for CI tests * Update basic_environment.yml * cython version requirements * Notebook Surface Radiation Field Tool completed with extra info to create a CustomPhotosphere with atmosphere extension 'Num4D' * Meaning of old scripts clarified. * small cleaning * warning if loading atmosphere data for default user elsewhere BB * Added sanity checks in hot_wrapper and elsewhere_wrapper Added checks to default to BB in case the `atmos_extension` values are different than the expected 1, 2, 3. It should not happen, but in case it does, the crash might be difficult to understand. * Small version date and number fixes. --------- Co-authored-by: sguillot <sebastien.guillot@irap.omp.eu>
1 parent e883e17 commit 412244f

47 files changed

Lines changed: 1895 additions & 2620 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.rst

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,48 @@ and this project adheres to
3434
.. ^^^^^^^^^^^
3535
3636
37+
[v2.1.0] - 2023-09-08
38+
~~~~~~~~~~~~~~~~~~~~~
39+
40+
Summary
41+
^^^^^^^
42+
43+
* Atmosphere switching implemented without need for re-installing X-PSI for different atmosphere extensions. **Note that old scripts using the numerical atmosphere extension need to be slightly modified (see Deprecated below).**
44+
45+
Added
46+
^^^^^
47+
48+
* Atmosphere extension flag ``atm_ext`` that can be used to select the wanted atmosphere extension (for an instance of HotRegion, Elsewhere, or Everywhere class). The default option is a blackbody atmosphere, but a numerical atmosphere extension can be switched by setting ``atm_ext="Num4D"``.
49+
50+
* Beaming modification flag ``beam_opt`` (an integer) that can be used to select the wanted atmospheric beaming correction model for an instance of HotRegion or Everywhere class (not implemented to Elsewhere currently). The default option is no modification. See the docstring for HotRegion class for other options.
51+
52+
* Extra atmosphere extension ``xpsi/surface_radiation_field/hot_user.pyx`` that can be replaced with a user-modified atmosphere model before (re-)installing X-PSI. This model can then be used by setting ``atm_ext="user"`` allowing still the possibility to use the other built-in options without re-installing X-PSI.
53+
54+
* Options to switch atmosphere extension and beaming option in the surface radiation field tools (``xpsi/surface_radiation_field/__init__.pyx``).
55+
56+
Changed
57+
^^^^^^^
58+
59+
* Documentation, tutorials, and example scripts updated for using the new atmosphere switching (except ``xpsi/module_generator.py``).
60+
61+
Deprecated
62+
^^^^^^^^^^
63+
64+
* The previous way of installing X-PSI with different atmosphere extensions has been deprecated. **To use the old python scripts (files usually named as `main.py`) to run X-PSI with numerical atmosphere setup, one needs to add `atm_ext="Num4D"` as an input parameter for all the relevant HotRegion/Elsewhere/Everywhere objects.**
65+
66+
Removed
67+
^^^^^^^
68+
69+
* Archived versions of atmosphere extensions that are not needed anymore.
70+
71+
Attribution
72+
^^^^^^^^^^^
73+
74+
Tuomo Salmi,
75+
Bas Dorsman,
76+
Sebastien Guillot
77+
78+
3779
[v2.0.3] - 2023-07-11
3880
~~~~~~~~~~~~~~~~~~~~~
3981

@@ -53,6 +95,7 @@ Fixed
5395

5496
Added
5597
^^^^^
98+
5699
* Added a keyword argument in ``xpsi/PostProcessing/_corner.py`` to allow user to define the decimal precisions for all the credible intervals printed in the figures (T.S.).
57100

58101
* Added a photosphere setter in ``xpsi/Star.py`` which should allow producing residual and signal plots for models with multiple photosphere objects as explained in ``https://github.com/xpsi-group/xpsi/issues/304`` (Y.K, T.S.).
@@ -62,7 +105,9 @@ Added
62105
Attribution
63106
^^^^^^^^^^^
64107

65-
Tuomo Salmi, Yves Kini, Sebastien Guillot
108+
Tuomo Salmi,
109+
Yves Kini,
110+
Sebastien Guillot
66111

67112

68113
[v2.0.2] - 2023-06-09

docs/source/Emitting_patterns_2Dprojection.ipynb

Lines changed: 157 additions & 306 deletions
Large diffs are not rendered by default.

docs/source/Example_script_and_modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Second script called `examples/examples_modeling_tutorial/TestRun_BB.py`__ is a
2121

2222
__ t2_
2323

24-
Third script called `examples/examples_modeling_tutorial/TestRun_Num.py`__ is also a test run, which is similar to the :doc:`Modeling<Modeling>` tutorial, except using the numerical atmosphere extension (X-PSI installed using the flag ``--NumHot``).
24+
Third script called `examples/examples_modeling_tutorial/TestRun_Num.py`__ is also a test run, which is similar to the :doc:`Modeling<Modeling>` tutorial, except using the numerical atmosphere extension.
2525

2626
.. _t3: https://github.com/xpsi-group/xpsi/tree/main/examples/examples_modeling_tutorial/TestRun_Num.py
2727

2828
__ t3_
2929

30-
Fourth script called `examples/examples_modeling_tutorial/TestRun_NumBeam.py`__ is a similar test run as the previous, except using a numerical atmosphere extension with extra parameters allowing deviations to the atmospheric beaming pattern (X-PSI installed using the flag ``--NumHotBeam`` instead of ``--NumHot``).
30+
Fourth script called `examples/examples_modeling_tutorial/TestRun_NumBeam.py`__ is a similar test run as the previous, except using a numerical atmosphere extension with extra parameters allowing deviations to the atmospheric beaming pattern.
3131

3232
.. _t4: https://github.com/xpsi-group/xpsi/tree/main/examples/examples_modeling_tutorial/TestRun_NumBeam.py
3333

docs/source/FAQ.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ If you want to test the binaries on a login node, note that you can
2525
compile with multiple instruction sets for auto-dispatch using the ``-x`` and
2626
``-ax`` flags. See the :ref:`hpcsystems` page for examples.
2727

28-
.. rubric:: What atmosphere extension should I use?
29-
30-
If you want to do some quick calculations and run the Modeling tutorial, you should use the default blackbody atmosphere extension. But if you want to use similar atmosphere models as in the published X-PSI applications so far, you should use to the numerical atmosphere extension when installing X-PSI (see instructions in :ref:`install`).
31-
32-
Note that using the model scripts with an unintended atmosphere extension may lead to a segmentation fault error if trying to use numerical atmosphere without providing numerical atmosphere data. Or if using the scripts including the numerical atmosphere data with the blackbody extension, you can get unexpected results, printing though a warning that numerical atmosphere data were preloaded but not used. Examples of numerical atmosphere data, which are required by the numerical atmosphere extension, can be found here: `doi:10.5281/zenodo.7094144`__. Examples of how to use the numerical atmospheres are shown e.g. in Surface radiation field tools -tutorial and in :ref:`example_script`.
33-
34-
.. _Zenodo: https://doi.org/10.5281/zenodo.7094144
35-
36-
__ Zenodo_
37-
3828

3929
Sampling
4030
^^^^^^^^

docs/source/Hot_region_complexity.ipynb

Lines changed: 22 additions & 36 deletions
Large diffs are not rendered by default.

docs/source/Instrument_synergy.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
"cell_type": "markdown",
1919
"metadata": {},
2020
"source": [
21-
"To run this tutorial, you should install X-PSI with the default (blackbody) atmosphere extension module, which is compiled when installing X-PSI with default settings. \n",
22-
"\n",
2321
"Some extra data files not available on the GitHub repository are needed to run this tutorial. They can be found in the [Zenodo](https://zenodo.org/record/7094144) and should be placed in the directory `examples/examples_modeling_tutorial/model_data/` of your local xpsi directory. These are the required files: \n",
2422
"- `nicer_v1.01_arf.txt`\n",
2523
"- `nicer_v1.01_rmf_matrix.txt`\n",
@@ -38,12 +36,12 @@
3836
"/=============================================\\\n",
3937
"| X-PSI: X-ray Pulse Simulation and Inference |\n",
4038
"|---------------------------------------------|\n",
41-
"| Version: 2.0.0 |\n",
39+
"| Version: 2.1.0 |\n",
4240
"|---------------------------------------------|\n",
4341
"| https://xpsi-group.github.io/xpsi |\n",
4442
"\\=============================================/\n",
4543
"\n",
46-
"Imported GetDist version: 1.4\n",
44+
"Imported GetDist version: 1.4.3\n",
4745
"Imported nestcheck version: 0.2.1\n"
4846
]
4947
}
@@ -928,7 +926,7 @@
928926
"name": "stdout",
929927
"output_type": "stream",
930928
"text": [
931-
"ll = -29322.44238519; time = 0.621\n"
929+
"ll = -29322.44238519; time = 0.649\n"
932930
]
933931
}
934932
],

0 commit comments

Comments
 (0)