diff --git a/monitor/monitor/utils.py b/monitor/monitor/utils.py index 70ee51f..9641216 100644 --- a/monitor/monitor/utils.py +++ b/monitor/monitor/utils.py @@ -25,6 +25,7 @@ def polynomial_func(x, *coefficients): """General polynomial function""" return sum(coef * x**i for i, coef in enumerate(coefficients)) +# KF version def detect_outbursts_threshold(times, fluxes, threshold=2.0, min_duration=3): """ Detect outbursts using a threshold-based approach. @@ -74,6 +75,7 @@ def detect_outbursts_threshold(times, fluxes, threshold=2.0, min_duration=3): return outburst_intervals, median_flux,mad +# RK version def detect_outbursts(times, fluxes, threshold=2.0, min_duration=3): """ Detect outbursts using a threshold-based approach. @@ -162,6 +164,7 @@ def decimal_year_to_date(decimal_year): def save_tex_table(outbursts, output=None): fmt="%d %b %H:%M" with open(output, 'w') as file: + counter=1 for start, end, peak, peak_flux in outbursts: date_start = decimal_year_to_date(start) date_end = decimal_year_to_date(end) @@ -170,4 +173,5 @@ def save_tex_table(outbursts, output=None): print_start = date_start.strftime(fmt) print_end = date_end.strftime(fmt) print_peak = date_peak.strftime(fmt) - file.write(f'{print_year} & {print_start} & {print_peak} & {peak_flux:.2f} & {print_end} \\\\\n') + file.write(f'{counter} & {print_year} & {print_start} & {print_peak} & {peak_flux:.2f} & {print_end} \\\\\n') + counter+=1 diff --git a/scripts/README.md b/scripts/README.md index a88ee02..77daa9e 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,5 +1,5 @@ -### 01_download.py +### 01_download.py (not working at this time, waiting for Anna to make link on the website) Скачивает файл с сайта монитора и помещает его в ```/data/default.csv```