### Install GaiaXPy from PyPI or Source Source: https://context7.com/gaia-dpci/gaiaxpy/llms.txt Instructions for installing the GaiaXPy library using pip or from its GitHub repository. ```sh pip install GaiaXPy ``` ```sh git clone https://github.com/gaia-dpci/GaiaXPy cd GaiaXPy python3 -m venv .env source .env/bin/activate pip install -e . ``` -------------------------------- ### Install GaiaXPy from Source Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/installation.md Install GaiaXPy from its source code. This involves cloning the repository, setting up a virtual environment, and installing the package in editable mode. ```sh cd GaiaXPy python3 -m venv .env source .env/bin/activate pip install -e . ``` -------------------------------- ### Install GaiaXPy from PyPI Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/installation.md Install the GaiaXPy package using pip. Ensure your pip is up-to-date for the desired Python version. ```sh pip install GaiaXPy ``` -------------------------------- ### Get Available Photometric Systems Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/usage.md Retrieves a list of all available photometric systems that can be used with the `generate` function. ```python from gaiaxpy import PhotometricSystem PhotometricSystem.get_available_systems() ``` -------------------------------- ### Clone GaiaXPy Repository Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/installation.md Clone the GaiaXPy repository from GitHub to install from source. You can clone a specific branch if needed. ```sh git clone https://github.com/gaia-dpci/GaiaXPy ``` ```sh git clone --branch my-branch https://github.com/gaia-dpci/GaiaXPy ``` -------------------------------- ### Get GaiaXPy Package Version Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/cite.md Run this Python code to check the installed version of the GaiaXPy package. This is useful for ensuring you are using the correct version for citation. ```python import gaiaxpy print(gaiaxpy.__version__) ``` -------------------------------- ### List and Inspect Photometric Systems Source: https://context7.com/gaia-dpci/gaiaxpy/llms.txt Demonstrates listing all available built-in photometric systems and accessing properties of a specific system like JKC. ```python from gaiaxpy import PhotometricSystem # List all available built-in systems print(PhotometricSystem.get_available_systems()) # Access a system and inspect its bands system = PhotometricSystem.JKC print(system.get_system_name()) # 'JKC' print(system.get_system_label()) # 'Jkc' print(system.get_bands()) # list of band names in the system ``` -------------------------------- ### Load and Use Custom Photometric Systems Source: https://context7.com/gaia-dpci/gaiaxpy/llms.txt Loads additional photometric systems from local filter files and demonstrates their usage with the 'generate' function. Custom systems are prefixed with 'USER_'. ```python from gaiaxpy import PhotometricSystem, load_additional_systems, remove_additional_systems # Load additional photometric systems from a local directory # Each file must be a CSV with columns: wavelength (nm or Å), total response PhotometricSystem = load_additional_systems('/path/to/my/filter/files') # User-defined systems get the prefix 'USER_', e.g. PhotometricSystem.USER_MyFilter # Use a custom system exactly like a built-in one from gaiaxpy import generate generated_df = generate( 'XpContinuousMeanSpectrum_example.csv', photometric_system=PhotometricSystem.USER_MyFilter, save_file=False ) ``` -------------------------------- ### Install urllib3 v1.26.6 to resolve OpenSSL/LibreSSL incompatibility Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/caveats.md If you encounter an 'urllib3 v2.0 only supports OpenSSL 1.1.1+' error when connecting to the Gaia Archive, install version 1.26.6 of urllib3. This resolves incompatibility issues with OpenSSL/LibreSSL versions. ```python pip install urllib3==1.26.6 ``` -------------------------------- ### List Available Photometric Systems Source: https://context7.com/gaia-dpci/gaiaxpy/llms.txt Prints a string listing all built-in photometric systems available in the PhotometricSystem enum. ```python print(PhotometricSystem.get_available_systems()) ``` -------------------------------- ### Install dvipng to fix 'dvipng could not be found' plotting error Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/caveats.md After resolving the `type1ec.sty` error on Ubuntu 22.04, you might encounter a 'Failed to process string with tex because dvipng could not be found' error. Install dvipng to fix this plotting issue. ```bash sudo apt-get install dvipng ``` -------------------------------- ### Install cm-super fonts to fix LaTeX Error: File `type1ec.sty` not found Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/caveats.md On Ubuntu 22.04 LTS, plotting errors like '! LaTeX Error: File `type1ec.sty` not found' can occur due to missing LaTeX system dependencies. Install the CM-Super fonts to resolve this. ```bash sudo apt-get -y install cm-super ``` -------------------------------- ### Specify Output Path, File Name, and Format Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/usage.md Shows how to customize the output file's location, name, and format using the `output_path`, `output_file`, and `output_format` options. Supported formats include 'avro', 'csv', 'ecsv', 'fits', and 'xml'. ```python from gaiaxpy import generic_function input_file = 'path/to/input/file.extension' output_data = generic_function(input_file, output_path='my/path', output_file='my_output_name', output_format='fits') ``` -------------------------------- ### QueryReader.get_srcids() Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/gaiaxpy.input_reader.md Gets the name of the source ID column from an Astropy Table. ```APIDOC ## QueryReader.get_srcids() ### Description Get the name of the source ID column from an Astropy Table. ### Method get_srcids(_table) ### Parameters #### Path Parameters - **_table** (Table) - A table containing columns. ### Returns The name of the source ID column. ### Return type str ### Raises - **ValueError** – If the source ID column is not found in the DataFrame. - **ValueError** – If the index of the source ID column is not a string. ``` -------------------------------- ### load_additional_systems Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/gaiaxpy.md Loads additional photometric systems from a specified path. If no path is provided, the user will be prompted to input one. ```APIDOC ## load_additional_systems ### Description Load additional photometric systems. ### Parameters #### Path Parameters * **_systems_path** (str) - Optional - Path to directory containing the additional filter files. If not provided, the program will ask the user to input one. ### Returns PhotometricSystem object corresponding to an enumeration of the updated available systems. ### Return type Enum ``` -------------------------------- ### Check pip Version Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/installation.md Verify the version of pip associated with your Python installation before proceeding. ```sh pip --version ``` -------------------------------- ### XpSpectrum Instance Methods Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/gaiaxpy.spectrum.md Methods available on an instance of XpSpectrum. ```APIDOC ## XpSpectrum Instance Methods ### get_positions Get the positions of all samples. #### Returns * **ndarray** - 1D array containing the position of all samples. ### spectrum_to_dict Represent spectrum as dictionary. #### Parameters * **with_correlation** (*bool*) - Whether to include correlation information. #### Returns * **dict** - A dictionary populated with the minimum set of parameters that need to be stored for this object. The array of positions is NOT included. ``` -------------------------------- ### Generate Synthetic Photometry from Source IDs with Credentials Source: https://context7.com/gaia-dpci/gaiaxpy/llms.txt Generates synthetic photometry from a list of source IDs, optionally providing Cosmos credentials, output path, format, and enabling file saving. ```python source_ids = [5762406957886626816] generated_df = generate( source_ids, photometric_system=PhotometricSystem.PanSTARRS1_Std, username='my_cosmos_user', password='my_cosmos_pass', output_path='./output', output_format='fits', save_file=True ) ``` -------------------------------- ### Pass Custom Sampling Data Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/usage.md Example of providing custom sampling data to a GaiaXPy function using the `sampling` option. The sampling data must be a NumPy array. ```python import numpy as np from gaiaxpy import generic_function input_file = 'path/to/input/file.extension' output_data, output_sampling = generic_function(input_file, sampling=np.linspace(0, 100, 1000)) ``` -------------------------------- ### PhotometricSystem Class Source: https://github.com/gaia-dpci/gaiaxpy/blob/main/docs/usage.md The `PhotometricSystem` class provides access to available photometric systems and their definitions. The `get_available_systems` method lists all supported systems. ```APIDOC ## PhotometricSystem ### Description Represents photometric systems and provides methods to access available systems. ### Methods #### get_available_systems() ### Description Returns a list of all available photometric systems that can be used with GaiaXPy. ### Request Example ```python from gaiaxpy import PhotometricSystem available_systems = PhotometricSystem.get_available_systems() print(available_systems) ``` ### Response #### Success Response (200) - **available_systems** (list) - A list of strings, where each string is the name of an available photometric system. ```