Skip to content

Commit

Permalink
run poetry lock and replace prints with logger.infos
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCWill committed Jul 30, 2024
1 parent ab194ed commit e8ae7bb
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 151 deletions.
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions imgcorrect/corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ def get_corrections(
image_df = io.apply_sensor_settings(image_df)

# Get autoexposure correction:
print("Getting autoexposure")
logger.info("Getting autoexposure")
image_df["autoexposure"] = image_df.progress_apply(
lambda row: imgparse.get_autoexposure(row.image_path, row.EXIF) / 100, axis=1
)

# Get and sort by timestamp
print("Getting timestamps")
logger.info("Getting timestamps")

def _get_timestamp(exif):
return datetime.strptime(
Expand All @@ -226,7 +226,7 @@ def _get_timestamp(exif):
image_df = image_df.set_index("timestamp", drop=False).sort_index()

# Attempt to parse ILS metadata
print("Getting ILS")
logger.info("Getting ILS")
try:

def _get_ils(row):
Expand All @@ -242,12 +242,12 @@ def _get_ils(row):

# Split out calibration images, if present:
if not no_reflectance_correct:
print("Creating calibration dataframe")
logger.info("Creating calibration dataframe")
calibration_df, image_df = io.create_cal_df(image_df, calibration_id)

# Get ILS correction:
if not no_ils_correct:
print("Computing ILS correction")
logger.info("Computing ILS correction")
image_df = compute_ils_correction(image_df)
else:
image_df["ILS_ratio"] = 1
Expand All @@ -256,7 +256,7 @@ def _get_ils(row):
calibration_sets = None
selected_group_id = None
if not no_reflectance_correct:
print("Computing reflectance correction")
logger.info("Computing reflectance correction")
image_df, calibration_sets, selected_group_id = compute_reflectance_correction(
image_df, calibration_df, not no_ils_correct
)
Expand Down
2 changes: 1 addition & 1 deletion imgcorrect/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def apply_sensor_settings(image_df):
v = new_image_df.ID.value_counts()
# remove images that don't appear in every band
new_image_df = new_image_df[new_image_df.ID.isin(v.index[v.eq(band_count)])]
print(
logger.info(
f"Skipping {images_before_filtering - len(new_image_df.index)} images because they don't have data for all bands"
)

Expand Down
Loading

0 comments on commit e8ae7bb

Please sign in to comment.