from dazer_methods import Dazer

#Declare objects
dz = Dazer()

#Define data type and location
Catalogue_Dic = dz.import_catalogue()
Table_Name = '_lineslog'
log_extension = '_log.txt'
cHbeta_type = 'cHBeta_red'
emission_log = '_' + Catalogue_Dic['Datatype'] + '_LinesLog_v3.txt'
# emission_log_st = '_' + Catalogue_Dic['Datatype'] + '_emission_LinesLog_v3.txt'

#Get file list
FilesList = dz.Folder_Explorer(emission_log,
                               Catalogue_Dic['Obj_Folder'],
                               CheckComputer=False)

#Get the dictionary with the headers format and the data
dz.EmissionLinesLog_header()

#Generate list of objects (Dazer should have a method for this)
for i in range(len(FilesList)):

    CodeName, FileName, FileFolder = dz.Analyze_Address(FilesList[i])

    #load object data
    cHbeta = dz.GetParameter_ObjLog(CodeName,
                                    FileFolder,
                                    cHbeta_type,
                                    Assumption='float')
Esempio n. 2
0
favoured_objects = ['02', '03', '05', '09', 'Mar2232']

#Generate dazer object
dz = Dazer()

#Define figure format
dz.FigConf(n_colors=2)
cmap = dz.cmap_pallete()

#Define operation
Catalogue_Dic = dz.import_catalogue()
Pattern = '_log'

FilesList = dz.Folder_Explorer(Pattern,
                               Catalogue_Dic['Obj_Folder'],
                               CheckComputer=False)
Hbeta_values, Flux_values, names, sn_values, z_values = [], [], [], [], []
g_mags, r_mags = [], []
Declination_values = []

for i in range(len(FilesList)):

    #Get the frame row
    CodeName, FileName, FileFolder = dz.Analyze_Address(FilesList[i],
                                                        verbose=False)

    #Load the observational data
    Hbeta_Flux = dz.GetParameter_ObjLog(CodeName,
                                        FileFolder,
                                        'SDSS_Flux_Hbeta',
    
    return image.imread(filename)


#Generate dazer object

dz = Dazer()

#Define figure format
dz.FigConf(n_colors = 2)

#Define operation
Catalogue_Folder   = '/home/vital/Dropbox/Astrophysics/Data/Fabian_Catalogue/'
log_file_extension =  '_log.txt'

FilesList = dz.Folder_Explorer(log_file_extension, Catalogue_Folder, CheckComputer=False)

#Labels with the data from Hbeta
Hbeta_label = 'H_beta'
objects_which_failed = []

for i in range(len(FilesList)):
    
    try:
    
        #Get the frame row
        CodeName, FileName_Blue, FileFolder = dz.Analyze_Address(FilesList[i])
         
        #Store parameter in object log file
        dz.SetLogFile(CodeName + log_file_extension, FileFolder)
             
Esempio n. 4
0
#!/usr/bin/python
from time import time
from os import remove
from dazer_methods import Dazer
from DZ_observation_reduction import spectra_reduction

#Create class object
dz = Dazer()

FilesList = dz.Folder_Explorer(
    '',
    '/home/vital/Dropbox/Astrophysics/Data/WHT_observations/',
    CheckComputer=False,
    verbose=False,
    Sort_Output='alphabetically')

files_to_keep = []
files_to_delete = []

for file_address in FilesList:

    CodeName, FileName, FolderName = dz.Analyze_Address(file_address,
                                                        verbose=False)

    if (FileName in [
            'WHT_Galaxies_properties.txt'
    ]) or ('run' in FileName) or ('_lick_indeces.txt' in FileName):
        files_to_keep.append(FolderName + FileName)
    else:
        files_to_delete.append(FolderName + FileName)
Esempio n. 5
0
from time import time
from os import remove
from dazer_methods import Dazer
from DZ_observation_reduction import spectra_reduction

#Import libraries
t2 = time()  # start time
dz = Dazer()
t3 = time()  # end time
print '--TOTAL Init', (t3 - t2)

sr = spectra_reduction()

FilesList = dz.Folder_Explorer('',
                               sr.Catalogue_folder,
                               CheckComputer=False,
                               verbose=False,
                               Sort_Output='alphabetically')

files_to_keep = []
files_to_delete = []

for file_address in FilesList:

    CodeName, FileName, FolderName = dz.Analyze_Address(file_address,
                                                        verbose=False)

    if (FileName in [
            'badpix_Bluemask', 'badpix_Redmask', 'observation_properties.txt',
            'rejected_files.txt'
    ]) or ('run' in FileName) or ('/raw_fits/' in FolderName) or (
Esempio n. 6
0
set_option('display.max_columns', None)
set_option('display.max_rows', None)

#Declare object
dz = Dazer()
dz.load_reduction_tools()

#Objects and file
pattern = '.fit'

#Load the catalogue
dz.declare_catalogue(dz.Catalogue_folder)

#Locate files
FilesList = dz.Folder_Explorer(pattern,
                               dz.Catalogue_folder,
                               Sort_Output='alphabetically')
empty_array = [None] * len(dz.columns_reducDf)

#Create the raw data folder
if path.exists(dz.reducFolders['raw data']) == False:
    makedirs(dz.reducFolders['raw data'])

#Loop through files
for i in range(len(FilesList)):

    #Identify object
    CodeName, FileName, FileFolder = dz.Analyze_Address(FilesList[i],
                                                        verbose=False)
    CodeName = FileName[0:FileName.find('.')]