def get_annotations(path, sap, label): logger.info('Loading annotations from: %s', path) result = lofarReadSnippet.read_clusters(path, label) if result[0] == {}: # No saps means no clusters either. return {} return result[0][sap]['annotations']
def get_cluster_annotations(path, sap, label='latest'): logger.info( 'Loading cluster annotations for label="%s" sap %d from: %s', label, int(sap), path) data = lofarReadSnippet.read_hypercube(path, read_visibilities=False, read_flagging=False) file_annotations = lofarReadSnippet.read_file_annotations(path) clusters, cluster_algo_annotations = lofarReadSnippet.read_clusters( path) info_string = lofarReadSnippet.create_info_string( data, path, file_annotations, clusters, cluster_algo_annotations) logger.info('Loaded cluster annotations for: %s\n%s', path, info_string) return clusters[int(sap)].get('annotations', {})
def get_observation(path, sap): print( '_________________________________________________________________' ) print('this is path: \n {}'.format(path)) print('this is sap: \n {}'.format(sap)) logger.info('Loading observation for sap %d from: %s', sap, path) data = lofarReadSnippet.read_hypercube(path, visibilities_in_dB=True, read_visibilities=True, read_flagging=False) file_annotations = lofarReadSnippet.read_file_annotations(path) clusters, cluster_algo_annotations = lofarReadSnippet.read_clusters( path) info_string = lofarReadSnippet.create_info_string( data, path, file_annotations, clusters, cluster_algo_annotations) logger.info('Loaded observation for %s\n%s', path, info_string) return data['saps'][sap]