Sets up the AbstractGeometry for the local geometry of site with index isite.
        :param isite: Index of the site for which the local geometry has to be set up
        :param coords: The coordinates of the (local) neighbors
359229
def setup_local_geometry(self, isite, coords, optimization=None):
        
        self.local_geometry = AbstractGeometry(
            central_site=self.structure.cart_coords[isite],
            bare_coords=coords,
            centering_type=self.centering_type,
            include_central_site_in_centroid=
            self.include_central_site_in_centroid,
            optimization=optimization)
226896
def setup_explicit_indices_local_geometry(self, explicit_indices):
        
        self.icentral_site = 0
        self.indices = [ii + 1 for ii in explicit_indices]
440445
def setCoords(self, x1, y1, x2, y2):
        """"""
        self.trans = Transform(self.size[0], self.size[1], x1, y1, x2, y2)
1328913
def coords(self) -> Iterator[Tuple[float, float, float]]:
        
        data = self.data[self.data.longitude.notnull()]
        yield from zip(data["longitude"], data["latitude"], data["altitude"])
1211201
def set_ellipsoid(self, ellipsoid):
        
        if not isinstance(ellipsoid, (list, tuple)):
            try:
                self.ELLIPSOID = ELLIPSOIDS[ellipsoid]
                self.ellipsoid_key = ellipsoid
            except KeyError:
                raise Exception(
                    "Invalid ellipsoid. See geopy.distance.ELIPSOIDS"
                )
        else:
            self.ELLIPSOID = ellipsoid
            self.ellipsoid_key = None
        return
259611
def _localize(var, indexes_coords):
    
    indexes = {}
    for dim, [x, new_x] in indexes_coords.items():
        index = x.to_index()
        imin = index.get_loc(np.min(new_x.values), method='nearest')
        imax = index.get_loc(np.max(new_x.values), method='nearest')

        indexes[dim] = slice(max(imin - 2, 0), imax + 2)
        indexes_coords[dim] = (x[indexes[dim]], new_x)
    return var.isel(**indexes), indexes_coords
1222527
def sort_coords(coord):
    
    import iris
    order = {'T': -2, 'Z': -1, 'X': 1, 'Y': 2}
    axis = iris.util.guess_coord_axis(coord)
    return (order.get(axis, 0), coord and coord.name())
728556
def make_coord_dict(coord):
    """"""
    return dict(
        z=int_if_exact(coord.zoom),
        x=int_if_exact(coord.column),
        y=int_if_exact(coord.row),
    )
70023
def setup_neighbors_distances_and_angles(self, indices):
        
        self.neighbors_distances = [None] * len(self.structure)
        self.neighbors_normalized_distances = [None] * len(self.structure)
        self.neighbors_angles = [None] * len(self.structure)
        self.neighbors_normalized_angles = [None] * len(self.structure)
        for isite in indices:
            results = self.voronoi_list2[isite]
            if results is None:
                continue
            #Initializes neighbors distances and normalized distances groups
            self.neighbors_distances[isite] = []
            self.neighbors_normalized_distances[isite] = []
            normalized_distances = [nb_dict['normalized_distance'] for nb_dict in results]
            isorted_distances = np.argsort(normalized_distances)
            self.neighbors_normalized_distances[isite].append({'min': normalized_distances[isorted_distances[0]],
                                                               'max': normalized_distances[isorted_distances[0]]})
            self.neighbors_distances[isite].append({'min': results[isorted_distances[0]]['distance'],
                                                    'max': results[isorted_distances[0]]['distance']})
            icurrent = 0
            nb_indices = {int(isorted_distances[0])}
            dnb_indices = {int(isorted_distances[0])}
            for idist in iter(isorted_distances):
                wd = normalized_distances[idist]
                if self.maximum_distance_factor is not None:
                    if wd > self.maximum_distance_factor:
                        self.neighbors_normalized_distances[isite][icurrent]['nb_indices'] = list(nb_indices)
                        self.neighbors_distances[isite][icurrent]['nb_indices'] = list(nb_indices)
                        self.neighbors_normalized_distances[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                        self.neighbors_distances[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                        break
                if np.isclose(wd, self.neighbors_normalized_distances[isite][icurrent]['max'],
                              rtol=0.0, atol=self.normalized_distance_tolerance):
                    self.neighbors_normalized_distances[isite][icurrent]['max'] = wd
                    self.neighbors_distances[isite][icurrent]['max'] = results[idist]['distance']
                    dnb_indices.add(int(idist))
                else:
                    self.neighbors_normalized_distances[isite][icurrent]['nb_indices'] = list(nb_indices)
                    self.neighbors_distances[isite][icurrent]['nb_indices'] = list(nb_indices)
                    self.neighbors_normalized_distances[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                    self.neighbors_distances[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                    dnb_indices = {int(idist)}
                    self.neighbors_normalized_distances[isite].append({'min': wd,
                                                                       'max': wd})
                    self.neighbors_distances[isite].append({'min': results[idist]['distance'],
                                                            'max': results[idist]['distance']})
                    icurrent += 1
                nb_indices.add(int(idist))
            else:
                self.neighbors_normalized_distances[isite][icurrent]['nb_indices'] = list(nb_indices)
                self.neighbors_distances[isite][icurrent]['nb_indices'] = list(nb_indices)
                self.neighbors_normalized_distances[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                self.neighbors_distances[isite][icurrent]['dnb_indices'] = list(dnb_indices)
            for idist in range(len(self.neighbors_distances[isite]) - 1):
                dist_dict = self.neighbors_distances[isite][idist]
                dist_dict_next = self.neighbors_distances[isite][idist+1]
                dist_dict['next'] = dist_dict_next['min']
                ndist_dict = self.neighbors_normalized_distances[isite][idist]
                ndist_dict_next = self.neighbors_normalized_distances[isite][idist + 1]
                ndist_dict['next'] = ndist_dict_next['min']
            if self.maximum_distance_factor is not None:
                dfact = self.maximum_distance_factor
            else:
                dfact = self.default_voronoi_cutoff / self.neighbors_distances[isite][0]['min']
            self.neighbors_normalized_distances[isite][-1]['next'] = dfact
            self.neighbors_distances[isite][-1]['next'] = dfact * self.neighbors_distances[isite][0]['min']
            #Initializes neighbors angles and normalized angles groups
            self.neighbors_angles[isite] = []
            self.neighbors_normalized_angles[isite] = []
            normalized_angles = [nb_dict['normalized_angle'] for nb_dict in results]
            isorted_angles = np.argsort(normalized_angles)[::-1]
            self.neighbors_normalized_angles[isite].append({'max': normalized_angles[isorted_angles[0]],
                                                            'min': normalized_angles[isorted_angles[0]]})
            self.neighbors_angles[isite].append({'max': results[isorted_angles[0]]['angle'],
                                                 'min': results[isorted_angles[0]]['angle']})
            icurrent = 0
            nb_indices = {int(isorted_angles[0])}
            dnb_indices = {int(isorted_angles[0])}
            for iang in iter(isorted_angles):
                wa = normalized_angles[iang]
                if self.minimum_angle_factor is not None:
                    if wa < self.minimum_angle_factor:
                        self.neighbors_normalized_angles[isite][icurrent]['nb_indices'] = list(nb_indices)
                        self.neighbors_angles[isite][icurrent]['nb_indices'] = list(nb_indices)
                        self.neighbors_normalized_angles[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                        self.neighbors_angles[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                        break
                if np.isclose(wa, self.neighbors_normalized_angles[isite][icurrent]['min'],
                              rtol=0.0, atol=self.normalized_angle_tolerance):
                    self.neighbors_normalized_angles[isite][icurrent]['min'] = wa
                    self.neighbors_angles[isite][icurrent]['min'] = results[iang]['angle']
                    dnb_indices.add(int(iang))
                else:
                    self.neighbors_normalized_angles[isite][icurrent]['nb_indices'] = list(nb_indices)
                    self.neighbors_angles[isite][icurrent]['nb_indices'] = list(nb_indices)
                    self.neighbors_normalized_angles[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                    self.neighbors_angles[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                    dnb_indices = {int(iang)}
                    self.neighbors_normalized_angles[isite].append({'max': wa,
                                                                    'min': wa})
                    self.neighbors_angles[isite].append({'max': results[iang]['angle'],
                                                         'min': results[iang]['angle']})
                    icurrent += 1
                nb_indices.add(int(iang))
            else:
                self.neighbors_normalized_angles[isite][icurrent]['nb_indices'] = list(nb_indices)
                self.neighbors_angles[isite][icurrent]['nb_indices'] = list(nb_indices)
                self.neighbors_normalized_angles[isite][icurrent]['dnb_indices'] = list(dnb_indices)
                self.neighbors_angles[isite][icurrent]['dnb_indices'] = list(dnb_indices)
            for iang in range(len(self.neighbors_angles[isite]) - 1):
                ang_dict = self.neighbors_angles[isite][iang]
                ang_dict_next = self.neighbors_angles[isite][iang + 1]
                ang_dict['next'] = ang_dict_next['max']
                nang_dict = self.neighbors_normalized_angles[isite][iang]
                nang_dict_next = self.neighbors_normalized_angles[isite][iang + 1]
                nang_dict['next'] = nang_dict_next['max']
            if self.minimum_angle_factor is not None:
                afact = self.minimum_angle_factor
            else:
                afact = 0.0
            self.neighbors_normalized_angles[isite][-1]['next'] = afact
            self.neighbors_angles[isite][-1]['next'] = afact * self.neighbors_angles[isite][0]['max']
934462
def setup_random_structure(self, coordination):
        
        aa = 0.4
        bb = -0.2
        coords = list()
        for ii in range(coordination + 1):
            coords.append(aa * np.random.random_sample(3, ) + bb)
        self.set_structure(
            lattice=np.array([[10, 0, 0], [0, 10, 0], [0, 0, 10]], np.float),
            species=["Si"] * (coordination + 1),
            coords=coords,
            coords_are_cartesian=False)
        self.setup_random_indices_local_geometry(coordination)
1170102
def coords_callback(self, data):
        
        for node_id, lon, lat in data:
            self.coords[node_id] = (lon, lat)
525478
private List<Coordinate> getCoordinates(Geometry[] geometries) {
		List<Coordinate> coordinates = new ArrayList<Coordinate>();
		for (Geometry geometry : geometries) {
			addCoordinateArrays(geometry, coordinates);
		}
		return coordinates;
	}
973606
def _get_coord(self, coord):
        
        x, y = coord
        return self.ctypes.c_int(y << 16 | x)
1118070
def coord_list_mapping(subset, superset, atol=1e-8):
    
    c1 = np.array(subset)
    c2 = np.array(superset)
    inds = np.where(np.all(np.isclose(c1[:, None, :], c2[None, :, :], atol=atol),
                           axis=2))[1]
    result = c2[inds]
    if not np.allclose(c1, result, atol=atol):
        if not is_coord_subset(subset, superset):
            raise ValueError("subset is not a subset of superset")
    if not result.shape == c1.shape:
        raise ValueError("Something wrong with the inputs, likely duplicates "
                         "in superset")
    return inds
1135614
def index_to_coords(index, shape):
    ''''''
    coords = []
    for i in xrange(1, len(shape)):
        divisor = int(np.product(shape[i:]))
        value = index // divisor
        coords.append(value)
        index -= value * divisor
    coords.append(index)
    return tuple(coords)
1309346
def set_point_geometry(w, src):
    
    assert "pointSource" in src.tag
    geometry_node = src.nodes[get_taglist(src).index("pointGeometry")]
    point_attrs = parse_point_geometry(geometry_node)
    w.point(point_attrs["point"][0], point_attrs["point"][1])
75054
private void addCoordinateArrays(Geometry geometry, List<Coordinate[]> coords) {
		if (geometry.getGeometries() != null) {
			for (Geometry child : geometry.getGeometries()) {
				addCoordinateArrays(child, coords);
			}
		} else if (geometry.getCoordinates() != null) {
			coords.add(geometry.getCoordinates());
		}
	}