Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

CAMS update: extended coverage and new error message handling #1799

Copy link
Copy link
Closed
@AdamRJensen

Description

@AdamRJensen
Issue body actions

There are a few upcoming changes happening to the CAMS Radiation Service (below is a quote from an email sent out on June 30th 2023):

• The CAMS Radiation Service for HIMAWARI satellite field of view is now open in beta test.
• New error messages for CAMS Radiation and McClear services that can affect your acquisition routine. More details in the relase note below.
See the complete release note at: https://www.soda-pro.com/help/cams-services/release-notes-cams#2023-07-03

This is exciting news in that CAMS will now also be covering Asia and Australia in addition to the current coverage of Europe and Africa!

New error messages
As stated above, the team is also making changes to the error messages, which will require an update to the pvlib get_cams function. Based on the beta version, it seems the API now raises an HTTP error when encountering invalid requests. Previously the status was always 200 (OK), and the error message had to be manually detected using these lines:

# Invalid requests returns an XML error message and the HTTP staus code 200
# as if the request was successful. Therefore, errors cannot be handled
# automatic (e.g. res.raise_for_status()) and errors are handled manually
if res.headers['Content-Type'] == 'application/xml':
errors = res.text.split('ows:ExceptionText')[1][1:-2]
raise requests.HTTPError(errors, response=res)

The beta API can be tried out by manually specifying the URL:

data, meta = pvlib.iotools.get_cams(
    latitude=-24.98,
    longitude=118.60,
    start=pd.Timestamp('2020-01-01'),
    end=pd.Timestamp('2020-01-02'),
    email='redacted',
    server='vhost5.soda-is.com',
)

Solution
The above lines should be substituted by something along the lines of:

if not res.ok:
    res.raise_for_status()

A big thanks goes out to the CAMS team!

mikofski and kandersolarmikofskimikofski

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.