Skip to main content

A collection of tools for working with ZVAR data.

Project description

ZVAR Utilities

Description

This repository contains a collection of utilities for working with the ZVAR data products. The utilities are written in Python and can be used to retrieve variability candidates. So far, we mostly rely on the FPW periods and Gaia DR3 data to extract interesting candidates. Said candidates are then stored in a CSV file, and the notebooks in the notebooks directory can be used to further analyze the candidates.

Installation

To get started with this project, you need to have Python installed on your machine. Follow the steps below to set up the project:

  1. Clone the repository:

    git clone https://github.com/zvar-astro/ZVAR-Utilities
    cd ZVAR-Utilities
    
  2. Fetch the demo_data submodule:

    git submodule update --init --recursive
    

    If this command isn't recognized, you may need to update your git version or install git-lfs.

  3. Create a virtual environment, with uv:

    uv venv env --python=python3.10
    source env/bin/activate
    

    Note: You can also use conda, virtualenv, or any other virtual environment manager of your choice.

  4. Install the required dependencies:

    uv sync
    

    You can rerun this command whenever you want to update the dependencies.

Usage

To generate a CSV file with variability candidates, you will first need to fetch FPW periods from magnetar (subject to change). You can save these anywhere in your machine, simply make sure to follow this directory structure:

whatever_directory/
└── field/
    └── fpw_field_ccd_quad_zfilter.h5
    └── ...

where:

  • The field should be padded with zeros to have a length of 4. For example, field 1 should be 0001.
  • The ccd should be padded with zeros to have a length of 2. For example, CCD 1 should be 01.
  • The quad should be of length 1.
  • The filter must be one of g, r, or i.

Example: fpw_0001_01_1_zfilter.h5.

Once you have the FPW periods, you can run the following command to generate the CSV file:

PYTHONPATH=. python scripts/retrieve_variability_candidates.py --field_min=279 --field_max=279 --bands=r,g --radius=3.0 --periods_path=/path/to/periods/directory --output_path=/path/to/output/directory --credentials_path=/path/to/credentials/file

where:

  • field_min and field_max are the minimum and maximum fields to consider.
  • bands is a comma-separated list of bands to consider. The possible values are g, r, and i.
  • radius is the radius in arcseconds used to query for xmatches from Kowalski's Gaia DR3 catalog.
  • periods_path is the path to the directory containing the FPW periods.
  • output_path is the path to the directory where the CSV file will be saved.
  • credentials_path is the path to the file containing the credentials to access Kowalski.

A default credentials file is provided as credentials.default.json. You can use this file as a template to create your own credentials.json file. The file should have the following structure:

{
  "melman": {
    "username": "your_username_here",
    "password": "your_password_here"
  }
}

where melman is the name of the Kowalski instance you want to access, and username and password are your credentials to access the instance.

Notebooks

The notebooks directory contains Jupyter notebooks that can be used to further analyze the variability candidates. For now, only one notebook is available, candidates_analysis.ipynb, in which we:

  • Load the CSV file with the variability candidates.
  • Plot the candidates on an HR diagram using Gaia DR3 data.
  • Plot the light curves of the candidates.
  • Compute a period using the Lomb-Scargle periodogram, and plot lightcurve vs periodogram vs phased lightcurve.
  • Compute a period using the FPW algorithm, and plot lightcurve vs periodogram vs phased lightcurve.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zvartools-0.1.0.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zvartools-0.1.0-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file zvartools-0.1.0.tar.gz.

File metadata

  • Download URL: zvartools-0.1.0.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.30

File hashes

Hashes for zvartools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5f2a611fad0603c09c063eb377ceebcb2f3e06a8f5bfb2969dfb131cc9b1ffa9
MD5 60beb2c1896b7c5c7b90aa2d57515625
BLAKE2b-256 de3332c733bd5c1cac9fe1cdd79f9dcc1daa95e93dce8bd10f045b8d724e1186

See more details on using hashes here.

File details

Details for the file zvartools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zvartools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.30

File hashes

Hashes for zvartools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c92d27af82d55256d479a8a3d90904c43b276aa6fdf463e8eba5d37f5284fcb
MD5 846932b8a7f0775d74b81af56470d5cc
BLAKE2b-256 43710f68e7ef531597fbfedf6c88e99fbd2405a5381b3a84b81edcfb448ebac4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page