Пример #1
0
    '/home/vital/Astrodata/WHT_2011_11/Night2/',
    '/home/vital/Astrodata/WHT_2016_04/Night1/',
    '/home/vital/Astrodata/WHT_2016_04/Night2/']
output_folder = '/home/vital/Dropbox/Astrophysics/Data/WHT_observations/objects/'

#Delete the folder contents
if isdir(output_folder):
    rmtree(output_folder)
 
catalogue_df        = pd.DataFrame()
catalogue_colums    = ['codename', 'objCode', 'folder_address', 'file_name', 'folder_code','night', 'time_obs', 'arm_color', 'aperture', 'parent_file_address', 'reduc_tag', 'telluric_star', 'telluric_file', 'chemistry_valid', ]
   
#--Load the data in the data frame
for data_folder in input_folders:
        
    dz.reducDf = dz.load_reduction_dataframe(data_folder)
    dz.observation_dict = dz.load_observation_dict(data_folder + 'observation_properties.txt')
    
    #Move the objects
    for target_object in dz.observation_dict['objects']:
                    
        code_name = target_object.translate(None, "[]")
                                  
        #Move the files to their folder
        for arm_color in ['Blue', 'Red']:
            for calibration in ['flocal', 'fglobal']:
                 
                reduction_tag   = 'flux_calibrated_objects_' + calibration
                idx_target      = (dz.reducDf.frame_tag == target_object) & (dz.reducDf.reduc_tag == reduction_tag) & (dz.reducDf.ISIARM == '{color} arm'.format(color = arm_color))           
                fits_address    = dz.reducDf.file_location[idx_target].values[0] + dz.reducDf.file_name[idx_target].values[0]
                 
Пример #2
0
dz.FigConf()

#Create the catalogue dataframe
key_codes = [
    'codename', 'objcode', 'obscode', 'obsfolder', 'Standard_stars',
    'time_obs', 'arm_color', 'aperture', 'parent_file_address', 'reduc_tag',
    'calibration_star'
]  #Codename will become the index in the final dataframe

transition_catalogue = pd.DataFrame()

#--Load the data in the data frame
for obs in input_folders:

    data_folder = input_folders[obs]
    dz.reducDf = dz.load_reduction_dataframe(data_folder)
    dz.observation_dict = dz.load_observation_dict(
        data_folder + 'observation_properties.txt')
    standard_stars = dz.observation_dict['Standard_stars']

    #Move the objects
    for target_object in dz.observation_dict['objects']:

        objcode = target_object.translate(None, "[]")
        calibration_stars = dz.observation_dict['{}_calibration_star'.format(
            target_object)]

        print '--', objcode

        #Move the files to their folder
        for arm_color in ['Blue', 'Red']: