rcgsheffield / urban_flows Goto Github PK
View Code? Open in Web Editor NEWResearch Computing work for the Urban Flows project
Research Computing work for the Urban Flows project
if the code runs hourly then there won't be enough data to calculate accurately
https://uk-air.defra.gov.uk/air-pollution/daqi?view=more-info&pollutant=ozone#pollutant
List of SCR data sets: https://drive.google.com/file/d/1Mbd4S7b2Vwd-qgmBBe8qUNgI1J-O_9cY/view?usp=sharing
Probably to version 3.9
https://devguide.python.org/#status-of-python-branches
warning from awesome:
https://urbanflowsawesome.slack.com/archives/C01DWG08GTY/p1620907753001300
this is the sync code:
https://github.com/rcgsheffield/urban_flows/blob/master/awesome/sync.py#L294
What happens if a new sensor/site is created during the data transfer?
Arrow ArrowParseWarning: The .get() parsing method without a format string will parse more strictly in version 0.15.0
arrow-py/arrow#612
sync every 5 minutes
Is this possible?
Something like locations/{id}/aqi-readings
where results are sorted desc. by created. This doesn't seem to exist currently.
Get units and convert to the required units
it now works on the basis of readings, not rows
Currently, only caught errors are recorded to the error file. All uncaught errors should be logged by default for all harvesters (by default to error.log in cwd)
https://stackoverflow.com/a/16993115/8634200
URL = 'http://ufdev.shef.ac.uk/uflobin/ufdexF1'
URL = 'http://uffront01.shef.ac.uk/uflobin/ufdex'
how record? info logging to file?
Enable multi-threading to sync in parallel and increase throughput?
For Awesome data bridge: run AQI and data in separate processes? so they both sync in near real-time
test before/after march-october
Old code:
a749d6f#diff-0bb5446cd5a42e1244ace667db79b27f4bddb9b042705e278b9c381a31c5eeb2
more efficient due to partitioning of netcdf files (by family and date)
/home/uflo/configs
not world-readableafter completing harvester, use row count to determine if output file should be deleted
I'm on master 39032ef
When I run > python pipeline.py -d 2020-01-01 -od test.csv
I get the output below.
ERROR:http_session:400 Client Error: Bad Request for url: https://uk-air.defra.gov.uk/sos-ukair/api/v1/stations?near=%7B'near':%20'%7B%22center%22%3A%7B%22type%22%3A%22Point%22%2C%22coordinates%22%3A%5B53.379699%2C-1.469815%5D%7D%2C%22radius%22%3A50%7D'%7D ERROR:http_session:<html><head><title>Apache Tomcat/7.0.82 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.82</h3></body></html> Traceback (most recent call last): File "pipeline.py", line 54, in <module> main() File "pipeline.py", line 32, in main stations = list(fh.get_stations()) File "C:\Users\joesh\Documents\University of Sheffield\Urban Flows Observatory\Data Pipelines\urban_flows\defra_sos\download.py", line 54, in get_stations data = self.session.call(self.base_url, 'stations?near={}'.format(query)) File "C:\Users\joesh\Documents\University of Sheffield\Urban Flows Observatory\Data Pipelines\urban_flows\defra_sos\http_session.py", line 37, in call response = self._call(base_url, endpoint, **kwargs) File "C:\Users\joesh\Documents\University of Sheffield\Urban Flows Observatory\Data Pipelines\urban_flows\defra_sos\http_session.py", line 26, in _call response.raise_for_status() File "C:\Users\joesh\Miniconda3\envs\uflo\lib\site-packages\requests\models.py", line 939, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://uk-air.defra.gov.uk/sos-ukair/api/v1/stations?near=%7B'near':%20'%7B%22center%22%3A%7B%22type%22%3A%22Point%22%2C%22coordinates%22%3A%5B53.379699%2C-1.469815%5D%7D%2C%22radius%22%3A50%7D'%7D
Make the data bridge remove null or -32768 values (don't upload them to remote server)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.