pysat / pysatMadrigal

Madrigal instrument support for the pysat ecosystem
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Added LoS TEC tag to the GNSS TEC Instrument #96

Closed aburrell closed 6 months ago

aburrell commented 7 months ago

Description

Addresses #12 by adding the 'los' tag to the TEC instrument. Also refactored the general load function to facilitate the new targeted load function needed for the LoS TEC.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

import datetime as dt
import pysat
import pysatMadrigal as pymad

stec = pysat.Instrument(inst_module=pymad.instruments.gnss_tec, tag='stec')
stec.download(dt.datetime(2023, 1, 1), user="your name", password='your email')

# Determine which sites are available to load
sites = pymad.instruments.methods.gnss.get_los_receiver_sites(stec.files.files[0])

# Load the last site
stec.load(2023, 1, los_method='site', los_value=sites[-1])

print(stec.variables)

yeilds:

['time', 'gps_site', 'sat_id', 'kindat', 'kinst', 'pierce_alt', 'los_tec', 'dlos_tec', 'tec', 'azm', 'elm', 'gdlat', 'glon', 'rec_bias', 'drec_bias', 'gdlatr', 'gdlonr', 'year', 'month', 'day', 'hour', 'min', 'sec', 'ut1_unix', 'ut2_unix', 'recno']

Test Configuration

Checklist:

If this is a release PR, replace the first item of the above checklist with the release checklist on the pysat wiki: https://github.com/pysat/pysat/wiki/Checklist-for-Release

aburrell commented 7 months ago

pysatMadrigal.instruments.methods.general.load complexity reduced from 43 to 27! 🦦

aburrell commented 7 months ago

@jklenzing I am trying to turn off download testing for the new TEC tag, since I don't ever expect the download to work on GA. It looks like I didn't do it right?

aburrell commented 7 months ago

The download routine does not work locally for me when running pytest.

That's a MadrigalWeb error, nothing we can do about it.

aburrell commented 7 months ago

Does the user download only part of a day of data (thus, breaking the assumptions for the unit tests)?

If MadrigalWeb can't handle the download, then the user has to go and get the files themselves. Not great. Might be worth poking Bill Rideout on this issue.