Example #1
0
dustfile = ExternalFile(
    os.path.join(get_data_path(), 'planets/mars/aux/dust.npy'))
icefile = ExternalFile(
    os.path.join(get_data_path(), 'planets/mars/aux/ice.npy'))
atm = ExternalFile(
    os.path.join(get_data_path(), 'planets/mars/aux/mars_atm_copy.npy'))
altitude_map = ExternalFile(
    os.path.join(get_data_path(), 'planets/mars/aux/altitude_map.npy'))
solar_spec = ExternalFile(
    os.path.join(get_data_path(), 'aux/solar_spectrum.npy'))
albedo_map = ExternalFile(
    os.path.join(get_data_path(), 'planets/mars/aux/albedo_map.npy'))

# Make an aerosol that was observed at these wavelengths
wavs = np.array([1, 9.3])
dust = Aerosol(dustfile.array, wavs, 9.3)  # 9.3 is the wavelength reference
ice = Aerosol(icefile.array, wavs, 12.1)

# Get the atmospheric layers
lay = Layers(atm.array)

# Make a Conrath dust profile, then make a column of dust with that profile
dust_conrath = Conrath(lay, 10, 0.5)  # 10 = scale height, 0.5 = Conrath nu
dust_column = Column(dust, lay, dust_conrath, np.array([1]),
                     np.array([0.8]))  # r_eff = 1, column OD = 0.8
# Make a custom ice profile, then make a column of ice with that profile
iceprof = np.where(
    (25 < lay.altitude_layers) & (75 > lay.altitude_layers), 1, 0
)  # This is a somewhat cryptic way of making a constant profile at altitudes between 25--75 km
ice_profile = GCMProfile(lay, iceprof)
ice_column = Column(ice, lay, ice_profile, np.array([2]), np.array([0.5]))
Example #2
0
from pyRT_DISORT.preprocessing.model.vertical_profiles import Conrath, Uniform, Layers, ProfileHolder

atmFile = ExternalFile(
    '/home/kyle/repos/pyRT_DISORT/pyRT_DISORT/data/planets/mars/aux/mars_atm.npy'
)
ma = ModelAtmosphere(atmFile.array, atmFile.array[:, 0])

dustFile = ExternalFile(
    '/home/kyle/repos/pyRT_DISORT/pyRT_DISORT/data/planets/mars/aux/dust_properties.fits'
)
radii = np.array([1, 1.2, 1.4])
wavs = np.array([1, 9.3])
wavref = np.array([12.1, 12.1, 12.1])
aero = Aerosol(dustFile.array['primary'].data,
               radii,
               wavs,
               wavelength_grid=dustFile.array['wavelengths'].data,
               reference_wavelengths=wavref)

sh = np.array([10, 10, 10])
nu = np.array([0.5, 0.5, 0.5])
c = Conrath(ma, sh, nu)
p = ProfileHolder()
p.add_profile(c.profile)
p.stack_profiles()

#raise SystemExit(9)

ods = np.array([0.1, 0.8, 0.2])
newCol = NewColumn(aero, ma, p.profile, ods)
print(newCol.total_optical_depth)
Example #3
0
file = ExternalFile(
    '/home/kyle/repos/pyRT_DISORT/pyRT_DISORT/data/planets/mars/aux/dust_properties.fits'
)

data = file.array['primary'].data
wavs = file.array['wavelengths'].data
sizes = np.linspace(1, 2, num=10)

w = np.array([1, 9.3])
r = np.array([1, 1.2, 1.4])
ref = np.array([9.1, 9.2, 9.3])

# Make fake 3D data for testing
fakeData = np.zeros((10, len(wavs), 3))
for i in range(10):
    fakeData[i, :, :] = data * ((i + 1) / 10)

#asdf = CreateFits(fakeData)
#asdf.add_image_hdu(wavs, 'wavelengths')
#asdf.add_image_hdu(sizes, 'sizes')
#asdf.save_fits('/home/kyle/junk3D.fits')

#aero = Aerosol(fakeData, r, w, ref, wavelength_grid=wavs, particle_size_grid=sizes)
aero = Aerosol(data, r, w, wavelength_grid=wavs, reference_wavelengths=ref)
print(aero.extinction)

file = ExternalFile(
    '/home/kyle/repos/pyRT_DISORT/pyRT_DISORT/data/planets/mars/aux/dust.npy')
old = OldAerosol(file.array, w, 9.1)
print(old.extinction_ratios)