Skip to content

Clarify cloudBaseHeight return value: AGL vs MSL#26

Merged
oyve merged 2 commits intodevfrom
copilot/document-cloudbase-height-return
Oct 28, 2025
Merged

Clarify cloudBaseHeight return value: AGL vs MSL#26
oyve merged 2 commits intodevfrom
copilot/document-cloudbase-height-return

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

The cloudBaseHeight function documentation was ambiguous about whether it returns height above ground level (AGL) or mean sea level (MSL). The formula shown only displayed the LCL calculation without indicating the altitude offset is added.

Documentation Changes

  • Explicitly document that return value depends on altitude parameter:
    • altitude = 0 (default): returns AGL
    • altitude > 0: returns MSL
  • Show both formula components:
    • Height above surface (AGL) = (T - Td) × 124.7 meters
    • Height above MSL = altitude + (T - Td) × 124.7 meters
  • Add examples demonstrating both use cases
  • Add reference to Wikipedia's Lifted Condensation Level article

Example Usage

// At sea level: returns height above ground
const cloudHeightAGL = cloudBaseHeight(293.15, 283.15);
// 1247 meters above ground level

// At elevated location: returns height above mean sea level
const cloudHeightMSL = cloudBaseHeight(293.15, 283.15, 500);
// 1747 meters above mean sea level (500m surface + 1247m cloud base)
Original prompt

The function cloudBaseHeight, today is a bit unclear about what it returns. Today it returns height above mean sea level because we add the height, This should be better documented in the function.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…lues

Co-authored-by: oyve <16225018+oyve@users.noreply.github.com>
@oyve oyve marked this pull request as ready for review October 28, 2025 10:18
Copilot AI changed the title [WIP] Improve documentation for cloudBaseHeight return value Clarify cloudBaseHeight return value: AGL vs MSL Oct 28, 2025
Copilot AI requested a review from oyve October 28, 2025 10:19
@oyve oyve merged commit 12c486e into dev Oct 28, 2025
6 checks passed
@oyve oyve deleted the copilot/document-cloudbase-height-return branch October 28, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants