lsst0, lsst1 = vol8d(hayfile='ZTF_boundaries.txt', searchfile='LSST_parameters.txt', verbose=True)

"""
Explanation: ZTF result
Using very simple assumptions/conversions, we see that ZTF offers a factor of 10-1000 better "haystack" coverage compared with the surveys listed in Wright+2018
If Wright+2018 likened their analysis to a large hot tub (8000 L) versus the Earth's oceans (1.335e21 L), then with ZTF we can search a modest above-ground swimming pool using only the r-band data!
<hr>
End of explanation
"""


evry0, evry1 = vol8d(hayfile='ZTF_boundaries.txt', searchfile='evryscope_parameters.txt', verbose=True)

"""
Explanation: LSST result
With LSST the fraction is improved by at least 2 orders of magnitude due to photometric depth and increased observing baseline, or ~2 olympic swimming pools
<hr>
End of explanation
"""


tess0, tess1 = vol8d(hayfile='ZTF_boundaries.txt', searchfile='TESS_parameters.txt', verbose=True)

"""
Explanation: Evryscope result
With Evryscope, if we use the 1-hour integrations of 2-min cadence (V=18.2 mag depth) the Haystack completness is actually comparable to LSST due to the incredible light curve coverage!
and with the 2-min depth (V=16.4), we're right between ZTF & LSST.
<hr>
End of explanation
"""


crts0, crts1 = vol8d(hayfile='ZTF_boundaries.txt', searchfile='CRTS_parameters.txt', verbose=True)

np.log10(crts1/crts0)

"""
Explanation: TESS result
Like Evryscope, TESS has very dense light curves (at least 27 days worth) and very wide sky coverage. Despite the relatively shallow depth (1% photometry at 16th mag), TESS is an excellent platform to hunt for technosignatures.
CRTS result
Catalina Real-time Transient Survey
End of explanation
"""


plt.figure(figsize=(8,5))

# plt.scatter(np.arange(4), [np.log10(ztf1/ztf0), np.log10(tess1/tess0), np.log10(lsst1/lsst0), np.log10(evry1/evry0)],
#            marker='o', s=100, alpha=0.7, c='k')
# plt.xticks(np.arange(4), ['ZTF', 'TESS', 'LSST', 'Evry'])


plt.scatter(np.arange(5), [np.log10(crts1/crts0), np.log10(ztf1/ztf0), np.log10(tess1/tess0), 
                           np.log10(lsst1/lsst0), np.log10(evry1/evry0)],
           marker='o', s=100, alpha=0.7, c='k')
plt.xticks(np.arange(5), ['CRTS','ZTF', 'TESS', 'LSST', 'Evry'])


plt.grid(True, alpha=0.3)
plt.ylabel('log $V_{Haystack}$')
plt.savefig('../figures/optical_haystack.pdf', dpi=300, bbox_inches='tight', pad_inches=0.25)

"""
Explanation: A Comparison Plot
End of explanation
"""


