Skip to content

Commit

Permalink
mwm_bin_rv_short_rgb_apogee: remove downsampling (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomygupta authored Oct 12, 2023
1 parent ed8a260 commit 5b6f1c5
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions python/target_selection/cartons/mwm_rv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)

import math
import random

import peewee

Expand Down Expand Up @@ -665,31 +664,3 @@ def build_query(self, version_id, query_region=None):
Gaia_DR3.parallax_error / Gaia_DR3.parallax < 0.2,
*mwm_rv_short_condition)
return query

def post_process(self, model):
"""
a set random seed, select 1/2 of the targets
"""

cursor = self.database.execute_sql(
"update sandbox.temp_mwm_bin_rv_short_rgb_apogee " +
"set selected = false;")

# The below "order by catalogid" ensures that the random selection
# further below gives the same result every time we run this carton.
cursor = self.database.execute_sql(
"select catalogid from " +
" sandbox.temp_mwm_bin_rv_short_rgb_apogee " +
" order by catalogid;")

output = cursor.fetchall()

random.seed(9123)
for i in range(len(output)):
current_catalogid = output[i][0]
current_random = random.randrange(2)
if (current_random == 0):
self.database.execute_sql(
" update sandbox.temp_mwm_bin_rv_short_rgb_apogee " +
" set selected = true " +
" where catalogid = " + str(current_catalogid) + ";")

0 comments on commit 5b6f1c5

Please sign in to comment.