move the session prep steps into a pcasa_session.py
Currently, data processing session prep steps (e.g. directory cleanup, copying ancillary files) generally happen before the job is submitted. They are done on the machine before the HPC job is submitted (post-master for PBS and regular node for Slurm)
It's better to move those steps into startup.py or pcasa_session.py (i.e. offload them into the HPC job); then everything is self-contained: pcasa.py will still: prep directory structure prep rcdir / bath job script send job;
For book-keeping purposes, it's better to put those I/O steps into a Python snippet and attach it to startup.py / pcasa_session.py, so they can be reviewed and easily manually rerun. We don't need to template the snippet (e.g. Mako or Jinja2) because they are mostly simple Python code pieces. But the situation will be re-evaluated once the conversion is done.
Currently, once the job is submitted, the CASA session will go through:
- rcdir/config.py
- rcdir/startup.py
- rcdir/pcasa_session.py only for standard Pipeline processing sessions, or PPS, otherwise, whatever CASA script is given.