Nearer AQ Station?

Hi all,

This is about soprisviewweather.com located in Carbondale, CO USA.

After years of selecting an AQ station relatively near to me, the AQ block has decided to show me a station more than 400 miles away in a different state. WAQI.info shows this as my nearest station. Combined with my token, I get the following info that seems legit:

{“status”:“ok”,“data”:{“aqi”:0,“idx”:-211078,“attributions”:[{“url”:“Requested page not found | PurpleAir Air”,“station”:“38561”},{“url”:“https://waqi.info/",“name”:"World Air Quality Index Project”}],“city”:{“geo”:[39.411358,-107.22104],“name”:“Carbondale Alpine Bank”,“url”:“https://aqicn.org/station/@211078",“location”:"Highway 133, Carbondale, Garfield County, Colorado, 81623, USA”},“dominentpol”:“pm25”,“iaqi”:{“h”:{“v”:19},“pm10”:{“v”:0},“pm25”:{“v”:0},“t”:{“v”:19.4}},“time”:{“s”:“2023-12-06 14:26:41”,“tz”:“-07:00”,“v”:1701898001,“iso”:“2023-12-06T21:26:41Z”}}}

To fix this, I have tried following the advice in this thread:
https://discourse2.weather-watch.com/t/official-airquality-source/70912
… but no luck.

Can anyone help?

Many thanks!

Bob

Hi there
there is a way but I will have to check as I have changed my nearest AQ station to a much nearer one.
I will check soon and let you know what file you have to change and the line numbers but you need to know the lat/long of it.

Just looked it up.
its the PWS_load files php
and its about line 365 that needs to be changed to the long/lat.
If you have any problems just ask.

It is described exactly in that discussion in this answer

https://discourse2.weather-watch.com/t/official-airquality-source/70912/8?u=pwsdashboard

Only the line to change is 368 in your version of PWS_load_files.php, I checked it with this link

https://www.soprisviewweather.com/PWS_load_files.php?sce=view

This is the code you should see when changing the code

if(isset ($gov_aqi)  &&  (   $gov_aqi === true)  &&  $waqitoken <> 'ADD YOUR API KEY')
     {  $filename       = $fl_folder.$gvaqi_fl;
        $allowed_age    = 3600*$times;
        $url            = 'https://api.waqi.info/feed/geo:'
                        .$lat.';'.$lon.'/?token='
                        .$waqitoken;
        $fake_keys[0]   = $waqitoken;
        fnctn_load_file ('AQ-official'); }
else {  $name           = substr('AQ-official'.$noload,0,14);
        $stck_lst .= basename(__FILE__).' ('.__LINE__.') '.$name.': goverment aqi not used '.PHP_EOL; }

The line 368, which now reads

                   .$lat.';'.$lon.'/?token='

should be changed to a more nearby official station
Make sure it looks like

                   .'12345.67;98765.43/?token='

So use the quote correctly and 12345.67 is the latitude of the AQ station and 98765.43 is the longitude.

When I check you current load files log, you are using your own latitude and longitude.

When you change that line you have to wait for new data as the data is cached for 3600 seconds. That is one hour!

If it fails, please post the link to the nearby station you want to use. That station should have a forecast in its data.

Wim

1 Like

But dont forget to change the PWS_load file to 09 at the start that will tell the updates that you have modified it.
WIM always says do this.

What station was that?

That seems to be a PurpleAir sensor and hence it might not be “official”. You may have to choose an APCD sensor – see Air Pollution in Carbondale: Real-time Air Quality Index Visual Map (aqicn.org) – or even one a bit further away. . .

EDIT: Sorry, the link seems to be temporarily broken. When I looked at it there were many more stations on view.

Thanks Wim, Bits and swright,

The station I want to use is here:

It seems to be stable with over a year of constant data. Although it is a Purple Air sensor, it has an official rectangular flag (as per Bits). It also has an AQ forecast as Wim requested.

According to Google Maps, it’s location is 39.41070647313357, -107.22097086675693. What that looks like when fit into the code format is: .‘39.41;-107.22/?token=’

Here’s what it looks like inserted into the code:

I have saved the changes to the PWS_load_files.php at 1:30pm MST. I’ll check back after the 3600 secs have elapsed and let you all know what happened.

Thanks to all for your thorough input to this problem!

Bob

Well … after more than 90 minutes, it looks like no luck. I’m still stuck in Uintah, Utah. Thoughts?

Thanks!
Bob

Bits, to answer your question:

What station was that?

I used to get my AQ from a site in Aspen, CO called Aspen PM but it hasn’t reported in almost 10 days.

swright:

But dont forget to change the PWS_load file to 09 at the start that will tell the updates that you have modified it. WIM always says do this.

So are you saying I should rename the PWS_load_files.php to 09PWS_load_files.php?

Thanks to you both!
Bob

I’ll look out for that one :slightly_smiling_face:

No, he means the version number at the start of the script. Currently

<?php  $scrpt_vrsn_dt  = 'PWS_load_files.php|01|2023-10-31|';

If you change the 01 to 09 the update routine will “know” that you have altered the script and it should not be automatically replaced.

Hi
Yes as BOS said the first line of the script change 01 to 09.
At the moment after I just checked that AQ station has no data showing, so that might be the problem. To test find another and put the lat/lon specs in and see if that works.
the following seems to be working as every one around carbondale are not showing any data.

Carbondale, USA Air Pollution: Real-time Air Quality Index (aqicn.org)

try this one and see

That one hasn’t updated since 25 October. . . add your token to

https://api.waqi.info/feed/@13200/?token=

Maybe ask the US Forest Service why not?

I’m trying a different location, one that doesn’t seem to have a Purple Air Sensor. It’s here:

I discovered this site thru waqi.info. It seems to be a sister or adjunct site to aqicn.org. PWS_load_files.php seems to be asking for WAQI input so I looked there.

We’ll see. Should know in an hour.

Thanks!
Bob

No forecast from that station. . . If you can get US Forest Service to reinstate Carbondale station you’ll get the forecast too.

It does if you scroll down on that aqicn.org site. It says Air Quality Forecast in the section header. Unless that graphical forecast doesn’t count? If not, what does?

Thanks for your patience!
Bob

By the Forest Service site, You mean this one, right?

They have that same graphical forecast if you scroll down. Trying to get the attention of the Forest Service right now is a challenge. Their facility next to Sopris Park, is under construction. May explain a few things. :wink:

Thanks!
Bob

If you scroll down even further to where it says

and add your token you will see that the feed has no forecast.

Now look at my earlier post re Carbondale:

and you can see the (out-of-date!) forecast details from https://airfire.org

That’s what the pwsWD script needs for the popup:

Ahhhh! Got it. Thanks for the education!

Older and now wiser,
Bob

Thanks to Bits educating me, I have spent the last couple hours trying to find a AQ station with a viable forecast in my area. I can’t seem to find one. It is starting to look like a lost cause.

Thanks to all who pitch in and gave me an education. Much appreciated!

Bob

That’s a shame. I’ve just remembered that Wim gave an explanation here when someone else was having this problem:

Ask the Forest Service if they are going to reinstate the “official” station in Carbondale :slightly_smiling_face: