TOPIC>
Useful Code

The Sequencer: Detect one-dimensional sequences in complex datasets

The Sequencer reveals the main sequence in a dataset if one exists. To do so, it reorders objects within a set to produce the most elongated manifold describing their similarities which are measured in a multi-scale manner and using a collection of metrics. To be generic, it combines information from four different metrics: the Euclidean Distance, the Kullback-Leibler Divergence, the Monge-Wasserstein or Earth Mover Distance, and the Energy Distance. It considers different scales of the data by dividing each object in the input data into separate parts (chunks), and estimating pair-wise similarities between the chunks. It then aggregates the information in each of the chunks into a single estimator for each metric+scale.

https://github.com/dalya/Sequencer

http://sequencer.org/

#space #tech #science #astronomy #code #python #unix #linux #commandline #plotting

Command Line Orbit Plotting

OK Binaries Interactive Catalog
https://github.com/mb2448/ok-binaries/

OK Binaries is a tool for identifying suitable calibration binaries from the Washington Double Star (WDS) Sixth Orbit Catalog. It calculates orbital positions at any epoch, propagates uncertainties using Monte Carlo sampling, and generates orbit plots. The web app includes automated daily updates of binary positions and a searchable interface with filters for position, magnitude, separation, and other orbital parameters. OK Binaries can be used online, as a standalone offline browser app, or via the command line.

https://github.com/mb2448/ok-binaries/

https://ok-binaries.streamlit.app/

#space #tech #science #astronomy #code #python #unix #linux #commandline #plotting

CLUES: Clustering tool for analyzing spectral data

CLUES (CLustering UnsupErvised with Sequencer) analyzes spectral and IFU data. This fully interpretable clustering tool uses machine learning to classify and reduce the effective dimensionality of data sets. It combines multiple unsupervised clustering methods with multiscale distance measures using Sequencer (ascl:2105.006) to find representative end-member spectra that can be analyzed with detailed mineralogical modeling and follow-up observations. CLUES has been used on Spitzer IRS data and debris disk science, and can be applied to other high-dimensional spectral data sets, including mineral spectroscopy in general areas of astrophysics and remote sensing.

https://github.com/Ompha/CLUES
https://ui.adsabs.harvard.edu/abs/2021ApJ...916...91B/abstract
https://ui.adsabs.harvard.edu/abs/2025ApJS..276...65L/abstract

#space #tech #science #astronomy #code #python #JupyterNotebook #unix #linux

3ML: Framework for multi-wavelength/multi-messenger analysis

The Multi-Mission Maximum Likelihood framework (3ML) provides a common high-level interface and model definition for coherent and intuitive modeling of sources using all the available data, no matter their origin. Astrophysical sources are observed by different instruments at different wavelengths with an unprecedented quality, and each instrument and data type has its own ad-hoc software and handling procedure. 3ML's architecture is based on plug-ins; the package uses the official software of each instrument under the hood, thus guaranteeing that 3ML is always using the best possible methodology to deal with the data of each instrument. Though Maximum Likelihood is in the name for historical reasons, 3ML is an interface to several Bayesian inference algorithms such as MCMC and nested sampling as well as likelihood optimization algorithms.

https://github.com/threeML/threeML
https://ui.adsabs.harvard.edu/abs/2015arXiv150708343V/abstract
https://github.com/threeML/threeML/blob/master/LICENSE
https://news.stanford.edu/stories/2017/12/software-advances-modeling-astronomical-observations

#code #python #bsd3 #fermi #xspec #hawc #science #astronomy

From technic960183

spherimatch:
A Python package for cross-matching and self-matching in spherical coordinates.

spherimatch is a Python package for efficient cross-matching and self-matching of astronomical catalogs in spherical coordinates. Designed for use in astrophysics, where data is naturally distributed on the celestial sphere, the package enables fast matching with an algorithmic complexity of O(NlogN). It supports Friends-of-Friends (FoF) group identification and duplicate removal in spherical coordinates, and integrates easily with common data processing tools such as pandas.

https://github.com/technic960183/spherimatch

https://technic960183.github.io/spherimatch/tutorial/xmatch.html
https://technic960183.github.io/spherimatch/install.html

https://pypi.org/project/fofpy/
https://linuxtut.com/en/68a22081e848030bc963/

#space #code #python #science #astronomy #astrophysics

GitHub - technic960183/spherimatch: A Python package for cross-matching and self-matching in spherical coordinates.

A Python package for cross-matching and self-matching in spherical coordinates. - technic960183/spherimatch

GitHub

AutoWISP

Kaloyan Penev, Angel Romero and S. Javad Jafarzadeh have developed a software pipeline, AutoWISP, for extracting high-precision photometry from citizen scientists' observations made with consumer-grade color digital cameras (digital single-lens reflex, or DSLR, cameras), based on their previously developed tool, AstroWISP. The new pipeline is designed to convert these observations, including color images, into high-precision light curves of stars.

"We outline the individual steps of the pipeline and present a case study using a Sony-alpha 7R II DSLR camera, demonstrating sub-percent photometric precision, and highlighting the benefits of three-color photometry of stars. Project PANOPTES will adopt this photometric pipeline and, we hope, be used by citizen scientists worldwide. Our aim is for AutoWISP to pave the way for potentially transformative contributions from citizen scientists with access to observing equipment."

Code site:
+ AutoWISP
https://github.com/kpenev/AutoWISP
+ Documentation:
https://kpenev.github.io/AutoWISP/

+ AstroWISP
https://github.com/kpenev/AstroWISP
https://pypi.org/project/astrowisp/
+ Documentation
https://kpenev.github.io/AstroWISP/

#space #code #python #astrophotography #photography #science #astronomy

Thanks to Sam Van Kooten
https://github.com/svank

wispr-analysis

Shared tools for WISPR data analysis

Some highlights

plot_utils.py
+ plot_WISPR:
Aims to be a versatile function that does the Right Thing for plotting WISPR images, with colorbar bounds that are adjusted for inner and outer FOV and for L2 or L3 images, a square-root-scaled colorbar, and WCS coordinate support
+ *_axis_dates: Helper util for labeling a temporal axis with dates.
+ plot_orbit:
Reads a directory (or nested set of directories) of WISPR files and plots a diagram showing the orbital path of PSP and the locations where images were taken, like this:

projections.py
+ reproject_to_radial: Proof-of-concept code for reprojecting data into a radial coordinate system (where each row of the output array is a radial line out from the Sun.

data_cleaning.py
+ dust_streak_filter: Code for identifying debris streaks in the WISPR images
+ clean_fits_files: Function to batch-run dust_streak_filter on a directory of images.

composites.py
+ gen_composite: Reprojects an inner- and outer-FOV image into a common coordinate system

utils.py
+ to_timestamp: Parse a timestamp from a handful of formats, including the timestamps inside WISPR headers, or entire WISPR filenames. Returns a numerical timestamp.
+ collect_files: Walks a directory of WISPR files (or a directory of subdirectories of WISPR images), identifies all the WISPR images, sorts them, and separates them by inner and outer FOVs.
+ ignore_fits_warnings: Suppresses the warnings Astropy raises when reading WISPR FITS files or parsing WCS data.

https://github.com/svank/wispr_analysis
Documentation:
https://svank.github.io/wispr_analysis/

#space #code #python #science #astronomy #astrophysics #tech #NASA

2025-08-20

Leandro Beraldo e Silva released four days ago:
lberaldoesilva/tropygal version 0.1.4
Entropy estimates and distribution functions for galactic dynamics

tropygal is a pure-python package for entropy estimates in the context of galactic dynamics, but can be used in other contexts too. It also provides functions for analytical distribution functions and density of states for models that have analytical expressions.

** Acknowledgements
Development of tropygal was supported by the following research grants:
+ NASA ATP awards 80NSSC20K0509 and 80NSSC24K0938
+ U.S. NSF AAG grant AST-2009122
+ STFC Ernest Rutherford fellowship (ST/X004066/1)
+ JSPS KAKENHI Grant Numbers JP24K07101, JP21K13965, and JP21H00053
+ CNPq (309723/2020-5)
+ Heising Simons Foundation grant # 2022-3927

** Funding agencies:
+ NASA ATP - NASA Astrophysical Theory Program (US)
+ NSF - National Science Foundation (US)
+ STFC - Science and Technology Facilities Council (UK)
+ JSPS - Japan Society for the Promotion of Science (Japan)
+ CNPq – Conselho Nacional de Desenvolvimento Científico e Tecnológico (Brasil)
+ Heising Simons Foundation (US)

https://github.com/lberaldoesilva/tropygal
https://tropygal.readthedocs.io/en/latest/
https://link.springer.com/epdf/10.1007/BF00773669?sharing_token=c10vjrwKcPemuJugFt8GPPe4RwlQNchNByi7wbcMAY4It9IZvz0cQPRbyx9xcOC67oJ1uYrQB3lur75MCDwqdPXd8sWtzve-hL8JYGekYHqhITNJ3f12mXyjbTmMIqid10HwkWoYRAWdltK0BTwIew%3D%3D
https://www.mdpi.com/1099-4300/18/1/13

#space #code #python #science #astronomy #astrophysics #tech #NASA

GitHub - lberaldoesilva/tropygal: Entropy estimates and distribution functions for galactic dynamics

Entropy estimates and distribution functions for galactic dynamics - lberaldoesilva/tropygal

GitHub

PIRATES
(Polarimetric Image Reconstruction AI for Tracing Evolved Structures)
uses machine learning to perform image reconstruction.

It uses MCFOST to generate models, then uses those models to build, train, iteratively fit, and evaluate PIRATES performance.

Optical interferometric image reconstruction is a challenging, ill-posed optimization problem which usually relies on heavy regularization for convergence. Conventional algorithms regularize in the pixel domain, without cognizance of spatial relationships or physical realism, with limited utility when this information is needed to reconstruct images. Here we present PIRATES (Polarimetric Image Reconstruction AI for Tracing Evolved Structures), the first image reconstruction algorithm for optical polarimetric interferometry. PIRATES has a dual structure optimized for parsimonious reconstruction of high fidelity polarized images and accurate reproduction of interferometric observables. The first stage, a convolutional neural network (CNN), learns a physically meaningful prior of self-consistent polarized scattering relationships from radiative transfer images. The second stage, an iterative fitting mechanism, uses the CNN as a prior for subsequent refinement of the images with respect to their polarized interferometric observables. Unlike the pixel-wise adjustments of traditional image reconstruction codes, PIRATES reconstructs images in a latent feature space, imparting a structurally derived implicit regularization.

https://github.com/LucindaLilley/PIRATES
https://ui.adsabs.harvard.edu/abs/2025arXiv250511950L/abstract
https://arxiv.org/pdf/2505.11950

CREDITS:
Lilley, Lucinda ; Norris, Barnaby ; Tuthill, Peter ; Spalding, Eckhart ; Lucas, Miles ; Zhang, Manxuan ; Millar-Blanchaer, Maxwell ; Pinte, Christophe ; Bottom, Michael ; Guyon, Olivier ; Lozi, Julien ; Deo, Vincent ; Vievard, Sébastien ; Wong, Alison P. ; Ahn, Kyohoon ; Ashcraft, Jaren

#space #code #python #science #astronomy #astrophysics #tech

nazgul is a joint effort by:

* J. Michael Burgess
* Ewan Cameron
* Dmitry Svinkin

Nazgul is a framework for performing GRB localization via fitting non-parametric models to their data time-series and computing the time delay between them. It is currentrly built upon the magic of Stan and implements a parallel version of non-stationary Random Fourier Features. The idea is get away from heuristic methods such as cross-correlation which do not have a self-consistent statitical model.

The idea is that satellites throughout the Sol system observe gamma-ray bursts at different times due to the finite speed of light. This creates a time delay in their observed light curves which can be used to triangulate the gamma-ray burst position on the sky. These triangulation create annuli or rings on the sky which Nazgul searches for so that it, in the darkness, it can bind them to a location on the sky.

Left image:
The heriarchical model is shown below and details can be found in here https://arxiv.org/abs/2009.08350. If you find the method and/or code useful in your research we ask that you please cite the paper.

Right image:
The sister program to simulate time-delayed light curves is pyIPN and can be used to generate time-delayed light curves for algorithm testing.
https://github.com/grburgess/pyipn

#space #code #python #science #astronomy #astrophysics #tech #NASA

Astro Catalog
by Sylvain Villet
https://github.com/sylvainvillet
https://app.astrobin.com/u/SylvainV
https://app.astrobin.com/forum/topic/191541

This project generates a mosaic of Messier or Caldwell objects, using images from a local folder.
The script arranges the objects into a configurable grid, supports larger slots for extended targets (e.g. Andromeda), and overlays labels and a title.

Perfect for creating a large-format print.

Features:
+ Loads Messier or Caldwell object images from a folder (M31.jpg, M-31.png, M_31.tif, etc.)
+ Places objects on a grid with configurable layout
+ Supports multi-cell slots for large objects (e.g. M31, M42, M45)
+ Supports grouping multiple objects in one slot for objects close to each other (e.g. M42 and M43, M31 and M32)
+ Adds a title and progress counter if it's not completed yet
+ Draws labels on images and placeholders for missing ones
+ Adjustable size of the final image
+ Saves as JPEG, PNG or TIFF

https://github.com/sylvainvillet/astro-catalog#features

#space #tech #science #astronomy #astrophotography #photography #code #python #unix #linux #commandline #plotting