https://github.com/amberlee2427/gullsplanets

Fast Python scripts that generate millions of planet entries for Gulls input catalogs, in seconds

https://github.com/amberlee2427/gullsplanets

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.8%) to scientific vocabulary

Keywords

microlensing simulations
Last synced: 5 months ago · JSON representation

Repository

Fast Python scripts that generate millions of planet entries for Gulls input catalogs, in seconds

Basic Info
  • Host: GitHub
  • Owner: AmberLee2427
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 830 KB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
microlensing simulations
Created 6 months ago · Last pushed 6 months ago
Metadata Files
Readme

README.md

Planet Array Generator Scripts

This repository provides two sampling scripts for generating synthetic planet (and low–mass star / brown dwarf) properties useful for microlensing / population studies.

Distributions implemented:

  • SUMI2023_draw_planet_arrays.pyComposite Sumi-style mass function: a sum of two independent power-law segments in base-10 logarithmic mass space:

    • Planet (free-floating / wide orbit) component: ( \frac{dN}{d\log{10} M} = Z{\rm planet} \,( M / M{\rm pivot,planet} )^{-\alpha4} ) with published parameters (\alpha4 = 0.96), (Z{\rm planet}=2.18\, \mathrm{dex^{-1}\,star^{-1}}), pivot (M{\rm pivot,planet}=8\,M\oplus), validity approximately 0.33–6660 (M\oplus) (1e-6–0.02 M(\odot)). Integrates to ~21 planets per star over that range.
    • Rising star + brown dwarf (BD) low-mass tail: ( \frac{dN}{d\log{10} M} = A{\rm BD} \,( M / M{\rm pivot,BD} )^{-\alpha3} ) with (\alpha3 = -0.82) (negative ⇒ rises with increasing mass), pivot (M{\rm pivot,BD}=38\,M\oplus). The amplitude (A{\rm BD}) is solved internally from a target number of brown dwarfs per star in a chosen interval (default: 0.2 objects in 0.012–0.08 M(\odot)). Validity adopted: 3×10⁻⁴–0.8 M(\odot) (~100–2.6×10⁵ M(_\oplus)).
    • The total differential frequency is the sum of the two segments wherever they overlap. There is no rejection; sampling uses analytic inverse CDFs and mixture weights from exact integrals.
    • Output includes a component label column (comp): 0 = planet segment, 1 = star/BD segment.
  • uniform_draw_planet_arrays.pyLog-uniform baseline: masses drawn log-uniform between 0.1–10,000 M(_\oplus); semi-major axes log-uniform (0.3–30 au); inclinations isotropic; orbital phase uniform.

Requirements

  • Python 3.11+ (tested)
  • NumPy

Optional (for exploration / plotting): matplotlib, pandas (used in the notebook).

Input

Both scripts read a source file (default: gulls_surot2d_H2023.sources) whose first whitespace–delimited column lists integer field identifiers. For each field, nf files of nl sampled objects are produced (parallelized across CPU cores).

Output

Files are written under planets/<run_name>/ as:

<run_name>.planets.<field_number>.<file_index>

Columns:

  • mass (M_Sun) – Mass in solar masses (sampled internally in Earth masses).
  • a (au) – Semi–major axis (au, log–uniform between configured bounds).
  • inc (deg) – Signed inclination (deg) from an isotropic distribution.
  • p (deg) – Orbital phase (deg) uniform in [0, 360).
  • comp (0=planet,1=starbd) – (Only in SUMI composite script) segment identifier.

Usage

1. Composite Sumi-style Mass Function

Generates a mixture of the declining planetary power law and the rising star+BD segment; mixture weights are exact integrals over the requested mass interval. Supports deterministic runs via FIXED_BASE_SEED.

bash python SUMI2023_draw_planet_arrays.py

Sumi 2023 MF

2. Log-Uniform Mass Function

Baseline sampler with purely log-uniform mass distribution (0.1–10,000 M(_\oplus)).

bash python uniform_draw_planet_arrays.py

Uniform Draw

Customization

Key parameters (edit near top of each script):

  • nl – number of objects per output file.
  • nf – number of files per field.
  • rundes – run descriptor used in output directory & filenames.
  • sources_file – path to field list.
  • file_ext – set to .npy for NumPy binary output; empty for CSV-like text.
  • overwrite_existing – if False existing files are left intact.
  • FIXED_BASE_SEED – set an integer for reproducible deterministic sampling across processes.

Composite-only parameters (defaults derived from literature):

  • Z_PLANET, ALPHA_PLANET (α4), PIVOT_PLANET.
  • A_BD (solved amplitude), ALPHA3, PIVOT_BD.
  • Global mass truncation (mmin, mmax) and semi–major axis log bounds (amin, amax).

Notes

  • Multiprocessing: a pool sized by mp.cpu_count() is used; each task derives a unique RNG seed when FIXED_BASE_SEED is set.
  • Mass sampling in the composite script is analytic (no rejection), ensuring efficiency even for large draws.
  • Component labels enable downstream filtering (e.g., isolate planetary segment only).
  • The uniform script omits the label column by design.

Example Output

Example composite output header (text mode):

```

mass (M_Sun), a (au), inc (deg), p (deg), comp (0=planet,1=starbd)

```

Example uniform output header:

```

mass (M_Sun), a (au), inc (deg), p (deg)

```


For questions or issues, please contact the script author.

GitHub Events

Total
  • Member event: 1
  • Push event: 1
  • Create event: 2
Last Year
  • Member event: 1
  • Push event: 1
  • Create event: 2

Dependencies

environment.yml pypi
  • asdf ==4.2.0
  • asdf-astropy ==0.8.0
  • asdf-coordinates-schemas ==0.4.0
  • asdf-standard ==1.3.0
  • asdf-transform-schemas ==0.6.0
  • asdf-wcs-schemas ==0.5.0
  • crds ==12.1.10
  • cython ==3.1.2
  • defusedxml ==0.7.1
  • drizzle ==2.0.1
  • et-xmlfile ==2.0.0
  • filelock ==3.18.0
  • future ==1.0.0
  • galsim ==2.7.2
  • gwcs ==0.22.1
  • imageio ==2.37.0
  • jsonschema ==4.24.0
  • jsonschema-specifications ==2025.4.1
  • lazy-loader ==0.4
  • lsstdesc-coord ==1.3.0
  • lxml ==5.4.0
  • lz4 ==4.4.4
  • networkx ==3.5
  • numexpr ==2.11.0
  • opencv-python-headless ==4.11.0.86
  • openpyxl ==3.1.5
  • parsley ==1.3
  • photutils ==2.2.0
  • poppy ==1.1.2
  • pybind11 ==2.13.6
  • pysiaf ==0.24.1
  • rad ==0.25.0
  • referencing ==0.36.2
  • roman-datamodels ==0.25.0
  • romancal ==0.19.0
  • romanisim ==0.9.0
  • rpds-py ==0.25.1
  • scikit-image ==0.25.2
  • semantic-version ==2.10.0
  • setuptools ==71.1.0
  • spherical-geometry ==1.3.3
  • stcal ==1.13.0
  • stpipe ==0.8.1
  • stpsf ==2.0.0
  • stsci-imagestats ==1.8.3
  • stsci-stimage ==0.3.0
  • synphot ==1.5.0
  • tifffile ==2025.6.11
  • tweakwcs ==0.8.11
  • vbmicrolensing ==5.1