def populate_obs_surface_geo_target_name(**kwargs): metadata = kwargs['metadata'] index_row = metadata['index_row'] surface_geo_row = metadata['body_surface_geo_row'] target_name = surface_geo_row['TARGET_NAME'].upper() if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) return None return (target_name, target_name.title())
def helper_cassini_target_name(**kwargs): metadata = kwargs['metadata'] index_row = metadata['index_row'] target_name = index_row['TARGET_NAME'].upper() if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] target_desc = None if 'TARGET_DESC' in index_row: # Only for COISS target_desc = index_row['TARGET_DESC'].upper() if target_desc in COISS_TARGET_DESC_MAPPING: target_desc = COISS_TARGET_DESC_MAPPING[target_desc] if target_desc in TARGET_NAME_MAPPING: target_desc = TARGET_NAME_MAPPING[target_desc] target_code = None obs_name = helper_cassini_obs_name(**kwargs) if helper_cassini_valid_obs_name(obs_name): obs_parts = obs_name.split('_') target_code = obs_parts[1][-2:] # 1: TARGET_NAME of SATURN or SKY and TARGET_CODE is one of the rings if ((target_name == 'SATURN' or target_name == 'SKY') and target_code in ('RA','RB','RC','RD','RE','RF','RG','RI')): return ('S RINGS', 'Saturn Rings') # 2: TARGET_NAME of SATURN or SKY and TARGET_DESC contains "RING" # (leave TARGET_CODE of "Star" alone) if ((target_name == 'SATURN' or target_name == 'SKY') and target_desc is not None and target_desc.find('RING') != -1 and target_code != 'ST'): return ('S RINGS', 'Saturn Rings') # 3: TARGET_NAME of SKY and TARGET_CODE of Skeleton, let TARGET_DESC # override TARGET_NAME if (target_name == 'SKY' and target_code == 'SK' and target_desc is not None and target_desc in TARGET_NAME_INFO): return (target_desc.upper(), target_desc.title()) if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) if impglobals.ARGUMENTS.import_ignore_errors: return 'None' return None target_name_info = TARGET_NAME_INFO[target_name] if len(target_name_info) == 3: return target_name, target_name_info[2] return (target_name, target_name.title())
def populate_obs_general_HSTx_target_name_OBS(**kwargs): metadata = kwargs['metadata'] index_row = metadata['index_row'] target_name = index_row['TARGET_NAME'].upper() if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) if impglobals.ARGUMENTS.import_ignore_errors: return 'None' return None target_name_info = TARGET_NAME_INFO[target_name] return target_name, target_name_info[2]
def helper_new_horizons_target_name(**kwargs): metadata = kwargs['metadata'] supp_index_row = metadata['supp_index_row'] target_name = supp_index_row['TARGET_NAME'].upper() if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) if impglobals.ARGUMENTS.import_ignore_errors: return 'None' return None target_name_info = TARGET_NAME_INFO[target_name] return target_name, target_name_info[2]
def helper_galileo_target_name(**kwargs): metadata = kwargs['metadata'] index_row = metadata['index_row'] target_name = index_row['TARGET_NAME'] if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name is None: return None if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) return None target_name_info = TARGET_NAME_INFO[target_name] return target_name, target_name_info[2]
def populate_obs_general_target_class(**kwargs): metadata = kwargs['metadata'] obs_general_row = metadata['obs_general_row'] # This target_name might have "SATURN RINGS" in it; slightly different # from the PDS "TARGET_NAME" target_name = obs_general_row['target_name'].upper() if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) if impglobals.ARGUMENTS.import_ignore_errors: return 'OTHER' return None target_class = TARGET_NAME_INFO[target_name][1] return target_class
def populate_obs_surface_geo_target_list(**kwargs): metadata = kwargs['metadata'] index_row = metadata['index_row'] target_list = metadata['inventory_list'] if target_list is None: return None new_target_list = [] for target_name in target_list: if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) return None new_target_list.append(TARGET_NAME_INFO[target_name][2]) return ','.join(sorted(new_target_list))
def helper_galileo_target_name(**kwargs): metadata = kwargs['metadata'] index_row = metadata['index_row'] target_name = index_row['TARGET_NAME'] if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name is None: return None if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) return None target_name_info = TARGET_NAME_INFO[target_name] if len(target_name_info) == 3: return target_name, target_name_info[2] return (target_name, target_name.title())
def helper_voyager_target_name(**kwargs): metadata = kwargs['metadata'] index_row = metadata['index_row'] target_name = index_row['TARGET_NAME'].upper() if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) if impglobals.ARGUMENTS.import_ignore_errors: return 'None' return None target_name_info = TARGET_NAME_INFO[target_name] if len(target_name_info) == 3: return target_name, target_name_info[2] return (target_name, target_name.title())
def helper_groundbased_target_name(**kwargs): metadata = kwargs['metadata'] index_label = metadata['index_label'] target_name = index_label['TARGET_NAME'] if target_name != 'S RINGS': import_util.log_nonrepeating_error( f'Ground-based mission targets "{target_name}" instead of "S RINGS"' ) if target_name in TARGET_NAME_MAPPING: target_name = TARGET_NAME_MAPPING[target_name] if target_name is None: return None if target_name not in TARGET_NAME_INFO: import_util.announce_unknown_target_name(target_name) return None target_name_info = TARGET_NAME_INFO[target_name] return target_name, target_name_info[2]