diff --git a/cfitsio-3.49.tar.gz b/cfitsio-3.49.tar.gz deleted file mode 100755 index be8bfe3..0000000 Binary files a/cfitsio-3.49.tar.gz and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_POL0_crop_region.png b/plots/NGC1068_x274020/NGC1068_FOC_POL0_crop_region.png index cc248e5..4a3a209 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_POL0_crop_region.png and b/plots/NGC1068_x274020/NGC1068_FOC_POL0_crop_region.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_errors_POL0_background_location.png b/plots/NGC1068_x274020/NGC1068_FOC_errors_POL0_background_location.png index c6d5f80..fb8e2a0 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_errors_POL0_background_location.png and b/plots/NGC1068_x274020/NGC1068_FOC_errors_POL0_background_location.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png b/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png index 41d658e..4870af5 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png and b/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png differ diff --git a/src/FOC_reduction.py b/src/FOC_reduction.py index 43175f6..c6d1386 100755 --- a/src/FOC_reduction.py +++ b/src/FOC_reduction.py @@ -98,10 +98,10 @@ def main(): iterations = 5 algo="richardson" # Initial crop - display_crop = True + display_crop = False # Error estimation error_sub_shape = (10,10) - display_error = True + display_error = False # Data binning rebin = True if rebin: @@ -110,7 +110,7 @@ def main(): rebin_operation = 'sum' #sum or average # Alignement align_center = 'image' #If None will align image to image center - display_data = True + display_data = False # Smoothing smoothing_function = 'combine' #gaussian_after, weighted_gaussian_after, gaussian, weighted_gaussian or combine smoothing_FWHM = 0.20 #If None, no smoothing is done @@ -120,7 +120,7 @@ def main(): rotate_data = False #rotation to North convention can give erroneous results # Final crop crop = False #Crop to desired ROI - final_display = True + final_display = False # Polarization map output figname = 'NGC1068_FOC' #target/intrument name figtype = '_combine_FWHM020' #additionnal informations diff --git a/src/lib/plots.py b/src/lib/plots.py index d7fefe7..c688e7a 100755 --- a/src/lib/plots.py +++ b/src/lib/plots.py @@ -81,6 +81,7 @@ def plot_obs(data_array, headers, shape=None, vmin=0., vmax=6., rectangle=None, be saved. Not used if savename is None. Defaults to current folder. """ + plt.rcParams.update({'font.size': 10}) if shape is None: shape = np.array([np.ceil(np.sqrt(data_array.shape[0])).astype(int),]*2) fig, ax = plt.subplots(shape[0], shape[1], figsize=(10,10), dpi=200, @@ -147,6 +148,7 @@ def plot_Stokes(Stokes, savename=None, plots_folder=""): wcs = WCS(Stokes[0]).deepcopy() # Plot figure + plt.rcParams.update({'font.size': 10}) fig = plt.figure(figsize=(30,10)) ax = fig.add_subplot(131, projection=wcs) diff --git a/src/lib/reduction.py b/src/lib/reduction.py index 9f8af28..bf90217 100755 --- a/src/lib/reduction.py +++ b/src/lib/reduction.py @@ -261,6 +261,7 @@ def crop_array(data_array, headers, error_array=None, data_mask=None, step=5, nu new_shape = np.array([v_array[1]-v_array[0],v_array[3]-v_array[2]]) rectangle = [v_array[2], v_array[0], new_shape[1], new_shape[0], 0., 'b'] if display: + plt.rcParams.update({'font.size': 20}) fig, ax = plt.subplots(figsize=(10,10)) data = data_array[0] instr = headers[0]['instrume'] @@ -276,13 +277,13 @@ def crop_array(data_array, headers, error_array=None, data_mask=None, step=5, nu color='grey', alpha=0.3) ax.plot([0,data.shape[1]-1], [data.shape[1]/2, data.shape[1]/2], '--', lw=1, color='grey', alpha=0.3) - ax.annotate(instr+":"+rootname, color='white', fontsize=5, + ax.annotate(instr+":"+rootname, color='white', fontsize=10, xy=(0.02, 0.95), xycoords='axes fraction') - ax.annotate(filt, color='white', fontsize=10, xy=(0.02, 0.02), + ax.annotate(filt, color='white', fontsize=14, xy=(0.02, 0.02), xycoords='axes fraction') - ax.annotate(exptime, color='white', fontsize=5, xy=(0.80, 0.02), + ax.annotate(str(exptime)+" s", color='white', fontsize=10, xy=(0.80, 0.02), xycoords='axes fraction') - ax.set(title="Location of cropped image.", + ax.set(#title="Location of cropped image.", xlabel='pixel offset', ylabel='pixel offset') @@ -430,7 +431,7 @@ def get_error(data_array, headers, error_array=None, data_mask=None, sub_shape=N if error_array is None: error_array = np.zeros(data_array.shape) if not data_mask is None: - data, error, mask = data_array, error_array, data_mask#_ = crop_array(data_array, headers, error_array, data_mask, step=5, null_val=0., inside=False) + data, error, mask = data_array, error_array, data_mask else: data, error, _ = crop_array(data_array, headers, error_array, step=5, null_val=0., inside=False) mask = np.ones(data[0].shape, dtype=bool) @@ -487,6 +488,7 @@ def get_error(data_array, headers, error_array=None, data_mask=None, sub_shape=N print(data_array[i]) if display: + plt.rcParams.update({'font.size': 20}) convert_flux = headers[0]['photflam'] date_time = np.array([headers[i]['date-obs']+';'+headers[i]['time-obs'] for i in range(len(headers))]) @@ -500,7 +502,7 @@ def get_error(data_array, headers, error_array=None, data_mask=None, sub_shape=N for f in np.unique(filt): mask = [fil==f for fil in filt] ax.scatter(date_time[mask], background[mask]*convert_flux, - color=dict_filt[f],label="Filter : {0:s}".format(f)) + color=dict_filt[f],label="{0:s}".format(f)) ax.errorbar(date_time, background*convert_flux, yerr=error_array[:,0,0]*convert_flux, fmt='+k', markersize=0, ecolor=c_filt) @@ -511,7 +513,7 @@ def get_error(data_array, headers, error_array=None, data_mask=None, sub_shape=N ax.xaxis.set_major_formatter(formatter) ax.set_xlabel("Observation date and time") ax.set_ylabel(r"Flux [$ergs \cdot cm^{-2} \cdot s^{-1} \cdot \AA^{-1}$]") - ax.set_title("Background flux and error computed for each image") + #ax.set_title("Background flux and error computed for each image") plt.legend() fig2, ax2 = plt.subplots(figsize=(10,10)) @@ -524,13 +526,13 @@ def get_error(data_array, headers, error_array=None, data_mask=None, sub_shape=N im = ax2.imshow(data0, vmin=data0.min(), vmax=data0.max(), origin='lower', cmap='gray') x, y, width, height, angle, color = rectangle[0] ax2.add_patch(Rectangle((x, y),width,height,edgecolor=color,fill=False)) - ax2.annotate(instr+":"+rootname, color='white', fontsize=5, + ax2.annotate(instr+":"+rootname, color='white', fontsize=10, xy=(0.02, 0.95), xycoords='axes fraction') - ax2.annotate(filt, color='white', fontsize=10, xy=(0.02, 0.02), + ax2.annotate(filt, color='white', fontsize=14, xy=(0.02, 0.02), xycoords='axes fraction') - ax2.annotate(exptime, color='white', fontsize=5, xy=(0.80, 0.02), + ax2.annotate(str(exptime)+" s", color='white', fontsize=10, xy=(0.80, 0.02), xycoords='axes fraction') - ax2.set(title="Location of background computation.", + ax2.set(#title="Location of background computation.", xlabel='pixel offset', ylabel='pixel offset') @@ -911,7 +913,7 @@ def smooth_data(data_array, error_array, data_mask, headers, FWHM=1., weights = np.ones(error_array[i].shape) if smoothing.lower()[:6] in ['weight']: weights = 1./error_array[i]**2 - weights /= weights.sum() + #weights /= weights.max() kernel = gaussian2d(x, y, stdev) kernel /= kernel.sum() smoothed[i] = convolve2d(image*weights/image.sum(),kernel,'same')*image.sum()