Skip to content

abrahammathews2000/mega

Repository files navigation

Alien Megastructure Transit Reconstruction

This repository contains the research code for generating synthetic transit light curves from arbitrary occulting shapes and training a neural network to reconstruct a 2D shadow image from a 1D light curve.

The project is organized as a pipeline:

  1. Generate 2D shapes that represent transiting objects.
  2. Simulate light curves for those shapes with EightBitTransit.
  3. Convert raw images and CSV light curves into .npy datasets.
  4. Train a TensorFlow model that maps a processed light curve to a reconstructed shape.
  5. Run inference on synthetic and real-world-inspired examples such as BATMAN, Kepler, and exocomet light curves.

Datasets and trained model artifacts referenced by the original experiments are stored externally:

Start Here

Repository Layout

  • lightcurve_simulation/: shape generation, raw light-curve simulation, and conversion utilities.
  • ml_training/: training and inference scripts, Colab notebooks, and archived experiments.
  • data/: dataset metadata and experiment notes used by the project.
  • lc_fitting/: notebook-based fitting experiments.

What The Current Code Assumes

This is a research codebase rather than a packaged library. Many scripts:

  • use hard-coded absolute paths such as /scratch/...,
  • prompt for confirmation with input("Do you want to run the code?"),
  • expect datasets to already exist on local disk,
  • were written as one-off experiment runners instead of reusable CLIs.

The new docs/ folder explains how those pieces fit together and points to the main scripts to use first.

Main Entry Points

  • Shape generation: lightcurve_simulation/data_raw/create_shapes.py
  • Light-curve simulation for one .npy shape file: lightcurve_simulation/data_raw/pll_create_8bit_lc.py
  • Light-curve simulation for batched training shapes: lightcurve_simulation/data_raw/frontend_rand_param_batch_lc_gen.py
  • Convert raw light curves to .npy: lightcurve_simulation/data_npy/cnvt_lcFlux_to_npy.py
  • Training script: ml_training/ml_train_lightcurve_unf_dist_LDC_size.py
  • Python inference script: ml_training/ml_inference_lc2shape.py
  • Final notebook workflow: ml_training/Google_Colab_Codes/megastructure_ml_model_training.ipynb

Recommended Reading Order For New Contributors

  1. Read docs/README.md for the big picture.
  2. Read docs/data-generation.md to understand the dataset.
  3. Read docs/model.md and docs/training.md.
  4. Use docs/inference.md to interpret the inference notebooks and script outputs.

About

MS Astronomy and Astrophysics Thesis Code

Topics

Resources

Stars

Watchers

Forks

Contributors