@@ -0,0 +1,635 @@
+from astropy.io import fits, ascii%0Afrom astropy.table import Table%0Aimport numpy as np%0A%0Asspp = fits.open(%22/Users/adrian/projects/segue-learn/data/ssppOut-dr9.fits%22)%0Aall_data = sspp%5B1%5D.data%0A%0Abest_data = all_data%5Ball_data%5B'FLAG'%5D == 'nnnnn'%5D%0Abest_data = best_data%5B(best_data%5B'RV_ADOP'%5D != -9999) & %5C%0A                      (best_data%5B'FEH_ADOP'%5D != -9999) & %5C%0A                      (best_data%5B'DIST_AP'%5D != -9999)%5D%0A%0Aidx = np.random.randint(len(best_data), size=5000)%0Asubsample = best_data%5Bidx%5D%0A%0Ad = Table(best_data)%5B'RA', 'DEC', 'L', 'B', 'RV_ADOP', 'TEFF_ADOP', 'LOGG_ADOP', 'FEH_ADOP'%5D%0A%0Aascii.write(d, %22segue_sample.csv%22, delimiter=%22,%22)%0A

Add script for selecting a segue subsample