From 0eb41c1710ebd85f8a7347ac3be9abf731f1dd22 Mon Sep 17 00:00:00 2001 From: Charlotte Hausman <chausman@nrao.edu> Date: Thu, 22 Jul 2021 20:05:37 +0000 Subject: [PATCH] fixes for restore&image with real CASA --- .../casa_envoy/casa_envoy/launchers.py | 4 + ...e524e1e04d_correcting_restore_and_image.py | 208 ++++++++++++++++++ 2 files changed, 212 insertions(+) create mode 100644 schema/versions/f2e524e1e04d_correcting_restore_and_image.py diff --git a/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py b/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py index ae0479869..74de2145c 100644 --- a/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py +++ b/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py @@ -182,6 +182,10 @@ class ImagingLauncher(LauncherIF): ) if check_input: + wf_name = self.metadata.content["workflowName"] + if "restore" in wf_name: + RestoreFoundation(self.parameters, self.metadata).data_foundation() + self.run_audit(self.parameters) CasaLauncher(self.parameters).run() else: diff --git a/schema/versions/f2e524e1e04d_correcting_restore_and_image.py b/schema/versions/f2e524e1e04d_correcting_restore_and_image.py new file mode 100644 index 000000000..e2f2a659c --- /dev/null +++ b/schema/versions/f2e524e1e04d_correcting_restore_and_image.py @@ -0,0 +1,208 @@ +"""correcting restore and image + +Revision ID: f2e524e1e04d +Revises: 34d7311d8290 +Create Date: 2021-07-22 12:56:45.067121 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = "f2e524e1e04d" +down_revision = "34d7311d8290" +branch_labels = None +depends_on = None + + +ppr = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<ns2:SciPipeRequest xmlns:ns2="Common/pipelinescience/SciPipeRequest"> + <ProjectSummary> + <ProposalCode>VLA/{{projectCode}}</ProposalCode> + <Observatory>NRAO</Observatory> + <Telescope>VLA</Telescope> + <ProcessingSite>Socorro</ProcessingSite> + <Operator>vlapipe</Operator> + <Mode>SCIENCE</Mode> + <Version>NGRH-ALMA-10_8</Version> + <CreationTime>{{created_at}}</CreationTime> + </ProjectSummary> + <ProjectStructure>TBD</ProjectStructure> + <ProcessingRequests> + <RootDirectory>{{root_directory}}</RootDirectory> + <ProcessingRequest> + <ProcessingIntents/> + <ProcessingProcedure> + <ProcedureTitle>Workspaces Restore Imaging</ProcedureTitle> + <ProcessingCommand> + <Command>hifv_restoredata</Command> + <ParameterSet/> + </ProcessingCommand> + <ProcessingCommand> + <Command>hifv_statwt</Command> + <ParameterSet/> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_mstransform</Command> + <ParameterSet> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_checkproductsize</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">maximsize</Keyword> + <Value xmlns="">16384</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_makeimlist</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">specmode</Keyword> + <Value xmlns="">cont</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_makeimages</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">hm_masking</Keyword> + <Value xmlns="">none</Value> + </Parameter> + <Parameter> + <Keyword xmlns="">hm_cyclefactor</Keyword> + <Value xmlns="">3.0</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hifv_exportdata</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">imaging_products_only</Keyword> + <Value xmlns="">True</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + </ProcessingProcedure> + <DataSet> + <RelativePath>{{relative_path}}</RelativePath> + <SdmIdentifier>{{sdmId}}</SdmIdentifier> + <DataType>asdm</DataType> + </DataSet> + </ProcessingRequest> + </ProcessingRequests> +</ns2:SciPipeRequest> + +""" + +old_ppr = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<ns2:SciPipeRequest xmlns:ns2="Common/pipelinescience/SciPipeRequest"> + <ProjectSummary> + <ProposalCode>VLA/{{projectCode}}</ProposalCode> + <Observatory>NRAO</Observatory> + <Telescope>VLA</Telescope> + <ProcessingSite>Socorro</ProcessingSite> + <Operator>vlapipe</Operator> + <Mode>SCIENCE</Mode> + <Version>NGRH-ALMA-10_8</Version> + <CreationTime>{{created_at}}</CreationTime> + </ProjectSummary> + <ProjectStructure>TBD</ProjectStructure> + <ProcessingRequests> + <RootDirectory>{{root_directory}}</RootDirectory> + <ProcessingRequest> + <ProcessingIntents/> + <ProcessingProcedure> + <ProcedureTitle>Workspaces Restore Imaging</ProcedureTitle> + <ProcessingCommand> + <Command>hifv_restoredata</Command> + <ParameterSet/> + </ProcessingCommand> + <ProcessingCommand> + <Command>hifv_statwt</Command> + <ParameterSet/> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">breakpoint</Command> + <ParameterSet> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_mstransform</Command> + <ParameterSet> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_checkproductsize</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">maximsize</Keyword> + <Value xmlns="">16384</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_makeimlist</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">specmode</Keyword> + <Value xmlns="">cont</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hif_makeimages</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">hm_masking</Keyword> + <Value xmlns="">none</Value> + </Parameter> + <Parameter> + <Keyword xmlns="">hm_cyclefactor</Keyword> + <Value xmlns="">3.0</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + <ProcessingCommand> + <Command xmlns="">hifv_exportdata</Command> + <ParameterSet> + <Parameter> + <Keyword xmlns="">imaging_products_only</Keyword> + <Value xmlns="">True</Value> + </Parameter> + </ParameterSet> + </ProcessingCommand> + </ProcessingProcedure> + <DataSet> + <RelativePath>{{relative_path}}</RelativePath> + <SdmIdentifier>{{sdmId}}</SdmIdentifier> + <DataType>asdm</DataType> + </DataSet> + </ProcessingRequest> + </ProcessingRequests> +</ns2:SciPipeRequest> + +""" + + +def upgrade(): + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{ppr}' WHERE filename='PPR.xml' AND workflow_name='std_restore_imaging' + """ + ) + + +def downgrade(): + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{old_ppr}' WHERE filename='PPR.xml' AND workflow_name='std_restore_imaging' + """ + ) -- GitLab