Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Debug logging to VSOClient #3330

Merged
merged 5 commits into from
Sep 4, 2019
Merged

Add Debug logging to VSOClient #3330

merged 5 commits into from
Sep 4, 2019

Conversation

Cadair
Copy link
Member

@Cadair Cadair commented Aug 30, 2019

This logs at the DEBUG level all the VSO envelopes that are sent between our client and the VSO. You can enable it by setting the sunpy logger to debug:

>>> from sunpy.net import Fido, attrs as a
>>> import astropy.units as u
>>> from sunpy import log

>>> log.setLevel("DEBUG")                                                                                                                                                                                        

>>> Fido.search(a.Time('2012-03-04','2012-03-06'), a.Instrument("EUVI"), a.Wavelength(304*u.AA), a.Sample(100*u.min))                                
DEBUG: VSO Request:
 <soap-env:Envelope xmlns:VSO="http://virtualsolar.org/VSO/VSOi" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
  <soap-env:Body>
    <VSO:Query>
      <body>
        <block>
          <time>
            <start>20120304000000</start>
            <end>20120306000000</end>
          </time>
          <instrument>EUVI</instrument>
          <wave>
            <wavemin>304.0</wavemin>
            <wavemax>304.0</wavemax>
            <waveunit>Angstrom</waveunit>
          </wave>
          <sample>6000.0</sample>
        </block>
      </body>
    </VSO:Query>
  </soap-env:Body>
</soap-env:Envelope>
 [sunpy.net.vso.zeep_plugins]
DEBUG: VSO Response:
 <soap:Envelope xmlns:VSO="http://virtualsolar.org/VSO/VSOi" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <VSO:QueryResponse>
      <body>
        <provideritem>
          <provider>SSC</provider>
          <error>VSO-D404 Bad Request -- Invalid Time Sample : contains non digit</error>
          <version>1</version>
        </provideritem>
      </body>
    </VSO:QueryResponse>
  </soap:Body>
</soap:Envelope>
 [sunpy.net.vso.zeep_plugins]
Out[2]: 
<sunpy.net.fido_factory.UnifiedResponse object at 0x7efbf7608790>
Results from 1 Provider:

0 Results from the VSOClient:
Start Time End Time  Source Instrument   Type 
 float64   float64  float64  float64   float64
---------- -------- ------- ---------- -------

@ghost
Copy link

ghost commented Aug 30, 2019

Thanks for the pull request @Cadair! Everything looks great!

@Cadair Cadair requested a review from a team August 30, 2019 14:28
@Cadair Cadair added this to the 1.1 milestone Aug 30, 2019
@Cadair Cadair added the net Affects the net submodule label Aug 30, 2019
@Cadair Cadair requested a review from ehsteve August 30, 2019 14:31
@pep8speaks
Copy link

pep8speaks commented Aug 30, 2019

Hello @Cadair! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 94:101: E501 line too long (106 > 100 characters)

Comment last updated at 2019-08-30 15:21:04 UTC

@Cadair
Copy link
Member Author

Cadair commented Aug 30, 2019

This as it is is walking a line with an API change sunpy.net.vso.vso.get_online_vso_url now does what it says on the tin and gives you the port, url pair for the first online VSO mirror. Before it used to give you the zeep.Client object and it used to take 3 args and now takes 0.

I don't really consider something in the sunpy.net.vso.vso namespace "public" API, but I am open to being persuaded...

@Cadair Cadair merged commit 8e229a4 into sunpy:master Sep 4, 2019
@Cadair Cadair deleted the vso_debug branch September 4, 2019 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Affects the net submodule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants