def _get_on_trixel_sources_from_database_query(<EOL>self):
self.log.debug(<EOL>'<STR_LIT>')<EOL>tableName = self.tableName<EOL>raCol = self.raCol<EOL>decCol = self.decCol<EOL>radiusArc = self.radius<EOL>radius = self.radius / (<NUM_LIT> * <NUM_LIT>)<EOL>trixelArray = self._get_trixel_ids_that_overlap_conesearch_circles()<EOL>if trixelArray.size > <NUM_LIT> and self.htmDepth == <NUM_LIT:16>:<EOL><INDENT>self.htmDepth = <NUM_LIT><EOL>self.mesh = HTM(<EOL>depth=self.htmDepth,<EOL>log=self.log<EOL>)<EOL>trixelArray = self._get_trixel_ids_that_overlap_conesearch_circles()<EOL><DEDENT>if trixelArray.size > <NUM_LIT> and self.htmDepth == <NUM_LIT>:<EOL><INDENT>self.htmDepth = <NUM_LIT:10><EOL>self.mesh = HTM(<EOL>depth=self.htmDepth,<EOL>log=self.log<EOL>)<EOL>trixelArray = self._get_trixel_ids_that_overlap_conesearch_circles()<EOL><DEDENT>htmLevel = "<STR_LIT>" % self.htmDepth<EOL>if trixelArray.size > <NUM_LIT>:<EOL><INDENT>self.log.info(<EOL>"<STR_LIT>" % locals())<EOL>minID = np.min(trixelArray)<EOL>maxID = np.max(trixelArray)<EOL>htmWhereClause = "<STR_LIT>" % locals(<EOL>)<EOL><DEDENT>else:<EOL><INDENT>thesHtmIds = "<STR_LIT:U+002C>".join(np.array(list(map(str, trixelArray))))<EOL>htmWhereClause = "<STR_LIT>" % locals(<EOL>)<EOL><DEDENT>cols = self.columns[:]<EOL>if cols != "<STR_LIT:*>" and raCol.lower() not in cols.lower():<EOL><INDENT>cols += "<STR_LIT:U+002CU+0020>" + raCol<EOL><DEDENT>if cols != "<STR_LIT:*>" and decCol.lower() not in cols.lower():<EOL><INDENT>cols += "<STR_LIT:U+002CU+0020>" + decCol<EOL><DEDENT>if self.distinct:<EOL><INDENT>sqlQuery = """<STR_LIT>""" % locals(<EOL>)<EOL><DEDENT>else:<EOL><INDENT>sqlQuery = """<STR_LIT>""" % locals(<EOL>)<EOL><DEDENT>if self.sqlWhere and len(self.sqlWhere):<EOL><INDENT>sqlQuery += "<STR_LIT>" + self.sqlWhere<EOL><DEDENT>self.log.debug(<EOL>'<STR_LIT>')<EOL>return sqlQuery<EOL>
*generate the mysql query before executing it*