コード例 #1
0
def photomet_rolo(img_name, rolo_angle_dict):
    """ Compute and return photometric properties of a projected rolo image
    Args: LROC NAC frame

    Returns: 
        clat, clon, emission, incidence
    """
    #rolo_band = rolodir + '/footprints/' + no_ext + '.' + rolo_base + '.band0001.cub'
    # get clat and clon for next calculation (just from the NAC map file) 
    # needs to be updated for new pysis
    mapping = parse_file_header(img_name + '.map')['Mapping']
    lat = mapping['CenterLatitude']
    lon = mapping['CenterLongitude']
    subearthlat = rolo_angle_dict[rolo_base]['selat']
    subearthlon = rolo_angle_dict[rolo_base]['selon']
    subsolarlat = rolo_angle_dict[rolo_base]['sslat']
    subsolarlon = rolo_angle_dict[rolo_base]['sslon']
    emission = rolotools.compute_emission(subearthlat, subearthlon, lat, lon)
    incidence = rolotoos.compute_incidence(subsolarlat, subsolarlon, lat, lon)
    return lat, lon, emission, incidence
コード例 #2
0
ファイル: rolo_ls.py プロジェクト: sbraden/pysis-scripts
def main():

    # read in lat and lon from the ROLO data file
    # Filename,Sample,Line,PlanetocentricLatitude,PositiveEast180Longitude
    dtype = {
      'names': ['filename','sample','line','lat','lon'],
      'formats': ['S64', 'f8','f8', 'f8', 'f8']
    }
    # rolo_pix_data: numpy array of image data
    rolo_pix_data = np.loadtxt('rolo_s_l_lat_lon.csv', dtype=dtype, delimiter=',')

    dtype = {
        'names': ['imagename', 'phase', 'selat', 'selon', 'sslat', 'sslon', 'lsratioatSE'],
        'formats': ['S64', 'f8', 'f8', 'f8', 'f8', 'f8', 'f8']
    }
    angle = np.loadtxt('rolo_angle_info.csv', dtype=dtype, delimiter=',')

    # rolo_angle_dict: dictionary of angles for images
    rolo_angle_dict = dict(zip(angle['imagename'], angle))

    subearthlat = rolo_angle_dict[image_name]['selat']
    subearthlon = rolo_angle_dict[image_name]['selon']
    subsolarlat = rolo_angle_dict[image_name]['sslat']
    subsolarlon = rolo_angle_dict[image_name]['sslon']
    lat, lon = rolo_pix_data['lat'], rolo_pix_data['lon']
    emission = rolotools.compute_emission(subearthlat, subearthlon, lat, lon)
    incidence = rolotoos.compute_incidence(subsolarlat, subsolarlon, lat, lon)

    # calculate Lommel-Seeliger factor for each point
    # L-S = cos(i) / ( cos(e) + cos(i) )
    LommelSeeliger = np.cos(np.radians(incidence))/(np.cos(np.radians(emission))+np.cos(np.radians(incidence)))
    # LS value at Sub Earth point
    LSsubearth = 0.4590 # I think I need to compute this for each image.
    # compute LS ratio for each point in image
    LSratio = LSsubearth / LommelSeeliger

    # write a function for generic ascii image writing
    # eventually this should be direct to isis (no ascii)
    write_image(emission, 'test_out_ema.ascii')
    write_image(incidence, 'test_out_inc.ascii')
    write_image(LSratio, 'test_out_LS_ratio.ascii')