sarapy 1.1.2__py3-none-any.whl → 1.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sarapy/dataProcessing/GeoProcessor.py +33 -2
- sarapy/version.py +1 -1
- {sarapy-1.1.2.dist-info → sarapy-1.1.3.dist-info}/METADATA +5 -1
- {sarapy-1.1.2.dist-info → sarapy-1.1.3.dist-info}/RECORD +7 -7
- {sarapy-1.1.2.dist-info → sarapy-1.1.3.dist-info}/LICENCE +0 -0
- {sarapy-1.1.2.dist-info → sarapy-1.1.3.dist-info}/WHEEL +0 -0
- {sarapy-1.1.2.dist-info → sarapy-1.1.3.dist-info}/top_level.txt +0 -0
|
@@ -39,8 +39,6 @@ class GeoProcessor(BaseEstimator, TransformerMixin):
|
|
|
39
39
|
assert isinstance(X, np.ndarray), "X debe ser un np.array"
|
|
40
40
|
##asserteamos que X tenga dos columnas
|
|
41
41
|
assert X.ndim == 2, "X debe ser de la forma (n, 2)"
|
|
42
|
-
# ##asserteamos que X no tenga valores nulos
|
|
43
|
-
# assert not np.isnan(X).any(), "X no debe tener valores nulos"
|
|
44
42
|
##chequeamos que X tenga una sola fila, si es así, enviamos un warning
|
|
45
43
|
if X.shape[0] == 1:
|
|
46
44
|
warnings.warn("En GeoProcesor.fit(): X tiene una sola fila, por lo tanto no se puede computar la distancia entre los puntos.\
|
|
@@ -79,8 +77,41 @@ class GeoProcessor(BaseEstimator, TransformerMixin):
|
|
|
79
77
|
Returns:
|
|
80
78
|
np.array: np.array con las distancias entre los dos puntos
|
|
81
79
|
"""
|
|
80
|
+
X = self.sanityCheck(X)
|
|
82
81
|
self.fit(X)
|
|
83
82
|
return self.transform(self.points)
|
|
83
|
+
|
|
84
|
+
def sanityCheck(self, X):
|
|
85
|
+
"""Chequea que los datos de latitud y lingitud estén en rangos válidos.
|
|
86
|
+
|
|
87
|
+
- Latitud: -90 a 90
|
|
88
|
+
- Longitud: -180 a 180
|
|
89
|
+
|
|
90
|
+
- X: array con los puntos de latitud y longitud. Shape (n, 2)
|
|
91
|
+
"""
|
|
92
|
+
##calculo los valores medios de latitud y longitud sin contar los valores de latitud fuera de rango (-90, 90)
|
|
93
|
+
##y los valores de longitud fuera de rango (-180, 180)
|
|
94
|
+
|
|
95
|
+
mask_lat = (X[:, 0] >= -90) & (X[:, 0] <= 90)
|
|
96
|
+
mask_lon = (X[:, 1] >= -180) & (X[:, 1] <= 180)
|
|
97
|
+
|
|
98
|
+
X_temp = X[mask_lat & mask_lon]
|
|
99
|
+
self.media_lat = np.mean(X_temp[:, 0])
|
|
100
|
+
self.media_lon = np.mean(X_temp[:, 1])
|
|
101
|
+
|
|
102
|
+
##mensaje de warning si hay valores de latitud fuera de rango
|
|
103
|
+
if not mask_lat.all():
|
|
104
|
+
warnings.warn("Hay valores de latitud fuera de rango. Se reemplazarán por el valor medio de latitud.")
|
|
105
|
+
|
|
106
|
+
##mensaje de warning si hay valores de longitud fuera de rango
|
|
107
|
+
if not mask_lon.all():
|
|
108
|
+
warnings.warn("Hay valores de longitud fuera de rango. Se reemplazarán por el valor medio de longitud.")
|
|
109
|
+
|
|
110
|
+
##reemplazo los valores de latitud y longitud fuera de rango por los valores medios
|
|
111
|
+
X[~mask_lat, 0] = self.media_lat
|
|
112
|
+
X[~mask_lon, 1] = self.media_lon
|
|
113
|
+
|
|
114
|
+
return X
|
|
84
115
|
|
|
85
116
|
@property
|
|
86
117
|
def points(self):
|
sarapy/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
## Version of the package
|
|
2
|
-
__version__ = "1.1.
|
|
2
|
+
__version__ = "1.1.3"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sarapy
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Home-page: https://github.com/lucasbaldezzari/sarapy
|
|
5
5
|
Author: Lucas Baldezzari
|
|
6
6
|
Author-email: Lucas Baldezzari <lmbaldezzari@gmail.com>
|
|
@@ -19,6 +19,10 @@ Requires-Dist: geopy
|
|
|
19
19
|
|
|
20
20
|
Library for processing SARAPICO project metadata of _AMG_.
|
|
21
21
|
|
|
22
|
+
#### Version 1.1.3
|
|
23
|
+
|
|
24
|
+
- Se modifica GeoProcessor para no tener problemas con valores de latitud y longitud fuera de rangos.
|
|
25
|
+
|
|
22
26
|
#### Version 1.1.2
|
|
23
27
|
|
|
24
28
|
- Se modifica TimeSeriesProcessor.transform() para poder usar la modificación realizada en 1.1.1.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
sarapy/__init__.py,sha256=aVoywqGSscYYDycLaYJnz08dlQabl9gH0h4Q5KtHM9o,74
|
|
2
|
-
sarapy/version.py,sha256=
|
|
3
|
-
sarapy/dataProcessing/GeoProcessor.py,sha256=
|
|
2
|
+
sarapy/version.py,sha256=XMwZelUPnYJt_GfegGPZxR6z_nj3U3pzn8-m2u7mvi0,51
|
|
3
|
+
sarapy/dataProcessing/GeoProcessor.py,sha256=ARjgKTXDVdf_cFCXyFmzlnmmmay3HG3q-yeJ9QrAcQU,5919
|
|
4
4
|
sarapy/dataProcessing/OpsProcessor.py,sha256=-mxZPA7V6r7xkkQBICmNBiT7FJGVs3C3D-DaPN34yHE,16433
|
|
5
5
|
sarapy/dataProcessing/TLMSensorDataProcessor.py,sha256=GfSIRYD_biFlOMTfSQSwW0HsUouZuUL3ScvL4uUHTPQ,23824
|
|
6
6
|
sarapy/dataProcessing/TimeSeriesProcessor.py,sha256=-uic18Sut9yMCenbLO1-VabmKifKABt_FbCCP_fLcmE,5403
|
|
@@ -18,8 +18,8 @@ sarapy/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
18
18
|
sarapy/utils/amg_decoder.py,sha256=JZ7cbu7DlCuatuq2F7aBfUr7S7U-K5poBgxw5nY6rNI,4319
|
|
19
19
|
sarapy/utils/amg_ppk.py,sha256=c0GusnxdntU-E0JOezzbIfC7SWoJmKAbad_zYDCJ3-c,1060
|
|
20
20
|
sarapy/utils/getRawOperations.py,sha256=8aA1fIkNCnUYgiWfnFggRT_U35z432gZBrZ7seGO5w4,817
|
|
21
|
-
sarapy-1.1.
|
|
22
|
-
sarapy-1.1.
|
|
23
|
-
sarapy-1.1.
|
|
24
|
-
sarapy-1.1.
|
|
25
|
-
sarapy-1.1.
|
|
21
|
+
sarapy-1.1.3.dist-info/LICENCE,sha256=N00sU3vSQ6F5c2vML9_qP4IFTkCPFFj0YGDB2CZP-uQ,840
|
|
22
|
+
sarapy-1.1.3.dist-info/METADATA,sha256=wrx25yDTSjHfV3NK-psqZ4Pv_vZ2KeEm7CZKc02jPsw,2990
|
|
23
|
+
sarapy-1.1.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
24
|
+
sarapy-1.1.3.dist-info/top_level.txt,sha256=4mUGZXfX2Fw47fpY6MQkaJeuOs_8tbjLkkNp34DJWiA,7
|
|
25
|
+
sarapy-1.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|