Skip to content

Commit

Permalink
solve only healpix dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred Castro Ginard authored and Alfred Castro Ginard committed Oct 5, 2023
1 parent 002a0a3 commit 64132f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gaiaunlimited/selectionfunctions/subsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,14 @@ class SubsampleSelectionFunction(SelectionFunctionBase):

def __init__(self, subsample_query, file_name, hplevel_and_binning):
def _download_binned_subset(self):
query_to_gaia = f"""SELECT {self.column_names_for_select_clause} COUNT(*) AS n, SUM(selection) AS k
if len(self.hplevel_and_binning) == 1:
query_to_gaia = f"""SELECT {self.column_names_for_select_clause} COUNT(*) AS n, SUM(selection) AS k
FROM (SELECT {self.binning}
to_integer(IF_THEN_ELSE('{self.subsample_query}',1.0,0.0)) AS selection
FROM gaiadr3.gaia_source) AS subquery
GROUP BY {self.group_by_clause}"""
else:
query_to_gaia = f"""SELECT {self.column_names_for_select_clause} COUNT(*) AS n, SUM(selection) AS k
FROM (SELECT {self.binning}
to_integer(IF_THEN_ELSE('{self.subsample_query}',1.0,0.0)) AS selection
FROM gaiadr3.gaia_source
Expand Down

0 comments on commit 64132f8

Please sign in to comment.