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

T28 + Python 3 support #15

Merged
merged 3 commits into from
Oct 20, 2015
Merged

T28 + Python 3 support #15

merged 3 commits into from
Oct 20, 2015

Conversation

tjlang
Copy link
Contributor

@tjlang tjlang commented Oct 16, 2015

The recent pull request spooked me, because it altered flight.py, which I had already modified. That causes all sorts of git headaches, so I decided I should get this pull request into AWOT sooner rather than later.

  1. Adjusted imports and a few other commands to ensure Python 3 compatibility.
  2. Added rudimentary T-28 reader based on the data provided via here: http://www.eol.ucar.edu/projects/t28/. This reader accounts for the 20-Hz sampling and subsequent 2-D structure of the T-28 data (arrays get flattened by the reader). The data work with FlightLevel plots.

Conflicts:
	awot/io/flight.py

	modified:   awot/io/flight.py
Added read_t28 call to the updated flight.py, and performed pep8
touchup.
@tjlang
Copy link
Contributor Author

tjlang commented Oct 16, 2015

Also did some pep8 cleanup.

"""
T-28 has enough differences from other aircraft netCDF files to
warrant its own read script.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try the updated NetCDF reader? It may do some of what you want if the NetCDF has a global attribute of Conventions with 'nimbus' in it. We could expand this if it works.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at your code below, it appears to do the same stuff (mostly) as the updated netcdf reader. If we were able to generalize a couple of parts of the netcdf reader it should work.

I ordered and tried some data from the JPOLE experiment. The encouraging thing is that it appears that they use the same global attribute I mention above. But:
The reader bombs in these two spots.

  1. I currently use the filename to pull out the dimension name and data acquisition rate. I'm not sure of a robust way to deal with this. We process the UWKA data anywhere between 1 - 50 Hz with many dimension included depending on if we downsample data.

  2. Different time variables names. I guess we add a time variable flag that specifies which variable to use, otherwise attempt some common variables. The issue arises because of legacy code keeping things like time Time HHMMSS alive so that old code didn't need to be rewritten. We have some code here that has dust blown off it every few years and compiled and used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree there is code duplication. At the same time, I have effectively cordoned off the T-28 routines to their own code chunk. There is merit in just having customized read scripts since aircraft data are kind of all over the place in terms of formats.

Up to you what you want to do. All I care is the T-28 is read into flattened arrays. This io script is inelegant in some ways (not all), but it works.

@nguy
Copy link
Owner

nguy commented Oct 19, 2015

I'm also okay just putting this in for now and seeing if we can manage to get the read_netcdf more general in those areas I point out. Regardless, I might add more keywords so that it works on these types of files also.

@nguy nguy merged commit 0be59e6 into nguy:master Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants