Skip to content

Commit

Permalink
πŸ•πŸŒ΄ ↝ [SSG-64 SSG-78 SSG-94]: Merge pull request #62 from Signal-K/SSG-64
Browse files Browse the repository at this point in the history
πŸ™πŸ• ↝ [SSG-64 SSG-78 SSG-94]: Cloud & DMP Datasets
  • Loading branch information
Gizmotronn authored Jan 2, 2025
2 parents 8180814 + fdd6b3a commit 7988825
Show file tree
Hide file tree
Showing 77 changed files with 61 additions and 11 deletions.
2 changes: 1 addition & 1 deletion archive/data/exofop.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ο»ΏThis file was produced by the Exoplanet Follow-up Observing Program website (exofop.ipac.caltech.edu) on Mon Sep 16 02:06:29 2024

"TICID","TOI","CTOI","Master priority","SG1A priority","SG1B priority","SG2 priority","SG3 priority","SG4 priority","SG5 priority","ESM","TSM","Predicted Mass (M_Earth)","Time Series Observations","Spectroscopy Observations","Imaging Observations","TESS Disposition","TFOPWG Disposition","TESS mag","TESS mag error","Pipeline Signal ID","Source","Detection","RA (deg)","Dec (deg)","PM RA (mas/yr)","PM RA error","PM Dec (mas/yr)","PM Dec error","Transit Epoch (BJD)","Transit Epoch error","Period (days)","Period error","Duration (hours)","Duration error","Depth (mmag)","Depth (mmag) error","Depth (ppm)","Depth (ppm) error","Planet Radius (R_Earth)","Planet Radius error","Planet Insolation (Earth flux)","Planet Eq Temp (K)","Planet SNR","Stellar Distance (pc)","Stellar Distance error","Stellar Teff (K)","Stellar Teff error","Stellar log(g) (cm/s2)","Stellar log(g) error","Stellar Radius (R_Sun)","Stellar Radius error","Stellar Metallicity","Stellar Metallicity error","Stellar Mass (M_Sun)","Stellar Mass error","Sectors","Comments","Date TOI Alerted (by TESS Project)","Date TOI Updated (by TESS Project)","Date Modified (by ExoFOP-TESS)"
"231663901","101.01","","5","5","5","5","5","5","5","87.6","211.2","116.12","0","1","3","KP","KP","12.4069","0.006","1","spoc-s01-s69-b0A-KP","SPOC","318.737012","-55.871863","12.641","0.044","-16.011","0.041","2458326.009117","0.00013154597","1.4303699496507","7.7233494e-7","1.6165994039944","0.019208942","20.784","0.200653","18960.712294363","184.79134","13.187450307582","0.6576402","1281.2408253875","1525.9048088915","151.72173","375.31","4.411","5600","","4.48851","","0.89077401161194","0.0438467","","","1.05","0.129454","1,27,67","WASP-46 b","2018-09-05","2024-09-06","2024-09-06"
"149603524","102.01","","5","5","5","5","5","5","5","137.4","179","317","1","2","1","KP","KP","9.7109","0.006","1","qlp-s68-ffi","SPOC","87.139821","-63.988329","-15.641","0.037","26.046","0.037","2460187.916571","0.0001263","4.4119378","8e-7","3.65","0.011","16.477767","0.075115","15062","69.1814","15.4706","0.691963","653.252","1408","1112","175.631","0.588","6280","","4.32092","","1.21","0.05","0.24","0.05","1.28","0.190812","1,2,3,4,6,7,8,9,10,11,12,13,27,28,29,30,31,32,33,34,36,37,38,39,61,62,64,65,68","WASP 62 b","2019-05-07","2023-11-16","2023-12-08"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 29 additions & 10 deletions buckets/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,40 @@ def check_anomaly_exists(supabase: Client, anomaly_id):
print(f"Error checking for anomaly {anomaly_id}: {e}")
return False

def insert_into_anomalies(supabase: Client, anomaly_id, content, anomaly_set: str):
def check_anomaly_needs_avatar_update(supabase: Client, anomaly_id):
try:
response = supabase.table('anomalies').select("avatar_url").eq("id", anomaly_id).execute()
if len(response.data) > 0:
return response.data[0]["avatar_url"] is None
return False
except Exception as e:
print(f"Error checking avatar_url for anomaly {anomaly_id}: {e}")
return False

def insert_or_update_anomalies(supabase: Client, anomaly_id, content, anomaly_set: str, avatar_url: str):
if not check_anomaly_exists(supabase, anomaly_id):
try:
data = {
"id": anomaly_id,
"content": content,
# "anomalytype": 'planet',
"anomalytype": "gaseousMapping",
# "anomalySet": anomaly_set,
"anomalySet": "lidar-jovianVortexHunter",
"parentAnomaly": 50, #69
"anomalytype": "telescopeMinor",
"anomalySet": "telescope-minorPlanet", # anomaly_set,
"parentAnomaly": 50,
"avatar_url": avatar_url
}
response = supabase.table('anomalies').insert(data).execute()
print(f"Inserted anomaly with id {anomaly_id} into 'anomalies' table.")
except Exception as e:
print(f"Failed to insert anomaly {anomaly_id}: {e}")
else:
print(f"Anomaly {anomaly_id} already exists in the database. Skipping insertion.")
if check_anomaly_needs_avatar_update(supabase, anomaly_id):
try:
response = supabase.table('anomalies').update({"avatar_url": avatar_url}).eq("id", anomaly_id).execute()
print(f"Updated anomaly {anomaly_id} with new avatar_url.")
except Exception as e:
print(f"Failed to update avatar_url for anomaly {anomaly_id}: {e}")
else:
print(f"Anomaly {anomaly_id} already has an avatar_url. Skipping update.")

def upload_directory_to_supabase(supabase: Client, bucket_name: str, local_directory: str):
for root, dirs, files in os.walk(local_directory):
Expand All @@ -68,13 +84,16 @@ def upload_directory_to_supabase(supabase: Client, bucket_name: str, local_direc
anomaly_id = anomaly_set
content = anomaly_set

# Upload file and if successful, insert or update the anomaly
if upload_file_to_supabase(supabase, bucket_name, file_path, destination_path):
insert_into_anomalies(supabase, anomaly_id, content, anomaly_set)
# Create the avatar_url with the relative path in the Supabase bucket
avatar_url = f"{bucket_name}/{destination_path}"
insert_or_update_anomalies(supabase, anomaly_id, content, anomaly_set, avatar_url)

def main():
supabase = init_supabase_client()
bucket_name = "telescope/lidar-jovianVortexHunter"
local_directory = "satellite/lidar-jovianVortexHunters"
bucket_name = "telescope/telescope-dailyMinorPlanet"
local_directory = "telescope/telescope-dailyMinorPlanet"

upload_directory_to_supabase(supabase, bucket_name, local_directory)

Expand Down
Binary file added content/avatars/0.07389757492226079.jpg
Binary file added content/avatars/0.13794308753885676.jpg
Binary file added content/avatars/0.4117873808422243.png
Binary file added content/avatars/0.719369311275373.webp
Binary file not shown.
Binary file added content/avatars/0.7332606112757318.jpg
Binary file added content/clouds/8423850804.png
Binary file added content/clouds/94904822.png
Binary file added content/telescope/4173692.jpg
Binary file added content/telescope/4173698.jpg
Binary file added content/telescope/4173704.jpg
Binary file added content/telescope/4173710.jpg
Binary file added content/telescope/4173716.jpg
Binary file added content/telescope/4173722.jpg
Binary file added content/telescope/4173734.jpg
Binary file added content/telescope/4173740.jpg
Binary file added content/telescope/4173743.jpg
Binary file added content/telescope/4173749.jpg
Binary file added content/telescope/4173758.jpg
Binary file added content/telescope/4173769.jpg
31 changes: 31 additions & 0 deletions utils/imgFileChange.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
from PIL import Image

def convert_jpeg_to_png():
"""
Convert all .jpeg and .jpg files to .png in the current directory and its subdirectories.
"""
current_directory = os.getcwd() # Get the directory where the script is located
print(f"Scanning for .jpeg and .jpg files in: {current_directory}")

for root, _, files in os.walk(current_directory): # Walk through all directories
for file in files:
if file.lower().endswith(('.jpeg', '.jpg')): # Check for .jpeg or .jpg
jpeg_path = os.path.join(root, file) # Full path to the file
png_path = os.path.splitext(jpeg_path)[0] + ".png" # Replace extension with .png

try:
# Open and convert the image
with Image.open(jpeg_path) as img:
img.convert("RGBA").save(png_path, "PNG")
print(f"Converted: {jpeg_path} -> {png_path}")

# Optionally delete the original file
# os.remove(jpeg_path)
except Exception as e:
print(f"Error converting {jpeg_path}: {e}")

if __name__ == "__main__":
print("Starting conversion of .jpeg and .jpg files to .png...")
convert_jpeg_to_png()
print("Conversion completed.")

0 comments on commit 7988825

Please sign in to comment.