<jupyter_start><jupyter_text>Figure out if randoms are really randomly distributed across footprint, and whether the downsampled random catalog traces the completeness map.<jupyter_code>%pylab inline
import sys; sys.path.insert(0, '/global/homes/e/elliek/kdcount')

from kdcount import KDTree, KDAttr
from kdcount.utils import constant_array

import healpy

import numpy as np
from numpy.testing import assert_equal, run_module_suite
from scipy.interpolate import griddata

import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib import rcParams
rcParams["image.interpolation"] = "nearest"
rcParams["image.aspect"] = "equal"
catdir = '/global/homes/e/elliek/imaginglss/imaginglss/nersc/ELG/'
ra_ran, dec_ran = np.loadtxt(catdir+'ELG_rand.txt.NOISES', usecols=(0,1), unpack=True)
fc_ran = np.loadtxt(catdir+'ELG_rand.txt.FC', unpack=True)
nside = 2**8
pid_ran = healpy.ang2pix(nside, pi * (0.5 - dec_ran / 180), ra_ran / 180 * pi)
nran = bincount(pid_ran, minlength = healpy.nside2npix(nside))
nran_ds = bincount(pid_ran, weights = fc_ran, minlength = healpy.nside2npix(nside))
healpy.mollview(nran, min=0, max=100,rot=(-120,0,0), title='ELG randoms')
healpy.mollview(nran_ds, min=0, max=150, rot=(-120,0,0), title='ELG randoms (downsampled)')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12413793103448276, 'fraction_numerical': 0.026053639846743294, 'mean_word_length': 6.682352941176471, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '583064', 'license': 'Artistic-2.0', 'n_tokens_mistral': 512, 'n_tokens_neox': 495, 'n_words': 108, 'path': 'test_randoms.ipynb', 'repo_name': 'bccp/imaginglss-notebooks', 'size': '1305'}