Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wind direction not downloaded from Data Garrison #10

Open
cmdln156 opened this issue Aug 23, 2021 · 1 comment
Open

wind direction not downloaded from Data Garrison #10

cmdln156 opened this issue Aug 23, 2021 · 1 comment

Comments

@cmdln156
Copy link

I'm using the transloader to download weather data from Data Garrison. It's downloading everything fine except for wind direction. It's not present in the JSON files that are generated in the datastore directory, although wind speed and wind gust are in the files.

@EHJ-52n
Copy link

EHJ-52n commented Jan 27, 2022

Hi @cmdln156 @openfirmware ,

I took a deeper look into this and the issue might be caused by the value of sens_details in the base_path:

@base_path = "https://datagarrison.com/users/#{@user_id}/#{@id}/index.php?sens_details=127&details=7"

For the stations, I am working with, sens_details=127 results in a html page having the last two entries under the sensors node collapsed. Hence, they are not parsed in this loop:

raw_metadata.split(/      |\n/).each do |matched|
# remove any non-breaking spaces
matched.gsub!(/ /, '')
# Match headers and create a new metadata section object
case matched
when /-Transceiver/
station_metadata.push({name: "transceiver"})
when /-Logger/
station_metadata.push({name: "logger"})
when /-Sensors/
when /^-([^-]+)/
station_metadata.push({name: $1})
else
# Match sub-section objects
last = station_metadata[-1]
m = matched.match(/(?<key>[^:]+): (?<value>.+)/)
if m
last[m['key'].strip] = m['value'].strip
end
end
end

One solution would be to adjust this value to something higher, or develop some logic to identify the number of sensors and unfold all available sensors.

As workaround, you might update the station metadata json manually and add the missing entries under metadata: datastreams: by hand.

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

No branches or pull requests

2 participants