diff --git a/MAC/Deployment/data/Coordinates/CoordMenu.py b/MAC/Deployment/data/Coordinates/CoordMenu.py index 92d24e14c2e314630c4e27983e5a99016707d358..717b37f801163be634f1cee32b5a8a36a0052c63 100755 --- a/MAC/Deployment/data/Coordinates/CoordMenu.py +++ b/MAC/Deployment/data/Coordinates/CoordMenu.py @@ -195,7 +195,7 @@ if __name__ == "__main__": if sel == '9': transform_all() if sel == '10': transform_one() if sel == '11': make_all_conf_files() - if sel == '12': make_one_conf_files() + if sel == '12': make_one_conf_file() if sel == '0': create_CDB() create_CDB_objects() diff --git a/MAC/Deployment/data/Coordinates/make_all_station_file.py b/MAC/Deployment/data/Coordinates/make_all_station_file.py index b3b27b84ebe9fdf22aee7cc3f2ac15631d914abd..9d0fb231848fb549cd16fb823ccca3a1329e0df6 100755 --- a/MAC/Deployment/data/Coordinates/make_all_station_file.py +++ b/MAC/Deployment/data/Coordinates/make_all_station_file.py @@ -52,7 +52,7 @@ def writeAntennaFieldHeader(frame): return ## -## write normal vector to antennaField file, in blitz format +## write normal vector ## def writeNormalVector(station, anttype): try: @@ -71,7 +71,7 @@ def writeNormalVector(station, anttype): return ## -## write rotation matrix to antennaField file, in blitz format +## write rotation matrix ## def writeRotationMatrix(station, anttype): try: @@ -95,7 +95,7 @@ def writeRotationMatrix(station, anttype): return ## -## write antenna positions to antennaField file, in blitz format +## write antenna positions ## def writeAntennaField(station, anttype, aPos): @@ -190,11 +190,8 @@ if __name__ == '__main__': # do something with the data print 'Making %s-AntennaField.conf with LBA shape=%s HBA shape=%s' %(station, np.shape(aPosL), np.shape(aPosH)) - aRef = None - - - + # write LBA information to AntennaPos.conf writeNormalVector(station, 'LBA') writeRotationMatrix(station, 'LBA') @@ -211,7 +208,6 @@ if __name__ == '__main__': aOffset = aPosH - [[aRefH,aRefH]] writeAntennaField(station, '', aOffset) - # if core station add also information for HBA0 and HBA1 fields if station[0] == 'C': # write information for HBA0 @@ -227,4 +223,3 @@ if __name__ == '__main__': db1.close() db2.close() sys.exit(0) - diff --git a/MAC/Deployment/data/Coordinates/make_conf_files.py b/MAC/Deployment/data/Coordinates/make_conf_files.py index f70c9b5e6800ef9cc853ca634d8cf91b9b172a3e..cf62d8e6c9e380e881915853a42338867a845b42 100755 --- a/MAC/Deployment/data/Coordinates/make_conf_files.py +++ b/MAC/Deployment/data/Coordinates/make_conf_files.py @@ -32,16 +32,18 @@ def print_help(): ## ## write hba deltas to a File +## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3) +## For a 3 by 4 array ## def writeHBADeltas(station,deltas): filename = '../StaticMetaData/iHBADeltas/%s-iHBADeltas.conf' %(str(station).upper()) f = open(filename,'w') f.write('#\n') - f.write('# HBADeltas for %s\n' %(str(station).upper())) + f.write('# iHBADeltas for %s\n' %(str(station).upper())) f.write('# Created: %s\n' %(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))) f.write('#\n') f.write('HBADeltas\n') - f.write('%d x %d [\n' %(np.shape(deltas)[0],np.shape(deltas)[1])) + f.write('(0,%d) x (0,%d) [\n' %(np.shape(deltas)[0]-1,np.shape(deltas)[1]-1)) for i in range(np.shape(deltas)[0]): f.write(' ') for j in range(np.shape(deltas)[1]): @@ -60,7 +62,7 @@ def writeAntennaFieldHeader(station,frame): fileName = '../StaticMetaData/AntennaFields/'+ station + '-AntennaField.conf' file = open(fileName, 'w') - dataStr += '#\n' + dataStr += '#\n' dataStr += '# AntennaPositions for %s\n' %(station) dataStr += '# %s target_date = %s\n' %(str(frame), sys.argv[2]) dataStr += '# Created: %s\n' %(datetime.now().strftime("%Y-%m-%d %H:%M:%S")) @@ -72,6 +74,8 @@ def writeAntennaFieldHeader(station,frame): ## ## write normal vector to antennaField file, in blitz format +## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3) +## For a 3 by 4 array ## def writeNormalVector(station, anttype): try: @@ -89,9 +93,9 @@ def writeNormalVector(station, anttype): Shape = np.shape(vector) Dims = len(Shape) - dataStr += str(Shape[0]) + dataStr += '(0,' + str(Shape[0]-1) + ')' for dim in range(1,Dims): - dataStr += ' x ' + str(Shape[dim]) + dataStr += ' x (0,' + str(Shape[dim]-1) + ')' dataStr += ' [ %10.6f %10.6f %10.6f ]\n' %(vector[0], vector[1], vector[2]) @@ -103,6 +107,8 @@ def writeNormalVector(station, anttype): ## ## write rotation matrix to antennaField file, in blitz format +## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3) +## For a 3 by 4 array ## def writeRotationMatrix(station, anttype): try: @@ -119,9 +125,9 @@ def writeRotationMatrix(station, anttype): Shape = np.shape(matrix) Dims = len(Shape) - dataStr += str(Shape[0]) + dataStr += '(0,' + str(Shape[0]-1) + ')' for dim in range(1,Dims): - dataStr += ' x ' + str(Shape[dim]) + dataStr += ' x (0,' + str(Shape[dim]-1) + ')' dataStr += ' [\n' for row in range(Shape[0]): @@ -137,6 +143,8 @@ def writeRotationMatrix(station, anttype): ## ## write antenna positions to antennaField file, in blitz format +## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3) +## For a 3 by 4 array ## def writeAntennaField(station, anttype, aPos): dataStr = '' @@ -148,9 +156,9 @@ def writeAntennaField(station, anttype, aPos): Shape = np.shape(aPos) Dims = len(Shape) - dataStr += str(Shape[0]) + dataStr += '(0,' + str(Shape[0]-1) + ')' for dim in range(1,Dims): - dataStr += ' x ' + str(Shape[dim]) + dataStr += ' x (0,' + str(Shape[dim]-1) + ')' if Dims == 1: dataStr += ' [ %10.9f %10.9f %10.3f ]\n' %\