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:
-
Clone the repository:
git clone https://github.com/zvar-astro/ZVAR-Utilities cd ZVAR-Utilities
-
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.
-
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.
-
Install the required dependencies:
uv syncYou 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
ccdshould be padded with zeros to have a length of 2. For example, CCD 1 should be01. - The
quadshould be of length 1. - The
filtermust be one ofg,r, ori.
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_minandfield_maxare the minimum and maximum fields to consider.bandsis a comma-separated list of bands to consider. The possible values areg,r, andi.radiusis the radius in arcseconds used to query for xmatches from Kowalski's Gaia DR3 catalog.periods_pathis the path to the directory containing the FPW periods.output_pathis the path to the directory where the CSV file will be saved.credentials_pathis 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zvartools-0.1.1.tar.gz.
File metadata
- Download URL: zvartools-0.1.1.tar.gz
- Upload date:
- Size: 35.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fdadfef15cd93f5ee35f05450ba966d6212a34b55199f67346f82bc587b1f65
|
|
| MD5 |
c839bd36de6ce344d5c2c9aff19cac79
|
|
| BLAKE2b-256 |
706781e560448136a9a94b92b8d086ea4c21c012fa98119c294209b3ec4e14c3
|
File details
Details for the file zvartools-0.1.1-py3-none-any.whl.
File metadata
- Download URL: zvartools-0.1.1-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bd65635cac8662fc646d351016dc6d4947145a2a656cd46e384c5cdf827c56a
|
|
| MD5 |
4d01ba039497bceac000be33f49ed0be
|
|
| BLAKE2b-256 |
46ed532c8df54508a07cd620e326c2199071aa32aac503eaccc7853a7956fcaf
|