Exemple #1
0
import os

from config import REPO_PATH, DB_PATH
from extract.core.lines import SpectralFits
from extract.helpers import convert_vacuum_to_air_wavelengths, \
    calculate_vacuum_wavelength_rydberg_formula

# Pickle combination alg fits.
SpectralFits.save(db_path=DB_PATH,
                  table='Hepsilon_RegimeConcat',
                  comp_number=[1, 2, 3, 4],
                  lab_wavelength=convert_vacuum_to_air_wavelengths(
                      calculate_vacuum_wavelength_rydberg_formula(2, 7)),
                  velocity_error='pooled_intra_night_variance',
                  pickle_path=os.path.join(
                      REPO_PATH, 'Pickles', 'EtaCar_v3',
                      'fits_gmos_hepsilon_combi_[1,2,3,4].p'))

# Pickle benchmark bisector half max fits.
SpectralFits.save(db_path=DB_PATH,
                  table='Hepsilon_BHM',
                  comp_number=None,
                  lab_wavelength=convert_vacuum_to_air_wavelengths(
                      calculate_vacuum_wavelength_rydberg_formula(2, 7)),
                  velocity_error=10.0,
                  pickle_path=os.path.join(REPO_PATH, 'Pickles', 'EtaCar_v3',
                                           'fits_gmos_hepsilon_bhm.p'))
from config import DB_PATH
from extract.core.lines import SpectralFits
from extract.observatories.gemini import GeminiTelescopeInstruments
from extract.helpers import fetch_bad_jds


# Define viewing routines.
viewer = SpectralFits(GeminiTelescopeInstruments.gmos)
viewer.view(db_path=DB_PATH,
            table='Hzeta_RegimeConcat',
            start_at=0, comp_number=[1, 2, 3, 4],
            bad_jds=fetch_bad_jds(
                db_path=DB_PATH, fit='h_zeta_master', comp='Any'),
            fold=False, save=False,
            save_loc='/Users/grantd/ScreenGrabs/SpectralDynamics/'
                     'Videos/Hzeta/Hzeta_GMOS_Fit_comp{}_{}.jpg')
Exemple #3
0
# Iterate different fitting regimes.
res_tables = []
for regime in jd_tuples:
    print('\nStarting new fitting regime={}\n'.format(regime['label']))

    # Select subset of the dataset.
    handler.select_fits_subset(pre_processing=None,
                               binning=None,
                               exposure=(None, 'max'),
                               reduction=None,
                               observatory=None,
                               jd=regime['jd_rule'])

    # Define fitting routines.
    fitter = SpectralFits(GeminiTelescopeInstruments.gmos)
    fitter.add(
        etacar_templates.h_i_3889(version=regime['template'],
                                  solver=regime['solver']))

    # Ready fitting routine and pre-processing options.
    fitter.compile(helio_correction=False,
                   continuum_normalisation=True,
                   re_bin=None,
                   refine_continuum=True,
                   bad_jds=fetch_bad_jds(db_path=DB_PATH,
                                         fit='h_zeta_master',
                                         comp='Any'))

    # Execute fitting routines.
    fitter.fit(handler.data_subset,
from config import DB_PATH
from extract.core.lines import SpectralFits
from extract.observatories.gemini import GeminiTelescopeInstruments
from extract.helpers import fetch_bad_jds


# Define viewing routines.
viewer = SpectralFits(GeminiTelescopeInstruments.gmos)
viewer.rcs_edge_size = (2, 10)
viewer.view(db_path=DB_PATH,
            table='Hiota_RegimeConcat',
            start_at=0, comp_number=[1, 2, 3, 4],
            bad_jds=fetch_bad_jds(
                db_path=DB_PATH, fit='h_iota_master', comp='Any'),
            fold=False, save=False,
            save_loc='/Data/ScreenGrabs/AstroDynamics Screenshots/'
                     'Videos/Hiota/Hiota_GMOS_Fit_comp{}_{}.jpg')