def __init__(self, specName, nu, tmprLow, tmprHi, tmprInc, sensorResp=None, opticsTau=None, filterTau=None, atmoTau=None, sourceEmis=None, sigMin=None, sigMax=None, sigInc=None, dicCaldata=None, dicPower=None, dicFloor=None): """Initialise and loads the camera calibration data from files and calculate the lookup tables. """ __all__ = ['info', 'LookupDLRad', 'LookupDLTemp', 'LookupTempRad', 'LookupRadTemp', 'PlotTempRadiance', 'PlotSpectrals', 'PlotCalSpecRadiance', 'PlotCalDLRadiance', 'PlotCalTempRadiance', 'PlotCalTintRad', 'PlotCalDLTemp' ] self.specName = specName self.nu = nu self.sigMin = sigMin self.sigMax = sigMax self.sigInc = sigInc self.tmprLow = tmprLow self.tmprHi = tmprHi self.tmprInc = tmprInc self.sensorResp = sensorResp self.opticsTau = opticsTau self.filterTau = filterTau self.atmoTau = atmoTau self.sourceEmis = sourceEmis self.dicCaldata = dicCaldata self.dicPower = dicPower self.dicFloor = dicFloor #flags to signal task completion self.spectralsLoaded = False self.hiresTablesCalculated = False self.calTablesCalculated = False #set up the spectral domain in wavelength self.wl = ryutils.convertSpectralDomain(self.nu, type='nl') #load the spectral files self.LoadSpectrals() # multiply to calculate the total spectral shape. self.specEffWiFil = self.specEmis * self.specAtmo * \ self.specFilter * self.specSensor * self.specOptics self.specEffNoFil = self.specEmis * self.specAtmo * \ self.specSensor * self.specOptics # convert calibration temperatures to K if self.dicCaldata: self.calLokey = min(self.dicCaldata.keys()) self.calHikey = max(self.dicCaldata.keys()) # for tmprInstr in self.dicCaldata: # self.dicCaldata[tmprInstr][:,0] += 273.16 #calculate the lookup tables self.CalculateDataTables()
tape7 = loadtape7( "data/tape7-05", ['FREQ', 'TOT_TRANS', 'PTH_THRML', 'SURF_EMIS', 'TOTAL_RAD']) np.savetxt('tape7-05.txt', tape7, fmt=str('%.6e')) tape7 = loadtape7( "data/tape7-05b", ['FREQ', 'TOT_TRANS', 'PTH_THRML', 'SURF_EMIS', 'TOTAL_RAD']) np.savetxt('tape7-05b.txt', tape7, fmt=str('%.6e')) if doAll: colSelect = ['FREQ_CM-1', 'COMBIN_TRANS', 'H2O_TRANS', 'UMIX_TRANS', \ 'O3_TRANS', 'H2O_CONT', 'MOLEC_SCAT', 'AER+CLD_TRANS'] tape7 = loadtape7("data/tape7VISNIR5kmTrop23Vis", colSelect) wavelen = ryutils.convertSpectralDomain(tape7[:, 0], type='nl') mT = ryplot.Plotter(1, 1, 1,"Modtran Tropical, 23 km Visibility (Rural)"\ + ", 5 km Path Length",figsize=(12,6)) mT.plot(1, wavelen, tape7[:, 1:], "", "Wavelength [$\mu$m]", "Transmittance", label=colSelect[1:], legendAlpha=0.5, pltaxis=[0.4, 1, 0, 1], maxNX=10, maxNY=4, powerLimits=[-4, 4, -5, 5]) mT.saveFig('ModtranPlot.png')
np.savetxt("tape7-05b.txt", tape7, fmt=str("%.6e")) if True: colSelect = [ "FREQ_CM-1", "COMBIN_TRANS", "H2O_TRANS", "UMIX_TRANS", "O3_TRANS", "H2O_CONT", "MOLEC_SCAT", "AER+CLD_TRANS", ] tape7 = loadtape7("data/tape7VISNIR5kmTrop23Vis", colSelect) wavelen = ryutils.convertSpectralDomain(tape7[:, 0], type="nl") mT = ryplot.Plotter( 1, 1, 1, "Modtran Tropical, 23 km Visibility (Rural)" + ", 5 km Path Length", figsize=(12, 6) ) mT.plot( 1, wavelen, tape7[:, 1:], "", "Wavelength [$\mu$m]", "Transmittance", label=colSelect[1:], legendAlpha=0.5, pltaxis=[0.4, 1, 0, 1], maxNX=10, maxNY=4,
__version__ = "$Revision$" __author__ = 'CJ Willers' import numpy import pyradi.ryfiles as ryfiles import pyradi.ryplot as ryplot import pyradi.ryplanck as ryplanck import pyradi.ryutils as ryutils #this example is somewhat contrived, but serves to show toolkit use #load atmospheric transmittance from file created in Modtran in wavenumbers # the transmittance is specified in the wavenumber domain with # 5 cm-1 intervals, but we want to work in wavelength with 2.5 cm-1 waven = numpy.arange(2000.0, 3300.0, 2.5).reshape(-1, 1) wavel = ryutils.convertSpectralDomain(waven, type='nl') #remove comment lines, and scale path radiance from W/cm2.sr.cm-1 to W/m2.sr.cm-1 tauA = ryfiles.loadColumnTextFile('../data/path1kmflamesensor.txt', [1], abscissaOut=waven, comment='%') lpathwn = ryfiles.loadColumnTextFile('../data/pathspaceflamesensor.txt', [9], abscissaOut=waven, ordinateScale=1.0e4, comment='%') #convert path radiance spectral density from 1/cm^-1 to 1/um, at the sample #wavenumber points (dum, lpathwl) = ryutils.convertSpectralDensity(waven, lpathwn, type='nl') #load the detector file in wavelengths, and interpolate on required values
__version__= "$Revision$" __author__='CJ Willers' import numpy import pyradi.ryfiles as ryfiles import pyradi.ryplot as ryplot import pyradi.ryplanck as ryplanck import pyradi.ryutils as ryutils #this example is somewhat contrived, but serves to show toolkit use #load atmospheric transmittance from file created in Modtran in wavenumbers # the transmittance is specified in the wavenumber domain with # 5 cm-1 intervals, but we want to work in wavelength with 2.5 cm-1 waven = numpy.arange(2000.0, 3300.0, 2.5).reshape(-1, 1) wavel= ryutils.convertSpectralDomain(waven, type='nl') #remove comment lines, and scale path radiance from W/cm2.sr.cm-1 to W/m2.sr.cm-1 tauA = ryfiles.loadColumnTextFile('../data/path1kmflamesensor.txt', [1],abscissaOut=waven, comment='%') lpathwn = ryfiles.loadColumnTextFile('../data/pathspaceflamesensor.txt', [9],abscissaOut=waven, ordinateScale=1.0e4, comment='%') #convert path radiance spectral density from 1/cm^-1 to 1/um, at the sample #wavenumber points (dum, lpathwl) = ryutils.convertSpectralDensity(waven, lpathwn, type='nl') #load the detector file in wavelengths, and interpolate on required values detR = ryfiles.loadColumnTextFile('../data/detectorflamesensor.txt', [1],abscissaOut=wavel, comment='%')