Skip to content
Snippets Groups Projects
Commit e640f4a7 authored by Greg Quinn's avatar Greg Quinn
Browse files

Stop using pycdf since pyhdf supports NetCDF

parent 6435b655
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,6 @@ import itertools
import numpy
import sys
from pycdf import CDF
from pyhdf.SD import SD, SDC
# returns a dictionary of objects providing spectral response
......@@ -20,17 +19,17 @@ from pyhdf.SD import SD, SDC
# SRF data file
def read_modis_srf_data(filename):
cdf = CDF(filename)
channels = cdf.var('channel_list').get()
begin_freqs = cdf.var('begin_frequency').get()
end_freqs = cdf.var('end_frequency').get()
sd = SD(filename)
channels = sd.select('channel_list').get()
begin_freqs = sd.select('begin_frequency').get()
end_freqs = sd.select('end_frequency').get()
srf_data = {}
class SRF:
pass
for i, channel in enumerate(channels):
srf = SRF()
srf.weights = cdf.var('channel_%s_response' % channel).get()
srf.weights = sd.select('channel_%s_response' % channel).get()
srf.wavenumbers = numpy.linspace(begin_freqs[i], end_freqs[i],
srf.weights.size)
srf_data[int(channel)] = srf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment