Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/deta.yml

This file was deleted.

96 changes: 0 additions & 96 deletions .github/workflows/nextjs.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .gitignore

This file was deleted.

Empty file removed .gitkeep
Empty file.
1 change: 0 additions & 1 deletion .vercelignore

This file was deleted.

6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

40 changes: 40 additions & 0 deletions App.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from flask import Flask, request, jsonify
import lightkurve as lk
import logging
import numpy as np

app = Flask(__name__)

@app.route('/lightcurve/summary', methods=['POST'])
def get_lightcurve_summary():

try:
request_data = request.get_json()
if not request_data or 'tic_id' not in request_data:
return jsonify({'error': 'Missing required field "tic_id"'}), 400

tic_id = request_data['tic_id']
if not tic_id.startswith("TIC "):
return jsonify({'error': 'Invalid TIC ID format'}), 400

lightcurve_data = lk.search_lightcurve(tic_id).download()
if lightcurve_data is None:
return jsonify({'error': 'No light curve found'}), 404

flux_values = lightcurve_data.flux.value
statistics_summary = {
'mean': float(np.mean(flux_values)),
'median': float(np.median(flux_values)),
'standard_deviation': float(np.std(flux_values)),
'peak_to_peak': float(np.ptp(flux_values)),
'interquartile_range': float(np.percentile(flux_values, 75) - np.percentile(flux_values, 25)),
}

return jsonify(statistics_summary)

except Exception as e:
logging.error(f"Error processing request: {str(e)}")
return jsonify({'error': str(e)}), 500

if __name__ == '__main__':
app.run(debug=True)
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Lightcurve Summary API

This Flask application provides an API endpoint to fetch and summarize light curve data for a given TIC ID from the TESS (Transiting Exoplanet Survey Satellite) data using the `lightkurve` Python library.

## Features

- Fetch light curve data using a TIC ID.
- Calculate statistical summaries of the light curve data including mean, median, standard deviation, peak-to-peak, and interquartile range.

## Requirements

- Flask
- lightkurve
- numpy

## Installation

Clone the repository and install the required packages:





7 changes: 0 additions & 7 deletions Spacefile

This file was deleted.

12 changes: 0 additions & 12 deletions capacitor.config.ts

This file was deleted.

11 changes: 0 additions & 11 deletions components/Avatar.tsx

This file was deleted.

Loading