def min_max_distance_pair(pair): """Calculate station distance for all timestamps For each timestamp (GPS and station layout) calculate the station distances. """ c = HiSPARCStations(pair, force_stale=True) ts = list(c.stations[0].timestamps) ts += list(c.stations[1].timestamps) ts += list(c.stations[0].detectors[0].timestamps) ts += list(c.stations[1].detectors[0].timestamps) distances = [] for t in sorted(ts): c.set_timestamp(t) distances.append(c.calc_distance_between_stations(*pair)) return (min(distances), max(distances))
def get_detector_locations(station): """Detector LLA locations for the detectors of a single station""" latitudes = [] longitudes = [] cluster = HiSPARCStations([station], force_stale=True) station = cluster.get_station(station) for timestamp in station.detectors[0].timestamps: cluster.set_timestamp(timestamp) for detector in station.detectors: lat, lon, _ = detector.get_lla_coordinates() if abs(lat) <= 0.01 or abs(lon) <= 0.01: continue latitudes.append(lat) longitudes.append(lon) return latitudes, longitudes