This commit is contained in:
2025-10-09 18:22:56 +03:00
parent fb6385d723
commit 97e1eac665
2 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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```