<jupyter_start><jupyter_text>FluxPDFWhen simulating very large densities, it is cumbersome to look at the specifics of each source. However, it is still possible to extract some of the most important distributions from an observational perspective: for example, the $\log(N) - \log(S)$ distribution which describes the number of sources as a function of the flux on Earth. First, we show how the two approaches – `Firesong.py` and `FluxPDF.py` – recover the same results for the same sets of physics parameters:<jupyter_code>min_log_flux = -20.
max_log_flux = 5.
nbins = 200

firesong_res = firesong_simulation(None, filename=None, 
                                   density=1e-9,
                                   Evolution='MD2014SFR',
                                   verbose=False)

flux_res = flux_pdf(None, filename=None,
                   density=1e-9, 
                   logFMin=min_log_flux,
                   logFMax=max_log_flux,
                   nFluxBins=nbins,
                   Evolution='MD2014SFR',
                   verbose=False)
fig, ax = plt.subplots()

plt.plot(flux_res[0], flux_res[1], lw=4., ls='-', 
         label="FluxPDF")
plt.hist(np.log10(firesong_res['sources']['flux']), 
         bins=np.linspace(min_log_flux, max_log_flux, nbins + 1),
         label='Firesong', histtype='stepfilled', alpha=0.4)

plt.xlabel(r'$\log_{10}(\phi)$ (a.u.)')
plt.ylabel(r'$N$')
plt.xlim(-14., -6.)
plt.legend(loc=1, frameon=False)
fig.set_facecolor('w')
plt.show()<jupyter_output><empty_output><jupyter_text>Large density $\log(N) - \log(S)$We now show the $\log(N) - \log(S)$ distributions that we get for a variety of densities, including large densities that would induce too large a memory requirement if using `Firesong`<jupyter_code>min_log_flux = -20.
max_log_flux = 5.
nbins = 150

low_density = 1e-10
med_density = 1e-7
high_density = 1e-4

pdf_dict = dict()

for density in [low_density, med_density, high_density]:
    pdf_dict[density] = flux_pdf(None, filename=None,
                                   density=density, 
                                   logFMin=min_log_flux,
                                   logFMax=max_log_flux,
                                   nFluxBins=nbins,
                                   Evolution='MD2014SFR',
                                   verbose=False)
for density, label in [(low_density, 'Low density'), 
                       (med_density, 'Medium density'), 
                       (high_density, 'High density')]:
    plt.plot(pdf_dict[density][0], np.cumsum(pdf_dict[density][1][::-1])[::-1],
            label = label)
    
plt.xlabel(r'$\log_{10}(\phi)$')
plt.ylabel(r'$N_{\mathrm{sources}} > \log_{10}(\phi)$')
plt.yscale('log')
plt.legend(loc=1, frameon=False)
plt.ylim(1e0, plt.ylim()[1])
plt.xlim(-18, -5)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12614517265680056, 'fraction_numerical': 0.02255109231853418, 'mean_word_length': 2.404076738609113, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '666887', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 996, 'n_tokens_neox': 895, 'n_words': 208, 'path': 'notebooks/FluxPDF Example.ipynb', 'repo_name': 'TGarfield17/FIRESONG', 'size': '2838'}