Spaces:
Running
on
L4
Running
on
L4
Update helpers/functional.py
Browse files- helpers/functional.py +5 -0
helpers/functional.py
CHANGED
|
@@ -2,6 +2,7 @@ from fsspec.parquet import open_parquet_file
|
|
| 2 |
import fsspec
|
| 3 |
import pyarrow.parquet as pq
|
| 4 |
from .grid import *
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
from io import BytesIO
|
| 7 |
import os
|
|
@@ -139,6 +140,10 @@ def text_to_image(text, return_centre=False, return_gridcell=False, return_times
|
|
| 139 |
|
| 140 |
def cell_to_image(cell, return_centre=False, return_gridcell=False, return_timestamp=False, source='Sentinel-2 L2A'):
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
# 3. translate major-tom cell to row in parquet
|
| 143 |
df = df_dict[source]
|
| 144 |
row = cell2row(cell, df, return_row = True)
|
|
|
|
| 2 |
import fsspec
|
| 3 |
import pyarrow.parquet as pq
|
| 4 |
from .grid import *
|
| 5 |
+
from .ReadAlphaEarth import *
|
| 6 |
import pandas as pd
|
| 7 |
from io import BytesIO
|
| 8 |
import os
|
|
|
|
| 140 |
|
| 141 |
def cell_to_image(cell, return_centre=False, return_gridcell=False, return_timestamp=False, source='Sentinel-2 L2A'):
|
| 142 |
|
| 143 |
+
# AEF is special - it's read live
|
| 144 |
+
if source == 'AlphaEarth Embeddings':
|
| 145 |
+
return cell_to_aef(cell, return_centre=return_centre, return_gridcell=return_gridcell, return_timestamp=return_timestamp)
|
| 146 |
+
|
| 147 |
# 3. translate major-tom cell to row in parquet
|
| 148 |
df = df_dict[source]
|
| 149 |
row = cell2row(cell, df, return_row = True)
|