GaiaXPy 2.1.1__tar.gz → 2.1.3__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.
- gaiaxpy-2.1.3/.gitignore +24 -0
- gaiaxpy-2.1.3/PKG-INFO +46 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/README.md +1 -1
- gaiaxpy-2.1.3/pyproject.toml +84 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/__init__.py +6 -1
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/calibrator/calibrator.py +3 -3
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/calibrator/external_instrument_model.py +4 -2
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/cholesky/cholesky.py +5 -4
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/converter/converter.py +4 -3
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/generic_functions.py +0 -7
- gaiaxpy-2.1.3/src/gaiaxpy/core/version.py +4 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/xml_utils.py +1 -1
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/cast.py +1 -1
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/parse_generic.py +12 -5
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/config.py +1 -1
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/generator.py +24 -20
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/internal_photometric_system.py +28 -14
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/multi_synthetic_photometry_generator.py +2 -2
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/synthetic_photometry_generator.py +8 -6
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/archive_reader.py +6 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/dataframe_reader.py +8 -2
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/list_reader.py +6 -5
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/query_reader.py +26 -7
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/output/output_data.py +4 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/output/sampled_spectra_data.py +2 -2
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/plotter/plotter.py +3 -1
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/absolute_sampled_spectrum.py +2 -2
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/multi_synthetic_photometry.py +18 -4
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/single_synthetic_photometry.py +4 -2
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/xp_sampled_spectrum.py +2 -2
- gaiaxpy-2.1.1/MANIFEST.in +0 -4
- gaiaxpy-2.1.1/PKG-INFO +0 -42
- gaiaxpy-2.1.1/pyproject.toml +0 -37
- gaiaxpy-2.1.1/setup.cfg +0 -4
- gaiaxpy-2.1.1/setup.py +0 -42
- gaiaxpy-2.1.1/src/GaiaXPy.egg-info/PKG-INFO +0 -42
- gaiaxpy-2.1.1/src/GaiaXPy.egg-info/SOURCES.txt +0 -173
- gaiaxpy-2.1.1/src/GaiaXPy.egg-info/dependency_links.txt +0 -1
- gaiaxpy-2.1.1/src/GaiaXPy.egg-info/requires.txt +0 -15
- gaiaxpy-2.1.1/src/GaiaXPy.egg-info/top_level.txt +0 -1
- gaiaxpy-2.1.1/src/gaiaxpy/core/version.py +0 -1
- /gaiaxpy-2.1.1/LICENCE → /gaiaxpy-2.1.3/LICENSE +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/calibrator/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/cholesky/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/colour_equation/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/colour_equation/xp_filter_system_colour_equation.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/OptimisedCalibratedBases_BpId32_RpId37_withNormalisation.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/TabulatedDispersionFunction-DR3-v375wiv142r_20200610.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/available_systems.txt +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/bpC03_v211w_bases.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/bpC03_v211w_dispersion.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/bpC03_v211w_response.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/bpC03_v375wi_bases.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/bpC03_v375wi_dispersion.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/bpC03_v375wi_response.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/colour_eq_files/JkcStd_colour_eq.ini +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/colour_eq_files/SdssStd_colour_eq.ini +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/config.ini +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-ElsCustomW09S2-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-EuclidVis-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Gaia2-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-GaiaDr3Vega-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HipparcosTycho-correction-factors-old.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HipparcosTycho-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstAcswfc-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstHugsStd-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstWfc3uvis-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-HstWfpc2-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Iphas-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Jkc-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-JkcStd-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Jpas-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Jplus-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-JwstNircam-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Panstarrs1-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Panstarrs1Std-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Pristine-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Sdss-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-SdssStd-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-SkyMapper-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Stromgren-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-StromgrenStd-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/correction_tables/DIDREQ-465-Wfirst-correction-factors.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Decam_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_ElsCustomW09S2_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_EuclidVis_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Gaia2_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_GaiaDr3Ab_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_GaiaDr3Vega_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_GaiaNominal_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HCustom_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HalphaCustomAb_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HalphaCustom_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HipparcosTycho_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HstAcswfc_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HstHugsStd_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HstWfc3uvis_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_HstWfpc2_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_IphasCustomW09S2_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_IphasCustomW09_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_IphasCustom_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Iphas_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_JkcStd_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Jkc_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Jpas_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Jplus_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_JwstNircam_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Lsst_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Panstarrs1Std_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Panstarrs1_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Pristine_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_SdssStd_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Sdss_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_SkyMapper_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_SscAb_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_StromgrenStd_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Stromgren_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Ucustom_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_Wfirst_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_v211wv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/filters/XpFilter_v375wiv142r.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/fluxCal_20230901_renorm_bspline.xml +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/paths.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/rpC03_v142r_bases.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/rpC03_v142r_dispersion.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/config/rpC03_v142r_response.csv +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/converter/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/converter/config.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/config.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/custom_errors.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/dispersion_function.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/generic_variables.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/input_validator.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/nature.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/satellite.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/core/server.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/error_correction/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/error_correction/error_correction.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/parse_external.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/parse_internal_continuous.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/parse_internal_sampled.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/parse_inverse.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/file_parser/utils.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/photometric_system.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/regular_photometric_system.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/standardised_photometric_system.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/utils.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/dataframe_numpy_array_reader.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/dataframe_string_array_reader.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/file_reader.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/hdfs_reader.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/input_reader.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/local_file_reader.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/input_reader/required_columns.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/output/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/output/continuous_spectra_data.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/output/ecsv_headers/headers_dict.txt +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/output/photometry_data.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/output/utils.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/plotter/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/plotter/multi_absolute.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/plotter/multi_xp.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/plotter/plot_spectra.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/plotter/single.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/__init__.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/calibration_absolute_sampled_spectrum.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/generic_spectrum.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/photometric_absolute_sampled_spectrum.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/sampled_basis_functions.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/sampled_spectrum.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/spectral_energy_distribution.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/utils.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/xp_continuous_spectrum.py +0 -0
- {gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/spectrum/xp_spectrum.py +0 -0
gaiaxpy-2.1.3/.gitignore
ADDED
|
@@ -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.3/PKG-INFO
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: GaiaXPy
|
|
3
|
+
Version: 2.1.3
|
|
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: Zuzanna Kostrzewa-Rutkowska, 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
|
|
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,84 @@
|
|
|
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 = 'Zuzanna Kostrzewa-Rutkowska'},
|
|
16
|
+
{name = 'Paolo Montegriffo', email = 'paolo.montegriffo@inaf.it'},
|
|
17
|
+
{name = 'Lovro Palaversa'},
|
|
18
|
+
{name = 'Daniela Ruz-Mieres', email = 'dr540@ast.cam.ac.uk'},
|
|
19
|
+
]
|
|
20
|
+
maintainers = [
|
|
21
|
+
{name = 'Daniela Ruz-Mieres', email = 'dr540@ast.cam.ac.uk'}
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
'Programming Language :: Python :: 3',
|
|
25
|
+
'Operating System :: OS Independent'
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
'aenum',
|
|
29
|
+
'astropy>=5.3.3,!=7.0.0,!=7.0.1',
|
|
30
|
+
'astroquery',
|
|
31
|
+
'fastavro',
|
|
32
|
+
'hdfs',
|
|
33
|
+
'matplotlib',
|
|
34
|
+
'numpy',
|
|
35
|
+
'packaging',
|
|
36
|
+
'pandas>=1.5.0',
|
|
37
|
+
'scipy',
|
|
38
|
+
'tqdm>=4.66.3'
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
dev = [
|
|
43
|
+
'pytest',
|
|
44
|
+
'pytest-cov',
|
|
45
|
+
'pytest-mock',
|
|
46
|
+
'flake8'
|
|
47
|
+
]
|
|
48
|
+
docs = [
|
|
49
|
+
'hatch',
|
|
50
|
+
'sphinx',
|
|
51
|
+
'sphinx-rtd-theme'
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[pytest]
|
|
55
|
+
addopts = '--cov=gaiaxpy --cov-report=term-missing --cov-fail-under=85'
|
|
56
|
+
testpaths = 'tests'
|
|
57
|
+
|
|
58
|
+
# To build docs
|
|
59
|
+
[tool.hatch.envs.docs]
|
|
60
|
+
dependencies = []
|
|
61
|
+
|
|
62
|
+
[tool.hatch.envs.docs.scripts]
|
|
63
|
+
build = 'pip install -e .[docs] && sphinx-build docs docs/build'
|
|
64
|
+
|
|
65
|
+
[tool.hatch.metadata]
|
|
66
|
+
allow-direct-references = true
|
|
67
|
+
|
|
68
|
+
[tool.hatch.version]
|
|
69
|
+
path = 'src/gaiaxpy/core/__init__.py'
|
|
70
|
+
source = 'vcs'
|
|
71
|
+
raw-options = {version_scheme = 'guess-next-dev', local_scheme = 'node-and-date'}
|
|
72
|
+
|
|
73
|
+
[tool.hatch.build]
|
|
74
|
+
packages = ['src']
|
|
75
|
+
|
|
76
|
+
[tool.hatch.build.targets.sdist]
|
|
77
|
+
include = ['src/gaiaxpy']
|
|
78
|
+
|
|
79
|
+
[tool.hatch.build.targets.wheel]
|
|
80
|
+
packages = ['src/gaiaxpy']
|
|
81
|
+
|
|
82
|
+
[project.urls]
|
|
83
|
+
homepage = 'https://gaia-dpci.github.io/GaiaXPy-website/'
|
|
84
|
+
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
|
-
|
|
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
|
|
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[
|
|
60
|
-
|
|
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,
|
|
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
|
|
60
|
-
their continuous representation, a pandas DataFrame, a list of sources ids (string or long), or
|
|
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,
|
|
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
|
|
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
|
|
@@ -347,12 +346,6 @@ def format_additional_columns(additional_columns: Optional[Union[str, list, dict
|
|
|
347
346
|
return convert_values_to_lists(additional_columns)
|
|
348
347
|
|
|
349
348
|
|
|
350
|
-
def validate_error_correction(phot_system, error_correction):
|
|
351
|
-
if any(system.name.startswith(ADDITIONAL_SYSTEM_PREFIX) for system in phot_system) and error_correction:
|
|
352
|
-
raise ValueError('Photometry is requested for a non-built-in system, but error_correction is set to True. '
|
|
353
|
-
'Error correction is only implemented for built-in systems.')
|
|
354
|
-
|
|
355
|
-
|
|
356
349
|
def validate_photometric_system(photometric_system):
|
|
357
350
|
"""
|
|
358
351
|
Ensure photometric system input isn't empty.
|
|
@@ -34,7 +34,7 @@ def get_xp_merge(x_root):
|
|
|
34
34
|
|
|
35
35
|
def get_array_text(x_root, tag):
|
|
36
36
|
result = x_root.find(tag)
|
|
37
|
-
result = [element.text for element in result] if result else None
|
|
37
|
+
result = [element.text for element in result] if result is not None else None
|
|
38
38
|
length = len(result) if result else None
|
|
39
39
|
return result, length
|
|
40
40
|
|
|
@@ -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
|
|
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
|
|
@@ -74,12 +75,12 @@ class GenericParser(object):
|
|
|
74
75
|
str: File extension ('.csv', '.fits', or '.xml').
|
|
75
76
|
"""
|
|
76
77
|
if not disable_info:
|
|
77
|
-
|
|
78
|
+
self.print_info_msg()
|
|
78
79
|
extension = _get_file_extension(file_path)
|
|
79
80
|
parser = self.get_parser(extension)
|
|
80
81
|
parsed_data = _cast(parser(file_path))
|
|
81
82
|
if not disable_info:
|
|
82
|
-
|
|
83
|
+
self.print_info_msg(done=True)
|
|
83
84
|
return parsed_data, extension
|
|
84
85
|
|
|
85
86
|
def _parse_avro(self, avro_file):
|
|
@@ -146,9 +147,9 @@ class GenericParser(object):
|
|
|
146
147
|
Returns:
|
|
147
148
|
DataFrame: A pandas DataFrame representing the XML file.
|
|
148
149
|
"""
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
#
|
|
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:
|
|
@@ -156,6 +157,12 @@ class GenericParser(object):
|
|
|
156
157
|
row[size_column]), axis=1)
|
|
157
158
|
return df
|
|
158
159
|
|
|
160
|
+
def print_info_msg(self, done=False):
|
|
161
|
+
msg = self.info_msg
|
|
162
|
+
if done:
|
|
163
|
+
msg = msg + ' Done!'
|
|
164
|
+
print(msg, end='\r')
|
|
165
|
+
|
|
159
166
|
|
|
160
167
|
def _get_file_extension(file_path):
|
|
161
168
|
"""
|
|
@@ -41,7 +41,7 @@ def __get_file_names_recursively(dir_path: str, show_warning: bool = False) -> l
|
|
|
41
41
|
if len(compliant_files) == 0:
|
|
42
42
|
raise ValueError('No filter files found in the given directory. Please check your files.')
|
|
43
43
|
elif len(compliant_files) < len(all_files) and show_warning:
|
|
44
|
-
message = '
|
|
44
|
+
message = 'Based on their names, some files in the directory do not correspond to filter files. They will be ignored.'
|
|
45
45
|
print(f'UserWarning: {message}', file=sys.stderr)
|
|
46
46
|
return compliant_files
|
|
47
47
|
|
|
@@ -4,8 +4,7 @@ from typing import Union, Optional
|
|
|
4
4
|
import pandas as pd
|
|
5
5
|
|
|
6
6
|
from gaiaxpy.colour_equation.xp_filter_system_colour_equation import _apply_colour_equation
|
|
7
|
-
from gaiaxpy.core.generic_functions import cast_output, format_additional_columns, validate_photometric_system
|
|
8
|
-
validate_error_correction
|
|
7
|
+
from gaiaxpy.core.generic_functions import cast_output, format_additional_columns, validate_photometric_system
|
|
9
8
|
from gaiaxpy.error_correction.error_correction import _apply_error_correction
|
|
10
9
|
from gaiaxpy.input_reader.input_reader import InputReader
|
|
11
10
|
from gaiaxpy.output.photometry_data import PhotometryData
|
|
@@ -15,7 +14,7 @@ from ..core.input_validator import validate_save_arguments
|
|
|
15
14
|
from ..file_parser.cast import _cast
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
def generate(input_object: Union[list, Path, str], photometric_system: Union[list, PhotometricSystem],
|
|
17
|
+
def generate(input_object: Union[list, Path, pd.DataFrame, str], photometric_system: Union[list, PhotometricSystem],
|
|
19
18
|
output_path: Union[Path, str] = '.', output_file: str = 'output_synthetic_photometry',
|
|
20
19
|
output_format: str = None, save_file: bool = True, error_correction: bool = False,
|
|
21
20
|
additional_columns: Optional[Union[dict, list, str]] = None, username: str = None, password: str = None) \
|
|
@@ -27,8 +26,9 @@ def generate(input_object: Union[list, Path, str], photometric_system: Union[lis
|
|
|
27
26
|
automatically when generating the corresponding synthetic photometry.
|
|
28
27
|
|
|
29
28
|
Args:
|
|
30
|
-
input_object (list/Path/str): Path to the file containing the mean spectra as downloaded from
|
|
31
|
-
their continuous representation, a list of sources ids (string or long), or a pandas
|
|
29
|
+
input_object (list/Path/pd.DataFrame/str): Path to the file containing the mean spectra as downloaded from
|
|
30
|
+
the archive in their continuous representation, a list of sources ids (string or long), or a pandas
|
|
31
|
+
DataFrame.
|
|
32
32
|
photometric_system (list/PhotometricSystem): Desired photometric system or list of photometric systems.
|
|
33
33
|
output_path (Path/str): Path where to save the output data.
|
|
34
34
|
output_file (str): Name of the output file without extension (e.g. 'my_file').
|
|
@@ -52,19 +52,23 @@ def generate(input_object: Union[list, Path, str], photometric_system: Union[lis
|
|
|
52
52
|
password=password)
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
def _generate(input_object: Union[list, Path, str], photometric_system: Union[list, PhotometricSystem],
|
|
56
|
-
output_path: Union[Path, str] = '.',
|
|
57
|
-
|
|
58
|
-
additional_columns: Optional[Union[dict, list, str]] = None,
|
|
59
|
-
|
|
55
|
+
def _generate(input_object: Union[list, Path, pd.DataFrame, str], photometric_system: Union[list, PhotometricSystem],
|
|
56
|
+
truncation: bool = False, output_path: Union[Path, str] = '.',
|
|
57
|
+
output_file: str = 'output_synthetic_photometry', output_format: str = None, save_file: bool = True,
|
|
58
|
+
error_correction: bool = False, additional_columns: Optional[Union[dict, list, str]] = None,
|
|
59
|
+
selector=None, username: str = None, password: str = None, bp_model: str = 'v375wi',
|
|
60
|
+
rp_model: str = 'v142r') -> pd.DataFrame:
|
|
60
61
|
"""
|
|
61
62
|
Internal function of the calibration utility. Refer to "generate".
|
|
62
63
|
|
|
63
64
|
Args:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
truncation (bool): Toggle truncation of the set of bases. The level of truncation to be
|
|
66
|
+
applied is defined by the recommended value in the input files.
|
|
67
|
+
selector (function): Function to filter AVRO records. The records returned will be the
|
|
68
|
+
ones for which the function returns True. The field names used in the selector
|
|
69
|
+
function should match the ones in the AVRO schema as the filter is run before any
|
|
70
|
+
column renaming happens. If selector is not None and the input is not an AVRO file,
|
|
71
|
+
a SelectorNotImplementedError will be raised.
|
|
68
72
|
bp_model (str): The bp model.
|
|
69
73
|
rp_model (str): The rp model.
|
|
70
74
|
"""
|
|
@@ -89,22 +93,22 @@ def _generate(input_object: Union[list, Path, str], photometric_system: Union[li
|
|
|
89
93
|
# Prepare systems, keep track of original systems (especially required for error_correction)
|
|
90
94
|
internal_phot_system = photometric_system.copy() if isinstance(photometric_system, list) else (
|
|
91
95
|
[photometric_system].copy())
|
|
92
|
-
validate_error_correction(internal_phot_system, error_correction)
|
|
93
96
|
gaia_system = PhotometricSystem.Gaia_DR3_Vega
|
|
94
97
|
is_gaia_in_input = __is_gaia_initially_in_systems(internal_phot_system)
|
|
95
98
|
if error_correction and not is_gaia_in_input:
|
|
96
99
|
internal_phot_system.append(gaia_system)
|
|
97
100
|
additional_columns = format_additional_columns(additional_columns)
|
|
98
101
|
# Read input data
|
|
99
|
-
parsed_input_data, extension = InputReader(input_object, generate,
|
|
100
|
-
selector=selector, user=username,
|
|
102
|
+
parsed_input_data, extension = InputReader(input_object, generate, truncation=truncation,
|
|
103
|
+
additional_columns=additional_columns, selector=selector, user=username,
|
|
104
|
+
password=password).read()
|
|
101
105
|
additional_data = parsed_input_data[list(additional_columns.keys())]
|
|
102
106
|
# Generate photometry
|
|
103
107
|
phot_generator = MultiSyntheticPhotometryGenerator(internal_phot_system, bp_model=bp_model, rp_model=rp_model)
|
|
104
108
|
photometry_df = phot_generator.generate(parsed_input_data, extension, output_file=None, output_format=None,
|
|
105
|
-
save_file=False)
|
|
106
|
-
photometry_df = _apply_colour_equation(photometry_df, photometric_system=internal_phot_system,
|
|
107
|
-
|
|
109
|
+
save_file=False, truncation=truncation)
|
|
110
|
+
photometry_df = _apply_colour_equation(photometry_df, photometric_system=internal_phot_system, save_file=False,
|
|
111
|
+
disable_info=True)
|
|
108
112
|
if error_correction:
|
|
109
113
|
photometry_df = _apply_error_correction(photometry_df, photometric_system=photometric_system, save_file=False,
|
|
110
114
|
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
|
|
|
@@ -115,27 +115,41 @@ class InternalPhotometricSystem(object):
|
|
|
115
115
|
str: Path of a file.
|
|
116
116
|
"""
|
|
117
117
|
|
|
118
|
-
def
|
|
119
|
-
|
|
118
|
+
def _extract_matches(_actual_path, _system_name):
|
|
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
|
+
|
|
128
|
+
__split_paths = [split(p) for p in _actual_path]
|
|
129
|
+
__paths, __filenames = zip(*__split_paths)
|
|
120
130
|
pattern = re.compile(_ADDITIONAL_SYSTEM_FILES_REGEX, re.IGNORECASE)
|
|
121
|
-
if all(f
|
|
131
|
+
if all(__is_built_in_name(f) for f in __filenames): # If system is built-in
|
|
122
132
|
return _actual_path
|
|
123
|
-
return [join(
|
|
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
|
|
135
|
+
|
|
136
|
+
def _validate_path(_actual_path):
|
|
137
|
+
if len(actual_path) == 0:
|
|
138
|
+
raise ValueError('Filter file not found in given path.')
|
|
139
|
+
elif len(actual_path) > 1:
|
|
140
|
+
# Remove configuration file if it exists to avoid issues when reloading
|
|
141
|
+
if exists(_CFG_FILE_PATH):
|
|
142
|
+
remove(_CFG_FILE_PATH)
|
|
143
|
+
raise ValueError(f'More than one system named {self.label.replace(f"{ADDITIONAL_SYSTEM_PREFIX}_", "")}'
|
|
144
|
+
f' were found. System names in the given directory should be unique. Operation aborted.')
|
|
124
145
|
|
|
125
146
|
file_name = replace_file_name(self.config_file, 'filter', 'filter', bp_model, rp_model, self.label)
|
|
126
147
|
system_name = file_name.split('.')[0]
|
|
127
148
|
file_path = get_file_path(self.config_file)
|
|
128
149
|
# Search file in file path to obtain the actual path
|
|
129
150
|
actual_path = glob(file_path + f"/**/{system_name}*.xml", recursive=True)
|
|
130
|
-
actual_path =
|
|
131
|
-
|
|
132
|
-
raise ValueError('Filter file not found in given path.')
|
|
133
|
-
elif len(actual_path) > 1:
|
|
134
|
-
# Remove configuration file if it exists to avoid issues on reloading
|
|
135
|
-
if exists(_CFG_FILE_PATH):
|
|
136
|
-
remove(_CFG_FILE_PATH)
|
|
137
|
-
raise ValueError(f'More than one system named {self.label.replace(f"{ADDITIONAL_SYSTEM_PREFIX}_", "")}'
|
|
138
|
-
f' were found. System names in the given directory should be unique. Operation aborted.')
|
|
151
|
+
actual_path = _extract_matches(actual_path, system_name)
|
|
152
|
+
_validate_path(actual_path)
|
|
139
153
|
self.filter_file = actual_path[0]
|
|
140
154
|
|
|
141
155
|
def _load_offset_from_xml(self):
|
{gaiaxpy-2.1.1 → gaiaxpy-2.1.3}/src/gaiaxpy/generator/multi_synthetic_photometry_generator.py
RENAMED
|
@@ -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
|
|
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
|
-
|
|
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)
|
|
@@ -67,7 +67,7 @@ class DataFrameReader(object):
|
|
|
67
67
|
|
|
68
68
|
def read(self):
|
|
69
69
|
if not self.disable_info:
|
|
70
|
-
|
|
70
|
+
self.show_info_msg()
|
|
71
71
|
content = self.content
|
|
72
72
|
str_array_columns, np_array_columns = self.__get_parseable_columns()
|
|
73
73
|
if str_array_columns:
|
|
@@ -88,10 +88,16 @@ class DataFrameReader(object):
|
|
|
88
88
|
data[f'{band}_covariance_matrix'] = data.apply(get_covariance_matrix, axis=1, args=(band,))
|
|
89
89
|
self.requested_columns = self.requested_columns + covariance_columns
|
|
90
90
|
if not self.disable_info:
|
|
91
|
-
|
|
91
|
+
self.show_info_msg(done=True)
|
|
92
92
|
data = _cast(data)
|
|
93
93
|
if self.additional_columns:
|
|
94
94
|
data = rename_with_required(data, self.additional_columns)
|
|
95
95
|
data = data[self.requested_columns] if self.requested_columns else data
|
|
96
96
|
# No extension returned for DataFrames
|
|
97
97
|
return data, None
|
|
98
|
+
|
|
99
|
+
def show_info_msg(self, done=False):
|
|
100
|
+
msg = self.info_msg
|
|
101
|
+
if done:
|
|
102
|
+
msg = msg + ' Done!'
|
|
103
|
+
print(msg, end='\r')
|