Skip to content

Instantly share code, notes, and snippets.

View 7yl4r's full-sized avatar

Tylar 7yl4r

View GitHub Profile
# analysis of west_of_canal and east_of_canal
import pandas as pd
import matplotlib.pyplot as plt
from pathlib import Path
# --- CONFIG ---
INDEX = "NDMoI"
files = {
import pandas as pd
import matplotlib.pyplot as plt
from pathlib import Path
# --- CONFIG ---
INDEX = "NDMoI"
AOI = "mangrove_recovery_RB"
# AOI = "mangrove_recovery_JB"
# AOI = "mangrove_death_JB"
# AOI = "mangrove_death_RB"
@7yl4r
7yl4r / gee.js
Last active August 6, 2025 16:05
Claudia's Placencia mangrove
/**
MANGROVE CLASSIFICATION SCRIPT
For Placencia 2025 USING SENTINEL 2
2025/06/09
Claudia Baron-Aguilar
Previous steps.
1. Selection of best image (Using Image selection code)
2. selection of positive and negative goriud-truth points
(Creating List of coordinates code with anotehr code)
@7yl4r
7yl4r / USAGE.md
Last active August 6, 2025 18:34
install process for planktoscope segmentation machine

This linux (ubuntu) machine is used to segement images from a planktoScope for submission to EcoTaxa.

To do this:

  1. Planktoscope must be on and connected (via wifi)
  2. Open a terminal on the desktop (ctrl+alt+t)
  3. Type ./copyPlanktoScopeImages.sh and press enter
  • this will prompt for the PlanktoScope password.
    • NOTE: nothing will show while typing the password.
  • NOTE: use "tab completion" to make this easier
@7yl4r
7yl4r / deglint.js
Last active July 25, 2025 18:04
Deglinting for Planet Imagery in GEE
var image = ee.Image('...Image Asset Path Here...')
var sunglintRegions = geometry; // this is a geometry of sunglinted areas
// Select the bands
var NIR = image.select('b8'); // NIR
var minNIR = NIR.reduceRegion({
reducer: ee.Reducer.min(),
geometry: NIR.geometry(),
scale: 4,
2025-07-16 13:33:47.371 | INFO | planktoscope.mqtt:on_message:150 - segmenter_client: segmenter/segment 0 b'{"action":"segment","path":["/home/pi/data/img/sfer_mbon_ws16130_ws_200um_20160510_real","/home/pi/data/img/sfer_mbon_ws16207_ws_200um_20160726"],"settings":{"force":false,"recursive":true,"ecotaxa":true,"keep":true,"process_id":1}}'
2025-07-16 13:33:47.371 | DEBUG | planktoscope.mqtt:on_message:154 - command is segment
2025-07-16 13:33:47.371 | DEBUG | planktoscope.mqtt:on_message:157 - args are {'action': 'segment', 'path': ['/home/pi/data/img/sfer_mbon_ws16130_ws_200um_20160510_real', '/home/pi/data/img/sfer_mbon_ws16207_ws_200um_20160726'], 'settings': {'force': False, 'recursive': True, 'ecotaxa': True, 'keep': True, 'process_id': 1}}
2025-07-16 13:33:47.371 | DEBUG | planktoscope.mqtt:on_message:159 - msg is {'topic': 'segmenter/segment', 'payload': {'action': 'segment', 'path': ['/home/pi/data/img/sfer_mbon_ws16130_ws_200um_20160510_real', '/home/pi/data/img/sfer_mbon_ws16207_ws_200u
original.analyte.name == "Ammonium" ~ "Ammonium",
original.analyte.name == "Ammonia__N_" ~ "Ammonia",
original.analyte.name == "Chlorophyll_a" ~ "Chlorophyll_a",
original.analyte.name == "Chlorophyll_a-_uncorrected" ~ "Chlorophyll_a",
original.analyte.name == "Chlorophyll_a__uncorrected_for_pheophytin" ~ "Chlorophyll_a"
original.analyte.name == "Chlorophyll_a__free_of_pheophytin" ~ "Chlorophyll_a",
original.analyte.name == "Chlorophyll_a-_corrected" ~ "Chlorophyll_a",
original.analyte.name == "Chlorophyll_a__corrected_for_pheophytin" ~ "Chlorophyll_a",
graph TD

subgraph st_andrew_assets_folder
    roi_hab1(seagrass)
    roi_hab2(sand)
    roi_hab3(etc...)
end
import re
def canonical_station_name(station_name):
station_aliases = {
"1": ["1"],
"2": ["2"],
"3": ["3"],
"4": ["4"],
"5": ["5"],
"5.5": ["5.5"],