# ----------------------------------------------------------------- # Setup the remote remote = Remote(host_id=environment.cache_host_id) # ----------------------------------------------------------------- directory_name = cached_directory_name_for_single_command( environment, "truncate") remote_truncation_path = fs.join(remote.home_directory, directory_name) # ----------------------------------------------------------------- filter_name = str(config.filter) remote_truncation_path_filter = fs.join(remote_truncation_path, filter_name) if not remote.is_directory(remote_truncation_path_filter): raise ValueError("Could not find cached data for the " + filter_name + " image") # ----------------------------------------------------------------- # Initialize variable the_image_path = None # Find the truncated image with the factor corresponding to the specified factor for image_path, image_name in remote.files_in_path( remote_truncation_path_filter, extension="fits", returns=["path", "name"]): #print(image_path, image_name)
# ----------------------------------------------------------------- # Load the modeling environment environment = GalaxyModelingEnvironment(modeling_path) # ----------------------------------------------------------------- # Setup the remote remote = Remote(host_id=environment.cache_host_id) # ----------------------------------------------------------------- remote_data_path = cached_directory_path_for_single_command( environment, "initialize_preparation", remote) if not remote.is_directory(remote_data_path): remote.create_directory(remote_data_path) # ----------------------------------------------------------------- # Reset? if config.reset: # Loop over all FITS files in the remote data directory for name, path in remote.files_in_path(remote_data_path, recursive=True, extension="fits", returns=["name", "path"]): # Determine origin origin = instrument_to_origin(name.split("_")[1])
# Get the generation generation = fitting_run.get_generation(config.generation) # ----------------------------------------------------------------- # Get the cache path cache_path = generation.single_cache_path # ----------------------------------------------------------------- # Create remote remote = Remote(host_id=config.host_id) # ----------------------------------------------------------------- # Determine RT Modeling backup directory path remote_backup_path = fs.join(remote.home_directory, "RT Modeling Backup") remote_backup_galaxy_path = fs.join(remote_backup_path, environment.galaxy_name) # ----------------------------------------------------------------- # Create path if not remote.is_directory(remote_backup_galaxy_path): remote.create_directory(remote_backup_galaxy_path, recursive=True) # ----------------------------------------------------------------- # Synchronize remote.synchronize(cache_path, remote_backup_galaxy_path, show_output=True) # -----------------------------------------------------------------