lvjiameng commited on
Commit
8bc88c1
·
verified ·
1 Parent(s): 3e924ae

Upload 5 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ Downtasks/photo-z-sdss/sdss_dr12_with_filenames_train_test.csv filter=lfs diff=lfs merge=lfs -text
Downtasks/galaxy-desi.rar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3cd7da5a4ce649c29c08da9d146be1ceb5121f61c632735b4d9c6fdf9a4ee89
3
+ size 2082656230
Downtasks/galaxy-sdss.rar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8a94b25a37a926772a30aeafe35ccad007cf831887ed7d63f6300df6d7db00b
3
+ size 60625346
Downtasks/object-lens.rar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:416fff99092d2fc09a35515495bb04d2421c6a3f42afb44e035952aba9fa0c3a
3
+ size 598631040
Downtasks/photo-z-sdss/download.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import os
3
+ from astropy.io import fits
4
+ from astroquery.skyview import SkyView
5
+ from astropy.coordinates import SkyCoord
6
+ import astropy.units as u
7
+ from astropy.visualization import make_lupton_rgb
8
+ import numpy as np
9
+ from concurrent.futures import ThreadPoolExecutor, as_completed
10
+
11
+ def create_rgb_image(g, r, i):
12
+ """
13
+ Create an RGB image using Lupton stretch.
14
+
15
+ Parameters:
16
+ g_band (array-like): Green band image data.
17
+ r_band (array-like): Red band image data.
18
+ i_band (array-like): Infrared band image data.
19
+
20
+ Returns:
21
+ array: RGB image created from the input bands.
22
+ """
23
+ rgb_image = make_lupton_rgb(i, r, g, Q=10, stretch=0.3, minimum=0.0)
24
+ return rgb_image
25
+
26
+ def adjust_flux(g_band, r_band, i_band):
27
+ """
28
+ Adjust the flux of the input bands.
29
+
30
+ Parameters:
31
+ g_band (array-like): Green band image data.
32
+ r_band (array-like): Red band image data.
33
+ i_band (array-like): Infrared band image data.
34
+
35
+ Returns:
36
+ tuple: Adjusted green, red, and infrared band image data.
37
+ """
38
+ g_band = np.array(g_band)* 1.1
39
+ r_band = np.array(r_band)* 1
40
+ i_band = np.array(i_band)* 0.79
41
+
42
+ return g_band, r_band, i_band
43
+
44
+ def process_star(star_ra, star_dec, image_width, image_height, output_path):
45
+ c = SkyCoord(ra=star_ra * u.degree, dec=star_dec * u.degree, frame='icrs')
46
+ fits_images = SkyView.get_images(position=c, survey=['SDSSu', 'SDSSg', 'SDSSr', 'SDSSi', 'SDSSz'], width=image_width, height=image_height)
47
+
48
+ g_band, r_band, i_band = adjust_flux(fits_images[1][0].data, fits_images[2][0].data, fits_images[3][0].data)
49
+ rgb_image = create_rgb_image(g_band, r_band, i_band)
50
+
51
+ images = np.zeros(shape=(5, 300, 300))
52
+ images[0] = fits_images[0][0].data
53
+ images[1] = fits_images[1][0].data
54
+ images[2] = fits_images[2][0].data
55
+ images[3] = fits_images[3][0].data
56
+ images[4] = fits_images[4][0].data
57
+
58
+ output_file = f"cutout_{star_ra}_{star_dec}.fits"
59
+ fits.writeto(os.path.join(output_path, output_file), images, overwrite=True)
60
+
61
+ def main():
62
+ image_width = (256 * 0.396) * u.arcsec
63
+ image_height = (256 * 0.396) * u.arcsec
64
+ output_path = r'./Data_download/DATA_SDSS'
65
+ csv_file_path = r'./Data_download/sdss_dr12_with_filenames_train_test.csv'
66
+
67
+ df = pd.read_csv(csv_file_path)
68
+
69
+ with ThreadPoolExecutor(max_workers=4) as executor:
70
+ futures = []
71
+ for i in range(len(df)):
72
+ star_ra = df['ra'].values[i]
73
+ star_dec = df['dec'].values[i]
74
+ futures.append(executor.submit(process_star, star_ra, star_dec, image_width, image_height, output_path))
75
+
76
+ for future in as_completed(futures):
77
+ try:
78
+ future.result()
79
+ except Exception as e:
80
+ print(f"An error occurred: {e}")
81
+
82
+ if __name__ == "__main__":
83
+ main()
Downtasks/photo-z-sdss/sdss_dr12_with_filenames_train_test.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16ff7e74364dfb745162dd3a9926bd845d6538fdf687e0a8bd1297344695dcef
3
+ size 14906349