From 856ba46c30d32bb39c99a4c11f62153529fbfb1c Mon Sep 17 00:00:00 2001 From: Peter Nemere Date: Mon, 4 Nov 2024 14:38:42 +1000 Subject: [PATCH] Printing args for BGT --- api/ws/handlers/scan.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/ws/handlers/scan.go b/api/ws/handlers/scan.go index 2ee38073..e576211a 100644 --- a/api/ws/handlers/scan.go +++ b/api/ws/handlers/scan.go @@ -563,7 +563,7 @@ func processEM(importId string, zipReader *zip.Reader, zippedData []byte, destBu rsiUploaded := 0 for _, rsi := range rsis { - rxlPath, logPath, err := createBeamLocation(rsi, localTemp, logger) + rxlPath, logPath, err := createBeamLocation(filepath.Join(localTemp, rsi), localTemp, logger) if err != nil { // Don't fail on errors for these - we may have run beam location tool on some incomplete scan, so failure isn't terrible! logger.Errorf("Beam location generation failed for RSI: %v. Error: %v", rsi, err) @@ -683,6 +683,15 @@ func createBeamLocation(rsiPath string, outputBeamLocationPath string, logger lo }*/ } + if _, err := os.Stat(bgtPath + "Geometry_PIXL_EM_Landing_25Jan2021.csv"); err != nil { + return "", "", errors.New("Calibration file not found") + } + if _, err := os.Stat(rsiPath); err != nil { + return "", "", errors.New("RSI not found") + } + + fmt.Printf("Executing: %v %v %v %v %v %v", bgtPath+"BGT", bgtPath+"Geometry_PIXL_EM_Landing_25Jan2021.csv", rsiPath, outSurfaceTop, outRXL, outLog) + cmd := exec.Command(bgtPath+"BGT", bgtPath+"Geometry_PIXL_EM_Landing_25Jan2021.csv", rsiPath, outSurfaceTop, outRXL, outLog) // var out bytes.Buffer