Skip to content

Conversation

@elxecutor
Copy link

This PR adds dew point calculations and displays the dew point value in both standard and compact weather output modes. Dew point is now calculated in Celsius or Fahrenheit based on the selected units and shown alongside other weather metrics. This feature is especially useful for users tracking humidity and comfort levels, such as during Arizona’s monsoon season

fixes #26

Copy link
Contributor

@WarningImHack3r WarningImHack3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to increase the count in main.go at line 182 for the live mode to still work properly

Overall though, the change is good, but I'm afraid it would unbalance the output as the icons are 7 high and this change would add an additional line at the bottom


var directionSymbols = [...]string{"↑", "↗", "→", "↘", "↓", "↙", "←", "↖"}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary unless a godoc is added here


// Determine units based on config
var windSpeedUnits, tempUnit string
var windSpeedUnits, tempUnit, dewPointUnit string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just use the tempUnit as it has the same purpose and cannot be different?

}

// displayWeatherArtCompact shows ASCII art with compact formatting

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one has to be removed to not unlink the godoc from the function


// Prepare the text lines
textLines := make([]string, 0, 5)
textLines := make([]string, 0, 7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it has to be increased by 2?

func dewPointCelsius(tempC float64, humidity int) float64 {
t := tempC
rh := float64(humidity)
a := 17.27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are a and b? I think they should be constants

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are from Magnus Tetens formula. And they are often called just a and b.

Where a is constant "Magnus Coefficient" and b is temperature constant. So we can call it so. Or leave it as is, they often appear in this way. What do you prefer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like if it represents something, let’s give it a name, otherwise single letters are fine

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.

Feature Request: Can you add dew point?

3 participants