You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at 1, @ohobby asked about how he would be able to feed a list of sensor identifiers from a file to the luftdatenpumpe stations or luftdatenpumpe readings commands.
I could also provide a list in a file with the sensor_id’s. Is it possible to include this list in the query so I don’t have to type all sensor_id’s in the query?
Indeed, it would be sweet if Luftdatenpumpe provided such an option.
As a workaround, a few commands of Unix magic can be applied to the problem. This incantation will read the file sensor_ids.txt, containing a list of sensor identifiers, separated by newlines, and will reformat it to be comma-separated.
In this way, it is suitable for feeding it to the --sensor= option of Luftdatenpumpe. Imagine you have a file sensor_ids.txt, you could use a wrapper program like ldipumpe.sh, attached below, by invoking ./ldipumpe.sh sensor_ids.txt --reverse-geocode --target=....
Wrapper program
#!/bin/bash## Use Luftdatenpumpe to acquire data by list of# sensor identifiers from file.## Synopsis:## ./ldipumpe.sh sensor_ids.txt --reverse-geocode## Read input file name.
infile=$1shift# Sanity checks.if [ -z"${infile}" ];thenecho"ERROR: No input file given"exit 1
fi# Read and reformat text file to comma-separated list.
sensor_ids=$(cat "${infile}"|printf"%s""$(< /dev/stdin)"| tr '\n'',')echo"Using sensor identifiers: ${sensor_ids}"# Invoke Luftdatenpumpe with given sensor identifiers,# forwarding other command line options.
luftdatenpumpe stations \
--network=ldi --sensor="${sensor_ids}" \
"$@"
Hi there,
at 1, @ohobby asked about how he would be able to feed a list of sensor identifiers from a file to the
luftdatenpumpe stations
orluftdatenpumpe readings
commands.Indeed, it would be sweet if Luftdatenpumpe provided such an option.
With kind regards,
Andreas.
Footnotes
https://community.panodata.org/t/luftdatenpumpe-the-sensor-ids-on-weather-hiveeyes-org-are-different-from-those-of-sensor-community-respectively/254/6 ↩
The text was updated successfully, but these errors were encountered: