GaiaXPy 2.1.2__tar.gz → 2.1.4__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 (179) hide show
  1. gaiaxpy-2.1.4/.gitignore +24 -0
  2. gaiaxpy-2.1.4/PKG-INFO +46 -0
  3. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/README.md +1 -1
  4. gaiaxpy-2.1.4/pyproject.toml +83 -0
  5. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/__init__.py +6 -1
  6. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/calibrator/calibrator.py +3 -3
  7. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/calibrator/external_instrument_model.py +4 -2
  8. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/cholesky/cholesky.py +5 -4
  9. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/converter/converter.py +4 -3
  10. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/generic_functions.py +0 -1
  11. gaiaxpy-2.1.4/src/gaiaxpy/core/version.py +4 -0
  12. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/cast.py +1 -1
  13. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/parse_generic.py +4 -3
  14. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/generator.py +30 -23
  15. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/internal_photometric_system.py +12 -6
  16. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/multi_synthetic_photometry_generator.py +2 -2
  17. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/synthetic_photometry_generator.py +8 -6
  18. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/list_reader.py +4 -3
  19. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/query_reader.py +4 -3
  20. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/output/output_data.py +4 -0
  21. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/output/sampled_spectra_data.py +2 -2
  22. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/plotter/plotter.py +3 -1
  23. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/absolute_sampled_spectrum.py +2 -2
  24. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/single_synthetic_photometry.py +4 -2
  25. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/xp_sampled_spectrum.py +2 -2
  26. gaiaxpy-2.1.2/MANIFEST.in +0 -4
  27. gaiaxpy-2.1.2/PKG-INFO +0 -42
  28. gaiaxpy-2.1.2/pyproject.toml +0 -37
  29. gaiaxpy-2.1.2/setup.cfg +0 -4
  30. gaiaxpy-2.1.2/setup.py +0 -42
  31. gaiaxpy-2.1.2/src/GaiaXPy.egg-info/PKG-INFO +0 -42
  32. gaiaxpy-2.1.2/src/GaiaXPy.egg-info/SOURCES.txt +0 -173
  33. gaiaxpy-2.1.2/src/GaiaXPy.egg-info/dependency_links.txt +0 -1
  34. gaiaxpy-2.1.2/src/GaiaXPy.egg-info/requires.txt +0 -15
  35. gaiaxpy-2.1.2/src/GaiaXPy.egg-info/top_level.txt +0 -1
  36. gaiaxpy-2.1.2/src/gaiaxpy/core/version.py +0 -1
  37. /gaiaxpy-2.1.2/LICENCE → /gaiaxpy-2.1.4/LICENSE +0 -0
  38. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/calibrator/__init__.py +0 -0
  39. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/cholesky/__init__.py +0 -0
  40. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/colour_equation/__init__.py +0 -0
  41. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/colour_equation/xp_filter_system_colour_equation.py +0 -0
  42. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/OptimisedCalibratedBases_BpId32_RpId37_withNormalisation.xml +0 -0
  43. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/TabulatedDispersionFunction-DR3-v375wiv142r_20200610.csv +0 -0
  44. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/__init__.py +0 -0
  45. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/available_systems.txt +0 -0
  46. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/bpC03_v211w_bases.csv +0 -0
  47. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/bpC03_v211w_dispersion.csv +0 -0
  48. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/bpC03_v211w_response.csv +0 -0
  49. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/bpC03_v375wi_bases.csv +0 -0
  50. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/bpC03_v375wi_dispersion.csv +0 -0
  51. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/bpC03_v375wi_response.csv +0 -0
  52. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/colour_eq_files/JkcStd_colour_eq.ini +0 -0
  53. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/colour_eq_files/SdssStd_colour_eq.ini +0 -0
  54. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/config.ini +0 -0
  55. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-ElsCustomW09S2-correction-factors.csv +0 -0
  56. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-EuclidVis-correction-factors.csv +0 -0
  57. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Gaia2-correction-factors.csv +0 -0
  58. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-GaiaDr3Vega-correction-factors.csv +0 -0
  59. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HipparcosTycho-correction-factors-old.csv +0 -0
  60. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HipparcosTycho-correction-factors.csv +0 -0
  61. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstAcswfc-correction-factors.csv +0 -0
  62. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstHugsStd-correction-factors.csv +0 -0
  63. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstWfc3uvis-correction-factors.csv +0 -0
  64. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstWfpc2-correction-factors.csv +0 -0
  65. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Iphas-correction-factors.csv +0 -0
  66. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Jkc-correction-factors.csv +0 -0
  67. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-JkcStd-correction-factors.csv +0 -0
  68. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Jpas-correction-factors.csv +0 -0
  69. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Jplus-correction-factors.csv +0 -0
  70. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-JwstNircam-correction-factors.csv +0 -0
  71. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Panstarrs1-correction-factors.csv +0 -0
  72. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Panstarrs1Std-correction-factors.csv +0 -0
  73. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Pristine-correction-factors.csv +0 -0
  74. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Sdss-correction-factors.csv +0 -0
  75. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-SdssStd-correction-factors.csv +0 -0
  76. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-SkyMapper-correction-factors.csv +0 -0
  77. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Stromgren-correction-factors.csv +0 -0
  78. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-StromgrenStd-correction-factors.csv +0 -0
  79. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Wfirst-correction-factors.csv +0 -0
  80. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Decam_v375wiv142r.xml +0 -0
  81. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_ElsCustomW09S2_v375wiv142r.xml +0 -0
  82. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_EuclidVis_v375wiv142r.xml +0 -0
  83. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Gaia2_v375wiv142r.xml +0 -0
  84. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_GaiaDr3Ab_v375wiv142r.xml +0 -0
  85. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_GaiaDr3Vega_v375wiv142r.xml +0 -0
  86. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_GaiaNominal_v375wiv142r.xml +0 -0
  87. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HCustom_v375wiv142r.xml +0 -0
  88. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HalphaCustomAb_v375wiv142r.xml +0 -0
  89. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HalphaCustom_v375wiv142r.xml +0 -0
  90. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HipparcosTycho_v375wiv142r.xml +0 -0
  91. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HstAcswfc_v375wiv142r.xml +0 -0
  92. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HstHugsStd_v375wiv142r.xml +0 -0
  93. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HstWfc3uvis_v375wiv142r.xml +0 -0
  94. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_HstWfpc2_v375wiv142r.xml +0 -0
  95. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_IphasCustomW09S2_v375wiv142r.xml +0 -0
  96. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_IphasCustomW09_v375wiv142r.xml +0 -0
  97. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_IphasCustom_v375wiv142r.xml +0 -0
  98. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Iphas_v375wiv142r.xml +0 -0
  99. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_JkcStd_v375wiv142r.xml +0 -0
  100. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Jkc_v375wiv142r.xml +0 -0
  101. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Jpas_v375wiv142r.xml +0 -0
  102. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Jplus_v375wiv142r.xml +0 -0
  103. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_JwstNircam_v375wiv142r.xml +0 -0
  104. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Lsst_v375wiv142r.xml +0 -0
  105. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Panstarrs1Std_v375wiv142r.xml +0 -0
  106. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Panstarrs1_v375wiv142r.xml +0 -0
  107. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Pristine_v375wiv142r.xml +0 -0
  108. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_SdssStd_v375wiv142r.xml +0 -0
  109. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Sdss_v375wiv142r.xml +0 -0
  110. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_SkyMapper_v375wiv142r.xml +0 -0
  111. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_SscAb_v375wiv142r.xml +0 -0
  112. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_StromgrenStd_v375wiv142r.xml +0 -0
  113. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Stromgren_v375wiv142r.xml +0 -0
  114. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Ucustom_v375wiv142r.xml +0 -0
  115. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_Wfirst_v375wiv142r.xml +0 -0
  116. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_v211wv142r.xml +0 -0
  117. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/filters/XpFilter_v375wiv142r.xml +0 -0
  118. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/fluxCal_20230901_renorm_bspline.xml +0 -0
  119. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/paths.py +0 -0
  120. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/rpC03_v142r_bases.csv +0 -0
  121. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/rpC03_v142r_dispersion.csv +0 -0
  122. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/config/rpC03_v142r_response.csv +0 -0
  123. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/converter/__init__.py +0 -0
  124. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/converter/config.py +0 -0
  125. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/__init__.py +0 -0
  126. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/config.py +0 -0
  127. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/custom_errors.py +0 -0
  128. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/dispersion_function.py +0 -0
  129. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/generic_variables.py +0 -0
  130. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/input_validator.py +0 -0
  131. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/nature.py +0 -0
  132. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/satellite.py +0 -0
  133. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/server.py +0 -0
  134. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/core/xml_utils.py +0 -0
  135. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/error_correction/__init__.py +0 -0
  136. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/error_correction/error_correction.py +0 -0
  137. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/__init__.py +0 -0
  138. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/parse_external.py +0 -0
  139. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/parse_internal_continuous.py +0 -0
  140. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/parse_internal_sampled.py +0 -0
  141. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/parse_inverse.py +0 -0
  142. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/file_parser/utils.py +0 -0
  143. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/__init__.py +0 -0
  144. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/config.py +0 -0
  145. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/photometric_system.py +0 -0
  146. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/regular_photometric_system.py +0 -0
  147. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/standardised_photometric_system.py +0 -0
  148. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/generator/utils.py +0 -0
  149. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/__init__.py +0 -0
  150. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/archive_reader.py +0 -0
  151. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/dataframe_numpy_array_reader.py +0 -0
  152. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/dataframe_reader.py +0 -0
  153. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/dataframe_string_array_reader.py +0 -0
  154. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/file_reader.py +0 -0
  155. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/hdfs_reader.py +0 -0
  156. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/input_reader.py +0 -0
  157. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/local_file_reader.py +0 -0
  158. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/input_reader/required_columns.py +0 -0
  159. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/output/__init__.py +0 -0
  160. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/output/continuous_spectra_data.py +0 -0
  161. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/output/ecsv_headers/headers_dict.txt +0 -0
  162. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/output/photometry_data.py +0 -0
  163. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/output/utils.py +0 -0
  164. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/plotter/__init__.py +0 -0
  165. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/plotter/multi_absolute.py +0 -0
  166. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/plotter/multi_xp.py +0 -0
  167. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/plotter/plot_spectra.py +0 -0
  168. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/plotter/single.py +0 -0
  169. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/__init__.py +0 -0
  170. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/calibration_absolute_sampled_spectrum.py +0 -0
  171. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/generic_spectrum.py +0 -0
  172. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/multi_synthetic_photometry.py +0 -0
  173. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/photometric_absolute_sampled_spectrum.py +0 -0
  174. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/sampled_basis_functions.py +0 -0
  175. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/sampled_spectrum.py +0 -0
  176. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/spectral_energy_distribution.py +0 -0
  177. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/utils.py +0 -0
  178. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/xp_continuous_spectrum.py +0 -0
  179. {gaiaxpy-2.1.2 → gaiaxpy-2.1.4}/src/gaiaxpy/spectrum/xp_spectrum.py +0 -0
@@ -0,0 +1,24 @@
1
+ *.pyc
2
+ .DS_Store
3
+ .coverage
4
+ coverage.xml
5
+ noxfile.py
6
+ src/gaiaxpy/_version.py
7
+ tox.ini
8
+ query_tests.py
9
+ .eggs/
10
+ .env/
11
+ .env10/
12
+ .idea/
13
+ .pytest_cache/
14
+ .svn/
15
+ .nox/
16
+ .tox/
17
+ __pycache__/
18
+ build/
19
+ dist/
20
+ docs/_build/
21
+ GaiaXPy.egg-info/
22
+ htmlcov/
23
+ junit/
24
+ tests_output_files/
gaiaxpy-2.1.4/PKG-INFO ADDED
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: GaiaXPy
3
+ Version: 2.1.4
4
+ Summary: Utilities to handle BP/RP (XP) Gaia low-resolution spectra as delivered via the Archive.
5
+ Project-URL: homepage, https://gaia-dpci.github.io/GaiaXPy-website/
6
+ Project-URL: documentation, https://gaiaxpy.readthedocs.io/en/latest/
7
+ Author: Lovro Palaversa
8
+ Author-email: Francesca De Angeli <fda@ast.cam.ac.uk>, Paolo Montegriffo <paolo.montegriffo@inaf.it>, Daniela Ruz-Mieres <dr540@ast.cam.ac.uk>
9
+ Maintainer-email: Daniela Ruz-Mieres <dr540@ast.cam.ac.uk>
10
+ License-Expression: BSD-3-Clause
11
+ License-File: LICENSE
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: aenum
16
+ Requires-Dist: astropy!=7.0.0,!=7.0.1,>=5.3.3
17
+ Requires-Dist: astroquery
18
+ Requires-Dist: fastavro
19
+ Requires-Dist: hdfs
20
+ Requires-Dist: matplotlib
21
+ Requires-Dist: numpy
22
+ Requires-Dist: packaging
23
+ Requires-Dist: pandas>=1.5.0
24
+ Requires-Dist: scipy
25
+ Requires-Dist: tqdm>=4.66.3
26
+ Provides-Extra: dev
27
+ Requires-Dist: flake8; extra == 'dev'
28
+ Requires-Dist: pytest; extra == 'dev'
29
+ Requires-Dist: pytest-cov; extra == 'dev'
30
+ Requires-Dist: pytest-mock; extra == 'dev'
31
+ Provides-Extra: docs
32
+ Requires-Dist: hatch; extra == 'docs'
33
+ Requires-Dist: sphinx; extra == 'docs'
34
+ Requires-Dist: sphinx-rtd-theme; extra == 'docs'
35
+ Description-Content-Type: text/markdown
36
+
37
+ BP/RP (often shortened as XP) spectra became available for the first time in Gaia Data Release 3 (DR3). In their first release, only source mean spectra are available: these are spectra that have been generated from a number of single observations of the same object. Epoch spectra, i.e. spectra consisting of one single observation, will become available in future releases.
38
+
39
+ GaiaXPy is a Python library to facilitate handling Gaia BP/RP spectra as distributed from the Gaia archive.
40
+
41
+ To learn more about the package click [here](https://gaiaxpy.readthedocs.io/en/latest/description.html).
42
+
43
+ You can also check the [homepage](https://gaia-dpci.github.io/GaiaXPy-website/) for documentation, tutorials, and resources.
44
+
45
+ ## Licence
46
+ [BSD 3-Clause](https://github.com/gaia-dpci/GaiaXPy/blob/main/LICENCE)
@@ -1,4 +1,4 @@
1
- BP/RP (often shortened as XP) spectra will become available for the first time in Gaia Data Release 3 (DR3). In their first release, only source mean spectra will be available: these are spectra that have been generated from a number of single observations of the same object. Epoch spectra, i.e. spectra consisting of one single observation, will become available in future releases.
1
+ BP/RP (often shortened as XP) spectra became available for the first time in Gaia Data Release 3 (DR3). In their first release, only source mean spectra are available: these are spectra that have been generated from a number of single observations of the same object. Epoch spectra, i.e. spectra consisting of one single observation, will become available in future releases.
2
2
 
3
3
  GaiaXPy is a Python library to facilitate handling Gaia BP/RP spectra as distributed from the Gaia archive.
4
4
 
@@ -0,0 +1,83 @@
1
+ [build-system]
2
+ requires = ['hatchling', 'hatch-vcs']
3
+ build-backend = 'hatchling.build'
4
+
5
+ [project]
6
+ name = 'GaiaXPy'
7
+ dynamic = ['version']
8
+ description = 'Utilities to handle BP/RP (XP) Gaia low-resolution spectra as delivered via the Archive.'
9
+ readme = 'README.md'
10
+ requires-python = '>=3.10'
11
+ license = 'BSD-3-Clause' # SPDX identifier as a string. It must be 'license', not 'licence' according to PEP621
12
+ license-files = ['LICENSE']
13
+ authors = [
14
+ {name = 'Francesca De Angeli', email = 'fda@ast.cam.ac.uk'},
15
+ {name = 'Paolo Montegriffo', email = 'paolo.montegriffo@inaf.it'},
16
+ {name = 'Lovro Palaversa'},
17
+ {name = 'Daniela Ruz-Mieres', email = 'dr540@ast.cam.ac.uk'},
18
+ ]
19
+ maintainers = [
20
+ {name = 'Daniela Ruz-Mieres', email = 'dr540@ast.cam.ac.uk'}
21
+ ]
22
+ classifiers = [
23
+ 'Programming Language :: Python :: 3',
24
+ 'Operating System :: OS Independent'
25
+ ]
26
+ dependencies = [
27
+ 'aenum',
28
+ 'astropy>=5.3.3,!=7.0.0,!=7.0.1',
29
+ 'astroquery',
30
+ 'fastavro',
31
+ 'hdfs',
32
+ 'matplotlib',
33
+ 'numpy',
34
+ 'packaging',
35
+ 'pandas>=1.5.0',
36
+ 'scipy',
37
+ 'tqdm>=4.66.3'
38
+ ]
39
+
40
+ [project.optional-dependencies]
41
+ dev = [
42
+ 'pytest',
43
+ 'pytest-cov',
44
+ 'pytest-mock',
45
+ 'flake8'
46
+ ]
47
+ docs = [
48
+ 'hatch',
49
+ 'sphinx',
50
+ 'sphinx-rtd-theme'
51
+ ]
52
+
53
+ [pytest]
54
+ addopts = '--cov=gaiaxpy --cov-report=term-missing --cov-fail-under=85'
55
+ testpaths = 'tests'
56
+
57
+ # To build docs
58
+ [tool.hatch.envs.docs]
59
+ dependencies = []
60
+
61
+ [tool.hatch.envs.docs.scripts]
62
+ build = 'pip install -e .[docs] && sphinx-build docs docs/build'
63
+
64
+ [tool.hatch.metadata]
65
+ allow-direct-references = true
66
+
67
+ [tool.hatch.version]
68
+ path = 'src/gaiaxpy/core/__init__.py'
69
+ source = 'vcs'
70
+ raw-options = {version_scheme = 'guess-next-dev', local_scheme = 'node-and-date'}
71
+
72
+ [tool.hatch.build]
73
+ packages = ['src']
74
+
75
+ [tool.hatch.build.targets.sdist]
76
+ include = ['src/gaiaxpy']
77
+
78
+ [tool.hatch.build.targets.wheel]
79
+ packages = ['src/gaiaxpy']
80
+
81
+ [project.urls]
82
+ homepage = 'https://gaia-dpci.github.io/GaiaXPy-website/'
83
+ documentation = 'https://gaiaxpy.readthedocs.io/en/latest/'
@@ -3,8 +3,13 @@ from .calibrator.calibrator import calibrate
3
3
  from .cholesky.cholesky import get_chi2, get_inverse_covariance_matrix, get_inverse_square_root_covariance_matrix
4
4
  from .converter.converter import convert
5
5
  from .core.dispersion_function import pwl_to_wl, wl_to_pwl, pwl_range, wl_range
6
+ from .core.version import __version__
6
7
  from .error_correction.error_correction import apply_error_correction
7
8
  from .generator.generator import generate
8
9
  from .generator.photometric_system import PhotometricSystem, load_additional_systems, remove_additional_systems
9
10
  from .plotter.plot_spectra import plot_spectra
10
- from .core.version import __version__
11
+
12
+ __all__ = ['calibrate', 'get_chi2', 'get_inverse_covariance_matrix', 'get_inverse_square_root_covariance_matrix',
13
+ 'convert', 'pwl_to_wl', 'wl_to_pwl', 'pwl_range', 'wl_range', 'apply_error_correction', 'generate',
14
+ 'PhotometricSystem', 'load_additional_systems', 'remove_additional_systems', 'plot_spectra',
15
+ '__version__']
@@ -31,7 +31,7 @@ from ..spectrum.calibration_absolute_sampled_spectrum import CalibrationAbsolute
31
31
  __FUNCTION_KEY = 'calibrator'
32
32
 
33
33
 
34
- def calibrate(input_object: Union[list, Path, str], sampling: np.ndarray = None, truncation: bool = False,
34
+ def calibrate(input_object: Union[list, Path, pd.DataFrame, str], sampling: np.ndarray = None, truncation: bool = False,
35
35
  output_path: Union[Path, str] = '.', output_file: str = 'output_spectra', output_format: str = None,
36
36
  save_file: bool = True, with_correlation: bool = False, username: str = None, password: str = None) -> \
37
37
  (pd.DataFrame, np.ndarray):
@@ -42,8 +42,8 @@ def calibrate(input_object: Union[list, Path, str], sampling: np.ndarray = None,
42
42
  available data.
43
43
 
44
44
  Args:
45
- input_object (list/Path/str): Path to the file containing the mean spectra as downloaded from the archive in
46
- their continuous representation, a list of sources ids (string or long), or a pandas DataFrame.
45
+ input_object (list/Path/pd.DataFrame/str): Path to the file containing the mean spectra as downloaded from the
46
+ Archive in their continuous representation, a list of sources ids (string or long), or a pandas DataFrame.
47
47
  sampling (ndarray): 1D array containing the desired sampling in absolute wavelengths [nm].
48
48
  truncation (bool): Toggle truncation of the set of bases. The level of truncation to be applied is defined by
49
49
  the recommended value in the input files.
@@ -56,8 +56,10 @@ class ExternalInstrumentModel(object):
56
56
  bases, _ = InverseBasesParser().parse_file(bases_path)
57
57
  bases = bases.iloc[0]
58
58
  bases['inverseBasesCoefficients'] = bases['inverseBasesCoefficients'].reshape(bases['nBases'],
59
- bases['nInverseBasesCoefficients'])
60
- bases['transformationMatrix'] = bases['transformationMatrix'].reshape(bases['nBases'], bases['nTransformedBases'])
59
+ bases[
60
+ 'nInverseBasesCoefficients'])
61
+ bases['transformationMatrix'] = bases['transformationMatrix'].reshape(bases['nBases'],
62
+ bases['nTransformedBases'])
61
63
  return cls(dispersion, response, bases)
62
64
 
63
65
  def get_response(self, wavelength: float) -> np.ndarray:
@@ -51,14 +51,15 @@ def __output_list_to_df(parsed_input_data: pd.DataFrame, bands_output: list, out
51
51
  return pd.DataFrame(zip(*output_list), columns=output_columns)
52
52
 
53
53
 
54
- def get_inverse_square_root_covariance_matrix(input_object: Union[list, Path, str], band: Optional[str] = None):
54
+ def get_inverse_square_root_covariance_matrix(input_object: Union[list, Path, pd.DataFrame, str],
55
+ band: Optional[str] = None):
55
56
  """
56
57
  Compute the inverse square root covariance matrix.
57
58
 
58
59
  Args:
59
- input_object (list/Path/str): Path to the file containing the mean spectra as downloaded from the archive in
60
- their continuous representation, a pandas DataFrame, a list of sources ids (string or long), or an ADQL
61
- query.
60
+ input_object (list/Path/pd.DataFrame/str): Path to the file containing the mean spectra as downloaded from the
61
+ Archive in their continuous representation, a pandas DataFrame, a list of sources ids (string or long), or
62
+ an ADQL query.
62
63
  band (str): Chosen band: 'bp' or 'rp'. If no band is passed, the function will compute the inverse square root
63
64
  covariance for both 'bp' and 'rp'.
64
65
 
@@ -28,7 +28,8 @@ from ..core.input_validator import validate_save_arguments
28
28
  __FUNCTION_KEY = 'converter'
29
29
 
30
30
 
31
- def convert(input_object: Union[list, Path, str], sampling: Optional[np.ndarray] = np.linspace(0, 60, 600),
31
+ def convert(input_object: Union[list, Path, pd.DataFrame, str],
32
+ sampling: Optional[np.ndarray] = np.linspace(0, 60, 600),
32
33
  truncation: bool = False, with_correlation: bool = False, output_path: Union[Path, str] = '.',
33
34
  output_file: str = 'output_spectra', output_format: str = None, save_file: bool = True,
34
35
  username: str = None, password: str = None) -> (pd.DataFrame, np.ndarray):
@@ -39,8 +40,8 @@ def convert(input_object: Union[list, Path, str], sampling: Optional[np.ndarray]
39
40
  that were considered not to be significant considering the errors on the reconstructed mean spectra.
40
41
 
41
42
  Args:
42
- input_object (list/Path/str): Path to the file containing the mean spectra as downloaded from the archive in
43
- their continuous representation, a list of sources ids (string or long), or a pandas DataFrame.
43
+ input_object (list/Path/pd.DataFrame/str): Path to the file containing the mean spectra as downloaded from the
44
+ Archive in their continuous representation, a list of sources ids (string or long), or a pandas DataFrame.
44
45
  sampling (ndarray): 1D array containing the desired sampling in pseudo-wavelengths.
45
46
  truncation (bool): Toggle truncation of the set of bases. The level of truncation to be applied is defined by
46
47
  the recommended value in the input files.
@@ -18,7 +18,6 @@ import pandas as pd
18
18
  from numpy import ndarray
19
19
 
20
20
  from gaiaxpy.config.paths import filters_path, config_path
21
- from gaiaxpy.core.config import ADDITIONAL_SYSTEM_PREFIX
22
21
  from gaiaxpy.core.custom_errors import InvalidBandError
23
22
  from gaiaxpy.core.satellite import BANDS
24
23
  from gaiaxpy.generator.config import get_additional_filters_path
@@ -0,0 +1,4 @@
1
+ from importlib import metadata
2
+
3
+ # Expose version attribute
4
+ __version__ = metadata.version('gaiaxpy')
@@ -65,7 +65,7 @@ def _cast(df):
65
65
  except KeyError:
66
66
  continue # Not every key is available in every case
67
67
  except ValueError as err:
68
- if np.isnan(np.sum(df[column].values)):
68
+ if df[column].isna().any():
69
69
  pass # There can be nan values, do nothing with them at this step
70
70
  else:
71
71
  # This is an actual error
@@ -6,6 +6,7 @@ Module to parse input files containing spectra.
6
6
  from os.path import splitext
7
7
 
8
8
  import pandas as pd
9
+ from astropy.io.votable import parse_single_table
9
10
  from astropy.table import Table
10
11
 
11
12
  from gaiaxpy.core.generic_functions import array_to_symmetric_matrix, str_to_array
@@ -146,9 +147,9 @@ class GenericParser(object):
146
147
  Returns:
147
148
  DataFrame: A pandas DataFrame representing the XML file.
148
149
  """
149
- # Astropy won't automatically remove the columns that are not in _usecols, but it speeds up the process a bit
150
- table = Table.read(xml_file, columns=_usecols)
151
- # The table read by Astropy will still contain all the columns
150
+ table = parse_single_table(xml_file).to_table()
151
+ # The columns argument of the parse_single_table function triggers an error in certain versions of Astropy,
152
+ # so all columns are read first, and then the unused ones are removed.
152
153
  df = table.to_pandas()[_usecols] if _usecols else table.to_pandas()
153
154
  if _matrix_columns:
154
155
  for size_column, values_column in _matrix_columns:
@@ -14,8 +14,9 @@ from ..core.input_validator import validate_save_arguments
14
14
  from ..file_parser.cast import _cast
15
15
 
16
16
 
17
- def generate(input_object: Union[list, Path, str], photometric_system: Union[list, PhotometricSystem],
18
- output_path: Union[Path, str] = '.', output_file: str = 'output_synthetic_photometry',
17
+ def generate(input_object: Union[list, Path, pd.DataFrame, str], photometric_system: Union[list, PhotometricSystem],
18
+ truncation: bool = False, output_path: Union[Path, str] = '.',
19
+ output_file: str = 'output_synthetic_photometry',
19
20
  output_format: str = None, save_file: bool = True, error_correction: bool = False,
20
21
  additional_columns: Optional[Union[dict, list, str]] = None, username: str = None, password: str = None) \
21
22
  -> pd.DataFrame:
@@ -26,9 +27,12 @@ def generate(input_object: Union[list, Path, str], photometric_system: Union[lis
26
27
  automatically when generating the corresponding synthetic photometry.
27
28
 
28
29
  Args:
29
- input_object (list/Path/str): Path to the file containing the mean spectra as downloaded from the archive in
30
- their continuous representation, a list of sources ids (string or long), or a pandas DataFrame.
30
+ input_object (list/Path/pd.DataFrame/str): Path to the file containing the mean spectra as downloaded from
31
+ the archive in their continuous representation, a list of sources ids (string or long), or a pandas
32
+ DataFrame.
31
33
  photometric_system (list/PhotometricSystem): Desired photometric system or list of photometric systems.
34
+ truncation (bool): Toggle truncation of the set of bases. The level of truncation to be applied is defined
35
+ by the recommended value in the input files.
32
36
  output_path (Path/str): Path where to save the output data.
33
37
  output_file (str): Name of the output file without extension (e.g. 'my_file').
34
38
  output_format (str): Desired output format. If no format is given, the output file format will be the same as
@@ -45,25 +49,27 @@ def generate(input_object: Union[list, Path, str], photometric_system: Union[lis
45
49
  Returns:
46
50
  DataFrame: A DataFrame of all synthetic photometry results.
47
51
  """
48
- return _generate(input_object=input_object, photometric_system=photometric_system, output_path=output_path,
49
- output_file=output_file, output_format=output_format, save_file=save_file,
50
- error_correction=error_correction, additional_columns=additional_columns, username=username,
51
- password=password)
52
+ return _generate(input_object=input_object, photometric_system=photometric_system, truncation=truncation,
53
+ output_path=output_path, output_file=output_file, output_format=output_format,
54
+ save_file=save_file, error_correction=error_correction, additional_columns=additional_columns,
55
+ username=username, password=password)
52
56
 
53
57
 
54
- def _generate(input_object: Union[list, Path, str], photometric_system: Union[list, PhotometricSystem],
55
- output_path: Union[Path, str] = '.', output_file: str = 'output_synthetic_photometry',
56
- output_format: str = None, save_file: bool = True, error_correction: bool = False,
57
- additional_columns: Optional[Union[dict, list, str]] = None, selector=None, username: str = None,
58
- password: str = None, bp_model: str = 'v375wi', rp_model: str = 'v142r') -> pd.DataFrame:
58
+ def _generate(input_object: Union[list, Path, pd.DataFrame, str], *, photometric_system: Union[list, PhotometricSystem],
59
+ truncation: bool = False, output_path: Union[Path, str] = '.',
60
+ output_file: str = 'output_synthetic_photometry', output_format: str = None, save_file: bool = True,
61
+ error_correction: bool = False, additional_columns: Optional[Union[dict, list, str]] = None,
62
+ selector=None, username: str = None, password: str = None, bp_model: str = 'v375wi',
63
+ rp_model: str = 'v142r') -> pd.DataFrame:
59
64
  """
60
65
  Internal function of the calibration utility. Refer to "generate".
61
66
 
62
67
  Args:
63
- selector (function): Function to filter AVRO records. The records returned will be the ones for which the
64
- function returns True. The field names used in the selector function should match the ones in the AVRO schema
65
- as the filter is run before any column renaming happens. If selector is not None and the input is not an AVRO
66
- file, a SelectorNotImplementedError will be raised.
68
+ selector (function): Function to filter AVRO records. The records returned will be the
69
+ ones for which the function returns True. The field names used in the selector
70
+ function should match the ones in the AVRO schema as the filter is run before any
71
+ column renaming happens. If selector is not None and the input is not an AVRO file,
72
+ a SelectorNotImplementedError will be raised.
67
73
  bp_model (str): The bp model.
68
74
  rp_model (str): The rp model.
69
75
  """
@@ -84,7 +90,7 @@ def _generate(input_object: Union[list, Path, str], photometric_system: Union[li
84
90
  return any([item.get_system_name() == gaia_system_name for item in _internal_photometric_system])
85
91
 
86
92
  validate_photometric_system(photometric_system)
87
- validate_save_arguments(generate.__defaults__[1], output_file, generate.__defaults__[2], output_format, save_file)
93
+ validate_save_arguments(generate.__defaults__[2], output_file, generate.__defaults__[3], output_format, save_file)
88
94
  # Prepare systems, keep track of original systems (especially required for error_correction)
89
95
  internal_phot_system = photometric_system.copy() if isinstance(photometric_system, list) else (
90
96
  [photometric_system].copy())
@@ -94,15 +100,16 @@ def _generate(input_object: Union[list, Path, str], photometric_system: Union[li
94
100
  internal_phot_system.append(gaia_system)
95
101
  additional_columns = format_additional_columns(additional_columns)
96
102
  # Read input data
97
- parsed_input_data, extension = InputReader(input_object, generate, False, additional_columns=additional_columns,
98
- selector=selector, user=username, password=password).read()
103
+ parsed_input_data, extension = InputReader(input_object, generate, truncation=truncation,
104
+ additional_columns=additional_columns, selector=selector, user=username,
105
+ password=password).read()
99
106
  additional_data = parsed_input_data[list(additional_columns.keys())]
100
107
  # Generate photometry
101
108
  phot_generator = MultiSyntheticPhotometryGenerator(internal_phot_system, bp_model=bp_model, rp_model=rp_model)
102
109
  photometry_df = phot_generator.generate(parsed_input_data, extension, output_file=None, output_format=None,
103
- save_file=False)
104
- photometry_df = _apply_colour_equation(photometry_df, photometric_system=internal_phot_system,
105
- save_file=False, disable_info=True)
110
+ save_file=False, truncation=truncation)
111
+ photometry_df = _apply_colour_equation(photometry_df, photometric_system=internal_phot_system, save_file=False,
112
+ disable_info=True)
106
113
  if error_correction:
107
114
  photometry_df = _apply_error_correction(photometry_df, photometric_system=photometric_system, save_file=False,
108
115
  disable_info=True)
@@ -9,12 +9,12 @@ from glob import glob
9
9
  from os import remove
10
10
  from os.path import exists, split, join
11
11
 
12
- from gaiaxpy.core.version import __version__
13
12
  from gaiaxpy.config.paths import config_ini_file
14
13
  from gaiaxpy.core.config import (get_filter_version_from_config, replace_file_name, get_file_path,
15
14
  ADDITIONAL_SYSTEM_PREFIX)
16
15
  from gaiaxpy.core.generic_functions import _get_system_label
17
16
  from gaiaxpy.core.satellite import BANDS
17
+ from gaiaxpy.core.version import __version__
18
18
  from gaiaxpy.core.xml_utils import get_file_root, parse_array, get_array_text, get_xp_sampling_matrix, get_xp_merge
19
19
  from .config import _CFG_FILE_PATH, _ADDITIONAL_SYSTEM_FILES_REGEX
20
20
 
@@ -116,16 +116,22 @@ class InternalPhotometricSystem(object):
116
116
  """
117
117
 
118
118
  def _extract_matches(_actual_path, _system_name):
119
- __is_built_in_name = lambda fname: fname.startswith('XpFilter')
120
- __is_exact_match = lambda fname, sysname: fname.startswith(sysname) and f'{sysname}.' in fname
121
- __matches_additional = lambda fname: pattern.match(fname)
119
+ def __is_built_in_name(f_name):
120
+ return f_name.startswith('XpFilter')
121
+
122
+ def __is_exact_match(f_name, sys_name):
123
+ return f_name.startswith(sys_name) and f'{sys_name}.' in f_name
124
+
125
+ def __matches_additional(f_name, _pattern):
126
+ return _pattern.match(f_name)
127
+
122
128
  __split_paths = [split(p) for p in _actual_path]
123
129
  __paths, __filenames = zip(*__split_paths)
124
130
  pattern = re.compile(_ADDITIONAL_SYSTEM_FILES_REGEX, re.IGNORECASE)
125
131
  if all(__is_built_in_name(f) for f in __filenames): # If system is built-in
126
132
  return _actual_path
127
- return [join(p, fn) for p, fn in __split_paths if not __is_built_in_name(fn) and __matches_additional(fn)
128
- and __is_exact_match(fn, _system_name)] # If is additional
133
+ return [join(p, fn) for p, fn in __split_paths if not __is_built_in_name(fn) and
134
+ __matches_additional(fn, pattern) and __is_exact_match(fn, _system_name)] # If is additional
129
135
 
130
136
  def _validate_path(_actual_path):
131
137
  if len(actual_path) == 0:
@@ -18,7 +18,7 @@ class MultiSyntheticPhotometryGenerator(SyntheticPhotometryGenerator):
18
18
  self.bp_model = bp_model
19
19
  self.rp_model = rp_model
20
20
 
21
- def generate(self, parsed_input_data, extension, output_file, output_format, save_file):
21
+ def generate(self, parsed_input_data, extension, output_file, output_format, save_file, truncation):
22
22
  __FUNCTION_KEY = 'photometry'
23
23
  # Recover attributes
24
24
  systems = self.photometric_system
@@ -33,7 +33,7 @@ class MultiSyntheticPhotometryGenerator(SyntheticPhotometryGenerator):
33
33
  xp_sampling, xp_sampling_grid in zip(xp_sampling_list, xp_sampling_grid_list)]
34
34
  # One list per system
35
35
  photometry_list_of_lists = [self._create_photometry_list(parsed_input_data, phot_system,
36
- sampled_basis_func, xp_merge)
36
+ sampled_basis_func, truncation, xp_merge)
37
37
  for phot_system, sampled_basis_func, xp_merge
38
38
  in zip(systems, sampled_basis_func_list, xp_merge_list)]
39
39
  # Now the first list contains the photometries in all systems for the first source_id, and so on.
@@ -18,19 +18,19 @@ config_parser.read(config_ini_file)
18
18
 
19
19
 
20
20
  class SyntheticPhotometryGenerator(object):
21
- def generate(self, parsed_input_data, extension, output_file, output_format, save_file):
21
+ def generate(self, parsed_input_data, extension, output_file, output_format, save_file, truncation):
22
22
  raise ValueError('Method not defined for base class.')
23
23
 
24
24
  def _get_sampled_basis_functions(self, xp_sampling, xp_sampling_grid):
25
25
  return {band: SampledBasisFunctions.from_design_matrix(xp_sampling_grid, xp_sampling[band]) for band in BANDS}
26
26
 
27
- def _create_photometry_list(self, parsed_input_data, photometric_system, sampled_basis_func, xp_merge):
27
+ def _create_photometry_list(self, parsed_input_data, photometric_system, sampled_basis_func, truncation, xp_merge):
28
28
  parsed_input_data_dict = parsed_input_data.to_dict('records')
29
- return (_generate_synthetic_photometry(row, sampled_basis_func, xp_merge, photometric_system) for row in
30
- parsed_input_data_dict)
29
+ return (_generate_synthetic_photometry(row, sampled_basis_func, xp_merge, truncation, photometric_system) for
30
+ row in parsed_input_data_dict)
31
31
 
32
32
 
33
- def _generate_synthetic_photometry(row, design_matrix, merge, photometric_system):
33
+ def _generate_synthetic_photometry(row, design_matrix, merge, truncation, photometric_system):
34
34
  """
35
35
  Create the synthetic photometry from the input continuously-represented mean spectrum and design matrix.
36
36
 
@@ -40,6 +40,7 @@ def _generate_synthetic_photometry(row, design_matrix, merge, photometric_system
40
40
  design_matrix (ndarray): 2D array containing the basis functions sampled for the specific photometric system.
41
41
  merge (dict): Dictionary containing an array of weights per BP and one for RP. These have one value per sample
42
42
  and define the contributions from BP and RP to the joined absolute spectrum.
43
+ truncation (bool): Toggle truncation of the set of bases.
43
44
  photometric_system (obj): Photometric system object containing the zero-points.
44
45
 
45
46
  Returns:
@@ -48,4 +49,5 @@ def _generate_synthetic_photometry(row, design_matrix, merge, photometric_system
48
49
  cont_dict = {band: XpContinuousSpectrum(row['source_id'], band.upper(), row[f'{band}_coefficients'],
49
50
  get_covariance_matrix(row, band), row[f'{band}_standard_deviation'])
50
51
  for band in BANDS}
51
- return SingleSyntheticPhotometry(row['source_id'], cont_dict, design_matrix, merge, photometric_system)
52
+ truncation = {band: row[f'{band}_n_relevant_bases'] for band in BANDS} if truncation else None
53
+ return SingleSyntheticPhotometry(row['source_id'], cont_dict, design_matrix, merge, truncation, photometric_system)
@@ -1,5 +1,3 @@
1
- from astroquery.gaia import GaiaClass
2
-
3
1
  from gaiaxpy.core.server import data_release, gaia_server
4
2
  from .archive_reader import ArchiveReader
5
3
  from .dataframe_reader import DataFrameReader
@@ -34,6 +32,9 @@ class ListReader(ArchiveReader):
34
32
  self.disable_info = disable_info
35
33
 
36
34
  def read(self, _data_release=data_release):
35
+ # Import only when read is called, as this module is dependent on the Archive’s availability
36
+ from astroquery.gaia import GaiaClass
37
+
37
38
  sources = self.content
38
39
  function_name = self.function.__name__
39
40
  if function_name in not_supported_functions:
@@ -50,7 +51,7 @@ class ListReader(ArchiveReader):
50
51
  continuous_key = [key for key in result.keys() if 'continuous' in key.lower()][0]
51
52
  data = result[continuous_key][0].to_pandas()
52
53
  except (KeyError, IndexError):
53
- raise ValueError('No continuous raw data found for the given sources.')
54
+ raise ValueError('No continuous BP/RP data found for the given sources.')
54
55
  if not self.disable_info:
55
56
  self.show_info_msg(done=True)
56
57
  return DataFrameReader(data, function_name, self.truncation, additional_columns=self.additional_columns,
@@ -1,7 +1,5 @@
1
1
  import re
2
2
 
3
- from astroquery.gaia import GaiaClass
4
-
5
3
  from gaiaxpy.core.server import data_release, gaia_server
6
4
  from gaiaxpy.core.version import __version__
7
5
  from .archive_reader import ArchiveReader
@@ -64,6 +62,9 @@ class QueryReader(ArchiveReader):
64
62
  return query
65
63
 
66
64
  def read(self, _data_release=data_release, _comment=f'This query was launched from within GaiaXPy {__version__}'):
65
+ # Import only when read is called, as this module is dependent on the Archive’s availability
66
+ from astroquery.gaia import GaiaClass
67
+
67
68
  query = self.content
68
69
  query = self._add_marker(query, _comment)
69
70
  function_name = self.function.__name__
@@ -83,7 +84,7 @@ class QueryReader(ArchiveReader):
83
84
  continuous_key = [key for key in result.keys() if 'continuous' in key.lower()][0]
84
85
  data = result[continuous_key][0].to_pandas()
85
86
  except KeyError:
86
- raise ValueError('No continuous raw data found for the requested query.')
87
+ raise ValueError('No continuous BP/RP data found for the requested query.')
87
88
  if not self.disable_info:
88
89
  self.show_info_msg(done=True)
89
90
  return DataFrameReader(data, function_name, self.truncation, additional_columns=self.additional_columns,
@@ -6,9 +6,13 @@ Module to represent generic output data.
6
6
  from ast import literal_eval
7
7
  from os.path import dirname, abspath, join
8
8
 
9
+ from numpy import set_printoptions
10
+
9
11
  from gaiaxpy.core.generic_functions import standardise_extension
10
12
  from gaiaxpy.file_parser.parse_generic import InvalidExtensionError
11
13
 
14
+ set_printoptions(legacy='1.21')
15
+
12
16
 
13
17
  def _initialise_header():
14
18
  return ["# %ECSV 1.0", "# ---", "# delimiter: ','", "# datatype:"]
@@ -110,7 +110,7 @@ class SampledSpectraData(OutputData):
110
110
  """
111
111
  data = self.data
112
112
  positions = self.positions
113
- modified_data = data.applymap(lambda x: _array_to_standard(x) if isinstance(x, ndarray) else x)
113
+ modified_data = data.map(lambda x: _array_to_standard(x) if isinstance(x, ndarray) else x)
114
114
  Path(output_path).mkdir(parents=True, exist_ok=True)
115
115
  modified_data.to_csv(join(output_path, f'{output_file}.csv'), index=False)
116
116
  # Assume the sampling is the same for all spectra
@@ -128,7 +128,7 @@ class SampledSpectraData(OutputData):
128
128
  """
129
129
  data = self.data
130
130
  positions = self.positions
131
- modified_data = data.applymap(lambda x: _array_to_standard(x, 'ecsv') if isinstance(x, ndarray) else x)
131
+ modified_data = data.map(lambda x: _array_to_standard(x, 'ecsv') if isinstance(x, ndarray) else x)
132
132
  header_lines = _build_ecsv_header(modified_data, positions)
133
133
  Path(output_path).mkdir(parents=True, exist_ok=True)
134
134
  modified_data.to_csv(join(output_path, f'{output_file}.ecsv'), index=False)
@@ -10,8 +10,10 @@ from pathlib import Path
10
10
  import matplotlib.pyplot as plt
11
11
  import pandas as pd
12
12
 
13
+ plt.rcParams['text.usetex'] = True
13
14
 
14
- class Plotter(object):
15
+
16
+ class Plotter:
15
17
 
16
18
  def __init__(self, spectra, sampling, show_plot, output_path, output_file, _format, legend, save_file):
17
19
  if isinstance(spectra, pd.Series):
@@ -91,11 +91,11 @@ class AbsoluteSampledSpectrum(SampledSpectrum):
91
91
 
92
92
  @classmethod
93
93
  def get_flux_label(cls):
94
- return 'Flux [W nm^-1 m^-2]'
94
+ return r'Flux [$\mathrm{W\,nm^{-1}\,m^{-2}}$]'
95
95
 
96
96
  @classmethod
97
97
  def get_position_label(cls):
98
- return 'Wavelength [nm]'
98
+ return r'Wavelength [$\mathrm{nm}$]'
99
99
 
100
100
  def spectrum_to_dict(self, with_correlation):
101
101
  """