xmmpysas 1.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. xmmpysas-1.4.2/PKG-INFO +132 -0
  2. xmmpysas-1.4.2/pyproject.toml +27 -0
  3. xmmpysas-1.4.2/pysas/.git/FETCH_HEAD +3 -0
  4. xmmpysas-1.4.2/pysas/.git/HEAD +1 -0
  5. xmmpysas-1.4.2/pysas/.git/config +12 -0
  6. xmmpysas-1.4.2/pysas/.git/description +1 -0
  7. xmmpysas-1.4.2/pysas/.git/hooks/applypatch-msg.sample +15 -0
  8. xmmpysas-1.4.2/pysas/.git/hooks/commit-msg.sample +24 -0
  9. xmmpysas-1.4.2/pysas/.git/hooks/fsmonitor-watchman.sample +109 -0
  10. xmmpysas-1.4.2/pysas/.git/hooks/post-update.sample +8 -0
  11. xmmpysas-1.4.2/pysas/.git/hooks/pre-applypatch.sample +14 -0
  12. xmmpysas-1.4.2/pysas/.git/hooks/pre-commit.sample +49 -0
  13. xmmpysas-1.4.2/pysas/.git/hooks/pre-merge-commit.sample +13 -0
  14. xmmpysas-1.4.2/pysas/.git/hooks/pre-push.sample +53 -0
  15. xmmpysas-1.4.2/pysas/.git/hooks/pre-rebase.sample +169 -0
  16. xmmpysas-1.4.2/pysas/.git/hooks/pre-receive.sample +24 -0
  17. xmmpysas-1.4.2/pysas/.git/hooks/prepare-commit-msg.sample +42 -0
  18. xmmpysas-1.4.2/pysas/.git/hooks/update.sample +128 -0
  19. xmmpysas-1.4.2/pysas/.git/index +0 -0
  20. xmmpysas-1.4.2/pysas/.git/info/exclude +6 -0
  21. xmmpysas-1.4.2/pysas/.git/logs/HEAD +1 -0
  22. xmmpysas-1.4.2/pysas/.git/logs/refs/heads/main +1 -0
  23. xmmpysas-1.4.2/pysas/.git/logs/refs/remotes/origin/HEAD +1 -0
  24. xmmpysas-1.4.2/pysas/.git/objects/pack/pack-10326aa5e3df550ba0d158c8031d83e2d26a4fb1.idx +0 -0
  25. xmmpysas-1.4.2/pysas/.git/objects/pack/pack-10326aa5e3df550ba0d158c8031d83e2d26a4fb1.pack +0 -0
  26. xmmpysas-1.4.2/pysas/.git/packed-refs +6 -0
  27. xmmpysas-1.4.2/pysas/.git/refs/heads/main +1 -0
  28. xmmpysas-1.4.2/pysas/.git/refs/remotes/origin/HEAD +1 -0
  29. xmmpysas-1.4.2/pysas/.gitignore +2 -0
  30. xmmpysas-1.4.2/pysas/LICENSE +674 -0
  31. xmmpysas-1.4.2/pysas/README.md +105 -0
  32. xmmpysas-1.4.2/pysas/XMMextractor_tools/XMMextractor_tools.py +1095 -0
  33. xmmpysas-1.4.2/pysas/XMMextractor_tools/XMMextractor_verify.py +746 -0
  34. xmmpysas-1.4.2/pysas/XMMextractor_tools/__init__.py +1 -0
  35. xmmpysas-1.4.2/pysas/XMMextractor_tools/__pycache__/XMMextractor_tools.cpython-310.pyc +0 -0
  36. xmmpysas-1.4.2/pysas/XMMextractor_tools/__pycache__/__init__.cpython-310.pyc +0 -0
  37. xmmpysas-1.4.2/pysas/XMMextractor_tools/version.py +29 -0
  38. xmmpysas-1.4.2/pysas/XMMextractor_tools/write_version.py +96 -0
  39. xmmpysas-1.4.2/pysas/__init__.py +50 -0
  40. xmmpysas-1.4.2/pysas/config_pysas.py +292 -0
  41. xmmpysas-1.4.2/pysas/configutils.py +130 -0
  42. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/_images/pile_up_Cen_X-3.png +0 -0
  43. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/_images/pile_up_Mkn_421.png +0 -0
  44. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/_images/pile_up_plot1.png +0 -0
  45. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm-epic-reprocessing.ipynb +609 -0
  46. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm-pysas-intro-long.ipynb +557 -0
  47. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm-pysas-intro-short.ipynb +245 -0
  48. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_RGS_data.ipynb +706 -0
  49. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_RGS_data.ipynb:Zone.Identifier +2 -0
  50. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_images_and_filters.ipynb +896 -0
  51. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_images_and_filters.ipynb:Zone.Identifier +2 -0
  52. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_source_spectra.ipynb +672 -0
  53. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_source_spectra.ipynb:Zone.Identifier +2 -0
  54. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_timing_mode.ipynb +822 -0
  55. xmmpysas-1.4.2/pysas/documentation/Jupyter_Notebooks/xmm_ABC_guide_timing_mode.ipynb:Zone.Identifier +2 -0
  56. xmmpysas-1.4.2/pysas/documentation/Scripts/xmm_ABC_guide_ch6_p1.py +238 -0
  57. xmmpysas-1.4.2/pysas/documentation/odfcontrol.ipynb +821 -0
  58. xmmpysas-1.4.2/pysas/documentation/starting_pysas.ipynb +312 -0
  59. xmmpysas-1.4.2/pysas/documentation/using_pysas.ipynb +431 -0
  60. xmmpysas-1.4.2/pysas/error.py +123 -0
  61. xmmpysas-1.4.2/pysas/init_sas.py +197 -0
  62. xmmpysas-1.4.2/pysas/logger.py +159 -0
  63. xmmpysas-1.4.2/pysas/odfcontrol/__init__.py +1 -0
  64. xmmpysas-1.4.2/pysas/odfcontrol/__pycache__/__init__.cpython-311.pyc +0 -0
  65. xmmpysas-1.4.2/pysas/odfcontrol/__pycache__/odfcontrol.cpython-311.pyc +0 -0
  66. xmmpysas-1.4.2/pysas/odfcontrol/odfcontrol.py +1067 -0
  67. xmmpysas-1.4.2/pysas/param.py +366 -0
  68. xmmpysas-1.4.2/pysas/parser.py +334 -0
  69. xmmpysas-1.4.2/pysas/pkgmaker/__init__.py +1 -0
  70. xmmpysas-1.4.2/pysas/pkgmaker/pkgmaker.py +635 -0
  71. xmmpysas-1.4.2/pysas/pkgmaker/version.py +29 -0
  72. xmmpysas-1.4.2/pysas/pkgmaker/write_version.py +96 -0
  73. xmmpysas-1.4.2/pysas/pyeslewchain/__init__.py +1 -0
  74. xmmpysas-1.4.2/pysas/pyeslewchain/__pycache__/__init__.cpython-310.pyc +0 -0
  75. xmmpysas-1.4.2/pysas/pyeslewchain/__pycache__/pyeslewchain.cpython-310.pyc +0 -0
  76. xmmpysas-1.4.2/pysas/pyeslewchain/__pycache__/pyeslewchainTime.cpython-310.pyc +0 -0
  77. xmmpysas-1.4.2/pysas/pyeslewchain/__pycache__/pyeslewchainUtils.cpython-310.pyc +0 -0
  78. xmmpysas-1.4.2/pysas/pyeslewchain/__pycache__/version.cpython-310.pyc +0 -0
  79. xmmpysas-1.4.2/pysas/pyeslewchain/pyeslewchain.py +823 -0
  80. xmmpysas-1.4.2/pysas/pyeslewchain/pyeslewchainTime.py +61 -0
  81. xmmpysas-1.4.2/pysas/pyeslewchain/pyeslewchainUtils.py +125 -0
  82. xmmpysas-1.4.2/pysas/pyeslewchain/version.py +29 -0
  83. xmmpysas-1.4.2/pysas/pyeslewchain/write_version.py +96 -0
  84. xmmpysas-1.4.2/pysas/pyeslewsearch/__init__.py +1 -0
  85. xmmpysas-1.4.2/pysas/pyeslewsearch/pyeslewsearch.py +949 -0
  86. xmmpysas-1.4.2/pysas/pyeslewsearch/version.py +29 -0
  87. xmmpysas-1.4.2/pysas/pyeslewsearch/write_version.py +96 -0
  88. xmmpysas-1.4.2/pysas/pymakethumbs/__init__.py +1 -0
  89. xmmpysas-1.4.2/pysas/pymakethumbs/__pycache__/__init__.cpython-310.pyc +0 -0
  90. xmmpysas-1.4.2/pysas/pymakethumbs/__pycache__/pymakethumbs.cpython-310.pyc +0 -0
  91. xmmpysas-1.4.2/pysas/pymakethumbs/__pycache__/version.cpython-310.pyc +0 -0
  92. xmmpysas-1.4.2/pysas/pymakethumbs/pymakethumbs.py +680 -0
  93. xmmpysas-1.4.2/pysas/pymakethumbs/version.py +29 -0
  94. xmmpysas-1.4.2/pysas/pymakethumbs/write_version.py +96 -0
  95. xmmpysas-1.4.2/pysas/pyomdrifthist/__init__.py +1 -0
  96. xmmpysas-1.4.2/pysas/pyomdrifthist/__pycache__/__init__.cpython-310.pyc +0 -0
  97. xmmpysas-1.4.2/pysas/pyomdrifthist/__pycache__/pyomdrifthist.cpython-310.pyc +0 -0
  98. xmmpysas-1.4.2/pysas/pyomdrifthist/__pycache__/version.cpython-310.pyc +0 -0
  99. xmmpysas-1.4.2/pysas/pyomdrifthist/pyomdrifthist.py +636 -0
  100. xmmpysas-1.4.2/pysas/pyomdrifthist/version.py +29 -0
  101. xmmpysas-1.4.2/pysas/pyomdrifthist/write_version.py +96 -0
  102. xmmpysas-1.4.2/pysas/pyomgchain/__init__.py +1 -0
  103. xmmpysas-1.4.2/pysas/pyomgchain/pyomgchain.py +866 -0
  104. xmmpysas-1.4.2/pysas/pyomgchain/version.py +29 -0
  105. xmmpysas-1.4.2/pysas/pyomgchain/write_version.py +96 -0
  106. xmmpysas-1.4.2/pysas/pyrgsimplot/__init__.py +1 -0
  107. xmmpysas-1.4.2/pysas/pyrgsimplot/__pycache__/__init__.cpython-310.pyc +0 -0
  108. xmmpysas-1.4.2/pysas/pyrgsimplot/__pycache__/pyrgsimplot.cpython-310.pyc +0 -0
  109. xmmpysas-1.4.2/pysas/pyrgsimplot/__pycache__/version.cpython-310.pyc +0 -0
  110. xmmpysas-1.4.2/pysas/pyrgsimplot/pyrgsimplot.py +646 -0
  111. xmmpysas-1.4.2/pysas/pyrgsimplot/version.py +29 -0
  112. xmmpysas-1.4.2/pysas/pyrgsimplot/write_version.py +96 -0
  113. xmmpysas-1.4.2/pysas/pyrgsspecplot/__init__.py +1 -0
  114. xmmpysas-1.4.2/pysas/pyrgsspecplot/__pycache__/__init__.cpython-310.pyc +0 -0
  115. xmmpysas-1.4.2/pysas/pyrgsspecplot/__pycache__/pyrgsspecplot.cpython-310.pyc +0 -0
  116. xmmpysas-1.4.2/pysas/pyrgsspecplot/__pycache__/version.cpython-310.pyc +0 -0
  117. xmmpysas-1.4.2/pysas/pyrgsspecplot/pyrgsspecplot.py +910 -0
  118. xmmpysas-1.4.2/pysas/pyrgsspecplot/version.py +29 -0
  119. xmmpysas-1.4.2/pysas/pyrgsspecplot/write_version.py +96 -0
  120. xmmpysas-1.4.2/pysas/pysasplot_utils/__init__.py +1 -0
  121. xmmpysas-1.4.2/pysas/pysasplot_utils/__pycache__/__init__.cpython-310.pyc +0 -0
  122. xmmpysas-1.4.2/pysas/pysasplot_utils/__pycache__/pysasplot_utils.cpython-310.pyc +0 -0
  123. xmmpysas-1.4.2/pysas/pysasplot_utils/__pycache__/version.cpython-310.pyc +0 -0
  124. xmmpysas-1.4.2/pysas/pysasplot_utils/pysasplot_utils.py +837 -0
  125. xmmpysas-1.4.2/pysas/pysasplot_utils/version.py +29 -0
  126. xmmpysas-1.4.2/pysas/pysasplot_utils/write_version.py +96 -0
  127. xmmpysas-1.4.2/pysas/pyutils/__init__.py +1 -0
  128. xmmpysas-1.4.2/pysas/pyutils/__pycache__/__init__.cpython-310.pyc +0 -0
  129. xmmpysas-1.4.2/pysas/pyutils/__pycache__/pyutils.cpython-310.pyc +0 -0
  130. xmmpysas-1.4.2/pysas/pyutils/__pycache__/version.cpython-310.pyc +0 -0
  131. xmmpysas-1.4.2/pysas/pyutils/pyutils.py +711 -0
  132. xmmpysas-1.4.2/pysas/pyutils/version.py +29 -0
  133. xmmpysas-1.4.2/pysas/pyutils/write_version.py +96 -0
  134. xmmpysas-1.4.2/pysas/rgsbkgsmoothing/__init__.py +1 -0
  135. xmmpysas-1.4.2/pysas/rgsbkgsmoothing/expTime.py +203 -0
  136. xmmpysas-1.4.2/pysas/rgsbkgsmoothing/rgsbkgsmoothing.py +431 -0
  137. xmmpysas-1.4.2/pysas/rgsbkgsmoothing/version.py +29 -0
  138. xmmpysas-1.4.2/pysas/rgsbkgsmoothing/write_version.py +96 -0
  139. xmmpysas-1.4.2/pysas/rgsdupframesfix/__init__.py +1 -0
  140. xmmpysas-1.4.2/pysas/rgsdupframesfix/rgsdupframesfix.py +310 -0
  141. xmmpysas-1.4.2/pysas/rgsdupframesfix/version.py +29 -0
  142. xmmpysas-1.4.2/pysas/rgsdupframesfix/write_version.py +96 -0
  143. xmmpysas-1.4.2/pysas/runtask.py +153 -0
  144. xmmpysas-1.4.2/pysas/sastask.py +357 -0
  145. xmmpysas-1.4.2/pysas/sasutils.py +329 -0
  146. xmmpysas-1.4.2/pysas/sasver/__init__.py +1 -0
  147. xmmpysas-1.4.2/pysas/sasver/sasver.py +58 -0
  148. xmmpysas-1.4.2/pysas/sasver/version.py +29 -0
  149. xmmpysas-1.4.2/pysas/sasver/write_version.py +96 -0
  150. xmmpysas-1.4.2/pysas/setup_pysas.py +28 -0
  151. xmmpysas-1.4.2/pysas/startsas/__init__.py +1 -0
  152. xmmpysas-1.4.2/pysas/startsas/startsas.py +488 -0
  153. xmmpysas-1.4.2/pysas/startsas/version.py +29 -0
  154. xmmpysas-1.4.2/pysas/startsas/write_version.py +96 -0
  155. xmmpysas-1.4.2/pysas/version.py +29 -0
  156. xmmpysas-1.4.2/pysas/wrapper.py +49 -0
  157. xmmpysas-1.4.2/pysas/write_version.py +98 -0
  158. xmmpysas-1.4.2/pysas/xmmextractorGUI/__init__.py +1 -0
  159. xmmpysas-1.4.2/pysas/xmmextractorGUI/controlPanel.py +323 -0
  160. xmmpysas-1.4.2/pysas/xmmextractorGUI/createXML.py +184 -0
  161. xmmpysas-1.4.2/pysas/xmmextractorGUI/doIt.py +123 -0
  162. xmmpysas-1.4.2/pysas/xmmextractorGUI/resultsStyles.qss +32 -0
  163. xmmpysas-1.4.2/pysas/xmmextractorGUI/showImage.py +91 -0
  164. xmmpysas-1.4.2/pysas/xmmextractorGUI/showImageClass.py +400 -0
  165. xmmpysas-1.4.2/pysas/xmmextractorGUI/utils.py +29 -0
  166. xmmpysas-1.4.2/pysas/xmmextractorGUI/version.py +29 -0
  167. xmmpysas-1.4.2/pysas/xmmextractorGUI/write_version.py +96 -0
  168. xmmpysas-1.4.2/pysas/xmmextractorGUI/xmmextractorGUI.py +2295 -0
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.1
2
+ Name: xmmpysas
3
+ Version: 1.4.2
4
+ Summary: Python wrapper for XMM-Newton SAS
5
+ Author: Ryan Tanner
6
+ Author-email: ryan.tanner@nasa.gov
7
+ Requires-Python: >=3.10,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: astropy (>=6.1.5,<7.0.0)
14
+ Requires-Dist: astroquery (>=0.4.7,<0.5.0)
15
+ Requires-Dist: beautifultable (>=1.1.0,<2.0.0)
16
+ Requires-Dist: matplotlib (>=3.9.2,<4.0.0)
17
+ Requires-Dist: notebook (>=7.2.2,<8.0.0)
18
+ Requires-Dist: numpy (>=2.1.3,<3.0.0)
19
+ Requires-Dist: pyds9 (>=1.8.1,<2.0.0)
20
+ Requires-Dist: pypdf (>=5.1.0,<6.0.0)
21
+ Requires-Dist: pyqt5 (>=5.15.11,<6.0.0)
22
+ Requires-Dist: pytest (>=8.3.3,<9.0.0)
23
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
24
+ Requires-Dist: scipy (>=1.14.1,<2.0.0)
25
+ Description-Content-Type: text/markdown
26
+
27
+ ### Installing pySAS
28
+
29
+ This development version of pySAS can be used with versions 20 and up of XMM-Newton SAS. After installing SAS [following the installation instructions](https://www.cosmos.esa.int/web/xmm-newton/sas-installation) you can then install the development version of pySAS using
30
+ ```
31
+ pip install xmmpysas
32
+ ```
33
+ Before you use pySAS for the first time you will need to configure pySAS so that it knows where you have SAS installed, and where the XMM calibration files are located. After installing pySAS using pip, in Python just run:
34
+ ```python
35
+ import pysas
36
+ pysas.config_pysas.run_config()
37
+ ```
38
+ This will step you through connecting pySAS to SAS. After pySAS has been configured you can import pySAS like normal.
39
+ ```python
40
+ import pysas
41
+ ```
42
+ You can update pySAS using
43
+ ```
44
+ pip install xmmpysas --upgrade
45
+ ```
46
+
47
+ ### Cloning This Repository
48
+
49
+ *Alternatively*, this repository can be cloned by going into the directory where pySAS is installed to remove the current version of pySAS using
50
+ ```
51
+ cd /path/to/sas/install/xmmsas_202XXXXXX_YYYY/lib/python/
52
+ rm -rf ./pysas
53
+ ```
54
+ and then clone this version of pySAS by executing the command,
55
+ ```
56
+ git clone https://github.com/XMMGOF/pysas.git
57
+ ```
58
+ You can then use pySAS like normal.
59
+
60
+ To incorporate new changes to pySAS from GitHub, from the pysas directory use the following command,
61
+ ```
62
+ git pull https://github.com/XMMGOF/pysas.git
63
+ ```
64
+
65
+ ### Running pySAS for the First Time
66
+
67
+ The very first time you run this version of pySAS you will have to set SAS defaults that will be used by pySAS. To set the defaults run the following commands in python:
68
+ ```python
69
+ import pysas
70
+ pysas.config_pysas.run_config()
71
+ ```
72
+ This script will set:
73
+
74
+ - sas_dir: The directory where SAS is installed. If you are running the script from inside the SAS directory this will be auto-detected.
75
+ - sas_ccfpath: The directory where the calibration files are stored. If you already have them downloaded, just enter the directory where they are. But if you have not downloaded them yet, you will be given the option to download them after the setup. The script will even create the directory for you.
76
+ - data_dir: You will have the option of designating a defaut data directory. All observation data files will be downloaded into this directory. If the data directory does not exist it will be created for you.
77
+
78
+ **Note:** If you installed pySAS by cloning it from GitHub you must add the pySAS directory to your PYTHONPATH environment variable. For example:
79
+ ```
80
+ export PYTHONPATH=/path/to/sas/install/xmmsas_202XXXXXX_YYYY/lib/python:$PYTHONPATH
81
+ ```
82
+ It is recommended that you add this line to your .bash_profile file (or equivelent shell file).
83
+ **This is not necessary if pySAS was installed using `pip install xmmpysas`.**
84
+
85
+ ### Example Scripts
86
+
87
+ There are example scripts and Jupyter notebooks available on [GitHub demonstrating how to use pySAS](https://github.com/XMMGOF/pysas/tree/main/documentation). We are expanding the number of example scripts and Jupyter notebooks.
88
+
89
+ ### FAQ
90
+
91
+ Q: Will this break my SAS inatallation?
92
+
93
+ A: No. All changes have been made to keep this developmental version of pySAS working with SAS.
94
+
95
+ Q: I have already been working with pySAS and I have several Python scripts already written. Will this make them break?
96
+
97
+ A: No. This developmental version of pySAS is fully backwards compatible with the standard pySAS distributed with SAS. The develomental version only adds capabilites. The features included here will eventually work their way into the standard version of pySAS.
98
+
99
+ Q: Can I contribute changes to pySAS?
100
+
101
+ A: YES! That is the purpose of this repository! The whole idea is to provide a place where changes can be made and tested, issues can be raised, and features can be requested for pySAS. User input is greatly encouraged.
102
+
103
+ Q: Can I use pip to install pySAS?
104
+
105
+ A: Yes! Install using
106
+ ```
107
+ pip install xmmpysas
108
+ ```
109
+
110
+ Q: What about using conda to install pySAS?
111
+
112
+ A: We are working on it!
113
+
114
+ Q: Can I use pySAS to update the XMM-Newton calibration files?
115
+
116
+ A: Yes! Just start a Python session and run the following commands:
117
+
118
+ ```python
119
+ import pysas
120
+ pysas.sasutils.update_calibration_files()
121
+ ```
122
+
123
+ This will download new calibration files.
124
+
125
+ Q: What version of pySAS is installed on SciServer?
126
+
127
+ A: The version 1.4.1a. Some changes to pySAS have been made since the HEASARC image was created for SciServer. The next time a new HEASARC image is created for SciServer all new changes to pySAS will be incorporated.
128
+
129
+ Q: Why have this version of pySAS separate from the standard version you can download from ESA when you download SAS?
130
+
131
+ A: Because of the realities of developing across multiple systems. Changes were needed to make pySAS run on systems such as SciServer (and other future online systems that are in the works, stay tuned!). The development timetable for SciServer did not match up with the development timetable for SAS. This allows us to continuously develop pySAS to match *all* of the development timetables. This also allows us to get feedback from the XMM-Newton user community about what they want to see in pySAS.
132
+
@@ -0,0 +1,27 @@
1
+ [tool.poetry]
2
+ name = "xmmpysas"
3
+ version = "1.4.2"
4
+ description = "Python wrapper for XMM-Newton SAS"
5
+ authors = ["Ryan Tanner <ryan.tanner@nasa.gov>"]
6
+ readme = "pysas/README.md"
7
+ packages = [{ include = "pysas" }]
8
+
9
+ [tool.poetry.dependencies]
10
+ python = "^3.10"
11
+ astropy = "^6.1.5"
12
+ numpy = "^2.1.3"
13
+ matplotlib = "^3.9.2"
14
+ requests = "^2.32.3"
15
+ pyds9 = "^1.8.1"
16
+ pyqt5 = "^5.15.11"
17
+ beautifultable = "^1.1.0"
18
+ scipy = "^1.14.1"
19
+ notebook = "^7.2.2"
20
+ astroquery = "^0.4.7"
21
+ pytest = "^8.3.3"
22
+ pypdf = "^5.1.0"
23
+
24
+
25
+ [build-system]
26
+ requires = ["poetry-core"]
27
+ build-backend = "poetry.core.masonry.api"
@@ -0,0 +1,3 @@
1
+ 1262902a30d0862d1d1cedc43fafa4b70a94f45a branch 'main' of https://github.com/XMMGOF/pysas
2
+ 3aa50333432aa3fc3dc0c92f485555bcbe90adba not-for-merge branch 'dev_calibration' of https://github.com/XMMGOF/pysas
3
+ 1bdf787aadad1161616d419eea892343ebfb63ae not-for-merge branch 'epatplotpy' of https://github.com/XMMGOF/pysas
@@ -0,0 +1 @@
1
+ ref: refs/heads/main
@@ -0,0 +1,12 @@
1
+ [core]
2
+ repositoryformatversion = 0
3
+ filemode = true
4
+ bare = false
5
+ logallrefupdates = true
6
+ [remote "origin"]
7
+ url = https://github.com/XMMGOF/pysas.git
8
+ fetch = +refs/heads/*:refs/remotes/origin/*
9
+ [branch "main"]
10
+ remote = origin
11
+ merge = refs/heads/main
12
+ vscode-merge-base = origin/main
@@ -0,0 +1 @@
1
+ Unnamed repository; edit this file 'description' to name the repository.
@@ -0,0 +1,15 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to check the commit log message taken by
4
+ # applypatch from an e-mail message.
5
+ #
6
+ # The hook should exit with non-zero status after issuing an
7
+ # appropriate message if it wants to stop the commit. The hook is
8
+ # allowed to edit the commit message file.
9
+ #
10
+ # To enable this hook, rename this file to "applypatch-msg".
11
+
12
+ . git-sh-setup
13
+ commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
14
+ test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
15
+ :
@@ -0,0 +1,24 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to check the commit log message.
4
+ # Called by "git commit" with one argument, the name of the file
5
+ # that has the commit message. The hook should exit with non-zero
6
+ # status after issuing an appropriate message if it wants to stop the
7
+ # commit. The hook is allowed to edit the commit message file.
8
+ #
9
+ # To enable this hook, rename this file to "commit-msg".
10
+
11
+ # Uncomment the below to add a Signed-off-by line to the message.
12
+ # Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13
+ # hook is more suited to it.
14
+ #
15
+ # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16
+ # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17
+
18
+ # This example catches duplicate Signed-off-by lines.
19
+
20
+ test "" = "$(grep '^Signed-off-by: ' "$1" |
21
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
22
+ echo >&2 Duplicate Signed-off-by lines.
23
+ exit 1
24
+ }
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/perl
2
+
3
+ use strict;
4
+ use warnings;
5
+ use IPC::Open2;
6
+
7
+ # An example hook script to integrate Watchman
8
+ # (https://facebook.github.io/watchman/) with git to speed up detecting
9
+ # new and modified files.
10
+ #
11
+ # The hook is passed a version (currently 1) and a time in nanoseconds
12
+ # formatted as a string and outputs to stdout all files that have been
13
+ # modified since the given time. Paths must be relative to the root of
14
+ # the working tree and separated by a single NUL.
15
+ #
16
+ # To enable this hook, rename this file to "query-watchman" and set
17
+ # 'git config core.fsmonitor .git/hooks/query-watchman'
18
+ #
19
+ my ($version, $time) = @ARGV;
20
+
21
+ # Check the hook interface version
22
+
23
+ if ($version == 1) {
24
+ # convert nanoseconds to seconds
25
+ # subtract one second to make sure watchman will return all changes
26
+ $time = int ($time / 1000000000) - 1;
27
+ } else {
28
+ die "Unsupported query-fsmonitor hook version '$version'.\n" .
29
+ "Falling back to scanning...\n";
30
+ }
31
+
32
+ my $git_work_tree;
33
+ if ($^O =~ 'msys' || $^O =~ 'cygwin') {
34
+ $git_work_tree = Win32::GetCwd();
35
+ $git_work_tree =~ tr/\\/\//;
36
+ } else {
37
+ require Cwd;
38
+ $git_work_tree = Cwd::cwd();
39
+ }
40
+
41
+ my $retry = 1;
42
+
43
+ launch_watchman();
44
+
45
+ sub launch_watchman {
46
+
47
+ my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty')
48
+ or die "open2() failed: $!\n" .
49
+ "Falling back to scanning...\n";
50
+
51
+ # In the query expression below we're asking for names of files that
52
+ # changed since $time but were not transient (ie created after
53
+ # $time but no longer exist).
54
+ #
55
+ # To accomplish this, we're using the "since" generator to use the
56
+ # recency index to select candidate nodes and "fields" to limit the
57
+ # output to file names only.
58
+
59
+ my $query = <<" END";
60
+ ["query", "$git_work_tree", {
61
+ "since": $time,
62
+ "fields": ["name"]
63
+ }]
64
+ END
65
+
66
+ print CHLD_IN $query;
67
+ close CHLD_IN;
68
+ my $response = do {local $/; <CHLD_OUT>};
69
+
70
+ die "Watchman: command returned no output.\n" .
71
+ "Falling back to scanning...\n" if $response eq "";
72
+ die "Watchman: command returned invalid output: $response\n" .
73
+ "Falling back to scanning...\n" unless $response =~ /^\{/;
74
+
75
+ my $json_pkg;
76
+ eval {
77
+ require JSON::XS;
78
+ $json_pkg = "JSON::XS";
79
+ 1;
80
+ } or do {
81
+ require JSON::PP;
82
+ $json_pkg = "JSON::PP";
83
+ };
84
+
85
+ my $o = $json_pkg->new->utf8->decode($response);
86
+
87
+ if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) {
88
+ print STDERR "Adding '$git_work_tree' to watchman's watch list.\n";
89
+ $retry--;
90
+ qx/watchman watch "$git_work_tree"/;
91
+ die "Failed to make watchman watch '$git_work_tree'.\n" .
92
+ "Falling back to scanning...\n" if $? != 0;
93
+
94
+ # Watchman will always return all files on the first query so
95
+ # return the fast "everything is dirty" flag to git and do the
96
+ # Watchman query just to get it over with now so we won't pay
97
+ # the cost in git to look up each individual file.
98
+ print "/\0";
99
+ eval { launch_watchman() };
100
+ exit 0;
101
+ }
102
+
103
+ die "Watchman: $o->{error}.\n" .
104
+ "Falling back to scanning...\n" if $o->{error};
105
+
106
+ binmode STDOUT, ":utf8";
107
+ local $, = "\0";
108
+ print @{$o->{files}};
109
+ }
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to prepare a packed repository for use over
4
+ # dumb transports.
5
+ #
6
+ # To enable this hook, rename this file to "post-update".
7
+
8
+ exec git update-server-info
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to verify what is about to be committed
4
+ # by applypatch from an e-mail message.
5
+ #
6
+ # The hook should exit with non-zero status after issuing an
7
+ # appropriate message if it wants to stop the commit.
8
+ #
9
+ # To enable this hook, rename this file to "pre-applypatch".
10
+
11
+ . git-sh-setup
12
+ precommit="$(git rev-parse --git-path hooks/pre-commit)"
13
+ test -x "$precommit" && exec "$precommit" ${1+"$@"}
14
+ :
@@ -0,0 +1,49 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to verify what is about to be committed.
4
+ # Called by "git commit" with no arguments. The hook should
5
+ # exit with non-zero status after issuing an appropriate message if
6
+ # it wants to stop the commit.
7
+ #
8
+ # To enable this hook, rename this file to "pre-commit".
9
+
10
+ if git rev-parse --verify HEAD >/dev/null 2>&1
11
+ then
12
+ against=HEAD
13
+ else
14
+ # Initial commit: diff against an empty tree object
15
+ against=$(git hash-object -t tree /dev/null)
16
+ fi
17
+
18
+ # If you want to allow non-ASCII filenames set this variable to true.
19
+ allownonascii=$(git config --bool hooks.allownonascii)
20
+
21
+ # Redirect output to stderr.
22
+ exec 1>&2
23
+
24
+ # Cross platform projects tend to avoid non-ASCII filenames; prevent
25
+ # them from being added to the repository. We exploit the fact that the
26
+ # printable range starts at the space character and ends with tilde.
27
+ if [ "$allownonascii" != "true" ] &&
28
+ # Note that the use of brackets around a tr range is ok here, (it's
29
+ # even required, for portability to Solaris 10's /usr/bin/tr), since
30
+ # the square bracket bytes happen to fall in the designated range.
31
+ test $(git diff --cached --name-only --diff-filter=A -z $against |
32
+ LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
33
+ then
34
+ cat <<\EOF
35
+ Error: Attempt to add a non-ASCII file name.
36
+
37
+ This can cause problems if you want to work with people on other platforms.
38
+
39
+ To be portable it is advisable to rename the file.
40
+
41
+ If you know what you are doing you can disable this check using:
42
+
43
+ git config hooks.allownonascii true
44
+ EOF
45
+ exit 1
46
+ fi
47
+
48
+ # If there are whitespace errors, print the offending file names and fail.
49
+ exec git diff-index --check --cached $against --
@@ -0,0 +1,13 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to verify what is about to be committed.
4
+ # Called by "git merge" with no arguments. The hook should
5
+ # exit with non-zero status after issuing an appropriate message to
6
+ # stderr if it wants to stop the merge commit.
7
+ #
8
+ # To enable this hook, rename this file to "pre-merge-commit".
9
+
10
+ . git-sh-setup
11
+ test -x "$GIT_DIR/hooks/pre-commit" &&
12
+ exec "$GIT_DIR/hooks/pre-commit"
13
+ :
@@ -0,0 +1,53 @@
1
+ #!/bin/sh
2
+
3
+ # An example hook script to verify what is about to be pushed. Called by "git
4
+ # push" after it has checked the remote status, but before anything has been
5
+ # pushed. If this script exits with a non-zero status nothing will be pushed.
6
+ #
7
+ # This hook is called with the following parameters:
8
+ #
9
+ # $1 -- Name of the remote to which the push is being done
10
+ # $2 -- URL to which the push is being done
11
+ #
12
+ # If pushing without using a named remote those arguments will be equal.
13
+ #
14
+ # Information about the commits which are being pushed is supplied as lines to
15
+ # the standard input in the form:
16
+ #
17
+ # <local ref> <local sha1> <remote ref> <remote sha1>
18
+ #
19
+ # This sample shows how to prevent push of commits where the log message starts
20
+ # with "WIP" (work in progress).
21
+
22
+ remote="$1"
23
+ url="$2"
24
+
25
+ z40=0000000000000000000000000000000000000000
26
+
27
+ while read local_ref local_sha remote_ref remote_sha
28
+ do
29
+ if [ "$local_sha" = $z40 ]
30
+ then
31
+ # Handle delete
32
+ :
33
+ else
34
+ if [ "$remote_sha" = $z40 ]
35
+ then
36
+ # New branch, examine all commits
37
+ range="$local_sha"
38
+ else
39
+ # Update to existing branch, examine new commits
40
+ range="$remote_sha..$local_sha"
41
+ fi
42
+
43
+ # Check for WIP commit
44
+ commit=`git rev-list -n 1 --grep '^WIP' "$range"`
45
+ if [ -n "$commit" ]
46
+ then
47
+ echo >&2 "Found WIP commit in $local_ref, not pushing"
48
+ exit 1
49
+ fi
50
+ fi
51
+ done
52
+
53
+ exit 0
@@ -0,0 +1,169 @@
1
+ #!/bin/sh
2
+ #
3
+ # Copyright (c) 2006, 2008 Junio C Hamano
4
+ #
5
+ # The "pre-rebase" hook is run just before "git rebase" starts doing
6
+ # its job, and can prevent the command from running by exiting with
7
+ # non-zero status.
8
+ #
9
+ # The hook is called with the following parameters:
10
+ #
11
+ # $1 -- the upstream the series was forked from.
12
+ # $2 -- the branch being rebased (or empty when rebasing the current branch).
13
+ #
14
+ # This sample shows how to prevent topic branches that are already
15
+ # merged to 'next' branch from getting rebased, because allowing it
16
+ # would result in rebasing already published history.
17
+
18
+ publish=next
19
+ basebranch="$1"
20
+ if test "$#" = 2
21
+ then
22
+ topic="refs/heads/$2"
23
+ else
24
+ topic=`git symbolic-ref HEAD` ||
25
+ exit 0 ;# we do not interrupt rebasing detached HEAD
26
+ fi
27
+
28
+ case "$topic" in
29
+ refs/heads/??/*)
30
+ ;;
31
+ *)
32
+ exit 0 ;# we do not interrupt others.
33
+ ;;
34
+ esac
35
+
36
+ # Now we are dealing with a topic branch being rebased
37
+ # on top of master. Is it OK to rebase it?
38
+
39
+ # Does the topic really exist?
40
+ git show-ref -q "$topic" || {
41
+ echo >&2 "No such branch $topic"
42
+ exit 1
43
+ }
44
+
45
+ # Is topic fully merged to master?
46
+ not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
47
+ if test -z "$not_in_master"
48
+ then
49
+ echo >&2 "$topic is fully merged to master; better remove it."
50
+ exit 1 ;# we could allow it, but there is no point.
51
+ fi
52
+
53
+ # Is topic ever merged to next? If so you should not be rebasing it.
54
+ only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
55
+ only_next_2=`git rev-list ^master ${publish} | sort`
56
+ if test "$only_next_1" = "$only_next_2"
57
+ then
58
+ not_in_topic=`git rev-list "^$topic" master`
59
+ if test -z "$not_in_topic"
60
+ then
61
+ echo >&2 "$topic is already up to date with master"
62
+ exit 1 ;# we could allow it, but there is no point.
63
+ else
64
+ exit 0
65
+ fi
66
+ else
67
+ not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
68
+ /usr/bin/perl -e '
69
+ my $topic = $ARGV[0];
70
+ my $msg = "* $topic has commits already merged to public branch:\n";
71
+ my (%not_in_next) = map {
72
+ /^([0-9a-f]+) /;
73
+ ($1 => 1);
74
+ } split(/\n/, $ARGV[1]);
75
+ for my $elem (map {
76
+ /^([0-9a-f]+) (.*)$/;
77
+ [$1 => $2];
78
+ } split(/\n/, $ARGV[2])) {
79
+ if (!exists $not_in_next{$elem->[0]}) {
80
+ if ($msg) {
81
+ print STDERR $msg;
82
+ undef $msg;
83
+ }
84
+ print STDERR " $elem->[1]\n";
85
+ }
86
+ }
87
+ ' "$topic" "$not_in_next" "$not_in_master"
88
+ exit 1
89
+ fi
90
+
91
+ <<\DOC_END
92
+
93
+ This sample hook safeguards topic branches that have been
94
+ published from being rewound.
95
+
96
+ The workflow assumed here is:
97
+
98
+ * Once a topic branch forks from "master", "master" is never
99
+ merged into it again (either directly or indirectly).
100
+
101
+ * Once a topic branch is fully cooked and merged into "master",
102
+ it is deleted. If you need to build on top of it to correct
103
+ earlier mistakes, a new topic branch is created by forking at
104
+ the tip of the "master". This is not strictly necessary, but
105
+ it makes it easier to keep your history simple.
106
+
107
+ * Whenever you need to test or publish your changes to topic
108
+ branches, merge them into "next" branch.
109
+
110
+ The script, being an example, hardcodes the publish branch name
111
+ to be "next", but it is trivial to make it configurable via
112
+ $GIT_DIR/config mechanism.
113
+
114
+ With this workflow, you would want to know:
115
+
116
+ (1) ... if a topic branch has ever been merged to "next". Young
117
+ topic branches can have stupid mistakes you would rather
118
+ clean up before publishing, and things that have not been
119
+ merged into other branches can be easily rebased without
120
+ affecting other people. But once it is published, you would
121
+ not want to rewind it.
122
+
123
+ (2) ... if a topic branch has been fully merged to "master".
124
+ Then you can delete it. More importantly, you should not
125
+ build on top of it -- other people may already want to
126
+ change things related to the topic as patches against your
127
+ "master", so if you need further changes, it is better to
128
+ fork the topic (perhaps with the same name) afresh from the
129
+ tip of "master".
130
+
131
+ Let's look at this example:
132
+
133
+ o---o---o---o---o---o---o---o---o---o "next"
134
+ / / / /
135
+ / a---a---b A / /
136
+ / / / /
137
+ / / c---c---c---c B /
138
+ / / / \ /
139
+ / / / b---b C \ /
140
+ / / / / \ /
141
+ ---o---o---o---o---o---o---o---o---o---o---o "master"
142
+
143
+
144
+ A, B and C are topic branches.
145
+
146
+ * A has one fix since it was merged up to "next".
147
+
148
+ * B has finished. It has been fully merged up to "master" and "next",
149
+ and is ready to be deleted.
150
+
151
+ * C has not merged to "next" at all.
152
+
153
+ We would want to allow C to be rebased, refuse A, and encourage
154
+ B to be deleted.
155
+
156
+ To compute (1):
157
+
158
+ git rev-list ^master ^topic next
159
+ git rev-list ^master next
160
+
161
+ if these match, topic has not merged in next at all.
162
+
163
+ To compute (2):
164
+
165
+ git rev-list master..topic
166
+
167
+ if this is empty, it is fully merged to "master".
168
+
169
+ DOC_END
@@ -0,0 +1,24 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to make use of push options.
4
+ # The example simply echoes all push options that start with 'echoback='
5
+ # and rejects all pushes when the "reject" push option is used.
6
+ #
7
+ # To enable this hook, rename this file to "pre-receive".
8
+
9
+ if test -n "$GIT_PUSH_OPTION_COUNT"
10
+ then
11
+ i=0
12
+ while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
13
+ do
14
+ eval "value=\$GIT_PUSH_OPTION_$i"
15
+ case "$value" in
16
+ echoback=*)
17
+ echo "echo from the pre-receive-hook: ${value#*=}" >&2
18
+ ;;
19
+ reject)
20
+ exit 1
21
+ esac
22
+ i=$((i + 1))
23
+ done
24
+ fi