#!/usr/bin/env python
"""
CINE command line script
"""

from cine import fluorescence

import argparse
import numpy as np

parser = argparse.ArgumentParser()
parser.add_argument("-m", "--mol", default="H2O",
                    choices=fluorescence.lamda.keys(),
                    help="Molecule name")
parser.add_argument("-n", "--nlevels", type=int, default=7,
                    help="Number of rotational levels")
parser.add_argument("-r", "--rh", type=float, default=1.,
                    help="Heliocentric distance in AU")
args = parser.parse_args()

g = fluorescence.pumping(args.mol, args.nlevels)

# scale infrared pumping rates by heliocentric distance
g.scale(args.rh)

# Save array using mixed numeric types
ii,jj = np.nonzero(g.gfactor[:args.nlevels,:args.nlevels])
np.savetxt('G_{0}.dat'.format(args.mol), np.transpose((ii, jj, g.gfactor[ii,jj])), fmt='%d %d %.6e')
