Skip to content

Commit fd16125

Browse files
committed
- Replaced percentile with nanpercentile to handle NaN values in residuals calculation.
- Added a `CHANGELOG.md` to document changes, adhering to semantic versioning.
1 parent a3da787 commit fd16125

File tree

2 files changed

+41
-7
lines changed

2 files changed

+41
-7
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Changelog
2+
3+
All notable changes to ExoIris will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
### Changed
13+
14+
### Removed
15+
16+
## [0.16.0] - 2025-02-17
17+
18+
### Added
19+
- **New Data Mask:** Introduced a general `mask` attribute in the `TSData` class to automatically flag valid data points (based on finite fluxes and errors).
20+
- **Uncertainty Estimation:** Added the `estimate_average_uncertainties` method in `TSData` to compute per-wavelength uncertainties using first differences.
21+
- **White Light Curve Processing:** Updated the `WhiteLPF` class to use `nanmean` and `isfinite` checks when computing the white light curve, ensuring only valid flux values are averaged.
22+
23+
### Changed
24+
- **Transit Mask Renaming:** Renamed the old `ootmask` attribute to `transit_mask` throughout the codebase for clarity. This change affects plotting, normalization, binning, and file I/O.
25+
- **Method Renaming:** Renamed `calculate_ootmask` in the `TSDataSet` class to `mask_transit` to reflect the updated naming convention.
26+
- **Normalization Enhancements:** Updated normalization methods (`normalize_to_poly` and `normalize_to_median`) to utilize the new `transit_mask` and `mask` attributes, improving the reliability of baseline fits.
27+
- **Cropping Flexibility:** Added an `inplace` parameter to both `crop_wavelength` and `crop_time` methods, allowing users to choose between modifying the existing data or returning a new cropped instance.
28+
- **Likelihood Function Update:** Modified the `lnlike_normal` function in `TSLPF` to accept an additional `mask` parameter and process only valid data points during likelihood calculations.
29+
- **Outlier Handling:** Refined the `remove_outliers` method to flag outliers by setting affected fluxes and errors to NaN, rather than replacing them with median-filtered values.
30+
31+
### Removed
32+
- **Removed Deprecated Method: `calculate_ootmask`**
33+
This method (deprecated since v0.9) has been removed in favor of the new transit masking functionality.
34+
- **Removed Deprecated Method: `normalize_baseline`**
35+
The `normalize_baseline` method (deprecated since v0.9) has been removed; users should now use `normalize_to_poly`.
36+
- **Removed Deprecated Method: `normalize_median`**
37+
The deprecated `normalize_median` method has been removed. Its functionality is now available via `normalize_to_median`.
38+
- **Removed Deprecated Method: `split_time`**
39+
The `split_time` method, deprecated since v0.9, has been removed. Use `partition_time` instead.

exoiris/exoiris.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from emcee import EnsembleSampler
3434
from matplotlib.pyplot import subplots, setp, figure, Figure, Axes
3535
from numpy import (where, sqrt, clip, percentile, median, squeeze, floor, ndarray,
36-
array, inf, newaxis, arange, tile, sort, argsort, concatenate, full, nan, r_)
36+
array, inf, newaxis, arange, tile, sort, argsort, concatenate, full, nan, r_, nanpercentile)
3737
from numpy.random import normal, permutation
3838
from pytransit import UniformPrior, NormalPrior
3939
from pytransit.orbits import epoch
@@ -912,17 +912,12 @@ def plot_residuals(self, result: Optional[str] = None, ax: None | Axes | Sequenc
912912
for ids, data in enumerate(self.data):
913913
ax = axs[ids]
914914
residuals = data.fluxes - squeeze(fmodel[ids])
915-
pp = percentile(residuals, [pmin, pmax])
915+
pp = nanpercentile(residuals, [pmin, pmax])
916916
data.plot(ax=ax, data=residuals, vmin=pp[0], vmax=pp[1], cmap=cmap)
917917

918918
tc = pv[1] + pv[2]*epoch(data.time.mean(), pv[1], pv[2])
919919
td = self.transit_duration
920920

921-
#for i in range(2):
922-
# ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='w', ymax=0.05, lw=5)
923-
# ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='w', ymin=0.95, lw=5)
924-
# ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='k', ymax=0.05, lw=1)
925-
# ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='k', ymin=0.95, lw=1)
926921
if not show_names:
927922
ax.set_title("")
928923

0 commit comments

Comments
 (0)