#!/bin/bash
# (c) Stefan Trklja Countryman, 2019
# .▄▄ · ▄▄▄▄▄▄▄▄ .·▄▄▄                                     
# ▐█ ▀. •██  ▀▄.▀·▐▄▄·                                     
# ▄▀▀▀█▄ ▐█.▪▐▀▀▪▄██▪                                      
# ▐█▄▪▐█ ▐█▌·▐█▄▄▌██▌.                                     
#  ▀▀▀▀  ▀▀▀  ▀▀▀ ▀▀▀                                      
#  ▄▄·       ▄• ▄▌ ▐ ▄ ▄▄▄▄▄▄▄▄   ▄· ▄▌• ▌ ▄ ·.  ▄▄▄·  ▐ ▄ 
# ▐█ ▌▪▪     █▪██▌•█▌▐█•██  ▀▄ █·▐█▪██▌·██ ▐███▪▐█ ▀█ •█▌▐█
# ██ ▄▄ ▄█▀▄ █▌▐█▌▐█▐▐▌ ▐█.▪▐▀▀▄ ▐█▌▐█▪▐█ ▌▐▌▐█·▄█▀▀█ ▐█▐▐▌
# ▐███▌▐█▌.▐▌▐█▄█▌██▐█▌ ▐█▌·▐█•█▌ ▐█▀·.██ ██▌▐█▌▐█ ▪▐▌██▐█▌
# ·▀▀▀  ▀█▄▀▪ ▀▀▀ ▀▀ █▪ ▀▀▀ .▀  ▀  ▀ • ▀▀  █▪▀▀▀ ▀  ▀ ▀▀ █▪




usage() {
    cat <<<'
BIO: stc.sh [-h]

OVERVIEW
========

I'm a physics Ph.D. candidate at Columbia University in Szabolcs Marka's group working on multi-messenger astrophysics (MMA) using gravitational waves (GW) and high energy neutrinos. I wrote and maintan LLAMA, a cutting-edge MMA search pipeline and software framework implementing the world's first GW+neutrino online search pipeline. I have also worked extensively on LIGO's timing system hardware and diagnostic software as well as education and outreach.

RESEARCH
========

LATE PHD RESEARCH: GW/NEUTRINO MULTI-MESSENGER PIPELINE
-------------------------------------------------------

In the late Initial LIGO and early (O1) Advanced LIGO eras, my team spearheaded the first GW/neutrino offline searches. During aLIGO's second observing run (O2), I took their method online by creating a software framework, LLAMA (Low-Latency Algorithm for Multi-messenger Astrophysics), for conducting this GW/neutrino search and disseminating results in low-latency. LLAMA was the world's first fully-automated low-latency GW/neutrino search pipeline and the first automated GW follow-up search to include spatial priors in its calculations. It proved to be highly reliable and was regularly the fastest GW follow-up search to run during O2. Follow-up with IceCube high-energy neutrinos was performed for all LIGO/Virgo O2 triggers, including historic kilonova GW170817; sub-threshold joint triggers overlapping with the original 1-detector GW skymap were successfully distributed and followed up by some EM partners, but improved GW skymap localizations showed a non-coincidence. The LLAMA framework was also used during O2 to run critical diagnostic checks of LIGO's timing system. It processed public triggers and demonstrated the ability to process LIGO sub-threshold triggers as well (though actual significance and plotting steps could not performed on sub-threshold triggers without code review). I used an advanced architecture, cloud-hosting solutions, and other advanced devops practices (which are only now becoming standard practice in MMA efforts) to achieve its exceptional performance.

For O3, my team and I developed an improved Bayesian significance calculation for our pipeline that uses other astrophysical source data to boost sensitivity. This search method relies on a general Bayesian odds ratio which can be readily extended to other messenger types and 3+ detectors. During this time, I also added extensive reliability and performance improvements and wrote a highly performant multi-resolution HEALPix math library to ensure that LLAMA could run quickly and reliably with arbitrary spatial-prior-motivated core significance calculations. This was done to ensure that the new Bayesian method would work for GW/neutrino searches as well as any extensions added during O3. LLAMA has been running with the new code during O3, regularly finishing in less than a minute from GW trigger generation time (though IceCube result dissemination time has been longer due to humans-in-the-loop).

Throughout this time, I gained highly extensive expertise in software development/operations methods and and astrophysics infrastructure by creating software tools in support of my entire team's scientific goals (many of these tools can be found in these three repositories). I developed advanced software for data retrieval, caching, validating, cleaning, and formatting, all highly non-trivial tasks due to LIGO's large data volumes and limited infrastructure. This also required developing virtual machines, cloud-hosted images, provisioning scripts, and extensive documentation to cope with the tremendous operational complexity of using constantly-changing experimental (in all senses of the word) scientific libraries with limited support and documentation. My teammate Rainer Corley and I extensively documented the photodiode layout of the Interferometer Sensing and Control (ISC) system (a crucial susbsytem used for scientific data collection and interferometer control) and created an interactive installation map showing the layout and operation of the whole system. I many other contributions to detector operations, like making useful LIGO tools available on MacPorts and adding control interfaces to LIGO's EPICS/MEDM industrial control system. I also used my technical expertise to make modest non-astrohysics contributions to to my group's public health efforts. (Much of my publically-available work is linked above; some of the rest is spread across DCC, ArXiV, BitBucket, and my GitHub.)

UNDERGRAD & EARLY PHD RESEARCH: LIGO TIMING SYSTEM
--------------------------------------------------

I started working with the Marka group as an undergraduate at Columbia. During this time I contributed to the development of Advanced LIGO's timing system, which my group was building from scratch to address weaknesses in Initial LIGO's commercially-built timing system. I debugged FPGA timing code; developed documentation and workflows for assembly, firmware-flashing, and testing; and personally assembled, tested, and shipped most of Advanced LIGO and KAGRA's timing system.

At the beginning of my Ph.D., I resumed my undergraduate work on LIGO's timing system. I developed diagnostic systems and software to ensure the timing system's reliability. This involved developing remote-work tools, devops methods (like virtual-machine images), installation documentation, maintenance procedures, and documentation that enabled timing system supervision from NYC. Thanks in large part to these efforts, my group has maintained the timing systems at both LIGO sites (this is no small accomplishment; the Columbia group is the only group that manages and maintains mission-critical LIGO hardware from off-site. The timing system has flawlessly through the Advanced LIGO era, enabling precise event reconstruction and source localization in support of LIGO's historic, Nobel-prize-winning detections. Japan's KAGRA GW detector will also rely on our proven timing system.

OPTIONS:
-h          Print this help string.
'
    exit 0
}
for opt in "$@"; do [[ "${opt}" = "-h" ]] && usage; done

# launch repl or compile and launch website.
stef_shell \
    --github "${GITHUB}" \
    --bitbucket "${BITBUCKET}" \
    --conda "${CONDA}" \
    --docker "${DOCKER}" \
    --llama "${LLAMA}" \
    --resume "${RESUME}" \
    --blog "${BLOG}" \
    --dept "${PHYS_DEPT}" \
    --contact "${CONTACT}" \
    --portrait "${PORTRAIT}" \
    --projects "${PROJECTS}" \
    --ligo_data_grid "${LIGO_DATA_GRID}" \
    --dcc "${DCC_DOCUMENTS}" \
    --hn "${HN}" \
    --fortunefile "${FORTUNEFILE}" \
    --publications "${PUBLICATIONS}"


print_version() {
    cat <<__OTACON
#           ▄▄▀▀▀▄▄▄▀▀▀▀▀▀▀▀▄▄
#         ▄▀      █           ▀▄
#        ██   ▄▄▄ █    ▄▄▄      █
#       █ █  ██▀▀▀█▄ ▀▀▀▀▀█      █
#     ▀█▀▀  ▄█            █  █    █
#       █▀▀▀ █           ▄█▄█▀    █
#      █     █▄▄▄▄▄    ▄▄▄▄▄▀▄    █
#      ▀▄  ▄██   ▄ █▀▀█     ██   ▄▀
#        ▀█ ██   ▀ █  █ ▀▀▀ ██▀█ ▀▄▄
#         ▀▄ █▀▀▀▀▀ █  ▀▀▀▀▀█ ▄███▀
#          ███      █       ███▀
#          ████    █▄▄     ████▄
#          ████▄ ▄▄▄▄▄▄▄▄ ▄████
#       ▄▄▄ ▀▀██          ██▀▀
#      █  █    ██        ██
#   ▄▄▄█▄▄▀▄    █       ██
# ▄▀      █ █▄▄▀ █▀█▀▀▀█ █ ▀▄
# █▄  ▀▀▀▀█ █ ▀  █ █   █ █   ▀▀▄
#  █   ▄▄▄█ █ ▄▄██ █   █ ██▀▄   ▀▄
#   ▀█     █▀▀  █ ▀█   █▀ █  █▀▀  █
#     ▀▀▀▀▀     █  █   █▄▀▀▀█   ▄▀
#              █   █▄▄▄█▀▀  ▀▄▄▀
#              █   █████▄   ▄▀
#              █▄▄▄██▀██▄███
#                  ██ ██
#                  ██ ▀██
#                 ▄██  ██
#                 ██   ██
#                 ██   ▀██
#                 ██    ██
#                ▀▀▀    ▀▀
# stef_shell running on ◬SPRITE VER.2.21
__OTACON
    

# old website deprecated, UI was too advanced for user tastes; click
# through to see my take on the eclectic, rarely-updated professorial
# website style. There are actually some useful links in there as
# well.
# old_website --please-stop=true