pysat / pysatNASA

pysat support for NASA Instruments
BSD 3-Clause "New" or "Revised" License
21 stars 7 forks source link

ENH: DMSP SSUSI EDR-Aurora Instrument #147

Closed aburrell closed 1 year ago

aburrell commented 1 year ago

Description

Added a new instrument for the DMSP SSUSI EDR-Aurora data. While adding this instrument support, discovered a bug in the general CDAWeb functions.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

import datetime as dt
import matplotlib.pyplot as plt
import pysat
import pysatNASA

# Initalize the instrument, download and load the data.  Loading will bring up logger warnings from the pysat function
# that aren't important in this instance
ssusi = pysat.Instrument(inst_module=pysatNASA.instruments.dmsp_ssusi, tag='edr-aurora', inst_id='f17')
ssusi.download(start=dt.datetime(2015, 1, 1))
ssusi.load(date=dt.datetime(2015, 1, 1))

# Create a plot like the one shown here
fig = plt.figure()
axs = fig.add_subplot(212, projection='polar')
axn = fig.add_subplot(211, projection='polar')
dvar = 'SOUTH_POLAR_GEOGRAPHIC_LONGITUDE'
lvar = 'SOUTH_POLAR_GEOGRAPHIC_LATITUDE'
ndvar = 'NORTH_POLAR_GEOGRAPHIC_LONGITUDE'
nlvar = 'NORTH_POLAR_GEOGRAPHIC_LATITUDE'

# Replace colors and markers with a list of colors and markers
for i, dtime in enumerate(ssusi.index):
    axs.plot(np.radians(ssusi[dvar][i]), 90 + ssusi[lvar][i], '.', label='{:}'.format(dtime), color='k')
    axn.plot(np.radians(ssusi[ndvar][i]), 90 - ssusi[nlvar][i], '.', color='k')

# Do various formatting to make things look nice

dmsp_ssusi_ocb

Test Configuration

Checklist:

aburrell commented 1 year ago

The warning is what I couldn't get rid of. The error you're getting is from a mistake in the sample code (now fixed). I addressed the extra space concern.