Skip to content
Snippets Groups Projects
Commit ced1b35c authored by Nathan Bockisch's avatar Nathan Bockisch
Browse files

Merge branch 'make-gmva-copy-to-difx' into '2.8.2-DEVELOPMENT'

Modified gmva_ingester to copy directories from the GMVA source area to the...

See merge request !1447
parents d094a486 0fb11c51
No related branches found
No related tags found
2 merge requests!1452Merge 2.8.2 to main,!1447Modified gmva_ingester to copy directories from the GMVA source area to the...
Pipeline #11585 passed
Pipeline: workspaces

#11586

    # gmva_ingester # gmva_ingester
    `gmva_ingester` is a utility that copies GMVA observation directories from the `gmva_ingester` is a utility that copies GMVA observation directories from the
    GMVA source directory (defined in CAPO) to the VLBI ingestion staging directory GMVA source directory (defined in CAPO) to the difx directory
    (also defined in CAPO). It is not meant to be run by hand, but by a workflow (also defined in CAPO). It is not meant to be run by hand, but by a workflow
    that facilitates the entire GMVA observation ingestion process. that facilitates the entire GMVA observation ingestion process.
    ...@@ -9,5 +9,5 @@ that facilitates the entire GMVA observation ingestion process. ...@@ -9,5 +9,5 @@ that facilitates the entire GMVA observation ingestion process.
    ``` ```
    Usage of ./gmva_ingester: Usage of ./gmva_ingester:
    -dir string -dir string
    Name of the GMVA directory within the GMVA source directory to be copied to the VLBI staging directory Name of the GMVA directory within the GMVA source directory to be copied to the difx directory
    ``` ```
    ...@@ -28,7 +28,7 @@ import ( ...@@ -28,7 +28,7 @@ import (
    func main() { func main() {
    var gmvaDir string var gmvaDir string
    flag.StringVar(&gmvaDir, "dir", "", "Name of the GMVA directory within the GMVA source directory to be copied to the VLBI staging directory") flag.StringVar(&gmvaDir, "dir", "", "Name of the GMVA directory within the GMVA source directory to be copied to the difx directory")
    flag.Parse() flag.Parse()
    if gmvaDir == "" { if gmvaDir == "" {
    ......
    ...@@ -50,9 +50,10 @@ func CopyGmva(dir string) { ...@@ -50,9 +50,10 @@ func CopyGmva(dir string) {
    capoProperties, err := config.InitConfig(os.Getenv("CAPO_PROFILE"), helpers.DefaultCapoPath) capoProperties, err := config.InitConfig(os.Getenv("CAPO_PROFILE"), helpers.DefaultCapoPath)
    checkError(err) checkError(err)
    ingestionSettings := capoProperties.SettingsForPrefix("edu.nrao.workspaces.IngestionSettings") wsIngestionSettings := capoProperties.SettingsForPrefix("edu.nrao.workspaces.IngestionSettings")
    gmvaSourcePath := ingestionSettings.GetString("gmvaSourceDirectory") gmvaSourcePath := wsIngestionSettings.GetString("gmvaSourceDirectory")
    vlbiStagingPath := ingestionSettings.GetString("vlbiStagingDirectory") aatIngestionSettings := capoProperties.SettingsForPrefix("archive-ingestion")
    difxPath := aatIngestionSettings.GetString("VLBAPath")
    // GMVA source only copies files starting with GMVA // GMVA source only copies files starting with GMVA
    gmvaSourceFiles := strings.Join([]string{gmvaSourcePath, dir, "GMVA*"}, "/") gmvaSourceFiles := strings.Join([]string{gmvaSourcePath, dir, "GMVA*"}, "/")
    ...@@ -60,15 +61,15 @@ func CopyGmva(dir string) { ...@@ -60,15 +61,15 @@ func CopyGmva(dir string) {
    gmvaSourcePaths, err = filepath.Glob(gmvaSourceFiles) gmvaSourcePaths, err = filepath.Glob(gmvaSourceFiles)
    checkError(err) checkError(err)
    vlbiTargetDir := strings.Join([]string{vlbiStagingPath, dir}, "/") difxDir := strings.Join([]string{difxPath, dir}, "/")
    // First make the directory to copy files to // First make the directory to copy files to
    mkdirCmd := exec.Command("mkdir", vlbiTargetDir) mkdirCmd := exec.Command("mkdir", difxDir)
    err = mkdirCmd.Run() err = mkdirCmd.Run()
    checkError(err) checkError(err)
    for _, path := range gmvaSourcePaths { for _, path := range gmvaSourcePaths {
    copyCmd := exec.Command("cp", "-LR", path, vlbiTargetDir) copyCmd := exec.Command("cp", "-LR", path, difxDir)
    err = copyCmd.Run() err = copyCmd.Run()
    checkError(err) checkError(err)
    } }
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment