Skip to content

Commit e1d9fcc

Browse files
committed
updated logging to be less anoying
1 parent 323b817 commit e1d9fcc

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

cryogrid_pytools/data/from_earth_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_modis_albedo_500m(bbox_WSEN, res=500, **kwargs) -> xr.DataArray:
4848

4949
# Load the MODIS image collection
5050
image_collection = ee.ImageCollection("MODIS/061/MCD43A3")
51-
logger.info(
51+
logger.debug(
5252
"Fetching MODIS albedo data from Earth Engine (MODIS/061/MCD43A3 @ 500m)"
5353
)
5454

@@ -121,7 +121,7 @@ def get_aster_ged_100m_v3(bbox_WSEN, res=100, **kwargs):
121121

122122
# Load the ASTER GED image
123123
image = ee.Image("NASA/ASTER_GED/AG100_003")
124-
logger.info(
124+
logger.debug(
125125
"Fetching ASTER-GED emissivity data from Earth Engine (NASA/ASTER_GED/AG100_003 @ 100m)"
126126
)
127127

cryogrid_pytools/data/from_planetary_computer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def get_dem_copernicus(
9090

9191
check_epsg(epsg)
9292

93-
_logger.info(
93+
_logger.debug(
9494
f"Fetching COP DEM Global data from Planetary Computer ({collection} @ {res:.2g})"
9595
)
9696
items = search_stac_items_planetary_computer(collection, bbox_WSEN)
@@ -170,7 +170,7 @@ def get_land_cover_classes(item):
170170
# make sure epsg is supported
171171
check_epsg(epsg)
172172

173-
_logger.info(
173+
_logger.debug(
174174
f"Fetching ESA World Cover (v2.0) data from Planetary Computer (esa-worldcover @ {res}m)"
175175
)
176176
items = search_stac_items_planetary_computer(
@@ -309,7 +309,7 @@ def get_sentinel2_data(
309309

310310
da_list = []
311311
for year in years:
312-
_logger.info(
312+
_logger.debug(
313313
f"Getting Sentinel-2 SCL granules @{res}m for {year} with max cloud cover = {max_cloud_cover}%"
314314
)
315315

@@ -376,7 +376,7 @@ def get_snow_melt_doy(
376376
bbox_WSEN, years=years, res=res, epsg=epsg, max_cloud_cover=10
377377
)
378378

379-
_logger.info("Calculating snow melt day of year (DOY) from Sentinel-2 SCL data")
379+
_logger.debug("Calculating snow melt day of year (DOY) from Sentinel-2 SCL data")
380380
doy = da.groupby("time.year").apply(_calc_sentinel2_snow_melt_doy)
381381

382382
return doy

cryogrid_pytools/excel_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(self, fname_xls: str, check_file_paths=True, check_strat_layers=Tru
7676
if check_strat_layers:
7777
self.check_strat_layers()
7878

79-
logger.info(
79+
logger.debug(
8080
f"Start and end times: {self.time.time_start:%Y-%m-%d} - {self.time.time_end:%Y-%m-%d}"
8181
)
8282

@@ -94,7 +94,7 @@ def _get_root_path(self):
9494
flist = path.glob("run_cryogrid.m")
9595
if len(list(flist)) > 0:
9696
self.root = path
97-
logger.info(f"Found root path: {path}")
97+
logger.debug(f"Found root path: {path}")
9898
return self.root
9999
elif str(path) == "/":
100100
logger.warning(
@@ -319,7 +319,7 @@ def get_class(self, class_name: str) -> pd.DataFrame:
319319
except Exception:
320320
# only intended for debugging
321321
df = blocks
322-
logger.warning(f"Could not concatenate blocks for class: {class_name}")
322+
logger.debug(f"Could not concatenate blocks for class: {class_name}")
323323

324324
return df
325325

@@ -441,7 +441,7 @@ def check_strat_layers(self):
441441
Run checks to ensure stratigraphy layers have physically plausible parameter values.
442442
"""
443443
strat_layers = self.get_class("STRAT_layers")
444-
logger.info("Checking stratigraphy layers...")
444+
logger.debug("Checking stratigraphy layers...")
445445
for layer in strat_layers:
446446
try:
447447
check_strat_layer_values(strat_layers[layer].iloc[0])
@@ -456,7 +456,7 @@ def check_files_exist(self):
456456

457457
flist = set(self.fname.values())
458458

459-
logger.info("Checking file locations...")
459+
logger.debug("Checking file locations...")
460460
for f in flist:
461461
if not f.exists():
462462
logger.warning(f"Cannot find file: {f}")

cryogrid_pytools/outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def read_OUT_regridded_files(
230230
depth = ds.depth.mean("index").compute()
231231
ds = ds.assign_coords(depth=depth)
232232
# now that depths are the same, we can rename the index to depth from the surface
233-
logger.info(
233+
logger.debug(
234234
"Depths are the same for all gridcells. Setting depth as the dimension."
235235
)
236236
ds = ds.swap_dims(level="depth")

0 commit comments

Comments
 (0)