Skip to content

Introduce KNYC Data Provider#1

Open
alexgoldschmidt wants to merge 6 commits intonjason:mainfrom
alexgoldschmidt:alexgoldschmidt/scratch
Open

Introduce KNYC Data Provider#1
alexgoldschmidt wants to merge 6 commits intonjason:mainfrom
alexgoldschmidt:alexgoldschmidt/scratch

Conversation

@alexgoldschmidt
Copy link

Moved NCDC specific functionality into separate file
Added KNYC weather data provider

Combine data from NCDC and KNYC for final determination

@njason
Copy link
Owner

njason commented Jun 29, 2022

I was having trouble running this. It turns out the issue was the folder DataProviders and Models needed to be lower case to match the package name. I did get it running but am seeing a gap in days from the output (missing 6/24)

jason@wargo:~/code/shouldwater$ go run main.go USW00094728
Done loading config.
StationId:  USW00094728
Start NCDC Data
[{2022-06-21 00:00:00 +0000 UTC 0.06} {2022-06-22 00:00:00 +0000 UTC 0.02} {2022-06-23 00:00:00 +0000 UTC 0.08}]
Start KNYC Data
Start Reading Data
Done Reading Data
[{2022-06-26 00:00:00 +0000 UTC 0} {2022-06-25 00:00:00 +0000 UTC 0} {2022-06-28 00:00:00 +0000 UTC 0} {2022-06-27 00:00:00 +0000 UTC 0.8}]
It's rained 0.96 inches in the last week
You should water the trees.

One issue is that the NCDC data isn't consistent, it sometimes is over a week behind. Also, I was looking for a solution that can work in any area, not just in NYC.

Usually I don't like to resort to web scrapping until absolutely necessary. I would prefer to use some sort of web service list a REST API but also don't want to have to pay for a license to use the API or keep the program constantly running to capture the data. Apparently this is a very small or impossible target to hit. Of the APIs I sent you, I tried tomorrow.io, AccuWeather, and AerisWeather and they all are not able to give you 7 days of historical data without purchasing a license.


dailyRainfallMap[rowDate] += knycRow.Precipitation.LastHour
dailyRainfallMap[rowDate] += knycRow.Precipitation.Last3Hours
dailyRainfallMap[rowDate] += knycRow.Precipitation.Last6Hours
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure if this is the proper way to calculate the rainfall, wouldnt these values overlap in time?

@alexgoldschmidt
Copy link
Author

alexgoldschmidt commented Jun 30, 2022 via email

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