txt_out_spectra1 = 'residuum_spectra_ccd1.csv'
txt_out_spectra3 = 'residuum_spectra_ccd3.csv'

print 'Reading data sets'
galah_data_dir = '/home/klemen/GALAH_data/'
galah_template_dir = '/home/klemen/GALAH_data/Spectra_template/'
galah_grid_dir_ccd1 = '/home/klemen/GALAH_data/Spectra_template_grid/galah_dr52_ccd1_4710_4910_wvlstep_0.02_lin_RF/Teff_300_logg_0.50_feh_0.20_snr_20_medianshift_std_3.0_redflag/'
galah_grid_dir_ccd3 = '/home/klemen/GALAH_data/Spectra_template_grid/galah_dr52_ccd3_6475_6745_wvlstep_0.03_lin_RF/Teff_300_logg_0.50_feh_0.20_snr_40_medianshift_std_3.0_redflag/'
galah_param = Table.read(galah_data_dir + 'sobject_iraf_52_reduced.fits')

spectra_file_ccd1 = 'galah_dr52_ccd1_4710_4910_wvlstep_0.04_lin_RF.pkl'
spectra_file_ccd3 = 'galah_dr52_ccd3_6475_6745_wvlstep_0.06_lin_RF.pkl'
template_file_ccd3 = ''
# parse resampling settings from filename
csv_param_ccd1 = CollectionParameters(spectra_file_ccd1)
wvl_values_ccd1 = csv_param_ccd1.get_wvl_values()
csv_param_ccd3 = CollectionParameters(spectra_file_ccd3)
wvl_values_ccd3 = csv_param_ccd3.get_wvl_values()

# change to output directory
out_dir = 'H_flux_template_grid_alpha_beta_complete'
ch_dir(out_dir)

# object selection criteria
# must be a giant - objects are further away than dwarfs
print 'Number of all objects: ' + str(len(galah_param))
if not RESUME_PROCESSING:
    # OLD definition of giant
    # idx_object_use = galah_param['logg_guess'] < 3.5
    # NEW definition of giants
    # idx_object_use = (-2./1500.*galah_param['teff_guess'] + 10) > galah_param['logg_guess']
Пример #2
0
selected_observation_fields = all_observation_fields
get_fields = len(selected_observation_fields)

C_LIGHT = 299792458  # m/s

wvl_min = 6479
wvl_max = 6520

print 'Reading resampled GALAH spectra'
spectra_file_csv = 'galah_dr52_ccd3_6475_6745_interpolated_wvlstep_0.06_spline_observed.csv'
# parse resampling settings from filename
csv_param = CollectionParameters(spectra_file_csv)
ccd = csv_param.get_ccd()
wvl_start, wvl_end = csv_param.get_wvl_range()
wvl_values = csv_param.get_wvl_values()

# determine the data range to be read and read it
idx_read = np.where(np.logical_and(wvl_values > wvl_min, wvl_values < wvl_max))
# alternative and much faster way
spectral_data = pd.read_csv(galah_data_dir + spectra_file_csv,
                            sep=',',
                            header=None,
                            na_values='nan',
                            usecols=idx_read[0]).values
spectal_data_size = np.shape(spectral_data)
print spectal_data_size
wvl_read = wvl_values[idx_read]

out_dir = 'Multiplots_observed'
if os.path.exists(out_dir) == False:
Пример #3
0
fields_param = pd.read_csv(galah_data_dir +
                           'sobject_iraf_52_reduced_fields.csv',
                           header=None,
                           sep=',').values[0]
galah_param = Table.read(galah_data_dir + 'sobject_iraf_52_reduced.csv',
                         format='ascii.csv')
# determine unique numbers of observation field

print 'Reading resampled GALAH spectra'
molecfit_csv = 'galah_dr52_ccd3_6475_6745_interpolated_wvlstep_0.02_spline_diagnostics.csv'
spectra_file_csv = 'galah_dr52_ccd3_6475_6745_interpolated_wvlstep_0.06_spline_restframe.csv'
# parse resampling settings from filename
csv_param = CollectionParameters(molecfit_csv)
ccd = csv_param.get_ccd()
wvl_start, wvl_end = csv_param.get_wvl_range()
wvl_values = csv_param.get_wvl_values()
csv_param_2 = CollectionParameters(spectra_file_csv)
wvl_values_spectra = csv_param_2.get_wvl_values()

# determine the data range to be read and read it
# idx_read = np.where(np.logical_and(wvl_values > wvl_min,
#                                    wvl_values < wvl_max))
# spectral_data = np.loadtxt(galah_data_dir + spectra_file_csv, delimiter=',',
#                            usecols=np.arange(len(wvl_values))[idx_read])  # read limited number of columns instead of full dataset
# alternative and much faster way
molecfit_data = pd.read_csv(galah_data_dir + molecfit_csv,
                            sep=',',
                            header=None,
                            na_values='nan').values
# spectral_data = pd.read_csv(galah_data_dir + spectra_file_csv,
#                             sep=',', header=None, na_values='nan').values