diff --git a/CDB/integrations/digitalbeam_cluster_ConfigDb.json b/CDB/integrations/digitalbeam_cluster_ConfigDb.json new file mode 100644 index 0000000000000000000000000000000000000000..d26d10a1a2b13e88d97e3d608c11dbcd7a8bbc08 --- /dev/null +++ b/CDB/integrations/digitalbeam_cluster_ConfigDb.json @@ -0,0 +1,746 @@ +{ + "servers": { + "SDP": { + "STAT": { + "SDP": { + "STAT/SDP/1": { + "properties": { + "OPC_Server_Name": [ + "sdptr-sim" + ], + "OPC_Server_Port": [ + "4840" + ], + "OPC_Time_Out": [ + "5.0" + ] + } + }, + "STAT/SDP/2": { + "properties": { + "OPC_Server_Name": [ + "sdptr-sim" + ], + "OPC_Server_Port": [ + "4840" + ], + "OPC_Time_Out": [ + "5.0" + ] + } + } + } + } + }, + "Beamlet": { + "STAT": { + "Beamlet": { + "STAT/Beamlet/1": { + "properties": { + "SDP_device": [ + "STAT/SDP/1" + ], + "OPC_Server_Name": [ + "sdptr-sim" + ], + "OPC_Server_Port": [ + "4840" + ], + "OPC_Time_Out": [ + "5.0" + ], + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "192.168.0.1", + "192.168.0.2", + "192.168.0.3", + "192.168.0.4", + "192.168.1.1", + "192.168.1.2", + "192.168.1.3", + "192.168.1.4", + "192.168.2.1", + "192.168.2.2", + "192.168.2.3", + "192.168.2.4", + "192.168.3.1", + "192.168.3.2", + "192.168.3.3", + "192.168.3.4" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_hdr_udp_destination_port_RW_default": [ + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001" + ] + } + }, + "STAT/Beamlet/2": { + "properties": { + "SDP_device": [ + "STAT/SDP/2" + ], + "OPC_Server_Name": [ + "sdptr-sim" + ], + "OPC_Server_Port": [ + "4840" + ], + "OPC_Time_Out": [ + "5.0" + ], + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "192.168.0.1", + "192.168.0.2", + "192.168.0.3", + "192.168.0.4", + "192.168.1.1", + "192.168.1.2", + "192.168.1.3", + "192.168.1.4", + "192.168.2.1", + "192.168.2.2", + "192.168.2.3", + "192.168.2.4", + "192.168.3.1", + "192.168.3.2", + "192.168.3.3", + "192.168.3.4" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_hdr_udp_destination_port_RW_default": [ + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001", + "10001" + ], + "FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [ + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB", + "01:23:45:67:89:AB" + ], + "FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [ + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1" + ] + } + } + } + } + }, + "DigitalBeam": { + "STAT": { + "DigitalBeam": { + "STAT/DigitalBeam/HBA": { + "properties": { + "AntennaField_Device": [ + "STAT/AntennaField/HBA" + ], + "Beamlet_Device": [ + "STAT/Beamlet/1" + ], + "Beam_tracking_interval": [ + "1.0" + ], + "Beam_tracking_preparation_period": [ + "0.5" + ] + } + }, + "STAT/DigitalBeam/LBA": { + "properties": { + "AntennaField_Device": [ + "STAT/AntennaField/LBA" + ], + "Beamlet_Device": [ + "STAT/Beamlet/2" + ], + "Beam_tracking_interval": [ + "1.0" + ], + "Beam_tracking_preparation_period": [ + "0.5" + ] + } + } + } + } + }, + "AntennaField": { + "STAT": { + "AntennaField": { + "STAT/AntennaField/LBA": { + "properties": { + "Antenna_Field_Reference_ETRS": [ + "3826896.631", "460979.131", "5064657.943" + ], + "Antenna_Reference_ETRS": [ + "3826886.142", "460980.772", "5064665.668", + "3826887.237", "460985.643", "5064664.406", + "3826889.022", "460974.271", "5064664.094", + "3826890.118", "460979.142", "5064662.831", + "3826891.214", "460984.012", "5064661.568", + "3826892.311", "460988.883", "5064660.305", + "3826891.902", "460967.768", "5064662.520", + "3826892.999", "460972.640", "5064661.256", + "3826894.094", "460977.511", "5064659.994", + "3826895.191", "460982.382", "5064658.730", + "3826896.287", "460987.252", "5064657.467", + "3826897.383", "460992.123", "5064656.204", + "3826895.879", "460966.138", "5064659.682", + "3826896.974", "460971.009", "5064658.419", + "3826898.071", "460975.880", "5064657.156", + "3826899.167", "460980.751", "5064655.893", + "3826900.263", "460985.622", "5064654.630", + "3826901.359", "460990.493", "5064653.367", + "3826900.951", "460969.378", "5064655.582", + "3826902.048", "460974.250", "5064654.319", + "3826903.143", "460979.120", "5064653.056", + "3826904.240", "460983.991", "5064651.793", + "3826906.024", "460972.619", "5064651.481", + "3826907.120", "460977.490", "5064650.218", + "3826969.290", "460898.914", "5064610.654", + "3826970.386", "460903.785", "5064609.392", + "3826972.171", "460892.413", "5064609.080", + "3826973.267", "460897.284", "5064607.817", + "3826974.363", "460902.154", "5064606.554", + "3826975.459", "460907.025", "5064605.291", + "3826975.051", "460885.911", "5064607.506", + "3826976.147", "460890.782", "5064606.242", + "3826977.243", "460895.653", "5064604.980", + "3826978.339", "460900.524", "5064603.716", + "3826979.436", "460905.394", "5064602.453", + "3826980.532", "460910.265", "5064601.190", + "3826979.027", "460884.281", "5064604.668", + "3826980.123", "460889.152", "5064603.405", + "3826981.220", "460894.022", "5064602.142", + "3826982.316", "460898.893", "5064600.879", + "3826983.412", "460903.764", "5064599.616", + "3826984.508", "460908.635", "5064598.353", + "3826984.100", "460887.521", "5064600.568", + "3826985.196", "460892.392", "5064599.305", + "3826986.292", "460897.262", "5064598.042", + "3826987.388", "460902.133", "5064596.779", + "3826989.173", "460890.761", "5064596.467", + "3826990.269", "460895.632", "5064595.204", + "3826886.142", "460980.772", "5064665.668", + "3826887.237", "460985.643", "5064664.406", + "3826889.022", "460974.271", "5064664.094", + "3826890.118", "460979.142", "5064662.831", + "3826891.214", "460984.012", "5064661.568", + "3826892.311", "460988.883", "5064660.305", + "3826891.902", "460967.768", "5064662.520", + "3826892.999", "460972.640", "5064661.256", + "3826894.094", "460977.511", "5064659.994", + "3826895.191", "460982.382", "5064658.730", + "3826896.287", "460987.252", "5064657.467", + "3826897.383", "460992.123", "5064656.204", + "3826895.879", "460966.138", "5064659.682", + "3826896.974", "460971.009", "5064658.419", + "3826898.071", "460975.880", "5064657.156", + "3826899.167", "460980.751", "5064655.893", + "3826900.263", "460985.622", "5064654.630", + "3826901.359", "460990.493", "5064653.367", + "3826900.951", "460969.378", "5064655.582", + "3826902.048", "460974.250", "5064654.319", + "3826903.143", "460979.120", "5064653.056", + "3826904.240", "460983.991", "5064651.793", + "3826906.024", "460972.619", "5064651.481", + "3826907.120", "460977.490", "5064650.218", + "3826969.290", "460898.914", "5064610.654", + "3826970.386", "460903.785", "5064609.392", + "3826972.171", "460892.413", "5064609.080", + "3826973.267", "460897.284", "5064607.817", + "3826974.363", "460902.154", "5064606.554", + "3826975.459", "460907.025", "5064605.291", + "3826975.051", "460885.911", "5064607.506", + "3826976.147", "460890.782", "5064606.242", + "3826977.243", "460895.653", "5064604.980", + "3826978.339", "460900.524", "5064603.716", + "3826979.436", "460905.394", "5064602.453", + "3826980.532", "460910.265", "5064601.190", + "3826979.027", "460884.281", "5064604.668", + "3826980.123", "460889.152", "5064603.405", + "3826981.220", "460894.022", "5064602.142", + "3826982.316", "460898.893", "5064600.879", + "3826983.412", "460903.764", "5064599.616", + "3826984.508", "460908.635", "5064598.353", + "3826984.100", "460887.521", "5064600.568", + "3826985.196", "460892.392", "5064599.305", + "3826986.292", "460897.262", "5064598.042", + "3826987.388", "460902.133", "5064596.779", + "3826989.173", "460890.761", "5064596.467", + "3826990.269", "460895.632", "5064595.204" + ], + "HBAT_PQR_rotation_angles_deg": [ + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24" + ], + "PQR_to_ETRS_rotation_matrix": [ + "-0.1195951054", "-0.7919544517", "0.5987530018", + " 0.9928227484", "-0.0954186800", "0.0720990002", + " 0.0000330969", " 0.6030782884", "0.7976820024" + ] + } + }, + "STAT/AntennaField/HBA": { + "properties": { + "Antenna_Field_Reference_ETRS": [ + "3826896.631", "460979.131", "5064657.943" + ], + "Antenna_Reference_ETRS": [ + "3826886.142", "460980.772", "5064665.668", + "3826887.237", "460985.643", "5064664.406", + "3826889.022", "460974.271", "5064664.094", + "3826890.118", "460979.142", "5064662.831", + "3826891.214", "460984.012", "5064661.568", + "3826892.311", "460988.883", "5064660.305", + "3826891.902", "460967.768", "5064662.520", + "3826892.999", "460972.640", "5064661.256", + "3826894.094", "460977.511", "5064659.994", + "3826895.191", "460982.382", "5064658.730", + "3826896.287", "460987.252", "5064657.467", + "3826897.383", "460992.123", "5064656.204", + "3826895.879", "460966.138", "5064659.682", + "3826896.974", "460971.009", "5064658.419", + "3826898.071", "460975.880", "5064657.156", + "3826899.167", "460980.751", "5064655.893", + "3826900.263", "460985.622", "5064654.630", + "3826901.359", "460990.493", "5064653.367", + "3826900.951", "460969.378", "5064655.582", + "3826902.048", "460974.250", "5064654.319", + "3826903.143", "460979.120", "5064653.056", + "3826904.240", "460983.991", "5064651.793", + "3826906.024", "460972.619", "5064651.481", + "3826907.120", "460977.490", "5064650.218", + "3826969.290", "460898.914", "5064610.654", + "3826970.386", "460903.785", "5064609.392", + "3826972.171", "460892.413", "5064609.080", + "3826973.267", "460897.284", "5064607.817", + "3826974.363", "460902.154", "5064606.554", + "3826975.459", "460907.025", "5064605.291", + "3826975.051", "460885.911", "5064607.506", + "3826976.147", "460890.782", "5064606.242", + "3826977.243", "460895.653", "5064604.980", + "3826978.339", "460900.524", "5064603.716", + "3826979.436", "460905.394", "5064602.453", + "3826980.532", "460910.265", "5064601.190", + "3826979.027", "460884.281", "5064604.668", + "3826980.123", "460889.152", "5064603.405", + "3826981.220", "460894.022", "5064602.142", + "3826982.316", "460898.893", "5064600.879", + "3826983.412", "460903.764", "5064599.616", + "3826984.508", "460908.635", "5064598.353", + "3826984.100", "460887.521", "5064600.568", + "3826985.196", "460892.392", "5064599.305", + "3826986.292", "460897.262", "5064598.042", + "3826987.388", "460902.133", "5064596.779", + "3826989.173", "460890.761", "5064596.467", + "3826990.269", "460895.632", "5064595.204", + "3826886.142", "460980.772", "5064665.668", + "3826887.237", "460985.643", "5064664.406", + "3826889.022", "460974.271", "5064664.094", + "3826890.118", "460979.142", "5064662.831", + "3826891.214", "460984.012", "5064661.568", + "3826892.311", "460988.883", "5064660.305", + "3826891.902", "460967.768", "5064662.520", + "3826892.999", "460972.640", "5064661.256", + "3826894.094", "460977.511", "5064659.994", + "3826895.191", "460982.382", "5064658.730", + "3826896.287", "460987.252", "5064657.467", + "3826897.383", "460992.123", "5064656.204", + "3826895.879", "460966.138", "5064659.682", + "3826896.974", "460971.009", "5064658.419", + "3826898.071", "460975.880", "5064657.156", + "3826899.167", "460980.751", "5064655.893", + "3826900.263", "460985.622", "5064654.630", + "3826901.359", "460990.493", "5064653.367", + "3826900.951", "460969.378", "5064655.582", + "3826902.048", "460974.250", "5064654.319", + "3826903.143", "460979.120", "5064653.056", + "3826904.240", "460983.991", "5064651.793", + "3826906.024", "460972.619", "5064651.481", + "3826907.120", "460977.490", "5064650.218", + "3826969.290", "460898.914", "5064610.654", + "3826970.386", "460903.785", "5064609.392", + "3826972.171", "460892.413", "5064609.080", + "3826973.267", "460897.284", "5064607.817", + "3826974.363", "460902.154", "5064606.554", + "3826975.459", "460907.025", "5064605.291", + "3826975.051", "460885.911", "5064607.506", + "3826976.147", "460890.782", "5064606.242", + "3826977.243", "460895.653", "5064604.980", + "3826978.339", "460900.524", "5064603.716", + "3826979.436", "460905.394", "5064602.453", + "3826980.532", "460910.265", "5064601.190", + "3826979.027", "460884.281", "5064604.668", + "3826980.123", "460889.152", "5064603.405", + "3826981.220", "460894.022", "5064602.142", + "3826982.316", "460898.893", "5064600.879", + "3826983.412", "460903.764", "5064599.616", + "3826984.508", "460908.635", "5064598.353", + "3826984.100", "460887.521", "5064600.568", + "3826985.196", "460892.392", "5064599.305", + "3826986.292", "460897.262", "5064598.042", + "3826987.388", "460902.133", "5064596.779", + "3826989.173", "460890.761", "5064596.467", + "3826990.269", "460895.632", "5064595.204" + ], + "HBAT_PQR_rotation_angles_deg": [ + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24", + "24" + ], + "PQR_to_ETRS_rotation_matrix": [ + "-0.1195951054", "-0.7919544517", "0.5987530018", + " 0.9928227484", "-0.0954186800", "0.0720990002", + " 0.0000330969", " 0.6030782884", "0.7976820024" + ] + } + } + } + } + }, + "RECV": { + "STAT": { + "RECV": { + "STAT/RECV/1": { + "properties": { + "OPC_Server_Name": [ + "recv-sim" + ], + "OPC_Server_Port": [ + "4840" + ], + "OPC_Time_Out": [ + "5.0" + ] + } + }, + "STAT/RECV/2": { + "properties": { + "OPC_Server_Name": [ + "recv-sim" + ], + "OPC_Server_Port": [ + "4840" + ], + "OPC_Time_Out": [ + "5.0" + ] + } + } + } + } + } + } +} diff --git a/CDB/integrations/recvcluster_ConfigDb.json b/CDB/integrations/tilebeam_cluster_ConfigDb.json similarity index 100% rename from CDB/integrations/recvcluster_ConfigDb.json rename to CDB/integrations/tilebeam_cluster_ConfigDb.json diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh index c39992fe6c50d497d99973fc964e11294fdeb2e5..cecea594ae98e7c8842c6871d70ad48c12b9ef2d 100755 --- a/sbin/run_integration_test.sh +++ b/sbin/run_integration_test.sh @@ -139,7 +139,9 @@ make up integration-test integration_test default -integration_test recv_cluster "device-recv device-tilebeam device-antennafield" "${LOFAR20_DIR}/CDB/integrations/recvcluster_ConfigDb.json" +integration_test tilebeam_performance "device-recv device-tilebeam device-antennafield" "${LOFAR20_DIR}/CDB/integrations/tilebeam_cluster_ConfigDb.json" + +integration_test digitalbeam_performance "device-sdp device-recv device-digitalbeam device-beamlet device-antennafield" "${LOFAR20_DIR}/CDB/integrations/digitalbeam_cluster_ConfigDb.json" integration_test observations "archiver-timescale hdbppts-cm hdbppts-es" "${LOFAR20_DIR}/CDB/integrations/multiobs_ConfigDb.json" diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py index e59a5cbe38eb1081f3522eef4530598d68b94cb4..bd24aeee8a5878b714babdfa914bd08d43d8f4ed 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py @@ -96,6 +96,13 @@ class Beamlet(OPCUADevice): default_value=[DEFAULT_SUBBAND] * N_beamlets_ctrl, ) + SDP_device = device_property( + dtype=str, + doc="Which SDP device subscribed for this beamlet", + mandatory=False, + default_value="STAT/SDP/1", + ) + FIRST_DEFAULT_SETTINGS = [ "FPGA_beamlet_output_hdr_eth_source_mac_RW", "FPGA_beamlet_output_hdr_ip_source_address_RW", @@ -448,7 +455,7 @@ class Beamlet(OPCUADevice): def configure_for_initialise(self): super().configure_for_initialise() - self.sdp_proxy = DeviceProxy("STAT/SDP/1") + self.sdp_proxy = DeviceProxy(self.SDP_device) self.sdp_proxy.set_source(DevSource.DEV) # subscribe to events to notice setting changes in SDP that determine the input frequency diff --git a/tangostationcontrol/tangostationcontrol/integration_test/recv_cluster/__init__.py b/tangostationcontrol/tangostationcontrol/integration_test/digitalbeam_performance/__init__.py similarity index 100% rename from tangostationcontrol/tangostationcontrol/integration_test/recv_cluster/__init__.py rename to tangostationcontrol/tangostationcontrol/integration_test/digitalbeam_performance/__init__.py diff --git a/tangostationcontrol/tangostationcontrol/integration_test/digitalbeam_performance/test_digitalbeam_performance.py b/tangostationcontrol/tangostationcontrol/integration_test/digitalbeam_performance/test_digitalbeam_performance.py new file mode 100644 index 0000000000000000000000000000000000000000..1b4d8e4afcef60cb9a939a2713043c8996e0d041 --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/integration_test/digitalbeam_performance/test_digitalbeam_performance.py @@ -0,0 +1,101 @@ +# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 + +import logging +import statistics +import time + +import numpy +from tango import DevState +from tangostationcontrol.devices.antennafield import AntennaQuality, AntennaUse +from tangostationcontrol.integration_test import base +from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy +from tangostationcontrol.common.constants import MAX_ANTENNA, N_beamlets_ctrl + +logger = logging.getLogger() + + +class TestDigitalbeamPerformance(base.IntegrationTestCase): + # The AntennaField is setup with self.NR_TILES tiles in the test configuration + POINTING_DIRECTION = numpy.array( + [["J2000", "0deg", "0deg"]] * N_beamlets_ctrl + ).flatten() + + def setUp(self): + super(TestDigitalbeamPerformance, self).setUp() + + def test_digitalbeam_performance(self): + antenna_field_proxies = [] + beamlet_proxies = [] + beam_proxies = [] + sdp_proxies = [] + recv_proxies = [] + + # import pdb; pdb.set_trace() + + # Setup multi SDP / recv and separate hba / lba antennafield / digitalbeams + for i, item in enumerate(["HBA", "LBA"]): + sdp_proxies.append(TestDeviceProxy(f"STAT/SDP/{i+1}")) + recv_proxies.append(TestDeviceProxy(f"STAT/RECV/{i+1}")) + beamlet_proxies.append(TestDeviceProxy(f"STAT/Beamlet/{i+1}")) + antenna_field_proxies.append(TestDeviceProxy(f"STAT/AntennaField/{item}")) + beam_proxies.append(TestDeviceProxy(f"STAT/DigitalBeam/{item}")) + + for sdp in sdp_proxies + recv_proxies + beamlet_proxies: + sdp.off() + self.assertTrue(sdp.state() is DevState.OFF) + sdp.warm_boot() + sdp.set_defaults() + self.assertTrue(sdp.state() is DevState.ON) + + for n in range(1, 2): + proxy = antenna_field_proxies[n - 1] + # setup AntennaField + control_mapping = [[1, i] for i in range(MAX_ANTENNA)] + antenna_qualities = numpy.array([AntennaQuality.OK] * MAX_ANTENNA) + antenna_use = numpy.array([AntennaUse.AUTO] * MAX_ANTENNA) + proxy.put_property( + { + "RECV_devices": [f"STAT/RECV/{n}"], + "SDP_device": f"STAT/SDP/{n}", + "Control_to_RECV_mapping": numpy.array(control_mapping).flatten(), + "Antenna_Quality": antenna_qualities, + "Antenna_Use": antenna_use, + } + ) + proxy.off() + proxy.boot() + self.assertEqual(MAX_ANTENNA, proxy.nr_antennas_R) + self.assertTrue(proxy.state() is DevState.ON) + + for proxy in beam_proxies: + proxy.off() + self.assertTrue(proxy.state() is DevState.OFF) + proxy.warm_boot() + proxy.set_defaults() + proxy.Tracking_enabled_RW = False + self.assertTrue(proxy.state() is DevState.ON) + + # Insert verify that all attributes have been set across + # one another~ + + results = [] + for _i in range(25): + start_time = time.monotonic_ns() + for proxy in beam_proxies: + proxy.set_pointing(self.POINTING_DIRECTION) + stop_time = time.monotonic_ns() + results.append(stop_time - start_time) + + for beam in beam_proxies: + self.assertEqual(0, beam.Nr_update_pointing_exceptions_R) + logging.error( + f"[{beam}] compute_weights: {beam.Duration_compute_weights_R} " + f"preparation slack: {beam.Duration_preparation_period_slack_R} " + f"apply time: {beam.Duration_apply_weights_R} " + ) + + logging.error( + f"Median {statistics.median(results) / 1.e9} Stdev " + f"{statistics.stdev(results) / 1.e9}" + ) diff --git a/tangostationcontrol/tangostationcontrol/integration_test/tilebeam_performance/__init__.py b/tangostationcontrol/tangostationcontrol/integration_test/tilebeam_performance/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..68ddd5cdc3efaa38e853aef337c08beb99c50c4c --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/integration_test/tilebeam_performance/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 diff --git a/tangostationcontrol/tangostationcontrol/integration_test/recv_cluster/test_recv_cluster.py b/tangostationcontrol/tangostationcontrol/integration_test/tilebeam_performance/test_tilebeam_performance.py similarity index 95% rename from tangostationcontrol/tangostationcontrol/integration_test/recv_cluster/test_recv_cluster.py rename to tangostationcontrol/tangostationcontrol/integration_test/tilebeam_performance/test_tilebeam_performance.py index fc4881b28a93d1ebebb5920a71358e9c981ee54b..0a9184021c4ccce065daae267d9815c0f906ab6b 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/recv_cluster/test_recv_cluster.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/tilebeam_performance/test_tilebeam_performance.py @@ -14,15 +14,15 @@ from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy logger = logging.getLogger() -class TestRecvCluster(base.IntegrationTestCase): +class TestTilebeamPerformance(base.IntegrationTestCase): # The AntennaField is setup with self.NR_TILES tiles in the test configuration NR_TILES = 48 POINTING_DIRECTION = numpy.array([["J2000", "0deg", "0deg"]] * NR_TILES).flatten() def setUp(self): - super(TestRecvCluster, self).setUp() + super(TestTilebeamPerformance, self).setUp() - def test_recv_cluster_performance(self): + def test_tilebeam_performance(self): beam_proxies = [] antenna_field_proxies = [] recv_proxies = [] @@ -40,7 +40,6 @@ class TestRecvCluster(base.IntegrationTestCase): recv_proxies.append(TestDeviceProxy(f"STAT/RECV/{i+1}")) antenna_field_proxies.append(TestDeviceProxy(f"STAT/AntennaField/{item}")) beam_proxies.append(TestDeviceProxy(f"STAT/TileBeam/{item}")) - beam_proxies.append(TestDeviceProxy(f"STAT/TileBeam/{item}")) # Recv and AntennaField devices must be ready before TileBeam for proxy in recv_proxies: