Example #1
0
    def save_cube_process(self, output_filename, cube_peaks, peak_count):
        """
        Saves the cube_fit as an hdf5 file
        """           

            
        output_file = h5py.File(output_filename,'w')
        output_file.attrs['peak_count'] = peak_count
        peaks = output_file.create_group("peaks")
        for peak in np.arange(peak_count):
            peak_holder = peaks.create_group("Peak%d"%peak)
            
            peak_function = fit_analysis.get_peak_function(cube_peaks, peak)
            peak_name = fit_analysis.get_peak_name(cube_peaks, peak)
            peak_penalty_function = fit_analysis.get_peak_penalty_function(cube_peaks,peak)
            peak_ranges = fit_analysis.get_peak_ranges(cube_peaks, peak)
            peak_variables = fit_analysis.get_peak_variables(cube_peaks, peak)
            peak_holder.attrs['function'] = peak_function
            peak_holder.attrs['name'] = peak_name
            peak_holder.attrs['penalty_function'] = peak_penalty_function
            peak_holder.attrs['ranges'] = peak_ranges
            peak_holder.attrs['variables'] = peak_variables
            
            for variable in peak_variables:
                image_cube = self.get_image_cube(variable)
                image = fit_analysis.get_image_from_cube(image_cube, peak)
                peak_holder.create_dataset(variable, data=image)
                
        output_file.create_dataset("integrated_residuals",
                                    data=self.cube_residuals)
        output_file.close()
Example #2
0
 def plot_peaks(self, image_cube, peak_count):
     for peak_number in np.arange(peak_count):
         axes = plt.subplot(1, peak_count, peak_number)
         axes.set_title("Peak Number %s"%str(peak_number+1))
         image = fit_analysis.get_image_from_cube(image_cube, peak_number)
         plt.imshow(image, interpolation='nearest')
         plt.colorbar() 
Example #3
0
    def save_cube_process(self, output_filename, cube_peaks, peak_count):
        """
        Saves the cube_fit as an hdf5 file
        """

        output_file = h5py.File(output_filename, 'w')
        output_file.attrs['peak_count'] = peak_count
        peaks = output_file.create_group("peaks")
        for peak in np.arange(peak_count):
            peak_holder = peaks.create_group("Peak%d" % peak)

            peak_function = fit_analysis.get_peak_function(cube_peaks, peak)
            peak_name = fit_analysis.get_peak_name(cube_peaks, peak)
            peak_penalty_function = fit_analysis.get_peak_penalty_function(
                cube_peaks, peak)
            peak_ranges = fit_analysis.get_peak_ranges(cube_peaks, peak)
            peak_variables = fit_analysis.get_peak_variables(cube_peaks, peak)
            peak_holder.attrs['function'] = peak_function
            peak_holder.attrs['name'] = peak_name
            peak_holder.attrs['penalty_function'] = peak_penalty_function
            peak_holder.attrs['ranges'] = peak_ranges
            peak_holder.attrs['variables'] = peak_variables

            for variable in peak_variables:
                image_cube = self.get_image_cube(variable)
                image = fit_analysis.get_image_from_cube(image_cube, peak)
                peak_holder.create_dataset(variable, data=image)

        output_file.create_dataset("integrated_residuals",
                                   data=self.cube_residuals)
        output_file.close()
Example #4
0
 def plot_peaks(self, image_cube, peak_count):
     for peak_number in np.arange(peak_count):
         axes = plt.subplot(1, peak_count, peak_number)
         axes.set_title("Peak Number %s" % str(peak_number + 1))
         image = fit_analysis.get_image_from_cube(image_cube, peak_number)
         plt.imshow(image, interpolation='nearest')
         plt.colorbar()