Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions examples/MOD05.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -17,7 +17,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -72,13 +72,13 @@
}
],
"source": [
"staremaster.conversions.gring2cover(granule.gring_lats, \n",
"staremaster.conversions.gring2cover(granule.gring_lats,\n",
" granule.gring_lons, 8).dtype"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -98,7 +98,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -107,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -119,10 +119,10 @@
" ...,\n",
" [12, 12, 12, ..., 11, 11, 11],\n",
" [12, 12, 12, ..., 11, 11, 11],\n",
" [12, 12, 12, ..., 11, 11, 11]])"
" [12, 12, 12, ..., 11, 11, 11]], shape=(406, 270))"
]
},
"execution_count": 9,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -141,7 +141,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "stare2",
"language": "python",
"name": "python3"
},
Expand All @@ -155,7 +155,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.13.2"
}
},
"nbformat": 4,
Expand Down
820 changes: 149 additions & 671 deletions examples/MOD09.ipynb

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion staremaster/create_sidecar_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def create_grid_sidecar(grid, out_path, n_workers):
granule = staremaster.products.IMERG()
elif grid[0] == 'h' and grid[3] == 'v':
granule = staremaster.products.ModisTile(grid)
elif grid == 'snodas':
granule = staremaster.products.SNODAS()
granule.load()
else:
print('unknown grid')
exit()
Expand Down Expand Up @@ -46,6 +49,10 @@ def create_sidecar(file_path, n_workers, product, cover_res, out_path, archive):
granule = staremaster.products.ATMS(file_path)
elif product == 'GOES_ABI_FIXED_GRID':
granule = staremaster.products.GOES_ABI_FIXED_GRID(file_path)
elif product == 'SNODAS':
granule = staremaster.products.SNODAS(file_path)
elif product == 'MERRA2':
granule = staremaster.products.MERRA2(file_path)
else:
print('product not supported')
print('supported products are {}'.format(get_installed_products()))
Expand All @@ -64,7 +71,7 @@ def list_granules(folder, product):
if not product:
product = ''
files = glob.glob(folder + '/*')
pattern = rf'.*{product}.*[^_stare]\.(nc|hdf|HDF5)'.format(product=product.upper())
pattern = rf'.*{product}.*[^_stare]\.(nc4|nc|hdf|HDF5)'.format(product=product.upper())
granules = list(filter(re.compile(pattern).match, files))
return granules

Expand All @@ -87,6 +94,8 @@ def product_name(file_path):
product = 'ATMS'
elif 'MERRA2' in file_path and '.nc4' in file_name:
product = 'MERRA2'
elif 'SNODAS' in file_path:
product = 'SNODAS'
else:
product = None
print('could not determine product for {}'.format(file_path))
Expand Down
4 changes: 2 additions & 2 deletions staremaster/find_missing_sidecars.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

def get_granule_paths(folder, granule_pattern):
granule_paths = sorted(glob.glob(os.path.expanduser(folder) + '/' + '*' ))
pattern = rf'.*/{granule_pattern}.*[^_stare]\.(nc|hdf|HDF5)'
pattern = rf'.*/{granule_pattern}.*[^_stare]\.(nc4|nc|hdf|HDF5)'
granule_paths = list(filter(re.compile(pattern).match, granule_paths))
return granule_paths


def get_sidecar_paths(folder, granule_pattern):
sidecar_paths = sorted(glob.glob(os.path.expanduser(folder) + '/' + '*' ))
pattern = rf'.*/{granule_pattern}.*_stare\.(nc|hdf|HDF5)'
pattern = rf'.*/{granule_pattern}.*_stare\.(nc4|nc|hdf|HDF5)'
sidecar_paths = list(filter(re.compile(pattern).match, sidecar_paths))
return sidecar_paths

Expand Down
3 changes: 2 additions & 1 deletion staremaster/products/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
from staremaster.products.modis_tilegrid import ModisTile
from staremaster.products.goes_abi_fixed_grid import GOES_ABI_FIXED_GRID
from staremaster.products.merra2 import MERRA2
from staremaster.products.amsr2 import AMSR2
from staremaster.products.amsr2 import AMSR2
from staremaster.products.snodas import SNODAS
Loading
Loading