<jupyter_start><jupyter_text>LSLGA GroupsPlaying around with nbodykit...  Preliminaries<jupyter_code>import os
import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table
from nbodykit.transform import SkyToUnitSphere
from nbodykit.source.catalog import FITSCatalog
from nbodykit.algorithms.fof import FOF
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Read the parent HyperLeda catalog<jupyter_code>LSLGAdir = os.getenv('LSLGA_DIR')
ledafile = os.path.join(LSLGAdir, 'sample', 'leda-logd25-0.05.fits')<jupyter_output><empty_output><jupyter_text>FOF with nbodykit<jupyter_code>cat = FITSCatalog(ledafile)
cat['Position'] = SkyToUnitSphere(cat['RA'], cat['DEC'], degrees=True)
pos = cat.compute(cat['Position'])
print(pos.shape)
_ = plt.hist(pos[:, 2])
fof = FOF(cat, linking_length=0.05, nmin=1, absolute=True)
from nbodykit.lab import RandomCatalog
nn = 100
data = RandomCatalog(nn, seed=1)
data['ra'] = np.(100, 200, 0.1)
data['dec'] = np.arange(10.0, 10.5, 0.1)
data['Position'] = SkyToUnitSphere(data['ra'], data['dec'], degrees=True)
xyz = data.compute(data['Position'])
xyz
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(xyz[:, 0], xyz[:, 1], xyz[:, 2])
xyz[:, 0].has_data()
help(np.linspace)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1539039039039039, 'fraction_numerical': 0.03003003003003003, 'mean_word_length': 7.712418300653595, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '637445', 'license': 'MIT', 'n_tokens_mistral': 545, 'n_tokens_neox': 522, 'n_words': 101, 'path': 'doc/sandbox/lslga-groups-nbodykit.ipynb', 'repo_name': 'moustakas/SGA', 'size': '1332'}