// Licence: Lesser GNU Public License 2.1 (LGPL) #pragma rtGlobals=3 // Use modern global access method. Menu "Macros" submenu "Import Tool "+version submenu "PES" "Load Kratos Ultra *.dset file... b4", KratosDSET_load_data() end end end // ###################### Kratos Ultra DSET ######################## strconstant DsetBG = "BG" structure KratosDsetobject variable id string objectname string addtovaluewave string header string AID_technique // 1 string AID_scan_type // 2 variable AID_spectrum_start // 3 - eV variable AID_spectrum_step_size // 4 - eV string FID_abscissa_label // 5 string FID_abscissa_units // 6 variable AID_dwell_time // 7 - seconds string FID_ordinate_label // 8 string FID_ordinate_units // 9 variable FID_no_abscissa_values // 10 wave FID_abscissa_values // 11 wave FID_ordinate_values // 12 wave FID_ordinate_valuesBG // 12' // ?? one is missing variable AID_coord_n_points_x // 25 variable AID_coord_n_lines_y // 26 variable FID_map_start_x // 27 variable FID_map_start_y // 28 variable FID_map_end_x // 29 variable FID_map_end_y // 30 variable AID_etch_time // 31 variable FID_map_counts // 32 variable FID_min_intensity // 33 variable FID_max_intensit // 34 variable FID_delta_x // 35 variable FID_delta_y // 36 string AID_region_name // 37 string FID_change_of_state // 38 variable AID_gun_current // 39 variable AID_gun_voltage // 40 variable FID_analyser_mode // 41 variable AID_pass_energy_nominal // 42 variable AID_retard_ratio_nominal // 43 variable FID_abscissa_end // 44 variable FID_min_scans // 45 variable FID_max_scans // 46 variable FID_required_counts // 47 variable FID_abscissa_point // 48 variable FID_signal_to_noise // 49 variable FID_magnification // 50 variable AID_map_energy // 51 variable FID_background_1 // 52 variable FID_background_2 // 53 variable FID_fat_code // 54 variable FID_frr_cod // 55 variable FID_mag_code // 56 variable FID_excitation_code // 57 variable AID_filament // 58 variable AID_current_counter // 59 variable FID_etch_table // 60 variable AID_counter_limit // 61 variable FID_map_geometry // 62 variable FID_pre_etch_delay // 63 variable FID_post_etch_delay // 64 variable FID_registration // 65 variable FID_multi_point // 66 variable FID_control // 67 variable FID_detector_mask // 68 variable FID_multi_point_coords // 69 variable FID_analyser_x // 70 variable FID_analyser_y // 71 variable FID_history // 72 variable FID_loop_start // 73 variable FID_loop_end // 74 variable FID_regions // 75 variable FID_components // 76 variable FID_map_energy_array // 77 variable FID_related_objects // 78 variable FID_annotation // 79 variable FID_abscissa_shift // 80 variable FID_carousel_increments // 81 variable FID_eg_magnification // 82 variable FID_eg_zoom // 83 variable FID_full_deflection // 84 variable FID_position_table // 85 variable FID_position_type // 86 variable FID_eucentric_correction // 87 variable FID_background_objects // 88 variable FID_colour_array // 89 variable FID_map_x0 // 90 variable FID_map_x1 // 91 variable FID_map_y0 // 92 variable FID_map_y1 // 93 variable FID_coord_type // 94 variable FID_map_scan_angle // 95 variable FID_process_ids // 96 string FID_position_name // 97 variable FID_position_values // 98 variable AID_n_sweeps_completed // 99 variable FID_mp_x // 100 variable FID_mp_y // 101 variable FID_mp_label // 102 variable FID_mp_units // 103 variable FID_mp_coordtype // 104 variable FID_mp_dset // 105 variable FID_mp_pid // 106 variable FID_mp_table // 107 variable FID_multipoint // 108 variable FID_peak_name // 109 variable FID_aborted // 110 variable FID_lower_limit // 111 variable FID_upper_limit // 112 variable AID_instrument // 113 variable FID_transmission_func // 114 variable FID_ion_gun_type // 115 variable FID_etch_position_id // 116 variable FID_pallet_type // 117 variable FID_channels_amu // 118 variable FID_default_sample_bias // 119 variable FID_sample_bias // 120 variable FID_polarity // 121 variable FID_n_frames // 122 variable FID_quadrupole_dc // 123 variable FID_ion_gun_name // 124 variable FID_ion_type // 125 variable FID_ion_gun_magnification // 126 variable FID_ion_gun_zoom // 127 variable FID_ion_gun_current // 128 variable FID_ion_gun_voltage // 129 variable FID_ion_spot_name // 130 variable FID_ion_spot_size // 131 variable FID_neutraliser // 132 variable FID_raster_name // 133 variable FID_raster_shift_x // 134 variable FID_raster_shift_y // 135 variable FID_raster_size_x // 136 variable FID_raster_size_y // 137 variable FID_raster_pixels_x // 138 variable FID_raster_pixels_y // 139 variable FID_raster_border_x // 140 variable FID_raster_border_y // 141 variable FID_temperature_table // 142 variable FID_temperature // 143 variable FID_profile_cycles // 144 variable FID_charge_neut_current // 145 variable FID_charge_neut_voltage // 146 variable FID_quad_resolution // 147 variable FID_ion_gun_number // 148 variable AID_operator_name // 149 //variable // 150 string AID_date_and_time // 151 //wave FID_spectrum_background // 221 //wave FID_dataset_filter // 238 variable FID_sensitivity_factor // 241 variable FID_atomic_mass // 242 variable FID_atomic_number // 250 variable FID_peak_position // 251 variable FID_abundance // 252 variable FID_element_filter // 253 variable FID_region_list // 268 variable FID_region_area // 269 variable FID_region_peak_position // 270 variable FID_region_peak_half_width // 271 variable FID_region_peak_height // 272 variable PID_background_type // 2041 variable PID_bin_to_average // 2045 variable AID_coord_start_x // 3001 variable AID_coord_start_y // 3002 variable AID_coord_step_size_x // 3003 variable AID_coord_step_size_y // 3004 variable AID_coord_fsd_x // 3005 variable AID_coord_fsd_y // 3006 variable AID_acquired_rtd_raw_index // 3009 variable AID_state_change_table // 3010 variable AID_scan_n_steps // 3011 variable AID_n_sweeps_required // 3012 wave AID_en_detector_list // 3013 variable AID_acq_spec_active // 3014 variable AID_acquisition_specs // 3015 variable AID_save_data_flag // 3016 variable AID_sum_sweeps_flag // 3017 variable AID_acquisition_specification // 3024 variable AID_goto_start // 3025 string AID_position_name // 3026 variable AID_final_etch_time // 3027 <-- 3030 (switched ??) variable AID_acquired_raw_data // 3028 //wave?? variable AID_acquired_raw_index // 3029 variable AID_object_display_type // 3030 <-- 3027 (switched ??) // 3031??? // 3032??? // 3033??? // 3034??? variable AID_no_etch_cycles // 3035 variable AID_etch_ramp_enabled // 3036 variable AID_esca3X00_xray_gun_anode // 3037 variable AID_esca3400_xray_gun_emission // 3038 variable AID_esca3400_xray_gun_accelHT // 3039 variable AID_on_off_switch // 3040 variable AID_esca3X00_ion_gun_emission // 3041 variable AID_esca3X00_ion_gun_accelHT // 3042 variable AID_esca_manipulator_samples_e // 3043 variable AID_esca_manipulator_position // 3044 string AID_analyser_type // 3045 string AID_analyser_scan_mode // 3046 string AID_pass_energy // 3047 variable AID_retard_ratio // 3048 string AID_hsa_lens_mode // 3049 variable AID_mhsa_lens_mode // 3050 variable AID_manual_xray_gun_current // 3051 variable AID_manual_xray_gun_voltage // 3052 variable AID_manual_xray_gun_anode // 3053 variable AID_manual_xray_gun_source // 3054 string AID_esca_manipulator_sample_n // 3055 variable AID_raster_zoom // 3056 variable AID_raster_x_offset // 3057 variable AID_raster_y_offset // 3058 variable AID_raster_ke_factor // 3059 variable AID_raster_x_scale // 3060 variable AID_raster_y_scale // 3061 variable AID_raster_rotation // 3062 variable AID_raster_shear // 3063 variable AID_xray_gun_settle_time // 3064 variable AID_neutraliser_charge_balance // 3065 variable AID_neutraliser_filament_curr // 3066 //ent variable AID_neutraliser_filament_bias // 3067 variable AID_neutraliser_trim_coil // 3068 variable AID_neutraliser_deguass // 3069 variable AID_hardware_control // 3071 variable AID_analyser_energy // 3072 variable AID_tune_mode_active // 3073 variable AID_tune_reference_energy // 3074 variable AID_tune_max_to_min_intensity // 3075 variable AID_tune_half_width // 3076 variable AID_tune_peak_area // 3077 variable AID_tune_intensity // 3078 variable AID_actual_etch_time // 3079 variable AID_xray_energy_reference // 3080 variable AID_object_tag // 3081 variable AID_acquire_sequence // 3082 variable AID_map_lines_completed // 3083 variable AID_stream_data // 3084 variable AID_stream_number // 3085 variable AID_map_prov_next_line // 3086 string AID_stage_position_name // 3087 variable AID_stage_x_position // 3088 variable AID_stage_y_position // 3089 variable AID_stage_z_position // 3090 variable AID_stage_x_rotation // 3091 variable AID_stage_y_rotation // 3092 variable AID_stage_z_rotation // 3093 variable AID_motor_name // 3094 variable AID_motor_position // 3095 variable AID_image_point_size // 3096 variable AID_map_type // 3097 variable AID_stage_position_table // 3098 variable AID_stage_button_state // 3099 variable AID_motor_position_name // 3100 string AID_selected_area_aperture // 3101 string AID_active_analyser_type // 3102 variable AID_iman_current_image_flag // 3103 variable AID_key_detector_number // 3104 variable AID_anaylser_energy // 3105 variable AID_stigmatic_image_shift_x // 3106 variable AID_stigmatic_image_shift_y // 3107 variable AID_institute_name // 3108 string AID_sample_batch_name // 3109 string AID_destination_report // 3110 variable AID_report_processing // 3111 variable AID_work_function // 3112 string AID_species_label // 3113 string AID_transition_or_charge_state // 3114 variable AID_manual_xray_gun_power // 3115 variable AID_print_report // 3116 string AID_xps_energy_scale // 3117 variable AID_nicpu_igun_beam_current // 3131 variable AID_iris_position_index // 3167 variable samplebias // 3179 variable AID_nicpu_xgun_active_filament // 3190 variable AID_nicpu_xgun_active_anode_mat // 3191 variable AID_nicpu_xgun_emission_current // 3192 variable AID_nicpu_xgun_ht_voltage // 3193 variable AID_nicpu_xgun_focus_voltage // 3194 variable AID_nicpu_igun_float_voltage // 3205 variable AID_nicpu_igun_degas_1st_time // 3226 //AID_nicpu_igun_degas_first_time variable AID_nicpu_igun_degas_2nd_time // 3227 //AID_nicpu_igun_degas_second_time variable AID_nicpu_igun_degas_1st_curr // 3228 variable AID_nicpu_igun_degas_2nd_curr // 3229 variable AID_nicpu_igun_raster_size // 3230 variable AID_platen_level // 3244 variable AID_platen_type // 3245 variable AID_nicpu_xgun_supp_bias_v // 3247 variable AID_nicpu_igun_standby_time // 3278 variable AID_state_change_delay // 3279 variable AID_flow_chart_index // 3280 variable AID_object_in_flow_chart_index // 3281 string AID_aperture_size_name // 3282 string AID_iris_position_name // 3283 string AID_vision_software_version // 3290 wave CID_transmission_ke // 5615 wave CID_transmission_value // 5616 variable AID_nicpu_igun_pah_gun_mode // 538971360 variable AID_nicpu_igun_pah_action_on_c // 538971367 variable AID_nicpu_igun_pah_wien_voltage // 542117083 variable AID_nicpu_igun_pah_beam_bend_v // 542117084 variable AID_nicpu_igun_pah_beam_mc // 542117091 //AID_nicpu_igun_pah_beam_monitor_current endstructure function KratosDSET_resetDsetobject(Dsetobject, header) struct KratosDsetobject &Dsetobject string header Dsetobject.id = NAN Dsetobject.objectname = "" Dsetobject.addtovaluewave = "" Dsetobject.header= header Dsetobject.AID_technique = "" // 1 Dsetobject.AID_scan_type = "" // 2 Dsetobject.AID_spectrum_start = NAN Dsetobject.AID_spectrum_step_size = NAN Dsetobject.FID_abscissa_label = "" Dsetobject.FID_abscissa_units = "" Dsetobject.AID_dwell_time = NAN Dsetobject.FID_ordinate_label = "" Dsetobject.FID_ordinate_units = "" waveclear Dsetobject.FID_abscissa_values // 11 waveclear Dsetobject.FID_ordinate_values waveclear Dsetobject.FID_ordinate_valuesBG Dsetobject.AID_coord_n_points_x = NAN // 25 Dsetobject.AID_coord_n_lines_y = NAN // 26 Dsetobject.AID_etch_time = NAN // 31 Dsetobject.AID_region_name = "" Dsetobject.FID_change_of_state = "" Dsetobject.AID_pass_energy_nominal = NAN Dsetobject.AID_map_energy = NaN // 51 Dsetobject.AID_current_counter = NAN // 59 Dsetobject.AID_counter_limit = NAN // 61 Dsetobject.FID_pre_etch_delay = NAN // 63 Dsetobject.FID_post_etch_delay = NAN // 64 Dsetobject.AID_n_sweeps_completed = NAN // 99 Dsetobject.AID_date_and_time = "" // 151 Dsetobject.FID_sensitivity_factor = NAN // 241 Dsetobject.FID_atomic_mass = NAN // 242 Dsetobject.FID_atomic_number = NAN // 250 Dsetobject.FID_peak_position = NAN // 251 Dsetobject.FID_abundance = NAN // 252 Dsetobject.FID_element_filter = NAN // 253 Dsetobject.FID_region_list = NAN // 268 Dsetobject.FID_region_area = NAN // 269 Dsetobject.FID_region_peak_position = NAN // 270 Dsetobject.FID_region_peak_half_width = NAN // 271 Dsetobject.FID_region_peak_height = NAN // 272 Dsetobject.PID_background_type = NAN // 2041 Dsetobject.AID_coord_start_x = NAN // 3001 Dsetobject.AID_coord_start_y = NAN // 3002 Dsetobject.AID_goto_start = NAN // 3025 Dsetobject.AID_map_lines_completed = NAN // 3083 Dsetobject.AID_image_point_size = NAN // 3096 Dsetobject.AID_stage_position_table = NAN // 3098 Dsetobject.AID_iman_current_image_flag = NAN // 3103 Dsetobject.AID_anaylser_energy = NAN // 3105 Dsetobject.AID_stigmatic_image_shift_x = NAN // 3106 Dsetobject.AID_stigmatic_image_shift_y = NAN // 3107 Dsetobject.AID_state_change_table = NAN // 3010 Dsetobject.AID_nicpu_igun_degas_1st_time = NAN //3226 Dsetobject.AID_nicpu_igun_degas_2nd_time = NAN //3227 Dsetobject.AID_nicpu_igun_degas_1st_curr = NAN //3228 Dsetobject.AID_nicpu_igun_degas_2nd_curr = NAN //3229 Dsetobject.AID_nicpu_igun_raster_size = NAN //3230 Dsetobject.AID_nicpu_igun_beam_current = NAN //3131 Dsetobject.AID_no_etch_cycles = NAN // 3035 Dsetobject.AID_etch_ramp_enabled = NAN // 3036 Dsetobject.AID_coord_fsd_x = NAN Dsetobject.AID_coord_fsd_y = NAN Dsetobject.AID_acquired_rtd_raw_index = NAN Dsetobject.AID_scan_n_steps = NAN Dsetobject.AID_save_data_flag = NAN Dsetobject.AID_sum_sweeps_flag = NAN Dsetobject.AID_analyser_type = "" Dsetobject.AID_analyser_scan_mode = "" Dsetobject.AID_pass_energy = "" Dsetobject.AID_hsa_lens_mode = "" Dsetobject.AID_tune_mode_active = NAN Dsetobject.AID_tune_reference_energy = NAN Dsetobject.AID_tune_max_to_min_intensity = NAN Dsetobject.AID_tune_half_width = NAN Dsetobject.AID_tune_peak_area = NAN Dsetobject.AID_tune_intensity = NAN Dsetobject.AID_xray_energy_reference = NAN Dsetobject.AID_stage_x_position = NAN Dsetobject.AID_stage_y_position = NAN Dsetobject.AID_stage_z_position = NAN Dsetobject.AID_active_analyser_type = "" Dsetobject.AID_work_function = NAN Dsetobject.AID_species_label = "" Dsetobject.AID_transition_or_charge_state = "" Dsetobject.samplebias = NAN Dsetobject.AID_nicpu_xgun_active_filament = NAN Dsetobject.AID_nicpu_xgun_active_anode_mat = NAN Dsetobject.AID_nicpu_xgun_emission_current = NAN Dsetobject.AID_nicpu_xgun_ht_voltage = NAN Dsetobject.AID_nicpu_xgun_focus_voltage = NAN Dsetobject.AID_platen_level = NAN Dsetobject.AID_platen_type = NAN Dsetobject.AID_nicpu_xgun_supp_bias_v = NAN Dsetobject.AID_state_change_delay = NAN Dsetobject.AID_iris_position_name = "" Dsetobject.AID_vision_software_version = "" Dsetobject.PID_bin_to_average = NAN // 2045 Dsetobject.AID_coord_step_size_x = NAN Dsetobject.AID_coord_step_size_y = NAN Dsetobject.AID_n_sweeps_required = NAN Dsetobject.AID_acq_spec_active = NAN Dsetobject.AID_acquisition_specs = NAN Dsetobject.AID_acquisition_specification = NAN Dsetobject.AID_on_off_switch = NAN Dsetobject.AID_raster_zoom = NAN Dsetobject.AID_neutraliser_charge_balance = NAN Dsetobject.AID_neutraliser_filament_curr = NAN Dsetobject.AID_neutraliser_filament_bias = NAN Dsetobject.AID_hardware_control = NAN Dsetobject.AID_object_tag = NAN Dsetobject.AID_acquire_sequence = NAN Dsetobject.AID_stage_x_rotation = NAN Dsetobject.AID_stage_y_rotation = NAN Dsetobject.AID_stage_z_rotation = NAN Dsetobject.AID_map_type = NAN Dsetobject.AID_nicpu_igun_float_voltage = NAN Dsetobject.AID_iris_position_index = NAN Dsetobject.AID_mhsa_lens_mode = NAN // 3050 Dsetobject.AID_nicpu_igun_pah_beam_mc = NAN waveclear Dsetobject.AID_en_detector_list // 3013 waveclear Dsetobject.CID_transmission_value waveclear Dsetobject.CID_transmission_ke end function KratosDSET_addnotestr(waves, name, str) wave waves string name string str if(strlen(str)>0) note waves, name+str endif end function KratosDSET_addnotenum(waves, name, num) wave waves string name variable num if(numtype(num)==0) note waves, name+num2str(num) endif end function KratosDSET_setnote(Dsetobject, data) struct KratosDsetobject &Dsetobject wave data KratosDSET_addnotestr(data, Dsetobject.header, "") KratosDSET_addnotestr(data, "Technique: ", Dsetobject.AID_technique) KratosDSET_addnotestr(data, "Scan type: ", Dsetobject.AID_scan_type) KratosDSET_addnotestr(data, "Abscissa label: ", cleanupname(Dsetobject.FID_abscissa_label,0)) KratosDSET_addnotestr(data, "Abscissa units: ", cleanupname(Dsetobject.FID_abscissa_units,0)) KratosDSET_addnotestr(data, "Ordiante label: ", cleanupname(Dsetobject.FID_ordinate_label,0)) KratosDSET_addnotestr(data, "Ordinate units: ", cleanupname(Dsetobject.FID_ordinate_units,0)) KratosDSET_addnotestr(data, "Aquisition name: ", cleanupname(Dsetobject.AID_region_name,0)) KratosDSET_addnotestr(data, "State change type: ", cleanupname(Dsetobject.FID_change_of_state,0)) KratosDSET_addnotestr(data, "Date aquired: ", cleanupname(Dsetobject.AID_date_and_time,0)) KratosDSET_addnotestr(data, "Chemical symbol or formula: ", cleanupname(Dsetobject.AID_species_label,0)) KratosDSET_addnotestr(data, "Transition or charge state: ", cleanupname(Dsetobject.AID_transition_or_charge_state,0)) KratosDSET_addnotestr(data, "Descriptor for aperture size used in acquisition: ", cleanupname(Dsetobject.AID_aperture_size_name,0)) KratosDSET_addnotestr(data, "Descriptor for iris position used in acquisition: ", cleanupname(Dsetobject.AID_iris_position_name,0)) KratosDSET_addnotestr(data, "Vision software version: ", cleanupname(Dsetobject.AID_vision_software_version,0)) KratosDSET_addnotenum(data, "Pass energy: ", Dsetobject.AID_pass_energy_nominal) KratosDSET_addnotenum(data, "# Sweeps completed: ", Dsetobject.AID_n_sweeps_completed) KratosDSET_addnotenum(data, "Start x coord: ", Dsetobject.AID_coord_start_x) KratosDSET_addnotenum(data, "Start y coord: ", Dsetobject.AID_coord_start_y) KratosDSET_addnotenum(data, "Full Scale Deflection X: ", Dsetobject.AID_coord_fsd_x) KratosDSET_addnotenum(data, "Full Scale Deflection Y: ", Dsetobject.AID_coord_fsd_y) KratosDSET_addnotenum(data, "Real time display data index: ", Dsetobject.AID_acquired_rtd_raw_index) KratosDSET_addnotenum(data, "Energy/line scan # steps: ", Dsetobject.AID_scan_n_steps) KratosDSET_addnotenum(data, "Xray Reference Energy: ", Dsetobject.AID_xray_energy_reference) KratosDSET_addnotenum(data, "Stage X Position: ", Dsetobject.AID_stage_x_position) KratosDSET_addnotenum(data, "Stage Y Position: ", Dsetobject.AID_stage_y_position) KratosDSET_addnotenum(data, "Stage Z Position: ", Dsetobject.AID_stage_z_position) KratosDSET_addnotenum(data, "Work function: ", Dsetobject.AID_work_function) KratosDSET_addnotenum(data, "Sample bias: ", Dsetobject.samplebias) KratosDSET_addnotenum(data, "NICPU X-ray Gun Filament: ", Dsetobject.AID_nicpu_xgun_active_filament) KratosDSET_addnotenum(data, "NICPU X-ray Gun Active Anode Material: ", Dsetobject.AID_nicpu_xgun_active_anode_mat) KratosDSET_addnotenum(data, "NICPU X-ray Gun Emission Current: ", Dsetobject.AID_nicpu_xgun_emission_current) KratosDSET_addnotenum(data, "NICPU X-ray Gun Anode HT Voltage: ", Dsetobject.AID_nicpu_xgun_ht_voltage) KratosDSET_addnotenum(data, "NICPU X-ray Gun Focus Voltage: ", Dsetobject.AID_nicpu_xgun_focus_voltage) KratosDSET_addnotenum(data, "Origin of platen: ", Dsetobject.AID_platen_level) KratosDSET_addnotenum(data, "Type of platen: ", Dsetobject.AID_platen_type) KratosDSET_addnotenum(data, "NICPU X-ray Gun Suppressor or Bias Voltage: ", Dsetobject.AID_nicpu_xgun_supp_bias_v) KratosDSET_addnotenum(data, "Dwell time: ", Dsetobject.AID_dwell_time) KratosDSET_addnotenum(data, "State change delay time: ", Dsetobject.AID_state_change_delay) KratosDSET_addnotenum(data, "Spectrum scan start: ", Dsetobject.AID_spectrum_start) KratosDSET_addnotenum(data, "Spectrum scan step size: ", Dsetobject.AID_spectrum_step_size) KratosDSET_addnotenum(data, "Save data flag: ", Dsetobject.AID_save_data_flag) KratosDSET_addnotenum(data, "Sum sweeps flag: ", Dsetobject.AID_sum_sweeps_flag) KratosDSET_addnotenum(data, "Tuning mode flag: ", Dsetobject.AID_tune_mode_active) KratosDSET_addnotenum(data, "Reference energy: ", Dsetobject.AID_tune_reference_energy) KratosDSET_addnotenum(data, "Max - Min Counts at Reference Energy: ", Dsetobject.AID_tune_max_to_min_intensity) KratosDSET_addnotenum(data, "Half-Width at Reference Energy: ", Dsetobject.AID_tune_half_width) KratosDSET_addnotenum(data, "Peak Area at Reference Energy: ", Dsetobject.AID_tune_peak_area) KratosDSET_addnotenum(data, "Intensity at Reference Energy: ", Dsetobject.AID_tune_intensity) KratosDSET_addnotestr(data, "Type Of Analyser: ", Dsetobject.AID_analyser_type) KratosDSET_addnotestr(data, "Analyser Scan Mode: ", Dsetobject.AID_analyser_scan_mode) KratosDSET_addnotestr(data, "Analyser Pass Energy: ", Dsetobject.AID_pass_energy) KratosDSET_addnotestr(data, "HSA Lens Mode: ", Dsetobject.AID_hsa_lens_mode) KratosDSET_addnotestr(data, "Active Analyser Type: ", Dsetobject.AID_active_analyser_type) end function /S KratosDSET_readstr(file) variable file variable num variable i=0 string tmps="" Fbinread /U/B=2/F=3 file, num // how many chars for(i=0;i beginning of new object // 2 x NULL --> end of object Fstatus file variable oldposition = V_filePOS variable t1=0, t2=0, t3=0, t4=0, tmp=0 // we can read 4 4byte uint if(V_logEOF>V_filePOS+4*4) Fbinread /U/B=2/F=3 file, t1 Fbinread /U/B=2/F=3 file, t2 Fbinread /U/B=2/F=3 file, t3 Fstatus file // for t4 we have to check if this doesn't conicides with the beginning of an offsetsblock (maybe obselute with the check below) FindValue /V=(V_filePOS) offsetblocks if(V_value == -1) Fbinread /U/B=2/F=3 file, t4 // check if this could fall on the beginning of the last offsetblock (because it would be also NULL instead of giving the adress of the next offsetblock else t4=-1 endif // in case we are at the end of the block // this is especially for this cases of split objects // ends of blocks are marked with a } (2x 3byte NULL) if((blockend-oldposition)<0)//1*4) // end of block --> no markers t1=-1 t2=-1 t3=-1 t4=-1 elseif((blockend-oldposition)==0)//1*4) // only a } possible t2=-1 t3=-1 t4=-1 elseif((blockend-oldposition)==1*4)//2*4) // a { is not possible t1=-1 t2=-1 t3=-1 t4=-1 elseif((blockend-oldposition)==2*4)//3*4) // a }} is possible t4=-1 //elseif((blokend-oldposition)>3*4 && (blokend-oldposition)<12) //a }{ } could be possible // t4=-1 endif if(t1==0 && t2==0 && t3 == 0 && t4 ==0) //}{ Debugprintf2("}{ at pos: "+num2str(oldposition-4),1) markercount+=0 return 1 else if(t1==0 && t2==0 && t3 == 0) // }} Fsetpos file, oldposition+12 Debugprintf2("}} at pos: "+num2str(oldposition-4),1) markercount+=-2 return 1 else if(t1==0 && t2==0) // { Fsetpos file, oldposition+8 Debugprintf2("{ at pos: "+num2str(oldposition-4),1) markercount+=1 return 1 else if(t1==0) // } Fsetpos file, oldposition+4 Debugprintf2("} at pos: "+num2str(oldposition-4),1) markercount+=-1 return 1 else Fsetpos file, oldposition return -1 endif endif endif endif endif // we can read 3 4byte uint // ok only a }} is possible and reasonable if(V_logEOF==V_filePOS+3*4) Fbinread /U/B=2/F=3 file, t1 Fbinread /U/B=2/F=3 file, t2 Fbinread /U/B=2/F=3 file, t3 if(t1==0 && t2==0 && t3 == 0) // }} Debugprintf2("}} at pos: "+num2str(oldposition-4),1) markercount+=-2 Fsetpos file, oldposition+8 // because the last 4byte has to be read before the routine notice it is at the end and saves (before the save routine starts 4bytes have to be read) return 1 else Fsetpos file, oldposition Debugprintf2("Bad file end!!",0) return -1 endif endif // we can read only 2 4byte uint // then samothing is wrong in the file, a { is not reasonable at the end of the fle // we can read 1 4byte uint // ok only a } is possible if(V_logEOF==V_filePOS+1*4) Fbinread /U/B=2/F=3 file, t1 if(t1==0) // } Debugprintf2("} at pos: "+num2str(oldposition-4),1) markercount+=-1 Fsetpos file, oldposition // because the last 4byte has to be read before the routine notice it is at the end and saves (before the save routine starts 4bytes have to be read) return 1 else Fsetpos file, oldposition Debugprintf2("Bad file end!!",0) return -1 endif endif return -1 end function KratosDSET_getoffsets2nd(file) variable file wave offsets wave /T offsetsname variable numoffsets variable maxoffsets //variable offset variable tmp=0, tmp2=0, len=0 Fstatus file variable lastoffset = V_filePOS struct KratosDsetobject Dsetobject2nd KratosDSET_resetDsetobject(Dsetobject2nd, "") //Fsetpos file, offset Fbinread /U/B=2/F=3 file, tmp // new offset (1024) Fbinread /U/B=2/F=3 file, tmp2 // new offset (1024) //print tmp if(tmp!=tmp2 || tmp!=1024) print "Never had this till now, please send me the file!" return -1 endif //Fstatus file //printf "Position: %08.0f ; ", V_filePOS Fbinread /U/B=2/F=3 file, len // length of the object //print len //print lastoffset Fbinread /U/B=2/F=3 file, tmp // meaning?? (NULL ID = 0??) do //Fstatus file //printf "Position: %08.0f ; ", V_filePOS Fbinread /U/B=2/F=3 file, tmp //print tmp KratosDSET_checkID(file, Dsetobject2nd, tmp, -1) Fstatus file while(V_filePOS<(len+lastoffset) && V_logEOF>V_filePOS) end function KratosDSET_getoffsets(file, offsets, offsetsname, numoffsets, maxoffsets) variable file wave offsets wave /T offsetsname variable numoffsets variable maxoffsets variable tmp=0, tmp2=0, i=0, j=0 string tmps="" i=numoffsets do Fbinread /U/B=2/F=2 file, tmp ; offsets[i][2]=tmp Fbinread /U/B=2/F=2 file, tmp ; offsets[i][3]=tmp // These are my guesses and may not be correct switch(offsets[i][2]) case 0: offsetsname[i][1]="AES" break case 1: offsetsname[i][1]="ISS" break case 2: offsetsname[i][1]="SIMS" break case 3: offsetsname[i][1]="XPS" break case 16: offsetsname[i][1]="Position" break case 32: // runspec- sam - Znso.dset offsetsname[i][1]="???" break case 144: // Sputter2kV500V.dset offsetsname[i][1]="???" break case 160: offsetsname[i][1]="Delay" break default: Fstatus file Debugprintf2("Unknown offsetparam #1 "+num2str(offsets[i][2])+" at position "+num2str(V_filePOS)+". Please check with kal and add to script! (ID: "+num2str(i+1)+")",0) offsetsname[i][1]="UNKNOWN" break endswitch // These are my guesses and may not be correct switch(offsets[i][3]) case 4: offsetsname[i][2]="List" break case 6: offsetsname[i][2]="Detector" break case 8: offsetsname[i][2]="Irregular" break case 69: offsetsname[i][2]="Spectrum" break case 73: offsetsname[i][2]="Split object" break case 37: // LAN_9_24_10.dset (service??) offsetsname[i][2]="???" break case 133: offsetsname[i][2]="??? AUTO Z?" break case 4096: //Sputter2kV500V.dset (sam runspec) offsetsname[i][2]="???" break case 4098:// runspec- sam - Znso.dset offsetsname[i][2]="???" break case 4160:// runspec- sam - Znso.dset offsetsname[i][2]="???" break default: Fstatus file Debugprintf2("Unknown offsetparam #2 "+num2str(offsets[i][3])+" at position "+num2str(V_filePOS)+". Please check with kal and add to script! (ID: "+num2str(i+1)+")",0) offsetsname[i][2]="UNKNOWN" break endswitch // now the name of the Block tmps="" for(j=0;j<4*4;J+=1) tmps+=mybinreadBE(file,1) //name of object endfor offsetsname[i][0]=tmps Fbinread /U/B=2/F=3 file, tmp // absolute offset of block Fbinread /U/B=2/F=3 file, tmp2 // and again if(tmp!=tmp2) Fstatus file sprintf tmps, "Position %08.0f ( %08.0f and %08.0f )", V_filePOS, tmp, tmp2 ; Debugprintf2("Object is split into two parts: "+tmps+" ; ID: "+num2str(i+1),0) endif offsets[i][0]=tmp // absolute offset of block offsets[i][1]=tmp2 // and again Debugprintf2(num2str(i+1)+"; "+num2str(offsets[i][0])+" ; "+num2str(offsets[i][1])+" ; "+num2str(offsets[i][2])+" ; "+num2str(offsets[i][3])+" ; "+offsetsname[i],1) fstatus file i+=1 while (V_logEOF>V_filePOS && i< numoffsets +64 && i < maxoffsets) end function KratosDSET_readblock(file, Dsetobject, offsetsnumber, offsets, offsetsname, offsetblocks) variable file struct KratosDsetobject &Dsetobject variable offsetsnumber wave offsets wave /T offsetsname wave offsetblocks variable tmp = 0, markercount=0, offset = 0 string tmps="" Fstatus file variable offlast=V_filePOS //variable offlast=offsets[offsetsnumber][0] if(offsets[offsetsnumber][0]!=offlast) if(offsets[offsetsnumber][1]!=offlast) print "Error!!!!" endif endif Debugprintf2("New block begins (ID: "+num2str(offsetsnumber+1)+")",1) // read a 4byte uint which contains an object-ID or the ID of the next object block Fbinread /U/B=2/F=3 file, offset // first line contains the length of the block Fbinread /U/B=2/F=3 file, Dsetobject.id // second line of the block contains the block-id Dsetobject.objectname = offsetsname[offsetsnumber] if(Dsetobject.id !=offsetsnumber+1) Debugprintf2("ID and block number are different: "+num2str(offsetsnumber+1)+" <> "+num2str(Dsetobject.id),0) return -1 endif mybinreadBE(file,2*4) // now two empty words (2*4 bytes) should follow ( somehow a "{" ) Debugprintf2("Number of next spectrum: "+num2str(Dsetobject.id),1) Debugprintf2("Size of next Block in bytes: "+num2str(offset),1) sprintf tmps, "%08.0f", offlast ; Debugprintf2("Current Pos in bytes: "+tmps,1) do // read object ID Fbinread /U/B=2/F=3 file, tmp if(KratosDSET_checkID(file, Dsetobject, tmp, offsetsnumber)!=0) // check if this is a marker in cas tmp==0, otherwise unknown ID or a wrong datatype in one ID Fstatus file if(tmp==0) // maybe a marker if(KratosDSET_getmarkers(file, markercount, offsetblocks, offset+offlast)!=1) // found no markers sprintf tmps, "%08.0f", (V_filePOS-4) ; Debugprintf2("Unknown value at position1: "+tmps+" ; Value: "+num2str(tmp)+" ; ID: "+num2str(offsetsnumber+1),0) break else // found markers endif else sprintf tmps, "%08.0f", (V_filePOS-4) ; Debugprintf2("Unknown value at position2: "+tmps+" ; Value: "+num2str(tmp)+" ; ID: "+num2str(offsetsnumber+1),0) endif endif Fstatus file if(offlast+offset<=V_filePOS && markercount <0) // reached end of block break endif while (V_logEOF>V_filePOS) end function KratosDSET_killtmpwave(name) string name name=GetDataFolder(1)+name if(WaveExists($name)) killwaves $name endif end function KratosDSET_load_data() // 4byte unsingned int in big-endian (because of sunos --> Sparc) string dfSave="" variable file string impname="Kratos Vision DSET" string filestr="*.dset" string header = loaderstart(impname, filestr,file,dfSave) if (strlen(header)==0) return -1 endif string tmps = "" struct KratosDsetobject Dsetobject KratosDSET_resetDsetobject(Dsetobject, header) variable tmp=0, tmp2=0, i=0, maxoffsets=0, majorrelease=0 variable offsetoffsetsblocks = 0, offsetcomments = 0, offsetdynamic0 = 0, offsetdynamic0len = 0, offsetdynamic1 = 0 // reading header // first line - magic number (56833) Fbinread /U/B=2/F=3 file, tmp if(tmp!=56833) Debugprintf2("Wrong magic number!!",0) loaderend(impname,1,file, dfSave) return -1 endif // second line - major release number (2) Fbinread /U/B=2/F=3 file, majorrelease // 2 // possible the major release number of the Vision software if(majorrelease!=2) Debugprintf2("Major release 2 expected; got "+num2str(tmp),0) endif // third line - random number; comments ??? Fbinread /U/B=2/F=3 file, offsetcomments // 4th line - offset to a dynamic offset for offsetblocks Fbinread /U/B=2/F=3 file, offsetdynamic0 // 5th line - offset to a first offsets block (1036) Fbinread /U/B=2/F=3 file, offsetoffsetsblocks // 6th line - number of actual number of blocks (max offsets; how many offsets (objectblocks) do we actually have) Fbinread /U/B=2/F=3 file, maxoffsets //comments to folllow??? // using offset2 which seems to give evidence of comment chars for(i=0;i "+num2str(tmp2),0) elseif(offsetdynamic1!=1024) sprintf tmps, "%08.0f", offsetdynamic1 ; Debugprintf2("Check what this offset could be (+12?): "+tmps,0) // does it somehow correspond to the fileend --> where to add the next offsetsblock???? (12 --> length of 1024 block --> 3*4 bytes --> double offset and length) endif Fbinread /U/B=2/F=3 file, offsetdynamic0len // offset0+offset4 ==offset = 1024+12==1036 if(offsetdynamic0+offsetdynamic0len!=offsetoffsetsblocks) Debugprintf2("Something is different here: "+num2str(offsetdynamic0)+" + "+num2str(offsetdynamic0len)+" <> "+num2str(offsetoffsetsblocks),0) endif //print "Take a deeper look!!! This is not yet finsished!!!!" //Fsetpos file, offsetdynamic1 //KratosDSET_getoffsets2nd(file) // jump to first offsetblock and get read offsetblocks Fsetpos file, offsetoffsetsblocks // from 5th 4byte block at the beginning of file variable numoffsets = 0 variable nextoffsetblock = 1 tmps="offsets" Make /O/R/N=(maxoffsets,4) $tmps /wave=offsets tmps="offsetsname" Make /O/T/N=(maxoffsets,3) $tmps /wave=offsetsname tmps="offsetblocks" Make /O/R/N=(ceil(maxoffsets/64)) $tmps /wave=offsetblocks offsetblocks=0 i=0 do Fbinread /U/B=2/F=3 file, nextoffsetblock // absolute offset to next offsetblock sprintf tmps, "%08.0f", nextoffsetblock ; Debugprintf2("Next offset block at: "+tmps,1) //Debugprintf2("Next offset block at: "+num2str(nextoffsetblock),1) if(nextoffsetblock!=0) offsetblocks[i]=nextoffsetblock else offsetblocks[i]=-1 // just in case endif i+=1 KratosDSET_getoffsets(file, offsets, offsetsname, numoffsets, maxoffsets) numoffsets += 64 if(nextoffsetblock!=0) Fsetpos file, nextoffsetblock else //???? break endif while(nextoffsetblock != 0) // goto first object block and start reading the objects variable offsetsnumber = 0 Fsetpos file, offsets[offsetsnumber][0] do // read object block if(KratosDSET_readblock(file, Dsetobject, offsetsnumber, offsets, offsetsname, offsetblocks)==-1) break endif // in some cases an object is split into two parts if(offsets[offsetsnumber][0]!=offsets[offsetsnumber][1]) Debugprintf2("Reading second part of Object with ID: "+num2str(offsetsnumber+1),0) Fsetpos file, offsets[offsetsnumber][1] if(KratosDSET_readblock(file, Dsetobject, offsetsnumber, offsets, offsetsname, offsetblocks)==-1) break endif endif // save the data KratosDSET_saveobject(Dsetobject) // save and KratosDSET_resetDsetobject(Dsetobject, header) // clean structure for next block // goto next object block position if(offsetsnumberV_filePOS) // remove temporary waves KratosDSET_killtmpwave("FID_ordinate_values") // tmp ordinate values wave KratosDSET_killtmpwave("FID_ordinate_values"+DsetBG) // tmp ordinate values wave KratosDSET_killtmpwave("AID_en_detector_list") // tmp enabled detector wave KratosDSET_killtmpwave("CID_transmission_ke") // tmp transmission energies wave KratosDSET_killtmpwave("CID_transmission_value") // tmp transmission values wave KratosDSET_killtmpwave("offsets") // object block offsets KratosDSET_killtmpwave("offsetsname") // object block names KratosDSET_killtmpwave("offsetblocks") // offsets to object block offsets // more cleanup loaderend(impname,1,file, dfSave) end // ###################### Kratos Ultra DSET END ######################