[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KH6SQ3493TJ2Z2ZW36VRDQ":3,"skill-same:01M6KH6SQ3493TJ2Z2ZW36VRDQ":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6KH6SQ3493TJ2Z2ZW36VRDQ","glm-output-extraction",null,"How to extract water temperature profiles from GLM NetCDF output files (output.nc). Use this skill when you need to read GLM simulation results, extract depth and temperature arrays, and construct a dataframe of simulated temperatures at specific depths and times.","cxcscmu\u002FSkillLearnBench","cxcscmu","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142838272?v=4","01M6KCQDFQWPDSN0MKZY96MSQP","01M6KCQDM7G70TKJ28NTSQC0RZ",93,"MIT","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb3-teacher-feedback-claude-opus-4-6\u002Ftemperature-simulation\u002Frun3_glm-output-extraction\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"glm","glm output extraction","output","extraction","how to","glm simulation","at","netcdf","you","profiles","temperature","simulation","how","dataframe","arrays","files","use","extract","results","read","2026-11-10 10:12:30",false,"---\nname: glm-output-extraction\ndescription: How to extract water temperature profiles from GLM NetCDF output files (output.nc). Use this skill when you need to read GLM simulation results, extract depth and temperature arrays, and construct a dataframe of simulated temperatures at specific depths and times.\n---\n\n## GLM NetCDF Output Structure\n\nGLM writes output to a NetCDF file (typically `output.nc`). Key variables:\n\n### Variables and Their Shapes\n- `time`: 1D array of hours since a reference time (e.g., hours since 1904-01-01 00:00:00)\n- `z`: **4D array with shape `(n_times, n_layers, 1, 1)`** — the height of each layer above the lake bottom (meters)\n- `temp`: **4D array with shape `(n_times, n_layers, 1, 1)`** — water temperature (°C)\n- `NS`: 1D array — number of active layers at each timestep\n\n**CRITICAL**: `z` and `temp` are 4D, NOT 2D. You must index them as `z[t_idx, layer_idx, 0, 0]` and `temp[t_idx, layer_idx, 0, 0]`, or squeeze them first: `z_squeezed = z[:, :, 0, 0]` and `temp_squeezed = temp[:, :, 0, 0]`.\n\n### Converting GLM Time to Datetime\n\n```python\nimport netCDF4 as nc\nimport pandas as pd\n\nds = nc.Dataset('\u002Froot\u002Foutput\u002Foutput.nc')\ntime_var = ds.variables['time']\n# Use netCDF4's num2date, then convert to pd.Timestamp\nraw_dates = nc.num2date(time_var[:], units=time_var.units)\n# CRITICAL: Convert to pd.Timestamp for exact merge compatibility\nsim_times = [pd.Timestamp(d.strftime('%Y-%m-%d %H:%M:%S')) for d in raw_dates]\n```\n\n### Extracting Temperature at Specific Depths\n\nGLM layers are counted from bottom up. The actual depth from surface is computed as:\n```\ndepth_from_surface = lake_depth - z_height_above_bottom\n```\n\n**CRITICAL**: Read `lake_depth` dynamically from the nml file, do NOT hardcode it:\n```python\nimport re\nwith open('\u002Froot\u002Fglm3.nml', 'r') as f:\n    nml_text = f.read()\nmatch = re.search(r'lake_depth\\s*=\\s*([\\d.]+)', nml_text)\nlake_depth = float(match.group(1))\n```\n\n### Full Extraction to DataFrame\n\n```python\nimport numpy as np\nimport netCDF4 as nc\nimport pandas as pd\n\nds = nc.Dataset('\u002Froot\u002Foutput\u002Foutput.nc')\ntime_var = ds.variables['time']\nraw_dates = nc.num2date(time_var[:], units=time_var.units)\nsim_times = [pd.Timestamp(d.strftime('%Y-%m-%d %H:%M:%S')) for d in raw_dates]\n\nz = ds.variables['z'][:, :, 0, 0]       # squeeze to (n_times, n_layers)\ntemp = ds.variables['temp'][:, :, 0, 0]  # squeeze to (n_times, n_layers)\nNS = ds.variables['NS'][:]\n\n# Read lake_depth from nml\nwith open('\u002Froot\u002Fglm3.nml', 'r') as f:\n    nml_text = f.read()\nlake_depth = float(re.search(r'lake_depth\\s*=\\s*([\\d.]+)', nml_text).group(1))\n\nrecords = []\nfor t_idx in range(len(sim_times)):\n    n_layers = int(NS[t_idx])\n    for layer_idx in range(n_layers):\n        depth_from_surface = lake_depth - z[t_idx, layer_idx]\n        rounded_depth = round(depth_from_surface)\n        records.append({\n            'datetime': sim_times[t_idx],\n            'depth_rounded': rounded_depth,\n            'sim_temp': temp[t_idx, layer_idx]\n        })\n\nsim_df = pd.DataFrame(records)\n# If multiple layers map to the same rounded depth at the same time, average them\nsim_df = sim_df.groupby(['datetime', 'depth_rounded'], as_index=False)['sim_temp'].mean()\n```\n\n### Datetime Alignment Warning\n\nGLM typically outputs at a specific time of day (often noon 12:00:00). Observations may have different times. For an **exact datetime merge**, both sides must have identical datetime values. Check both:\n\n```python\nprint(\"Sim times sample:\", sim_df['datetime'].iloc[:3].tolist())\nprint(\"Obs times sample:\", obs_df['datetime'].iloc[:3].tolist())\n```\n\nIf observations are date-only (00:00:00) and simulation is at noon, you may need to normalize:\n```python\n# Option: normalize both to date only\nsim_df['datetime'] = sim_df['datetime'].dt.normalize()\nobs_df['datetime'] = pd.to_datetime(obs_df['datetime']).dt.normalize()\n```\n\nOnly do this if the task allows it or if exact merge otherwise yields zero pairs.","## GLM NetCDF Output Structure\n\nGLM writes output to a NetCDF file (typically `output.nc`). Key variables:\n\n### Variables and Their Shapes\n- `time`: 1D array of hours since a reference time (e.g., hours since 1904-01-01 00:00:00)\n- `z`: **4D array with shape `(n_times, n_layers, 1, 1)`** — the height of each layer above the lake bottom (meters)\n- `temp`: **4D array with shape `(n_times, n_layers, 1, 1)`** — water temperature (°C)\n- `NS`: 1D array — number of active layers at each timestep\n\n**CRITICAL**: `z` and `temp` are 4D, NOT 2D. You must index them as `z[t_idx, layer_idx, 0, 0]` and `temp[t_idx, layer_idx, 0, 0]`, or squeeze them first: `z_squeezed = z[:, :, 0, 0]` and `temp_squeezed = temp[:, :, 0, 0]`.\n\n### Converting GLM Time to Datetime\n\n```python\nimport netCDF4 as nc\nimport pandas as pd\n\nds = nc.Dataset('\u002Froot\u002Foutput\u002Foutput.nc')\ntime_var = ds.variables['time']\n# Use netCDF4's num2date, then convert to pd.Timestamp\nraw_dates = nc.num2date(time_var[:], units=time_var.units)\n# CRITICAL: Convert to pd.Timestamp for exact merge compatibility\nsim_times = [pd.Timestamp(d.strftime('%Y-%m-%d %H:%M:%S')) for d in raw_dates]\n```\n\n### Extracting Temperature at Specific Depths\n\nGLM layers are counted from bottom up. The actual depth from surface is computed as:\n```\ndepth_from_surface = lake_depth - z_height_above_bottom\n```\n\n**CRITICAL**: Read `lake_depth` dynamically from the nml file, do NOT hardcode it:\n```python\nimport re\nwith open('\u002Froot\u002Fglm3.nml', 'r') as f:\n    nml_text = f.read()\nmatch = re.search(r'lake_depth\\s*=\\s*([\\d.]+)', nml_text)\nlake_depth = float(match.group(1))\n```\n\n### Full Extraction to DataFrame\n\n```python\nimport numpy as np\nimport netCDF4 as nc\nimport pandas as pd\n\nds = nc.Dataset('\u002Froot\u002Foutput\u002Foutput.nc')\ntime_var = ds.variables['time']\nraw_dates = nc.num2date(time_var[:], units=time_var.units)\nsim_times = [pd.Timestamp(d.strftime('%Y-%m-%d %H:%M:%S')) for d in raw_dates]\n\nz = ds.variables['z'][:, :, 0, 0]       # squeeze to (n_times, n_layers)\ntemp = ds.variables['temp'][:, :, 0, 0]  # squeeze to (n_times, n_layers)\nNS = ds.variables['NS'][:]\n\n# Read lake_depth from nml\nwith open('\u002Froot\u002Fglm3.nml', 'r') as f:\n    nml_text = f.read()\nlake_depth = float(re.search(r'lake_depth\\s*=\\s*([\\d.]+)', nml_text).group(1))\n\nrecords = []\nfor t_idx in range(len(sim_times)):\n    n_layers = int(NS[t_idx])\n    for layer_idx in range(n_layers):\n        depth_from_surface = lake_depth - z[t_idx, layer_idx]\n        rounded_depth = round(depth_from_surface)\n        records.append({\n            'datetime': sim_times[t_idx],\n            'depth_rounded': rounded_depth,\n            'sim_temp': temp[t_idx, layer_idx]\n        })\n\nsim_df = pd.DataFrame(records)\n# If multiple layers map to the same rounded depth at the same time, average them\nsim_df = sim_df.groupby(['datetime', 'depth_rounded'], as_index=False)['sim_temp'].mean()\n```\n\n### Datetime Alignment Warning\n\nGLM typically outputs at a specific time of day (often noon 12:00:00). Observations may have different times. For an **exact datetime merge**, both sides must have identical datetime values. Check both:\n\n```python\nprint(\"Sim times sample:\", sim_df['datetime'].iloc[:3].tolist())\nprint(\"Obs times sample:\", obs_df['datetime'].iloc[:3].tolist())\n```\n\nIf observations are date-only (00:00:00) and simulation is at noon, you may need to normalize:\n```python\n# Option: normalize both to date only\nsim_df['datetime'] = sim_df['datetime'].dt.normalize()\nobs_df['datetime'] = pd.to_datetime(obs_df['datetime']).dt.normalize()\n```\n\nOnly do this if the task allows it or if exact merge otherwise yields zero pairs.",{"name":5,"description":7},"main","726e1f79b96b0cb3d729d0e55a1c847e0b5353ae","skills\u002Fb3-teacher-feedback-claude-opus-4-6\u002Ftemperature-simulation\u002Frun3_glm-output-extraction",8,"https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench","https:\u002F\u002Fcxcscmu.github.io\u002FSkillLearnBench","https:\u002F\u002Fgithub.com\u002Fcxcscmu","2026-10-02 22:55:36",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add cxcscmu\u002FSkillLearnBench --skill glm-output-extraction",{"tool":57,"command":58},"bunx","bunx skills add cxcscmu\u002FSkillLearnBench --skill glm-output-extraction",{"tool":60,"command":61},"pnpm","pnpm dlx skills add cxcscmu\u002FSkillLearnBench --skill glm-output-extraction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb3-teacher-feedback-claude-opus-4-6\u002Ftemperature-simulation\u002Frun3_glm-output-extraction\u002FSKILL.md",true,[],[66,79,101,118,136,147],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":38},"01M6KM5KH175P5ABP5JMX2SBDQ","object_counter","Count occurrences of an object in the image using computer vision algorithm.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Fvideo-object-counting\u002Fobject_counter\u002FSKILL.md",[],[73,74,75,76,77,78],"object counter","object","vision","computer","Computer Vision","image",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":38},"01M6KM51TMVXG79MMPCS6Y8G86","travel-planning-workflow","Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Ftravel-planning-workflow\u002FSKILL.md",[],[86,87,88,89,90,91,92,93,94,95,96,97,98,99,100],"workflow","planning","planning workflow","travel","travel planning","travel planning workflow","structured","performing","plan","for","user","it","requirements","essential","itineraries",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":38},"01M6KM4DY820XHS9YTSK5QP5HD","bundled-dataset-search-tool","invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Fbundled-dataset-search-tool\u002FSKILL.md",[],[108,109,110,111,112,113,114,89,115,116,90,26,95,117,87],"search","tool","dataset","bundled dataset search tool","restaurants","Tools","up","look","flights","database",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6KM465BB9PQ0B548HQSVAWZ","glm-output","Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final \u002Froot\u002Fmetrics.json.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-output\u002FSKILL.md",[],[125,20,18,95,126,127,128,129,130,131,132,133,26,134,135],"glm output","tasks","metrics","json","basics","guidance","matching","verifier","processing","root","calibration",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":38},"01M6KM40KY3QWDW5W97S39R2BC","glm-calibration","Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-calibration\u002FSKILL.md",[],[143,135,18,20,130,129,126,144,145,95,146],"glm calibration","setup","companion","metric",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":38},"01M6KM3VHHVSGMGHJQB3PPT6YG","glm-basics","A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-basics\u002FSKILL.md",[],[154,18,129,155,143,135,95,20,156,33,157,34,30,158,126],"glm basics","inspect","relevant","good","Evaluation"]