Skip to content
Snippets Groups Projects
Commit e987213c authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-207: use tmsssession.get_subtask_input_dataproducts to determine the...

TMSS-207: use tmsssession.get_subtask_input_dataproducts to determine the input param for the ms2hdf5 cmdline
parent ef4f9077
No related branches found
No related tags found
1 merge request!175Resolve TMSS-207
...@@ -308,18 +308,26 @@ class QAService: ...@@ -308,18 +308,26 @@ class QAService:
hdf5_path = self.h5_lustre_filepath(obs_id) hdf5_path = self.h5_lustre_filepath(obs_id)
h5_dir_path, h5_filename = os.path.split(hdf5_path) h5_dir_path, h5_filename = os.path.split(hdf5_path)
nr_of_timestamps = -1 logger.info('trying to convert MS uv dataset with otdb_id=%s subtask_id=%s if any', otdb_id, subtask_id)
nr_of_subbands = -1 cmd = ['ms2hdf5', '--cep4', '-p', '-22', '--output_dir', h5_dir_path, '--output_filename', h5_filename]
if subtask_id: if subtask_id:
subtask = self.tmsssession.get_subtask(subtask_id=subtask_id) subtask = self.tmsssession.get_subtask(subtask_id=subtask_id)
nr_of_timestamps = subtask['specifications_doc'].get('nr_of_timestamps', -1) nr_of_timestamps = subtask['specifications_doc'].get('nr_of_timestamps', -1)
nr_of_subbands = subtask['specifications_doc'].get('nr_of_subbands', -1) nr_of_subbands = subtask['specifications_doc'].get('nr_of_subbands', -1)
cmd += ['-t', str(nr_of_timestamps), '-s', str(nr_of_subbands)]
logger.info('trying to convert MS uv dataset with otdb_id=%s subtask_id=%s if any', otdb_id, subtask_id) dataproducts = self.tmsssession.get_subtask_input_dataproducts(subtask_id=subtask_id)
cmd = ['ms2hdf5', '-o', str(obs_id), '--cep4', '-p', '-22', '-t', str(nr_of_timestamps), '-s', str(nr_of_subbands), ]
cmd += ['--output_dir', h5_dir_path] if not dataproducts:
cmd += ['--output_filename', h5_filename] raise ValueError("QA subtask %s has no input dataproducts" % subtask_id)
directory = dataproducts[0]['directory'].replace('CEP4:', '').strip()
cmd += ['-m', directory]
elif otdb_id:
cmd += ['-o', str(obs_id)]
else:
raise ValueError("either otdb_id or subtask_id needs to be set")
# wrap the command in a cep4 docker ssh call # wrap the command in a cep4 docker ssh call
cmd = wrap_command_for_docker(cmd, 'adder', 'latest') cmd = wrap_command_for_docker(cmd, 'adder', 'latest')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment