Browse Source

create_processing_log added to post_processing

Benito Marcote 1 year ago
2 changed files with 11 additions and 4 deletions
  1. +7
  2. +4

+ 7
- 3 View File

@@ -38,11 +38,13 @@ from datetime import datetime as dt
usage = '%(prog)s [-h] [-d OBSDATE] [-e eEVN_session] [-jss SupSci] [-o outputfile] <experiment name>'
help_eEVN = 'If this is an e-EVN experiment with a name different to the one used for the vex file, '\
+'then provide the exp. name used to set the vex file.'
help_password = 'Password for the access to the data in the EVN archive. By default it creates one automatically.'

parser = argparse.ArgumentParser(description=description, prog='', usage=usage)
parser.add_argument('expname', type=str, help='Name of the experiment to process')
parser.add_argument('-d', '--date', type=str, default=None, help='Date of the observations (in YYMMDD format)')
parser.add_argument('-e', '--eEVN', type=str, default=None, help=help_eEVN)
parser.add_argument('-p', '--password', type=str, default=None, help=help_password)
parser.add_argument('-jss', type=str, default='marcote', help='Name of the Support Scientist running this')
parser.add_argument('-o', type=str, default='processing.log', help='Output file (default: processing.log)')

@@ -147,12 +149,14 @@ ofile.write(f' {args.expname.lower()}.ms 0.9\n\n\n\n')

ofile.write(f'tConvert {args.expname.lower()}.ms {args.expname.lower()}_1_1.IDI\n\n')

if args.password is None:
args.password = str(os.popen('date | md5sum | cut -b 1-12').read())[:-1]

ofile.write('# Password for the experiment (generated with date | md5sum | cut -b 1-12):\n')
passwd = str(os.popen('date | md5sum | cut -b 1-12').read())[:-1]
ofile.write(f'touch {args.expname.lower()}_{passwd}.auth\n\n')
ofile.write(f'touch {args.expname.lower()}_{args.password}.auth\n\n')
ofile.write('# Edit the piletter\n\n')
ofile.write('gzip *ps\n')
ofile.write('archive -auth -e {0}_{1} -n {0} -p {2}\n'.format(args.expname.lower(), obsdate.strftime('%y%m%d'), passwd))
ofile.write('archive -auth -e {0}_{1} -n {0} -p {2}\n'.format(args.expname.lower(), obsdate.strftime('%y%m%d'), args.password))
ofile.write('archive -stnd -e {0}_{1} {0}.piletter *ps.gz\n'.format(args.expname.lower(), obsdate.strftime('%y%m%d')))
ofile.write('archive -fits -e {0}_{1} *IDI*\n\n'.format(args.expname.lower(), obsdate.strftime('%y%m%d')))
ofile.write('# In case it is necessary (if the proposal was not sent through NorthStar):\n')

+ 4
- 1 View File

@@ -34,6 +34,10 @@ function post_process_eee() {
cd /data0/marcote/$EXP

# Password for
export pass=$(date | md5sum | cut -b 1-12) $EXP -p $pass

# Create the lis file from ccs
ssh jops@ccs "cd /ccs/expr/${EXP};/ccs/bin/make_lis -e ${EXP} -p prod -s ${exp}.lis"

@@ -81,7 +85,6 @@ function post_process_eee() {

tConvert ${exp}.ms ${exp}_1_1.IDI

export pass=$(date | md5sum | cut -b 1-12)
touch ${exp}_${pass}.auth

echo "The experiment has been protected with"