本文へ移動
cccskills
無料GitHub で公開

ameriflux-bif-timeseries-sorter

Sort AmeriFlux BASE-BADM BIF variables from Excel or CSV files into observation, management-event, static metadata, and plotting-ready target time-series tables. Use when Codex is asked to sort AmeriFlux BIF variables into time series; organize BADM/BIF variables by date; pivot AMF *_BIF_*.xlsx files by GROUP_ID; output total LAI, leaf mass per area, above-ground biomass, canopy height, fruit yield, or total yield time series; write MATLAB readers for BIF time-series plotting; or prepare dated AmeriFlux site observations and management records for EcoSIM workflows.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md6.0 KB
  • agents/openai.yaml330 B
  • scripts/read_bif_target_timeseries.m4.6 KB
  • scripts/sort_bif_timeseries.py19.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

AmeriFlux BIF Time-Series Sorter

Overview

Use this skill to convert AmeriFlux BADM BIF long tables into time-series tables. BIF files commonly store one variable per row with columns such as SITE_ID, GROUP_ID, VARIABLE_GROUP, VARIABLE, and DATAVALUE. A single dated observation or management event is reconstructed by grouping rows with the same SITE_ID, VARIABLE_GROUP, and GROUP_ID.

When To Use

Use this skill for requests such as:

  • sort variables into time series
  • sort AmeriFlux BIF variables into time series
  • organize BADM variables by date
  • convert AMF_<SITE>_BIF_*.xlsx into dated observation and management tables
  • prepare BIF site observations or management events for EcoSIM comparison/input workflows

Do not treat BIF files as continuous half-hourly BASE flux files. BIF/BADM records are metadata, biological observations, soil observations, and management/event records, often irregular in time.

Workflow

  1. Inspect the input workbook or CSV.

    • Prefer the AMF-BIF sheet for AmeriFlux BIF Excel files.
    • Confirm required columns: SITE_ID, GROUP_ID, VARIABLE_GROUP, VARIABLE, DATAVALUE.
    • Record the site ID and the source file path.
  2. Reconstruct records.

    • Group rows by SITE_ID, VARIABLE_GROUP, and GROUP_ID.
    • Pivot VARIABLE names into columns and keep raw DATAVALUE strings.
    • Preserve comments, units, depth/profile fields, species/organ/phenology qualifiers, and date uncertainty fields.
  3. Identify date-bearing records.

    • Treat variables ending in _DATE as observation dates.
    • Treat variables ending in _DATE_START and _DATE_END as event intervals.
    • Preserve _DATE_UNC as a qualifier, not as the timestamp.
    • Normalize dates like YYYYMMDD to YYYY-MM-DD for sorting, while keeping raw values in the original variable columns.
  4. Classify record groups.

    • Observation series: dated biological or soil observations, for example GRP_AG_BIOMASS_CROP, GRP_LAI, GRP_HEIGHTC, GRP_LMA, GRP_BIOMASS_CHEM, GRP_SOIL_CHEM, and GRP_SPP_O.
    • Management/event series: dated site operations, usually GRP_DM_*, such as planting, fertilization, tillage, pesticide, agriculture, or external-weather events.
    • Static metadata: records without a usable date, such as location, climate averages, soil texture, IGBP, DOI, team members, and references.
  5. Write outputs under result/<SITE_ID>/bif_timeseries/ unless the user asks for another path.

    • all_records_wide.csv: one row per reconstructed BIF record, sorted by series class, variable group, timestamp, and group ID.
    • time_series_long.csv: one row per main data variable from date-bearing records, with timestamp, date_start, date_end, unit, raw_value, and qualifiers_json.
    • by_group/<VARIABLE_GROUP>.csv: one wide dated table per variable group.
    • target_timeseries/total_lai.csv: plotting-ready rows from GRP_LAI variable LAI_TOT.
    • target_timeseries/leaf_mass_per_area.csv: plotting-ready rows from GRP_LMA variable LMA.
    • target_timeseries/aboveground_biomass.csv: plotting-ready rows from GRP_AG_BIOMASS_CROP variable AG_BIOMASS_CROP, preserving organ, phenology, unit, and comments.
    • target_timeseries/canopy_height.csv: plotting-ready rows from GRP_HEIGHTC variable HEIGHTC, preserving statistic qualifiers.
    • target_timeseries/fruit_yield.csv: plotting-ready rows from GRP_AG_PROD_CROP variable AG_PROD_CROP where AG_PROD_CROP_ORGAN is Fruits.
    • target_timeseries/total_yield.csv: plotting-ready rows from GRP_AG_PROD_CROP variable AG_PROD_CROP where AG_PROD_CROP_ORGAN is Total.
    • static_metadata.csv: wide records without usable dates.
    • summary.json: counts, groups, date fields, and output paths.
  6. Report the result.

    • List observation time series, management/event series, and static metadata groups.
    • Mention records that lacked dates and were not sorted as time series.
    • For EcoSIM use, flag which groups can inform comparison targets versus management inputs.

Bundled Script

Use scripts/sort_bif_timeseries.py for deterministic conversion:

python3 .agents/skills/ameriflux-bif-timeseries-sorter/scripts/sort_bif_timeseries.py \
  /path/to/AMF_US-Ne3_BIF_20250522.xlsx \
  --out-dir result/US-Ne3/bif_timeseries

The script accepts .xlsx, .xlsm, and CSV files. It uses openpyxl for Excel input and writes only CSV/JSON outputs.

Use scripts/read_bif_target_timeseries.m in MATLAB to read the plotting-ready target files:

data = read_bif_target_timeseries("result/US-Ne3/bif_timeseries", true);

The returned struct contains data.total_lai, data.leaf_mass_per_area, data.aboveground_biomass, data.canopy_height, data.fruit_yield, and data.total_yield tables. Each table includes Time as datetime and Value as numeric when the source values can be parsed.

EcoSIM Notes

  • Use observation groups such as LAI, crop biomass, yield/crop production, height, biomass chemistry, and soil chemistry for model-data comparison after checking units and aggregation windows.
  • Use GRP_DM_* groups as candidate management inputs, but check event semantics before converting to EcoSIM planting, harvest, fertilization, irrigation, tillage, or pesticide records.
  • Do not silently convert units. Preserve raw units and report missing units where comparisons or EcoSIM inputs require conversion.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Extract EPA/NADP tDEP atmospheric deposition and NADP precipitation chemistry rasters for an AmeriFlux or EcoSIM site. Use when deriving atmospheric chemistry inputs such as NH4, NO3, SO4, Ca, or precipitation pH for EcoSIM forcing workflows.

日本語の概要は準備中です。原文の説明を表示しています。

bioepic-data/ecosim-agent32026年10月12日 更新

Extract AmeriFlux BASE-BADM/BIF crop management records into EcoSIM-editable plant-management and soil-management Excel workbooks that can be converted to EcoSIM NetCDF files. Use when asked to derive EcoSIM planting, harvest, fertilizer, or tillage management inputs from AMF *_BIF_*.xlsx or BIF CSV files, especially for crop sites where management details live in GRP_DM_* records and DM_COMMENT fields.

日本語の概要は準備中です。原文の説明を表示しています。

bioepic-data/ecosim-agent32026年10月12日 更新

Convert AmeriFlux ERA5 half-hourly meteorological CSV files into EcoSIM hourly climate forcing NetCDF files, compare generated forcing against overlapping measured tower meteorology when a FULLSET file is available, and report large biases or errors. Use when preparing or validating EcoSIM climate inputs for AmeriFlux sites, checking ERA5 against in situ records, diagnosing forcing discrepancies, or writing climate-quality reports. For non-AmeriFlux paper sites that need a fresh Copernicus CDS ERA5 point download by longitude/latitude, use era5-cds-point-download first.

日本語の概要は準備中です。原文の説明を表示しています。

bioepic-data/ecosim-agent32026年10月12日 更新

Create EcoSIM Fortran namelist files and workable EcoSIM run folders for AmeriFlux site runs from site-specific grid, plant management, climate forcing, and greenhouse-gas inputs. Use when preparing or updating an EcoSIM `.namelist`, run folder, runfolder, run directory, or executable-ready site case for AmeriFlux or FLUXNET sites, especially after generating `*_ecosim_grid.nc`, `*_ecosim_climate_<first>-<last>.nc`, and `*_pft_mgmt.nc` inputs.

日本語の概要は準備中です。原文の説明を表示しています。

bioepic-data/ecosim-agent32026年10月12日 更新

Extract AmeriFlux site metadata and map it to EcoSIM JSON variables. Use when a task needs site latitude, longitude, elevation, mean annual temperature, Koppen climate code, or vegetation type for an AmeriFlux site ID or flux-site name.

日本語の概要は準備中です。原文の説明を表示しています。

bioepic-data/ecosim-agent32026年10月12日 更新

Extract dominant-component soil profile variables for EcoSIM grid or template inputs from gSSURGO, with FAO HWSD v2.0 fallback when gSSURGO data are unavailable or incomplete. Use when deriving soil depth, bulk density, field capacity, wilting point, hydraulic conductivity, texture, rock fraction, pH, CEC, or soil organic carbon; or when converting EcoSIM grid NetCDF files to editable Excel workbooks and back.

日本語の概要は準備中です。原文の説明を表示しています。

bioepic-data/ecosim-agent32026年10月12日 更新

bioepic-data のスキルをすべて見る

このスキルの問題を報告する