Imaging InstrumentΒΆ

An example of how to do setup an imaging instrument.

import sasktranif.sasktranif as skif
import numpy as np
from radtran.scan import Scan
from retrieval.instruments.spectral_imager import MultiSensorImager

def imaging_instrument():

    #generate the optical axis line of sight
    scan = Scan()
    altitudes = np.array([0.0])
    scan.make_scan_saa(sza=90, saa=45, lat=45, lon=0, tanalts_km=altitudes, mjd=54372.5, locallook=45,sataltkm=10000)

    #instrument location
    latitude  = 0.0
    longitude = 0.0
    altitude  = 500.0

    #get the location as geodetic coordinates
    geoid = skif.ISKGeodetic()
    geoid.SetLocationLatLonAlt(latitude, longitude, altitude)
    x,y,z = geoid.GetLocationXYZ()

    #find the vertical direction
    vert = np.cross(scan.look[0],scan.obs/np.sqrt(np.sum(scan.obs[0]**2)))
    vert = np.cross(scan.look[0],vert)

    #setup the instrument geometry - here the instrument does not move, but the
    #images are taken at two different times of day
    position       = [np.array([scan.obs[0]]),  np.array([scan.obs[0]])]
    look_direction = [np.array([scan.look[0]]), np.array([scan.look[0]])]
    orientation    = [np.array([vert]), np.array([vert])]
    mjd            = [np.array([[54372.5]]),   np.array([[54372.6]])]

    wavelengths = [np.array([700.0]), np.array([700.0])]   #can be changed later

    #create the instrument
    ali = MultiSensorImager( wavelengths, look_direction, vertical=orientation, obs=position,mjd=mjd )

    #OPTIONAL: setup the size and field of view of the detector (default is a single line of sight)
    ali.horFOV     = 10
    ali.vertFOV    = 0.7
    ali.horPixels  = 100
    ali.vertPixels = 200

    #OPTIONAL: setup the wavelength oversampling (default is no oversampling)
    ali.psf_wavel_nm = np.array([0.0, 1000])
    ali.psf          = np.array([0.5, 4.0])
    ali.waveSamples  = 1

    #OPTIONAL: setup the spacial oversampling (default is no oversampling)
    ali.vertRes     = 1*np.pi/180
    ali.vertSamples = 1
    ali.horRes      = 1*np.pi/180
    ali.horSamples  = 1

    #initialize the instrument
    ali.initialize_sensors_and_optics()

    return ali