---
title: "Search an observed OGLE variable star and count the aliases"
description: "Replay a frozen RR Lyrae light curve, inspect its observing window, calibrate full-search false alarms and measure injected-period recovery."
canonical_url: "https://sandboxphysics.com/stories/observing-cadence/ogle-lightcurve/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/observing-cadence/ogle-lightcurve/"
last_modified: "2026-10-28"
---

[Choose when to observe a changing sky](https://sandboxphysics.com/stories/observing-cadence/)

AC07 · L3

# Search an observed OGLE variable star and count the aliases

Sandbox Physics · 2026-10-28

Open the official OGLE-IV I-band light curve of OGLE-LMC-RRLYR-00001. The checked-in file contains 403 measured times, magnitudes and uncertainties. You will analyze its first season, repeat the search after discarding observations, and test whether a stronger peak actually identifies the period more reliably.

## Before you begin

Read the sampling-window and floating-mean chapters. The offline script needs Python and NumPy; it performs no network requests. NumPy 2.0.2 generated the saved results.

## Freeze the original measurements before selecting a season

The source file is a 9672-byte public OGLE per-object download, last modified 29 June 2017. Its SHA-256 is 6d6bb05178881e421ca2c03cf77bc100d51f74c87efbd523a9f017216c6e5a1b. The official README and the matching RRab catalog row are saved beside it. Those provide column meanings and the published period, separately from any result of this replay.

The three columns are heliocentric Julian day minus 2450000, I-band magnitude and quoted magnitude uncertainty. Do not relabel the time as barycentric Julian day or infer a TDB/UTC convention absent from this file. A smaller magnitude means a brighter star. The analysis stays in magnitude units; it does not pretend those amplitudes are linear flux amplitudes.

The full file spans about 2233 days. Select all finite positive-error rows within 160 days of the first timestamp. In this actual file, that rule yields only twenty-five points spanning 51.96797 days, followed by a gap to the next season. There is no clipping and no replacement of measurements by a fitted curve.

Reading: OGLE-IV LMC RR Lyrae official data README · Soszyński et al., OGLE Magellanic RR Lyrae catalog

## Use the actual times to set the frequency grid

Subtract the first selected time, 5262.50439 in the archive’s offset convention, before evaluating trigonometric functions. This changes the fitted phase, not the physical period. Use the same shifted timestamps in the observing window and every simulated search.

The grid begins at 0.2 cycles per day, ends at the last point no greater than six, and has spacing one divided by five times the selected baseline. Save the actual array. The chosen upper limit is a declared search range, not a Nyquist frequency computed from the average gap.

Fit one sine, one cosine and a floating constant with inverse squared quoted-error weights. The Python script uses a weighted orthogonal projection, while the browser implementation eliminates normal equations. The independent formulations agree in the owned model tests.

Reading: Zechmeister & Kürster, generalized Lomb–Scargle, arXiv v1 · Astropy 8.0.2 Lomb–Scargle documentation · VanderPlas, Understanding the Lomb–Scargle Periodogram, arXiv v1

## Run the complete offline replay

Download the files listed below into one folder, open a terminal there, and run the commands. The observed script checks the source hash and saves measured points, the complete frequency and window arrays, null maxima, trial seeds and injection outcomes in ogle-replay-rerun.json. It never downloads fresh data during analysis. The second script independently reanalyzes saved synthetic exposures; it does not turn them into observations of OGLE.

For each selected time pattern, 4096 constant-source Gaussian simulations provide a separate maximum-power distribution. Every simulation searches every frequency on the same declared grid. Another 1024 independent simulations test the five-percent threshold. A separate 256-trial randomization permutes standardized observed deviations at fixed timestamps; its exchangeability assumption and result are named separately from Gaussian-noise calibration.

A real RRab pulse is not a perfect sine. Quoted errors can also omit correlated sky or calibration effects. This replay measures the behavior of the specified one-harmonic, independent-noise procedure.

```
python3 -W error replay-ogle.py
python3 -W error replay-synthetic.py
```

Reading: OGLE-IV LMC RR Lyrae official data README · Zechmeister & Kürster, generalized Lomb–Scargle, arXiv v1 · Astropy 8.0.2 Lomb–Scargle documentation

## Compare the observed curve with the measured search

The full first-season sample gives a strongest grid period of 0.635355 days, with power 0.641815. The saved catalog row lists 0.6347521 days and a much smaller catalog uncertainty. Our short span, coarse frequency grid and single-harmonic model do not reproduce that catalog precision. Folding the measured points by the searched period reveals a repeating pattern without turning the fitted sinusoid into new observations.

The full-search Gaussian-noise tail rank is 0.004882. The separately permuted standardized data give a rank of 0.01556. That randomization tests a different assumption about the deviations. Report the noise assumption and simulation size beside either number. A finite Monte Carlo rank has sampling error and is not an exact tail probability.

The periodogram panel shows standard GLS power and the separately calibrated five-percent full-search threshold. Its peak is a fit to observed magnitudes; the threshold comes from synthetic constant-source draws.

Twenty-five measured points with their quoted error bars; smaller magnitudes are brighter. Folding changes the horizontal coordinate; no new brightness samples are generated.

Teal: full measured sample. Gold: every-third sample. Dashed lines are their separate five-percent full-search Gaussian-null thresholds, not correct-period probabilities.

Direct equal-weight transform of the twenty-five timestamps. Magnitude values do not enter this panel.

Reading: OGLE-IV LMC RR Lyrae official data README · Soszyński et al., OGLE Magellanic RR Lyrae catalog · Astropy 8.0.2 Lomb–Scargle documentation

## Remove observations and recalibrate

Now keep every third selected row, including its original uncertainty. Only nine measured points remain. Keep the same declared frequency grid, but build a new Gaussian-null calibration at these nine actual times. Reusing the full-data threshold would give the wrong reference distribution.

The sparse sample’s maximum power increases to 0.899168 at a grid period of 0.638477 days. Yet its Gaussian-null rank is 0.2060. Its five-percent threshold is 0.943579, compared with 0.545894 for the full sample. A visually taller peak is much less unusual when a sinusoid has only nine points to match.

The held-out false-alarm fractions are 4.39 percent for the full sample and 4.49 percent for the sparse one. These rates check a nominal five-percent target under the independent-Gaussian model. A survey with red noise needs its own calibration.

Reading: VanderPlas, Understanding the Lomb–Scargle Periodogram, arXiv v1 · Astropy 8.0.2 Lomb–Scargle documentation

## Inject signals to measure period recovery

The replay next creates 128 explicitly synthetic sine signals in magnitudes with semi-amplitude 0.1 mag, independent random phases and frequencies from 0.3 to 4.8 cycles per day. It adds new noise using the measured error sizes at the actual times. These arrays are not additional measurements of the OGLE star.

For each injection, run the same full-grid search. A detection crosses that schedule’s five-percent null threshold. A correct-frequency recovery must also fall within one inverse baseline of its injected frequency. The full sample detects 112 signals: 36 recover the declared neighborhood, 76 choose aliases and sixteen miss threshold. The sparse sample detects twelve, all assigned to aliases, and misses 116.

A low noise false-alarm rate therefore does not ensure a low alias-error rate. Detection, correct-period recovery and missed-signal fractions should accompany any completeness claim, with the tested amplitude and frequency distribution stated.

Reading: VanderPlas, Understanding the Lomb–Scargle Periodogram, arXiv v1 · Astropy 8.0.2 Lomb–Scargle documentation

## Keep the version and the limits with the result

The data are publicly available and the OGLE README requests the relevant collaboration papers be cited. We preserve the source, README, catalog row and retrieval metadata; no broader Creative Commons license is asserted. The README’s acknowledgement wording mentions Galactic bulge inside the LMC directory, so we cite the LMC catalog and its appropriate update.

To repeat this on another source, freeze its measured values and errors, define the time convention and selection, inspect its window, save the exact frequency grid, calibrate the entire search at those times, then inject a declared signal family. A period result becomes easier to assess when the same file contains both its successes and its aliases.

Reading: OGLE-IV LMC RR Lyrae official data README · Soszyński et al., OGLE Magellanic RR Lyrae catalog · VanderPlas, Understanding the Lomb–Scargle Periodogram, arXiv v1

## Try the prediction

### [Connect a controlled alias to an observed search](https://sandboxphysics.com/labs/observing-cadence-aliases/)

1. Reproduce the once-nightly synthetic alias, then spread visits and compare the window. Use the known source to distinguish period error from non-detection.
2. Run the OGLE replay unchanged. Explain why nine points produce a taller peak but a larger full-search false-alarm rank.

[Previous: Fit a period and measure the risk of a false peak](https://sandboxphysics.com/stories/observing-cadence/period-search/) [Next: Follow an alert from first exposure to the next telescope](https://sandboxphysics.com/stories/observing-cadence/alert-followup/)

Save these files together. The offline scripts need Python 3.10 or newer and NumPy 2.0.2, the version used here.

- [Observed-light-curve replay](https://sandboxphysics.com/stories/observing-cadence/downloads/replay-ogle.py)
- [403 original OGLE measurements](https://sandboxphysics.com/stories/observing-cadence/downloads/ogle-lmc-rrlyr-00001.dat)
- [Original OGLE README](https://sandboxphysics.com/stories/observing-cadence/downloads/ogle-readme.txt)
- [Catalog row](https://sandboxphysics.com/stories/observing-cadence/downloads/ogle-catalog-row.txt)
- [Source, units and hashes](https://sandboxphysics.com/stories/observing-cadence/downloads/ogle-provenance.json)
- [Frozen observed replay output](https://sandboxphysics.com/stories/observing-cadence/downloads/ogle-replay.json)
- [Independent synthetic-exposure reanalysis](https://sandboxphysics.com/stories/observing-cadence/downloads/replay-synthetic.py)
- [Saved synthetic exposures](https://sandboxphysics.com/stories/observing-cadence/downloads/synthetic-results.json)
- [Frozen independent reanalysis output](https://sandboxphysics.com/stories/observing-cadence/downloads/synthetic-replay.json)
- [Offline instructions](https://sandboxphysics.com/stories/observing-cadence/downloads/README.md)

## Sources and calculation scope

1. [VanderPlas, Understanding the Lomb–Scargle Periodogram, arXiv v1](https://arxiv.org/pdf/1703.09824v1)

   28 March 2017; Sections 3.2/4.2 and Figures 7–14 for windows and aliases; Sections 6.1–6.2 for weighted floating mean; Section 7.1 and 7.4.2/Figure 26 for grid and FAP. Published journal counterpart: ApJS 236,16 (2018). This guide pins the arXiv version.

2. [Zechmeister & Kürster, generalized Lomb–Scargle, arXiv v1](https://arxiv.org/html/0901.2573v1)

   16 January 2009, Section 2 equations 4–18 and Appendix A.1: weighted sine/cosine/offset normal equations and normalized chi-square reduction. The replay uses orthogonal projections as an independent numerical formulation.

3. [Astropy 8.0.2 Lomb–Scargle documentation](https://docs.astropy.org/en/stable/timeseries/lombscargle.html)

   Consulted 28 October 2026; page updated 15 October 2026. Additional Arguments, standard normalization, peak significance and RR Lyrae example. Default floating mean, same-times/same-grid FAP, and no general average-Nyquist cutoff for irregular data.

4. [OGLE-IV LMC RR Lyrae official data README](https://www.astrouw.edu.pl/ogle/ogle4/OCVS/lmc/rrlyr/README)

   Column definitions for HJD minus 2450000, I-band magnitude and uncertainty; public-data citation requirement. Frozen per-object file OGLE-LMC-RRLYR-00001.dat and catalog row are retained with SHA-256 and HTTP metadata.

5. [Soszyński et al., OGLE Magellanic RR Lyrae catalog](https://arxiv.org/abs/1606.02727v2)

   Version 2,14 July 2016; Acta Astronomica 66,131. Catalog attribution and data context; exact tutorial values come from the archived measured file and the selected RRab catalog row, not a generated curve.
