alphas_inslice = np.append( 0, alphas_inslice ) # To include alpha=0, and put it at the beginning of the array inds_al = np.where( (alphas_inslice < alpha_high) & (alphas_inslice > alpha_low) ) # we cut to this range to avoid issues with the edges of the slices. alphas_inslice = alphas_inslice[inds_al] for alpha_pos in alphas_inslice: if alpha_pos == alphas_inslice[0]: print 'Along-slice position:' print ' {} arcsec'.format(round(alpha_pos, 2)) # Take pixel trace along specified slice, specified alpha position trace is built by taking the pixel in every detector row with alpha value closest to the one specified ypos, xpos = funcs.detpixel_trace(band, d2cMaps, sliceID=islice, alpha_pos=alpha_pos) if band == '1C': xpos[0] = xpos[1] xpos[-1] = xpos[-2] # Choose data regions #--FM data etalon1A_fm_data = etalon1A_img[ypos, xpos] etalon1B_fm_data = etalon1B_img[ypos, xpos] # Determine etalon peaks #--FM Etalon_1A data if user == 'yannis': etalon1A_fm_data[np.isnan(etalon1A_fm_data)] = -1 FMetalon1A_peaks = funcs.find_peaks(etalon1A_fm_data,
sliceMap = d2cMaps['sliceMap'] lambdaMap = d2cMaps['lambdaMap'] alphaMap = d2cMaps['alphaMap'] nslices = d2cMaps['nslices'] det_dims = (1024, 1032) # In[6]: plt.close('all') # reference spectral trace if band == '2C': lower, upper = 600, -10 else: lower, upper = 10, -10 ypos_ref, xpos_ref = funcs.detpixel_trace(band, d2cMaps, sliceID=ref_slice, alpha_pos=ref_alpha) sci_fm_data_ref = mrs_transmission_img[ypos_ref, xpos_ref][lower:upper] # create a finer grid step = 0.2 fine_grid = np.arange(lower, 1023 - abs(upper) + step, step) if band == '2C': fine_grid = fine_grid[:-2] sci_fm_data_ref_fine = interp1d(lower + np.arange(len(sci_fm_data_ref)), sci_fm_data_ref)(fine_grid) if band in ['1B', '2C']: sci_fm_data_ref_fine = savgol_filter(sci_fm_data_ref_fine, 201, 2) pix_offsets = [] offsets = np.arange(1, 200) wider_offsets = np.arange(-200, 200)