John H.
John H.

Reputation: 11

Exception thrown with simple Siphon ACIS Request

I'm using the following code in Google Colab with siphon 0.9:

from siphon.simplewebservice import acis
import json
params = {"sid":"KPIH","elems":"maxt,mint,avgt,pcpn,snow,snwd"}
ds = acis.acis_request("StnData", params)

Resulting error:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

AcisApiException                          Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/siphon/simplewebservice/acis.py in acis_request(method, params)
     60         raise AcisApiException('Bad URL. Check your ACIS connection method string.')
     61     except ValueError:
---> 62         raise AcisApiException('No data returned! The ACIS parameter dictionary'
     63                                'may be incorrectly formatted')
     64 

AcisApiException: No data returned! The ACIS parameter dictionarymay be incorrectly formatted

Using Jupyter Lab resulted in the same error.

Upvotes: 0

Views: 35

Answers (1)

John H.
John H.

Reputation: 11

Fixed the issue by adding the start and end date to the query.

params = {"sid":"KPIH","elems":"maxt,mint,avgt,pcpn,snow,snwd","sdate":"por","edate":"por"}

Upvotes: 1

Related Questions