From 53333d7f9c07cc771a6ebd500acc176172ef9557 Mon Sep 17 00:00:00 2001 From: Jackie Date: Tue, 10 Sep 2024 12:32:01 -0700 Subject: [PATCH] Remove egg_info file, old gitignore file, build directory, and dist directory from repo. --- build/lib/eclipsebin/__init__.py | 5 - build/lib/eclipsebin/binning.py | 347 ------------------ build/lib/tests/__init__.py | 0 .../lib/tests/test_eclipsing_binary_binner.py | 300 --------------- dist/eclipsebin-0.1.0-py3-none-any.whl | Bin 8296 -> 0 bytes dist/eclipsebin-0.1.0.tar.gz | Bin 7580 -> 0 bytes eclipsebin.egg-info/PKG-INFO | 78 ---- eclipsebin.egg-info/SOURCES.txt | 12 - eclipsebin.egg-info/dependency_links.txt | 1 - eclipsebin.egg-info/requires.txt | 4 - eclipsebin.egg-info/top_level.txt | 2 - tests/.gitignore | 60 --- 12 files changed, 809 deletions(-) delete mode 100644 build/lib/eclipsebin/__init__.py delete mode 100644 build/lib/eclipsebin/binning.py delete mode 100644 build/lib/tests/__init__.py delete mode 100644 build/lib/tests/test_eclipsing_binary_binner.py delete mode 100644 dist/eclipsebin-0.1.0-py3-none-any.whl delete mode 100644 dist/eclipsebin-0.1.0.tar.gz delete mode 100644 eclipsebin.egg-info/PKG-INFO delete mode 100644 eclipsebin.egg-info/SOURCES.txt delete mode 100644 eclipsebin.egg-info/dependency_links.txt delete mode 100644 eclipsebin.egg-info/requires.txt delete mode 100644 eclipsebin.egg-info/top_level.txt delete mode 100644 tests/.gitignore diff --git a/build/lib/eclipsebin/__init__.py b/build/lib/eclipsebin/__init__.py deleted file mode 100644 index 6fd7836..0000000 --- a/build/lib/eclipsebin/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -This module initializes the Eclipsing Binary Binner. -""" - -from .binning import EclipsingBinaryBinner diff --git a/build/lib/eclipsebin/binning.py b/build/lib/eclipsebin/binning.py deleted file mode 100644 index bf2222d..0000000 --- a/build/lib/eclipsebin/binning.py +++ /dev/null @@ -1,347 +0,0 @@ -""" -This module contains the EclipsingBinaryBinner class, which performs non-uniform binning -of eclipsing binary star light curves. -""" - -import numpy as np -import pandas as pd -from scipy import stats -import matplotlib.pyplot as plt - - -class EclipsingBinaryBinner: - """ - A class to perform non-uniform binning of eclipsing binary star light curves. - - This class identifies primary and secondary eclipses within the light curve - and allocates bins to better capture these eclipse events, while also binning - the out-of-eclipse regions. - - Attributes: - data (dict): Dictionary containing the light curve data. - params (dict): Dictionary containing the binning parameters. - primary_eclipse_min_phase (float): Phase value of the primary eclipse minimum. - secondary_eclipse_min_phase (float): Phase value of the secondary eclipse minimum. - primary_eclipse (tuple): Start and end phase values of the primary eclipse. - secondary_eclipse (tuple): Start and end phase values of the secondary eclipse. - """ - - def __init__(self, phases, fluxes, flux_errors, nbins=200, fraction_in_eclipse=0.2): - """ - Initializes the EclipsingBinaryBinner with the given light curve data and parameters. - - Args: - phases (np.ndarray): Array of phase values. - fluxes (np.ndarray): Array of flux values. - flux_errors (np.ndarray): Array of flux errors. - nbins (int, optional): Number of bins to use. Defaults to 200. - fraction_in_eclipse (float, optional): Fraction of bins within eclipses. - Defaults to 0.2. - - Raises: - ValueError: If the number of data points is less than 10, or if the number of bins - is less than 10, or if the number of data points is less than the number of bins. - """ - if len(phases) < 10: - raise ValueError("Number of data points must be at least 10.") - if nbins < 10: - raise ValueError("Number of bins must be at least 10.") - if len(phases) < nbins: - raise ValueError( - "Number of data points must be greater than or equal to the number of bins." - ) - sort_idx = np.argsort(phases) - self.data = {"phases": phases[sort_idx], "fluxes": fluxes[sort_idx], "flux_errors": flux_errors[sort_idx]} - self.params = {"nbins": nbins, "fraction_in_eclipse": fraction_in_eclipse} - - # Identify primary and secondary eclipse minima - self.primary_eclipse_min_phase = self.find_minimum_flux() - self.secondary_eclipse_min_phase = self.find_secondary_minimum() - - # Determine start and end of each eclipse - self.primary_eclipse = self.get_eclipse_boundaries( - self.primary_eclipse_min_phase - ) - self.secondary_eclipse = self.get_eclipse_boundaries( - self.secondary_eclipse_min_phase - ) - - def find_minimum_flux(self): - """ - Finds the phase of the minimum flux, corresponding to the primary eclipse. - - Returns: - float: Phase value of the primary eclipse minimum. - """ - idx_min = np.argmin(self.data["fluxes"]) - return self.data["phases"][idx_min] - - def find_secondary_minimum(self): - """ - Finds the phase of the secondary eclipse by identifying the minimum flux - at least 0.2 phase units away from the primary eclipse. - - Returns: - float: Phase value of the secondary eclipse minimum. - """ - mask = np.abs(self.data["phases"] - self.primary_eclipse_min_phase) > 0.2 - idx_secondary_min = np.argmin(self.data["fluxes"][mask]) - return self.data["phases"][mask][idx_secondary_min] - - def get_eclipse_boundaries(self, eclipse_min_phase): - """ - Finds the start and end phase of an eclipse based on the minimum flux. - - Args: - eclipse_min_phase (float): Phase of the minimum flux. - - Returns: - tuple: Start and end phases of the eclipse. - """ - start_idx, end_idx = self._find_eclipse_boundaries(eclipse_min_phase) - return (self.data["phases"][start_idx], self.data["phases"][end_idx]) - - def _find_eclipse_boundaries(self, eclipse_min_phase): - """ - Determines the start and end indices of an eclipse. - - Args: - eclipse_min_phase (float): Phase of the minimum flux. - - Returns: - tuple: Indices of the start and end of the eclipse. - """ - start_idx = self._find_eclipse_boundary(eclipse_min_phase, direction="start") - end_idx = self._find_eclipse_boundary(eclipse_min_phase, direction="end") - return start_idx, end_idx - - def _find_eclipse_boundary(self, eclipse_min_phase, direction): - """ - Finds the boundary index of an eclipse either before (start) or after (end) - the minimum flux. - - Args: - eclipse_min_phase (float): Phase of the minimum flux. - direction (str): Direction to search ('start' or 'end'). - - Returns: - int: Index of the boundary point. - """ - if direction == "start": - mask = self.data["phases"] < eclipse_min_phase - else: # direction == 'end' - mask = self.data["phases"] > eclipse_min_phase - - idx_boundary = np.where(mask & np.isclose(self.data["fluxes"], 1.0, atol=0.01))[ - 0 - ] - - if len(idx_boundary) == 0: - # If no boundary found, use the closest point to 1.0 flux - if direction == "start": - return np.where(np.isclose(self.data["fluxes"], 1.0, atol=0.01))[0][-1] - return np.where(np.isclose(self.data["fluxes"], 1.0, atol=0.01))[0][0] - # Return the last or first index depending on direction - return idx_boundary[-1] if direction == "start" else idx_boundary[0] - - def find_bin_edges(self): - """ - Finds the bin edges within the light curve. - """ - bins_in_primary = int( - (self.params["nbins"] * self.params["fraction_in_eclipse"]) / 2 - ) - bins_in_secondary = int( - (self.params["nbins"] * self.params["fraction_in_eclipse"]) - - bins_in_primary - ) - - primary_bin_edges = self.calculate_eclipse_bins( - self.primary_eclipse, bins_in_primary - ) - secondary_bin_edges = self.calculate_eclipse_bins( - self.secondary_eclipse, bins_in_secondary - ) - - ooe1_bins, ooe2_bins = self.calculate_out_of_eclipse_bins( - bins_in_primary, bins_in_secondary - ) - - all_bins = np.sort( - np.concatenate( - (primary_bin_edges, secondary_bin_edges, ooe1_bins, ooe2_bins) - ) - ) - return all_bins - - def calculate_bins(self): - """ - Calculates the bin centers, means, and standard deviations for the binned light curve. - - Returns: - tuple: Arrays of bin centers, bin means, bin standard deviations, bin numbers, - and bin edges. - """ - all_bins = self.find_bin_edges() - bin_means, bin_edges, bin_number = stats.binned_statistic( - self.data["phases"], self.data["fluxes"], statistic="mean", bins=all_bins - ) - bin_centers = (bin_edges[1:] - bin_edges[:-1]) / 2 + bin_edges[:-1] - bin_stds, _, bin_number = stats.binned_statistic( - self.data["phases"], self.data["fluxes"], statistic="std", bins=all_bins - ) - - return bin_centers, bin_means, bin_stds, bin_number, bin_edges - - def calculate_eclipse_bins(self, eclipse_boundaries, bins_in_eclipse): - """ - Calculates bin edges within an eclipse. - - Args: - eclipse_boundaries (tuple): Start and end phases of the eclipse. - bins_in_eclipse (int): Number of bins within the eclipse. - - Returns: - np.ndarray: Array of bin edges within the eclipse. - """ - start_idx, end_idx = np.searchsorted(self.data["phases"], eclipse_boundaries) - eclipse_phases = ( - np.concatenate( - ( - self.data["phases"][start_idx:], - self.data["phases"][: end_idx + 1] + 1, - ) - ) - if end_idx < start_idx - else self.data["phases"][start_idx : end_idx + 1] - ) - bins = pd.qcut(eclipse_phases, q=bins_in_eclipse) - return np.array([interval.right for interval in np.unique(bins)])%1 - - def calculate_out_of_eclipse_bins(self, bins_in_primary, bins_in_secondary): - """ - Calculates bin edges for out-of-eclipse regions. - - Args: - bins_in_primary (int): Number of bins in the primary eclipse. - bins_in_secondary (int): Number of bins in the secondary eclipse. - - Returns: - tuple: Arrays of bin edges for the two out-of-eclipse regions. - """ - bins_in_ooe1 = int( - (self.params["nbins"] - bins_in_primary - bins_in_secondary) / 2 - ) - bins_in_ooe2 = ( - self.params["nbins"] - bins_in_primary - bins_in_secondary - bins_in_ooe1 - ) - - # Calculate bin edges between end of secondary eclipse and start of primary eclipse - end_idx_secondary_eclipse = np.searchsorted( - self.data["phases"], self.secondary_eclipse[1] - ) - start_idx_primary_eclipse = np.searchsorted( - self.data["phases"], self.primary_eclipse[0] - ) - ooe1_phases = ( - np.concatenate( - ( - self.data["phases"][end_idx_secondary_eclipse:], - self.data["phases"][: start_idx_primary_eclipse + 1] + 1, - ) - ) - if end_idx_secondary_eclipse > start_idx_primary_eclipse - else self.data["phases"][ - end_idx_secondary_eclipse : start_idx_primary_eclipse + 1 - ] - ) - ooe1_bins = pd.qcut(ooe1_phases, q=bins_in_ooe1) - ooe1_edges = np.array([interval.right for interval in np.unique(ooe1_bins)])%1 - - # Calculate bin edges between end of primary eclipse and start of secondary eclipse - end_idx_primary_eclipse = np.searchsorted( - self.data["phases"], self.primary_eclipse[1] - ) - start_idx_secondary_eclipse = np.searchsorted( - self.data["phases"], self.secondary_eclipse[0] - ) - ooe2_phases = ( - np.concatenate( - ( - self.data["phases"][end_idx_primary_eclipse:], - self.data["phases"][: start_idx_secondary_eclipse + 1] + 1, - ) - ) - if end_idx_primary_eclipse > start_idx_secondary_eclipse - else self.data["phases"][ - end_idx_primary_eclipse : start_idx_secondary_eclipse + 1 - ] - ) - ooe2_bins = pd.qcut(ooe2_phases, q=bins_in_ooe2) - ooe2_edges = np.array([interval.right for interval in np.unique(ooe2_bins)])%1 - - return ooe1_edges, ooe2_edges - - def plot_binned_light_curve(self, bin_centers, bin_means, bin_stds, bin_edges): - """ - Plots the binned light curve and the bin edges. - - Args: - bin_centers (np.ndarray): Array of bin centers. - bin_means (np.ndarray): Array of bin means. - bin_stds (np.ndarray): Array of bin standard deviations. - bin_edges (np.ndarray): Array of bin edges. - """ - plt.figure(figsize=(20, 5)) - plt.title("Binned Light Curve") - plt.errorbar(bin_centers, bin_means, yerr = bin_stds, linestyle = "none", marker='.') - plt.xlabel("Phases", fontsize = 10) - plt.ylabel("Magnitude", fontsize = 10) - plt.xlim(0,1) - ylims = plt.ylim() - plt.vlines( - self.primary_eclipse, ymin=ylims[0], ymax=ylims[1], linestyle="--", color="red", label = "Primary Eclipse" - ) - plt.vlines( - self.secondary_eclipse, ymin=ylims[0], ymax=ylims[1], linestyle="--", color="blue", label = "Secondary Eclipse" - ) - plt.ylim(ylims) - plt.legend() - plt.show() - - def plot_unbinned_light_curve(self): - """ - Plots the unbinned light curve with the calculated eclipse minima and bin edges. - """ - plt.figure(figsize=(20, 5)) - plt.title("Unbinned Light Curve") - plt.scatter(self.data["phases"], self.data["fluxes"], s=3) - ylims = plt.ylim() - plt.vlines( - self.primary_eclipse, ymin=ylims[0], ymax=ylims[1], linestyle="--", color="red", label = "Primary Eclipse" - ) - plt.vlines( - self.secondary_eclipse, ymin=ylims[0], ymax=ylims[1], linestyle="--", color="blue", label = "Secondary Eclipse" - ) - plt.ylim(ylims) - plt.legend() - plt.show() - - def bin_light_curve(self, plot=True): - """ - Bins the light curve data and optionally plots the results. - - Args: - plot (bool, optional): Whether to plot the binned and unbinned light curves. - Defaults to True. - - Returns: - tuple: Arrays of bin centers, bin means, and bin standard deviations. - """ - bin_centers, bin_means, bin_stds, _, bin_edges = self.calculate_bins() - - if plot: - self.plot_unbinned_light_curve() - self.plot_binned_light_curve(bin_centers, bin_means, bin_stds, bin_edges) - - return bin_centers, bin_means, bin_stds diff --git a/build/lib/tests/__init__.py b/build/lib/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/build/lib/tests/test_eclipsing_binary_binner.py b/build/lib/tests/test_eclipsing_binary_binner.py deleted file mode 100644 index 55a6de6..0000000 --- a/build/lib/tests/test_eclipsing_binary_binner.py +++ /dev/null @@ -1,300 +0,0 @@ -""" -Unit tests for the EclipsingBinaryBinner class from the eclipsebin module. -""" - -# pylint: disable=redefined-outer-name - -import numpy as np -import pytest -import matplotlib -from eclipsebin import EclipsingBinaryBinner - -matplotlib.use("Agg") - - -@pytest.fixture -def wrapped_light_curve(): - """ - Fixture to set up a wrapped eclipsing binary light curve. - """ - phases = np.linspace(0, 1, 100) - fluxes = np.ones_like(phases) - fluxes[45:55] = 0.9 # Simulate primary eclipse - fluxes[0:3] = 0.95 # Simulate secondary eclipse - fluxes[97:100] = 0.95 # Wrap secondary eclipse - flux_errors = np.random.normal(0.01, 0.001, 100) - return phases, fluxes, flux_errors - - -@pytest.fixture -def unwrapped_light_curve(): - """ - Fixture to set up an unwrapped eclipsing binary light curve. - """ - phases = np.linspace(0, 1, 100) - fluxes = np.ones_like(phases) - fluxes[65:75] = 0.9 # Simulate primary eclipse - fluxes[20:30] = 0.95 # Simulate secondary eclipse - flux_errors = np.random.normal(0.01, 0.001, 100) - return phases, fluxes, flux_errors - - -def test_initialization(wrapped_light_curve): - """ - Test the initialization of EclipsingBinaryBinner with valid data. - """ - phases, fluxes, flux_errors = wrapped_light_curve - binner = EclipsingBinaryBinner( - phases, fluxes, flux_errors, nbins=50, fraction_in_eclipse=0.3 - ) - assert binner.params["nbins"] == 50 - assert binner.params["fraction_in_eclipse"] == 0.3 - assert len(binner.data["phases"]) == 100 - assert len(binner.data["fluxes"]) == 100 - assert len(binner.data["flux_errors"]) == 100 - # Check if the data is sorted - assert np.all(np.diff(binner.data["phases"]) >= 0) - - -def test_initialization_invalid_data(unwrapped_light_curve): - """ - Test that EclipsingBinaryBinner raises ValueError with invalid data. - """ - phases, fluxes, flux_errors = unwrapped_light_curve - - # Fewer than 10 data points - phases_invalid = np.linspace(0, 1, 9) - fluxes_invalid = np.random.normal(1, 0.01, 9) - flux_errors_invalid = np.random.normal(0.01, 0.001, 9) - - with pytest.raises(ValueError, match="Number of data points must be at least 10."): - EclipsingBinaryBinner( - phases_invalid, fluxes_invalid, flux_errors_invalid, nbins=10 - ) - - # Fewer than 10 bins - with pytest.raises(ValueError, match="Number of bins must be at least 10."): - EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=9) - - # Data points fewer than bins - with pytest.raises( - ValueError, - match="Number of data points must be greater than or equal to the number of bins.", - ): - EclipsingBinaryBinner(phases[:50], fluxes[:50], flux_errors[:50], nbins=60) - - -def test_eclipse_detection(wrapped_light_curve, unwrapped_light_curve): - """ - Test the eclipse detection capabilities of EclipsingBinaryBinner. - """ - # Test wrapped light curve - phases, fluxes, flux_errors = wrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - primary_min = binner.find_minimum_flux() - assert np.isclose(primary_min, 0.45, atol=0.05) - primary_eclipse = binner.get_eclipse_boundaries(primary_min) - assert primary_eclipse[0] < primary_min < primary_eclipse[1] - - # Test unwrapped light curve - phases_unwrapped, fluxes_unwrapped, flux_errors_unwrapped = ( - unwrapped_light_curve - ) - binner_unwrapped = EclipsingBinaryBinner( - phases_unwrapped, fluxes_unwrapped, flux_errors_unwrapped, nbins=50 - ) - primary_min_unwrapped = binner_unwrapped.find_minimum_flux() - assert np.isclose(primary_min_unwrapped, 0.65, atol=0.05) - primary_eclipse_unwrapped = binner_unwrapped.get_eclipse_boundaries( - primary_min_unwrapped - ) - assert ( - primary_eclipse_unwrapped[0] - < primary_min_unwrapped - < primary_eclipse_unwrapped[1] - ) - - -def test_calculate_eclipse_bins(wrapped_light_curve, unwrapped_light_curve): - """ - Test the calculate_eclipse_bins method - """ - # Test the wrapped light curve - phases, fluxes, flux_errors = wrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - bins_in_primary = int( - (binner.params["nbins"] * binner.params["fraction_in_eclipse"]) / 2 - ) - bins_in_secondary = int( - (binner.params["nbins"] * binner.params["fraction_in_eclipse"]) - - bins_in_primary - ) - - primary_bin_right_edges = binner.calculate_eclipse_bins( - binner.primary_eclipse, bins_in_primary - ) - secondary_bin_right_edges = binner.calculate_eclipse_bins( - binner.secondary_eclipse, bins_in_secondary - ) - - # Check if the number of bin edges are as expected - assert len(primary_bin_right_edges) == bins_in_primary - assert len(secondary_bin_right_edges) == bins_in_secondary - - # Check if the bin edges are unique - assert len(np.unique(primary_bin_right_edges)) == bins_in_primary - assert len(np.unique(secondary_bin_right_edges)) == bins_in_secondary - - # Test the unwrapped light curve - phases, fluxes, flux_errors = unwrapped_light_curve - binner_unwrapped = EclipsingBinaryBinner( - phases, fluxes, flux_errors, nbins=50 - ) - bins_in_primary_unwrapped = int( - ( - binner_unwrapped.params["nbins"] - * binner_unwrapped.params["fraction_in_eclipse"] - ) - / 2 - ) - bins_in_secondary_unwrapped = int( - ( - binner_unwrapped.params["nbins"] - * binner_unwrapped.params["fraction_in_eclipse"] - ) - - bins_in_primary_unwrapped - ) - - primary_bin_right_edges_unwrapped = binner_unwrapped.calculate_eclipse_bins( - binner_unwrapped.primary_eclipse, bins_in_primary_unwrapped - ) - secondary_bin_right_edges_unwrapped = binner_unwrapped.calculate_eclipse_bins( - binner_unwrapped.secondary_eclipse, bins_in_secondary_unwrapped - ) - # Check if the number of bin edges are as expected - assert len(primary_bin_right_edges_unwrapped) == bins_in_primary_unwrapped - assert len(secondary_bin_right_edges_unwrapped) == bins_in_secondary_unwrapped - - # Check if the bin edges are unique - assert len(np.unique(primary_bin_right_edges_unwrapped)) == bins_in_primary_unwrapped - assert len(np.unique(secondary_bin_right_edges_unwrapped)) == bins_in_secondary_unwrapped - - -def test_calculate_out_of_eclipse_bins(wrapped_light_curve, unwrapped_light_curve): - """ - Test the calculate_out_of_eclipse_bins method - """ - # Test the wrapped light curve - phases, fluxes, flux_errors = wrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - bins_in_primary = int( - (binner.params["nbins"] * binner.params["fraction_in_eclipse"]) / 2 - ) - bins_in_secondary = int( - (binner.params["nbins"] * binner.params["fraction_in_eclipse"]) - - bins_in_primary - ) - bins_in_ooe1 = int( - (binner.params["nbins"] - bins_in_primary - bins_in_secondary) / 2 - ) - bins_in_ooe2 = ( - binner.params["nbins"] - bins_in_primary - bins_in_secondary - bins_in_ooe1 - ) - - ooe1_right_edges, ooe2_right_edges = binner.calculate_out_of_eclipse_bins( - bins_in_primary, bins_in_secondary - ) - assert len(ooe1_right_edges) == bins_in_ooe1 - assert len(ooe2_right_edges) == bins_in_ooe2 - - # Check if the bin edges are unique - assert len(np.unique(ooe1_right_edges)) == bins_in_ooe1 - assert len(np.unique(ooe2_right_edges)) == bins_in_ooe2 - - # Test the unwrapped light curve - phases, fluxes, flux_errors = unwrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - bins_in_primary = int( - (binner.params["nbins"] * binner.params["fraction_in_eclipse"]) / 2 - ) - bins_in_secondary = int( - (binner.params["nbins"] * binner.params["fraction_in_eclipse"]) - - bins_in_primary - ) - bins_in_ooe1 = int( - (binner.params["nbins"] - bins_in_primary - bins_in_secondary) / 2 - ) - bins_in_ooe2 = ( - binner.params["nbins"] - bins_in_primary - bins_in_secondary - bins_in_ooe1 - ) - - ooe1_right_edges, ooe2_right_edges = binner.calculate_out_of_eclipse_bins( - bins_in_primary, bins_in_secondary - ) - assert len(ooe1_right_edges) == bins_in_ooe1 - assert len(ooe2_right_edges) == bins_in_ooe2 - - # Check if the bin edges are unique - assert len(np.unique(ooe1_right_edges)) == bins_in_ooe1 - assert len(np.unique(ooe2_right_edges)) == bins_in_ooe2 - - -def test_find_bin_edges(wrapped_light_curve, unwrapped_light_curve): - """ - Test the find_bin_edges method - """ - # Test the wrapped light curve - phases, fluxes, flux_errors = wrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - all_bins = binner.find_bin_edges() - # Check if the bins are sorted - assert np.all(np.diff(all_bins) >= 0) - # Check if the number of bins is as expected - expected_bins_count = binner.params["nbins"] - assert len(all_bins) == expected_bins_count - # Check that all bin edges are different - assert len(np.unique(all_bins)) == len(all_bins) - - # Test the unwrapped light curve - phases, fluxes, flux_errors = unwrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - all_bins = binner.find_bin_edges() - # Check if the bins are sorted - assert np.all(np.diff(all_bins) >= 0) - # Check if the number of bins is as expected - expected_bins_count = binner.params["nbins"] - assert len(all_bins) == expected_bins_count - # Check that all bin edges are different - assert len(np.unique(all_bins)) == len(all_bins) - - -def test_bin_calculation(wrapped_light_curve, unwrapped_light_curve): - """ - Test the bin calculation capabilities of EclipsingBinaryBinner. - """ - # Test wrapped light curve - phases, fluxes, flux_errors = wrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - bin_centers, bin_means, bin_stds = binner.bin_light_curve(plot=False) - assert len(bin_centers) > 0 - assert len(bin_means) == len(bin_centers) - assert len(bin_stds) == len(bin_centers) - - # Test unwrapped light curve - phases, fluxes, flux_errors = unwrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - bin_centers, bin_means, bin_stds = binner.bin_light_curve(plot=False) - assert len(bin_centers) > 0 - assert len(bin_means) == len(bin_centers) - assert len(bin_stds) == len(bin_centers) - - -def test_plot_functions(wrapped_light_curve): - """ - Test the plotting capabilities of EclipsingBinaryBinner. - """ - phases, fluxes, flux_errors = wrapped_light_curve - binner = EclipsingBinaryBinner(phases, fluxes, flux_errors, nbins=50) - bin_centers, bin_means, bin_stds = binner.bin_light_curve(plot=True) - binner.plot_binned_light_curve(bin_centers, bin_means, bin_stds, bin_centers) - binner.plot_unbinned_light_curve() diff --git a/dist/eclipsebin-0.1.0-py3-none-any.whl b/dist/eclipsebin-0.1.0-py3-none-any.whl deleted file mode 100644 index 6fa33da35f20dbb8bc05b11afd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>@4*&q9m$UMvQWcW@ G@$^4~D914X diff --git a/dist/eclipsebin-0.1.0.tar.gz b/dist/eclipsebin-0.1.0.tar.gz deleted file mode 100644 index 1d52da7d9a7943f94c2e5d5194798bfac433a4f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7580 zcmai&Wl+=)^zP}96{MuQeuQ)`NJ@)zcXvoEEsbX<;XG5$&N%Jsq9;Efxqs+`@xZ8wsD5hUG16x-L3b&YgbR zKnAzXxxq>^1hg5MM{FH%bxlV0Oosm)gho#-LWK0XLc!Pg#z9MNlMBx{SE{+j{J=d zfam^!O+Zno=Qtq>KJO-8mNBYy4XD-uav*{6(9qXw8M0!fwC_vdpyL%8*2TA}?U9;0 zat%o5qO2t~hG}1om^g-b*glywyC3cMBaQ;xT)H{+lGoT8i4q)$Zpvwwl2?o^zd4Yu z&lEAwz^xuj5a(f5`gG!myJ1IiF;o6OTJ zSt)G}R zL%u{zVkF&B@i?5_jeVSA`@?E?=QwNxFXi*wO~tBg%EBOdaie{2fBG%*X}K%?;Su9e(5XwKw(CP5v6{J`N!*pK6g8zvcEDsrT`cBJTbi?WQC0eOa%Ff*J4o z%irTL`t4B6df^R&4;ANL@-y1&7GYpXx{NI;sh84s!9k*utT{1$x0baZw1<)dxtIh9 zb|j@G2X5nv`&jVD;2Cg|^z=iA^RjB^m`guj-|GeHcaq_9^k0UykXsMwszZp*9We?S zSy$w-pEQLG>qLlT1^BCm^cb~qP#WZpj`UWbqMl+xleRbV{oPuh(#c1251n7$nvt7@aXoXZU^mE=yYvFCS_w(%8p-3j2G3bZF*N9eBtBzC}! z210HPq8fOt>I#&hQ76P8e=ZVd;H=~3SNE-Ubt)PT1DL*`t24z~Sl#!X1z&#kTIG7t z=1Ol))T6DpBAC_rS}o-=sHHi2S2ka>Li?*h;BiExBY{-GTc)&q|EOFSW}8i=AVOt= zEV^S)QQ5J#K1xc6lFoAJ0kIg`eche+552u2%~J?>zvCB>2>Vlf#J8sC?+T#Y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 @@ -Metadata-Version: 2.1 -Name: eclipsebin -Version: 0.1.4 -Summary: A specialized binning scheme for eclipsing binary star light curves -Home-page: https://github.com/jackieblaum/eclipsebin -Author: Jackie Blaum -Author-email: jackie.blaum@example.com -Classifier: Programming Language :: Python :: 3 -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: OS Independent -Requires-Python: >=3.6 -Description-Content-Type: text/markdown -License-File: LICENSE - -## Binning Eclipsing Binary Star Light Curves - -![Build Status](https://github.com/jackieblaum/eclipsebin/actions/workflows/tests.yml/badge.svg) -![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg) -![Python Versions](https://img.shields.io/pypi/pyversions/eclipsebin) -![PyPI Version](https://img.shields.io/pypi/v/eclipsebin) -![Coverage](https://codecov.io/gh/jackieblaum/eclipsebin/branch/main/graph/badge.svg) - -![Binned Light Curve](docs/images/binning_comparison.jpg) - -### Overview - -This Python package provides a specialized binning scheme designed to more effectively capture the features of eclipsing binary star light curves. Unlike **traditional uniform binning (middle panel)**, which can dilute the crucial details of eclipses, this **non-uniform binning method (right panel)** prioritizes the accurate representation of eclipse events. - -### Key Features - -- **Eclipse-Focused Binning**: The binning algorithm identifies the eclipse phases and allocates up to half of the total bins to these critical periods. The remaining bins are distributed across the out-of-eclipse regions. - -- **Optimized Data Distribution**: Using the `pandas qcut` function, the package ensures that each bin within the eclipse and out-of-eclipse segments contains approximately the same number of data points, maintaining the integrity of the light curve's structure. - -- **Enhanced Accuracy**: By concentrating bins around the brief, narrow eclipse phases, the method improves the resolution of these events, which are essential for deriving accurate parameters of the binary system. - -### Why Use This Binning Scheme? - -Eclipses in binary star systems contain vital information about the system's properties, such as the relative sizes, masses, and orbital parameters of the stars. Standard uniform binning can obscure these details, especially when the eclipse duration is short relative to the orbital period. This package mitigates that issue by adaptively placing more bins where they matter most—during the eclipses—thereby preserving the fidelity of the light curve and improving the subsequent analysis. - -### How it Works -- **Eclipse Detection**: The package first identifies the primary and secondary eclipse phases. The primary eclipse is located by finding the minimum flux, and the secondary eclipse is located by finding the minimum flux at least 0.2 phase units away from the primary eclipse. - -- **Eclipse Boundaries**: The package defines the boundaries of the eclipses as the points where the flux returns to 1.0 flux units, or the closest point to 1.0 flux units if the flux does not return to 1.0. - -- **Bin Groups**: The package then groups the data into four segments: the two eclipse regions and the two out-of-eclipse regions. A specified fraction of the total number of bins is split between the eclipse regions, and the remaining bins are split evenly between the out-of-eclipse regions. - -- **Binning**: The package then uses the `pandas qcut` function within each group to bin the data into a specified number of bins. This function bins the data such that there are an approximately equal number of points within each bin for the given group. - -- **Plotting**: The package also provides a function to plot the binned and unbinned light curves, marking the eclipse boundaries with vertical lines. - -### Getting Started - -To start using the package, install it via pip: - -```bash -pip install eclipsebin -``` - -### Usage - -```bash -import eclipsebin as ebin - -# Example usage -binner = EclipsingBinaryBinner(phases, fluxes, fluxerrs, nbins=200, fraction_in_eclipse=0.2) -bin_centers, bin_means, bin_stds = binner.bin_light_curve(plot=True) -``` - -Refer to the [documentation](https://github.com/jackieblaum/eclipsebin/blob/main/docs/usage.md) for more detailed usage instructions and examples. - -### Contributing - -Contributions are welcome! Please refer to the [Contributing Guide](CONTRIBUTING.md) for guidelines on how to help improve this project. - -### License - -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. diff --git a/eclipsebin.egg-info/SOURCES.txt b/eclipsebin.egg-info/SOURCES.txt deleted file mode 100644 index d3e1102..0000000 --- a/eclipsebin.egg-info/SOURCES.txt +++ /dev/null @@ -1,12 +0,0 @@ -LICENSE -README.md -setup.py -eclipsebin/__init__.py -eclipsebin/binning.py -eclipsebin.egg-info/PKG-INFO -eclipsebin.egg-info/SOURCES.txt -eclipsebin.egg-info/dependency_links.txt -eclipsebin.egg-info/requires.txt -eclipsebin.egg-info/top_level.txt -tests/__init__.py -tests/test_eclipsing_binary_binner.py \ No newline at end of file diff --git a/eclipsebin.egg-info/dependency_links.txt b/eclipsebin.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/eclipsebin.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/eclipsebin.egg-info/requires.txt b/eclipsebin.egg-info/requires.txt deleted file mode 100644 index 439a27a..0000000 --- a/eclipsebin.egg-info/requires.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy -pandas -scipy -matplotlib diff --git a/eclipsebin.egg-info/top_level.txt b/eclipsebin.egg-info/top_level.txt deleted file mode 100644 index 885ed97..0000000 --- a/eclipsebin.egg-info/top_level.txt +++ /dev/null @@ -1,2 +0,0 @@ -eclipsebin -tests diff --git a/tests/.gitignore b/tests/.gitignore deleted file mode 100644 index cb4e296..0000000 --- a/tests/.gitignore +++ /dev/null @@ -1,60 +0,0 @@ -# Python artifacts -__pycache__/ -*.py[cod] -*$py.class -*.so - -# Virtual environments -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Distribution / packaging -build/ -dist/ -*.egg-info/ -.eggs/ -wheels/ - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.pytest_cache/ - -# Jupyter Notebook -.ipynb_checkpoints/ - -# Editor directories and files -.vscode/ -.idea/ -*.sublime-project -*.sublime-workspace - -# OS-specific files -.DS_Store -Thumbs.db -Desktop.ini - -# Logs -*.log - -# Secrets and configuration -.env -.env.* -secrets.json -config.json - -# Build directories -/build/ -/out/ - -# Pylint -pylint.log