#!/bin/bash
# A simple (a,e) (a,i) figure of the albedo distribution in the asteroid bel
# (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 \
   xlabel='Proper\ semi\ major\ axis\ /\ au' ylabel='Proper\ inclination\ /\ deg' texttype=latex \
    fontsize=20 \
   xmin=1.75 xmax=3.7 ymin=0 ymax=40 \
   legend=false \
   auxflip=true auxfunc=log auxmin=0.02 auxmax=0.4 \
   auxvisible=true auxlabel=Albedo \
   layer=Mark \
      in=ssoBFT-latest_Asteroid.parquet \
      x=proper_elements.proper_semi_major_axis.value y=proper_elements.proper_inclination.value \
       weight=albedo.value \
      shading=weighted
