#!/bin/bash
# Obliquity vs diameter for all SSOs
# (c) SsODNet, B.Carry & J.Berthier, Lagrange/OCA & LTE/Obs. Paris

if [[ ! -f ssoBFT-latest_Asteroid.parquet ]]; then
  read -p "ssoBFT not found. Download it [~800MB]? [y/n]: " resp
  if [[ ${resp,,} = "y" ]]; then
    echo "Downloading ssoBFT ..."
    wget -q https://ssp.imcce.fr/data/ssoBFT-latest_Asteroid.parquet
  else
    exit 1
  fi
fi

topcat -stilts plot2plane \
   xpix=938 ypix=568 \
   xscale=log xlabel='Diameter\ /\ km' ylabel='Obliquity\ /\ deg' ycrowd=0.76 texttype=latex fontsize=22 \
   xmin=1 xmax=500 ymin=0 ymax=180 \
   legend=false \
   auxvisible=false \
   layer=Mark \
      in=ssoBFT-latest_Asteroid.parquet \
      x=diameter.value y='$197[0]' \
      shading=auto size=2 color=light_grey 
