-
Notifications
You must be signed in to change notification settings - Fork 5
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
GUVI #107
GUVI #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Luis! I have a round of comments, some on style, and some on the loaded data format in xarray.
Friendly note that the formatting notes point to specific examples but are intended to apply throughout the file. |
I have included time variables according to pysat standards. timeDayAur is left as a secondary index in case of future need to use it. Geographic coordinates, altitude and solar zenith angle were also added as coordinates into the output dataset. The pytest routines successfully passed from my side. Finally, I checked the pep8 standard on this script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More comment, mostly about style. Looks like you got to at least some of the files between the times I started and ended the review, so some of these may be outdated.
Also, an entry in the "supported_instruments" documentation file needs to be added. |
I just added a few style considerations recommended before. Thanks. |
Checked style code with flake8 and autopep8. |
Added this instrument into 'supported instruments' section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc tags were in the wrong order. Also, some style updates weren't made across the entire file.
Looks like there's some bugs in the download and remote file listing functions. Feel free to poke me if you need help debugging or need the CI tests to run again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions for your work in progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @landsito! The tests are running locally for me. The CI server is hanging on some formatting issues. I've added some comments that should fix those (though they may different in the upstream branch).
You can check these locally by running
flake8 . --count --select=D,E,F,H,W --show-source --statistics
pysatNASA/instruments/timed_guvi.py
Outdated
tags_fmt = {tag: fname.format(res= "-2" if 'low' in tag.split('_')[1] else "", | ||
mode=tag.split("_")[0].upper()) | ||
for tag in tags.keys()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tags_fmt = {tag: fname.format(res= "-2" if 'low' in tag.split('_')[1] else "", | |
mode=tag.split("_")[0].upper()) | |
for tag in tags.keys()} | |
tags_fmt = {tag: fname.format(res="-2" if 'low' in tag.split('_')[1] else "", | |
mode=tag.split("_")[0].upper()) | |
for tag in tags.keys()} |
pysatNASA/instruments/timed_guvi.py
Outdated
tags_url = {tag: url.format(mode='imaging') if 'img' in tag else | ||
url.format(mode='spectrograph') for tag in tags.keys()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tags_url = {tag: url.format(mode='imaging') if 'img' in tag else | |
url.format(mode='spectrograph') for tag in tags.keys()} | |
tags_url = {tag: url.format(mode='imaging') if 'img' in tag else | |
url.format(mode='spectrograph') for tag in tags.keys()} |
pysatNASA/instruments/timed_guvi.py
Outdated
inners = {dim : xr.concat([inners[dim], jnners[dim]], dim=dim) | ||
for dim in dims } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inners = {dim : xr.concat([inners[dim], jnners[dim]], dim=dim) | |
for dim in dims } | |
inners = {dim: xr.concat([inners[dim], jnners[dim]], dim=dim) | |
for dim in dims} |
pysatNASA/instruments/timed_guvi.py
Outdated
data = data.drop_vars(["YEAR_GAIM_DAY", "DOY_GAIM_DAY", | ||
"TIME_GAIM_DAY", "TIME_GAIM_NIGHT", | ||
"YEAR_GAIM_NIGHT", "DOY_GAIM_NIGHT"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data = data.drop_vars(["YEAR_GAIM_DAY", "DOY_GAIM_DAY", | |
"TIME_GAIM_DAY", "TIME_GAIM_NIGHT", | |
"YEAR_GAIM_NIGHT", "DOY_GAIM_NIGHT"]) | |
data = data.drop_vars(["YEAR_GAIM_DAY", "DOY_GAIM_DAY", | |
"TIME_GAIM_DAY", "TIME_GAIM_NIGHT", | |
"YEAR_GAIM_NIGHT", "DOY_GAIM_NIGHT"]) |
pysatNASA/instruments/timed_guvi.py
Outdated
data = data.assign(time_day=xr.DataArray(day_dts, dims=('nAlongDay')), | ||
time=night_dts) | ||
if 'img' in tag: | ||
dt_aur=xr.DataArray(aur_dts, dims=('nAlongDayAur')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dt_aur=xr.DataArray(aur_dts, dims=('nAlongDayAur')) | |
dt_aur = xr.DataArray(aur_dts, dims=('nAlongDayAur')) |
pysatNASA/instruments/timed_guvi.py
Outdated
"nCrossDayAur": data.nCrossDayAur.data} | ||
elif 'spect' in tag: | ||
coords = {"nchan": ["121.6nm", "130.4nm", "135.6nm", | ||
"LBHshort", "LBHlong","?"]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"LBHshort", "LBHlong","?"]} | |
"LBHshort", "LBHlong", "?"]} |
pysatNASA/instruments/timed_guvi.py
Outdated
|
||
# Sort | ||
data = data.sortby("time") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pysatNASA/instruments/timed_guvi.py
Outdated
# Instrument test attributes | ||
|
||
_test_dates = {'': {tag: dt.datetime(2005, 6, 28) for tag in tags.keys()}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pysatNASA/instruments/timed_guvi.py
Outdated
data = data.swap_dims({"nAlongNight": "time"}) | ||
|
||
# Update time variables | ||
# 'time_night' will be renamed as 'time' to follow pysat standard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 'time_night' will be renamed as 'time' to follow pysat standard | |
# 'time_night' will be renamed as 'time' to follow pysat standard |
Description
Addresses # (issue)
Adding support for TIMED-GUVI L1C disk data (v13) into pysatNASA.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Simple local script indicated in comments:
import pysat
from datetime import datetime
guvi = pysat.Instrument(platform='timed', name='guvi')
guvi.download(start=datetime(2005, 6, 20), stop=datetime(2005, 6, 21))
guvi.load(yr=2005,doy=171)
Test Configuration
Checklist:
develop
(notmain
) branch