obj_db = pd.read_csv(db_address_i,
                             delim_whitespace=True,
                             header=0,
                             index_col=0)
        mask_df = pd.read_csv(mask_global_address_i,
                              delim_whitespace=True,
                              header=0,
                              index_col=0)

        # Reset and measure the lines
        # lm = sr.LineMesurer(wave_rest, flux_voxel * norm_flux, normFlux=norm_flux, linesDF_address=mask_global_address_i)

        print(f'\n- {obj}: Cube dimensions {cube.shape}')

        # Get line region data
        lineFlux_dict, levelFlux_dict, levelText_dict = compute_line_flux_image(
            lineAreas, cube, z_objs[i], percent_array=pertil_array)
        # Declare voxels to analyse
        lineLabel = 'O3_5007A'
        percentil_array = pertil_array
        wcs_cube = WCS(cube.data_header)
        voxel_coord = (236, 132)
        idx_j, idx_i = voxel_coord

        fluxImage = lineFlux_dict[lineLabel]
        fluxLevels = levelFlux_dict[lineLabel]
        levels_text = levelText_dict[lineLabel]
        flux_voxel = cube[:, idx_j, idx_i].data.data

        plotConf = {
            'image': {
                'xlabel': r'RA',
Exemple #2
0
for i, obj in enumerate(objList):

    # Load the data
    print(f'\n- {obj}')
    file_address_i = f'{dataFolder}/{fileList[i]}'
    wave, cube, header = sr.import_fits_data(file_address_i, instrument='MUSE')
    wave = wave / (1 + z_objs[i])
    print(f'\n-- {header["OBJECT"]}')

    # Get astronomical coordinates one pixel
    coord_sky = cube.wcs.pix2sky(idx_voxel, unit=u.deg)
    dec, ra = deg2sexa(coord_sky)[0]
    wcs_cube = WCS(cube.data_header)

    lineFlux_dict, levelFlux_dict, levelText_dict = compute_line_flux_image(
        lineAreas, wave, cube)

    # Plot the line flux maps
    for lineLabel, lineLimits in lineAreas.items():

        lineFlux_i, levelFlux_i, levelText_i = lineFlux_dict[
            lineLabel], levelFlux_dict[lineLabel], levelText_dict[lineLabel]

        # Plot line image map with coordinates
        labelsDict = {
            'xlabel': r'RA',
            'ylabel': r'DEC',
            'title': r'Galaxy {} {}'.format(obj, lineLabel)
        }

        # Plot Configuration