Skip to content
Snippets Groups Projects
Commit 7f9fd4c7 authored by Adam Paquette's avatar Adam Paquette
Browse files

Small changes.

parent 81d0ef93
No related branches found
No related tags found
No related merge requests found
...@@ -34,11 +34,7 @@ def main(args): ...@@ -34,11 +34,7 @@ def main(args):
else: else:
outpath = os.path.split(at_file)[0] outpath = os.path.split(at_file)[0]
# with open(args.cub_ipf_map) as cub_ipf_map: # Read in and setup the atf dict of information
# reader = csv.reader(cub_ipf_map, delimiter = ',')
# image_dict = dict([(row[0], row[1]) for row in reader])
# Read in and setup the atf dict of information
atf_dict = read_atf(at_file) atf_dict = read_atf(at_file)
# Get the gpf and ipf files using atf dict # Get the gpf and ipf files using atf dict
......
...@@ -317,12 +317,24 @@ def apply_isis_transformations(df, eRadius, pRadius, serial_dict, extension, cub ...@@ -317,12 +317,24 @@ def apply_isis_transformations(df, eRadius, pRadius, serial_dict, extension, cub
Parameters Parameters
---------- ----------
atf_dict : dict
Dictionary containing information from an atf file
df : object df : object
Pandas dataframe object Pandas dataframe object
eRadius : float
Equitorial radius
pRadius : float
Polar radius
serial_dict : dict
Dictionary mapping serials as keys to images as the values
extension : str
String extension of all cubes being used
cub_path : str
Path to all cubes being used
""" """
# Convert from geocentered coords (x, y, z), to lat lon coords (latitude, longitude, alltitude) # Convert from geocentered coords (x, y, z), to lat lon coords (latitude, longitude, alltitude)
ecef = np.array([[df['long_X_East']], [df['lat_Y_North']], [df['ht']]]) ecef = np.array([[df['long_X_East']], [df['lat_Y_North']], [df['ht']]])
...@@ -521,16 +533,52 @@ def reverse_known(record): ...@@ -521,16 +533,52 @@ def reverse_known(record):
return 3 return 3
def fix_sample_line(record, serial_dict, extension, cub_path): def fix_sample_line(record, serial_dict, extension, cub_path):
"""
Extracts the sample, line data from a cube and computes deviation from the
center of the image
Parameters
----------
record : dict
Dict containing the key serialnumber, l., and s.
serial_dict : dict
Maps serial numbers to images
extension : str
Extension for cube being looked at
cub_path : str
Path to a given cube being looked at
Returns
-------
new_line : int
new line deviation from the center
new_sample : int
new sample deviation from the center
"""
# Cube location to load # Cube location to load
cube = pvl.load(os.path.join(cub_path, serial_dict[record['serialnumber']] + extension)) cube = pvl.load(os.path.join(cub_path, serial_dict[record['serialnumber']] + extension))
line_size = find_in_dict(cube, 'Lines') line_size = find_in_dict(cube, 'Lines')
sample_size = find_in_dict(cube, 'Samples') sample_size = find_in_dict(cube, 'Samples')
new_line = record['l.'] - (int(line_size)/2.0) - 1 new_line = record['l.'] - (int(line_size/2.0)) - 1
new_sample = record['s.'] - (int(sample_size)/2.0) - 1 new_sample = record['s.'] - (int(sample_size/2.0)) - 1
return new_line, new_sample return new_line, new_sample
def ignore_toggle(record): def ignore_toggle(record):
"""
Maps the stat column in a record to 0 or 1 based on True or False
Parameters
----------
record : dict
Dict containing the key stat
"""
if record['stat'] == True: if record['stat'] == True:
return 0 return 0
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment