Metadata-Version: 2.1
Name: photcalib
Version: 0.6
Summary: calibration tool for photometric data
Home-page: https://github.com/zyuan-astro/PhotCalib
Author: Zhen Yuan
Author-email: 
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering :: Astronomy
Description-Content-Type: text/x-rst
License-File: LICENSE

PhotCalib
-----------

Calibration tool for Prisitine CaHK data. For more details see Martin, Starkenburg & Yuan 2023



Installation
----------------

Before installation, make sure you have pytorch or install essential dependencies :

.. code::

  pip install -r requirements.txt



* Installation from PyPI

.. code::

   pip install photcalib

* Manual installation

download the repository and run the setup

.. code::

   python setup.py install      

Getting started 
----------------

.. code::

   cd examples
 

To Calibrate CaHK data using the trained run model

.. code::

   python calib_raw.py 25Am02 25Am02  -D cpu

The first run name represents the run to train the calibration model.

The second run name represents the run to be calibrated.

* D (str) is the device (default:cpu, gpu) to run pytorch. If gpu is chosen, it will use the first graphic card cuda:0 by default.

To train calibration run model:
.. code::

   python calib_mod.py 25Am02

Spceify the run for calibration using the input file as examples/data/inputs_run.npy, which is generated using Prepare_input.ipynb

Specify the device and training parameters (the followings are the default settings)

.. code::

   python calib_mod.py 17Am05 -D cpu -lr 1e-6 -n 400 -mom 0.9 -thr 1e-2

* D (str) is the device (default:cpu, mps, gpu) to run pytorch. 
* n (int) is the number of training epochs.
* lr (float) is the initial learning rate, which will decrease using scheduler (see details at https://pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.ReduceLROnPlateau).
* thr (float) is the threshold of the scheduler.
* mom (float) is the momentum of gradient descent.

Citing this work
----------------

**Martin, F.N.**, **Starkenburg, E.**, & **Yuan, Z.** et al. (A&A 2024) https://www.aanda.org/articles/aa/full_html/2024/12/aa47633-23/aa47633-23.html
