From 7ade3ecd2cce7114cd85eb2c7698ab78c6ba6cf8 Mon Sep 17 00:00:00 2001
From: Daniel Brown <ddb@star.sr.bham.ac.uk>
Date: Sat, 25 Jul 2015 00:28:15 +0100
Subject: [PATCH] fixing read_map

---
 pykat/optics/maps.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pykat/optics/maps.py b/pykat/optics/maps.py
index 658e9a0..c7a07a1 100644
--- a/pykat/optics/maps.py
+++ b/pykat/optics/maps.py
@@ -912,6 +912,8 @@ def read_map(filename, mapFormat='finesse', scaling=1.0e-9):
         
         data = np.loadtxt(filename, dtype=np.float64,ndmin=2,comments='%')    
 
+        return surfacemap(name, maptype, size, center, step, scaling, data)
+        
     # Converts raw zygo and ligo mirror maps to the finesse
     # format. Based on the matlab scripts 'FT_read_zygo_map.m' and
     # 'FT_read_ligo_map.m'.
@@ -1124,15 +1126,15 @@ def read_map(filename, mapFormat='finesse', scaling=1.0e-9):
         # Changing NaN to zeros. Just to be able to plot the
         # map with surfacemap.plot().
         data[isNan] = 0 
-    
+        
+        return surfacemap(name, maptype, size, center, step, scaling, data, notNan)
         
     # TODO: Add options for reading virgo maps, and .xyz zygo
     # maps (need .xys file for this). Binary ligo-maps?
     # The intensity data is not used to anything here. Remove
     # or add to pykat?
 
-    return surfacemap(name, maptype, size, center, step,
-                      scaling, data, notNan)
+    
     
 
 
-- 
GitLab