Metadata-Version: 2.4
Name: pymovie
Version: 4.3.0
Summary: PyMovie is a lightcurve extractor for astronomical videos
Author-email: Bob Anderson <bob.anderson.ok@gmail.com>
Maintainer-email: Bob Anderson <bob.anderson.ok@gmail.com>
License: MIT License
        
        Copyright (c) 2019 bob-anderson-ok bob.anderson.ok@gmail.com
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/bob-anderson-ok/pymovie
Keywords: desktop app,lightcurve extraction from astronomical videos
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Requires-Python: <3.11,>=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: PyQt5==5.15.7; platform_system != "Darwin"
Requires-Dist: PyQt5>=5.15.10; platform_system == "Darwin"
Requires-Dist: PyQt5-Qt5==5.15.2; platform_system == "Windows"
Requires-Dist: PyQt5-sip==12.11.0; platform_system != "Darwin"
Requires-Dist: PyQt5-sip>=12.13; platform_system == "Darwin"
Requires-Dist: pyqtgraph==0.12.4
Requires-Dist: numpy==1.23.1
Requires-Dist: scipy==1.8.1
Requires-Dist: matplotlib==3.5.2
Requires-Dist: opencv-python==4.6.0.66
Requires-Dist: Pillow==9.2.0
Requires-Dist: scikit-image==0.19.3
Requires-Dist: tifffile==2022.5.4
Requires-Dist: imageio==2.19.5
Requires-Dist: astropy==5.1
Requires-Dist: astroquery==0.4.6
Requires-Dist: pyvo==1.3
Requires-Dist: numba==0.56.4
Requires-Dist: llvmlite==0.39.1
Requires-Dist: ravf==1.0.1
Requires-Dist: Adv2==1.2.0
Requires-Dist: Resource==0.2.1
Requires-Dist: JsonSir==0.0.2
Requires-Dist: JsonForm==0.0.2
Requires-Dist: PyYAML==6.0
Requires-Dist: keyring==23.7.0
Requires-Dist: requests==2.28.1
Requires-Dist: beautifulsoup4==4.11.1
Requires-Dist: html5lib==1.1
Requires-Dist: more-itertools==9.1.0
Requires-Dist: platformdirs<5,>=4
Requires-Dist: winshell==0.6; platform_system == "Windows"
Requires-Dist: pypiwin32; platform_system == "Windows"
Dynamic: license-file

PyMovie
=======

PyMovie is a simple (hopefully) application for extracting lightcurves from occultation videos.

It is specially designed to be robust in both star tracking and data extraction when the
video has been disturbed by wind-shake.

The name was chosen out of respect and deference to LiMovie, a pioneer application
published many years ago.
This application has fewer 'bells and whistles' than LiMovie and so should be easier
to use for a newbie.


Installing
==========

Windows: download the executable (easiest)
------------------------------------------

Windows users can skip the Python toolchain entirely. Go to the
`latest release <https://github.com/bob-anderson-ok/pymovie/releases/latest>`_
page and download ``PyMovie.exe`` from the *Assets* section. Double-click to
run — no installation, no Python setup required. The executable bundles its
own Python runtime and all dependencies.

The first activation will take extra time because it will be downloading the
proper version of Python and all the other dependencies. Subsequent activations will
only tkae a few seconds.

To update later, just download the newer ``PyMovie.exe`` from the release
page and replace the old one.

If you'd rather run from source (all platforms), follow the uv-based
instructions below.

Installing from source (any platform)
-------------------------------------

PyMovie uses `uv <https://docs.astral.sh/uv/>`_ to manage its Python environment.
You do **not** need Python pre-installed — uv will automatically download the
correct version (3.10) on first run.

Step 1. Install uv (one line, user-scope, no admin rights required).

Windows, in PowerShell::

    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

macOS or Linux, in a terminal::

    curl -LsSf https://astral.sh/uv/install.sh | sh

Close and reopen your terminal afterwards so the new ``uv`` command is on your PATH.

Step 2. Get the PyMovie source. Either clone with git::

    git clone https://github.com/bob-anderson-ok/pymovie.git
    cd pymovie

or download the repository as a ZIP from the GitHub page, unzip it, and ``cd``
into the extracted folder.

Step 3. Launch PyMovie::

    uv run pymovie

On first run, uv downloads Python 3.10 (if not already present), installs the
pinned dependencies from ``uv.lock`` into a local ``.venv`` folder, and opens
the PyMovie window. Subsequent runs are near-instant.

Updating
--------

To pick up a new PyMovie release::

    git pull
    uv run pymovie

uv automatically re-syncs the environment whenever ``uv.lock`` has changed,
so there is nothing else to do.

Photometry uncertainty export
-----------------------------

The ``Photometry Noise`` controls on the ``Median/Misc`` tab can add
``signal_err`` and ``snr`` columns to CSV files. The estimate combines local
background scatter with source shot noise. Local background scatter already
includes read noise, so it is not added separately. Set the detector gain for
your camera; the default gain is marked as approximate in the CSV header.
The existing ``.pymovie`` recording is still written alongside the CSV.

AVI/AAV to FITS
---------------

After opening a video and loading or training its OCR timestamp profile, use
``Timestamp -> Convert AVI/AAV to FITS``. Choose an existing output folder in
the folder dialog. It starts at ``fits_converted`` for full frames or
``fits_converted_fields`` for field images when those folders exist; otherwise
it starts in the source video's folder. You can create a new folder in the
dialog. The confirmation lists the target folder and warns before replacing
matching ``frame-`` or ``field-`` FITS files. Other FITS files are preserved.

AAV conversion preserves the reader's 16-bit pixel values. Full-frame exposure
comes from AAV frame metadata where available, with the effective frame rate
as a fallback. Integrated AAV recordings use full-frame output only.

Tests
-----

Run the regression tests from the repository root::

    uv run python -m unittest discover -s tests -v

The tests cover numerical limiting cases and CSV error columns alongside the
``.pymovie`` recording. The numerical tests check the implemented uncertainty
formula; they do not establish its physical calibration for a specific
detector or data reduction workflow.
The tests cover FITS timestamp and exposure headers, conversion cancellation,
and AAV reader behavior using generated data.

AVI codecs
----------

If OpenCV cannot decode an AVI, PyMovie tries its packed RV24 reader and then
PyAV/FFmpeg. Install PyAV in the environment created by uv to enable that
second fallback::

    uv pip install av

The reader regression tests create short RV24 and lossless FFV1 videos in
temporary directories. Run all of them with::

    uv run --with av python -m unittest discover -s tests -v

ADV/AAV on Apple Silicon
------------------------

Adv2 1.2.0 bundles an Intel-only macOS library. After installing the Python
dependencies, Apple Silicon users can build the native reader with::

    uv run python scripts/build_advcore_macos.py

This requires Git and Xcode Command Line Tools (``xcode-select --install``).
The script builds the official ADVCore source at a pinned revision for ARM64,
keeps a backup of the original library, and installs it in the active Python
environment. Repeat this step after reinstalling Adv2.

Tests
-----

Run the OCR pickle compatibility regression tests from the repository root::

    uv run python -m unittest discover -s tests -v

The tests cover NumPy 1.x and 2.x array module paths, corrupted input, and
loading OCR templates from the observation folder or application folder.
Fixtures are generated in temporary directories; existing OCR files are not
modified.

Troubleshooting
---------------

* **"uv: command not found"** — close and reopen your terminal, or follow the
  PATH instructions printed by the uv installer.
* **Windows SmartScreen warning on the uv installer** — click *More info* →
  *Run anyway*. The installer is published by Astral.
* **Corporate proxy / firewall issues** — uv honours standard ``HTTPS_PROXY``
  and ``HTTP_PROXY`` environment variables.

