def get_pho_angles(img_name): output = isis.campt.check_output(from_=img_name) output = content_re.search(output).group(1) phase_angle = parse_label(output)['GroundPoint']['Phase'] incidence_angle = parse_label(output)['GroundPoint']['Incidence'] emission_angle = parse_label(output)['GroundPoint']['Emission'] return phase_angle, incidence_angle, emission_angle
def get_img_center(img_name): """ Args: image filename Returns: center latitude and center longitude of image """ output = isis.campt.check_output(from_=img_name) output = GROUP_RE.search(output).group(1) clon = parse_label(output)['GroundPoint']['PositiveEast360Longitude'] clat = parse_label(output)['GroundPoint']['PlanetographicLatitude'] return clat, clon
def get_lat_lon_from_x_y(xy, img_name): # TODO: add to module ''' Takes xy tuple containing sample and line ints Returns latitude and longitude ''' output = isis.mappt.check_output( from_ = img_name, to = 'mappt_temp.txt', format = 'flat', type = 'image', sample = xy[0], line = xy[1] ) latitude = parse_label(output)['Results']['PlanetographicLatitude'] longitude = parse_label(output)['Results']['PositiveEast360Longitude'] return latitude, longitude
def get_pixel_scale(img_name): ''' Input image filename Rturns the pixel_scale (as a string?) ''' output = isis.campt.check_output(from_=img_name) output = content_re.search(output).group(1) pixel_scale = parse_label(output)['GroundPoint']['SampleResolution'] return pixel_scale
def get_max_sample_line(img_name): # TODO: add to module ''' Get the max sample line without reading in the image. ''' output = isis.catlab.check_output(from_=img_name) data = parse_label(output)['IsisCube']['Core'] max_sample = data['Dimensions']['Samples'] max_line = data['Dimensions']['Lines'] return max_sample, max_line
def get_native_pixel_scale(img_name): """ Args: image filename Returns: the pixel_scale """ output = isis.campt.check_output(from_=img_name) output = GROUP_RE.search(output).group(1) pixel_scale = parse_label(output)['GroundPoint']['SampleResolution'] return pixel_scale
def get_image_info(image): """ GATHER INFORMATION ABOUT SINGLE OBSERVATION BASED ON VIS mosaic only """ # Get label info label = parse_file_label(image) instrument = label['IsisCube']['Instrument'] # Get campt info output = isis.campt.check_output(from_=image) gp = parse_label(GROUP_RE.search(output).group(1))['GroundPoint'] return pd.Series({ 'start_time': instrument['StartTime'], 'exp_time': instrument['ExposureDuration'], 'fpa_temp': instrument['MiddleTemperatureFpa'], 'subsolar_azimuth': gp['SubSolarAzimuth'], 'subsolar_ground_azimuth': gp['SubSolarGroundAzimuth'], 'solar_distance': gp['SolarDistance'] })
def get_img_center(img_name): output = isis.campt.check_output(from_=img_name) output = content_re.search(output).group(1) clon = parse_label(output)['GroundPoint']['PositiveEast360Longitude'] clat = parse_label(output)['GroundPoint']['PlanetographicLatitude'] return clat, clon
def number_null_pixels(image): output = isis.stats.check_output(from_=image) results = parse_label(GROUP_RE.search(output).group(1))['Results'] return results['NullPixels']
def get_pixel_scale(img_name): # special case output = isis.campt.check_output(from_=img_name) output = content_re.search(output).group(1) pixel_scale = parse_label(output)['GroundPoint']['SampleResolution'] return pixel_scale