9 #ifndef IMPSAXS_PROFILE_H
10 #define IMPSAXS_PROFILE_H
12 #include <IMP/saxs/saxs_config.h>
22 IMPSAXS_BEGIN_NAMESPACE
24 class RadialDistributionFunction;
46 bool reciprocal =
false) {
48 calculate_profile_real(particles, ff_type);
50 calculate_profile_reciprocal(particles, ff_type);
81 calculate_profile_real(particles1, particles2, ff_type);
89 void calculate_profile_constant_form_factor(
101 Float max_distance)
const;
107 void resample(
const Profile* exp_profile,
Profile* resampled_profile,
108 bool partial_profiles =
false)
const;
111 void downsample(
Profile* downsampled_profile,
112 unsigned int point_number)
const;
128 void read_SAXS_file(
const String& file_name,
bool fit_file =
false);
134 void write_SAXS_file(
const String& file_name,
Float max_q = 0.0)
const;
137 void read_partial_profiles(
const String& file_name);
140 void write_partial_profiles(
const String& file_name)
const;
153 Float get_intensity(
unsigned int i)
const {
return intensity_[i]; }
154 Float get_q(
unsigned int i)
const {
return q_[i]; }
155 Float get_error(
unsigned int i)
const {
return error_[i]; }
156 Float get_weight(
unsigned int i)
const {
160 Float get_average_radius()
const {
return average_radius_; }
163 unsigned int size()
const {
return q_.size(); }
166 bool is_uniform_sampling()
const;
168 std::string get_name()
const {
return name_; }
170 unsigned int get_id()
const {
return id_; }
174 void set_intensity(
unsigned int i,
Float iq) { intensity_[i] = iq; }
179 void set_average_radius(
Float r) { average_radius_ = r; }
181 void set_average_volume(
Float v) { average_volume_ = v; }
183 void set_name(std::string name) { name_ = name; }
185 void set_id(
unsigned int id) { id_ = id; }
187 void set_beam_profile(std::string beam_profile_file) {
188 beam_profile_ =
new Profile(beam_profile_file);
194 intensity_.push_back(intensity);
195 error_.push_back(error);
202 void add_noise(
Float percentage = 0.03);
205 void sum_partial_profiles(
Float c1,
Float c2,
bool check_cashed =
true);
208 void add(
const Profile* other_profile,
Float weight = 1.0);
211 void add_partial_profiles(
const Profile* other_profile,
Float weight = 1.0);
214 void add(
const std::vector<Profile*>& profiles,
215 const std::vector<Float>& weights = std::vector<Float>());
218 void add_partial_profiles(
const std::vector<Profile*>& profiles,
219 const std::vector<Float>& weights =
220 std::vector<Float>());
223 void background_adjust(
double start_q);
229 void offset(
Float c);
232 void copy_errors(
const Profile* exp_profile);
235 static const Float modulation_function_parameter_;
259 void squared_distributions_2_partial_profiles(
260 const std::vector<RadialDistributionFunction>& r_dist);
262 double radius_of_gyration_fixed_q(
double end_q)
const;
265 std::vector<double> q_;
266 std::vector<double> intensity_;
267 std::vector<double> error_;
269 Float min_q_, max_q_;
274 std::vector<std::vector<double> > partial_profiles_;
278 Float average_radius_;
279 Float average_volume_;
282 std::map<float, unsigned int> q_mapping_;
292 IMPSAXS_END_NAMESPACE
unsigned int size() const
return number of entries in SAXS profile
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
void calculate_profile(const kernel::Particles &particles1, const kernel::Particles &particles2, FormFactorType ff_type=HEAVY_ATOMS)
Float get_delta_q() const
return sampling resolution
Float get_min_q() const
return minimal sampling point
Various general useful macros for IMP.
#define IMP_UNUSED(variable)
void calculate_profile(const kernel::Particles &particles, FormFactorType ff_type=HEAVY_ATOMS, bool reciprocal=false)
computes theoretical profile
Float get_max_q() const
return maximal sampling point
computes distribution functions
Common base class for heavy weight IMP objects.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
A shared base class to help in debugging and things.
Float radius_of_gyration(const kernel::Particles &particles)
compute radius_of_gyration
IMP::base::Vector< Float > Floats
Standard way to pass a bunch of Float values.
double Float
Basic floating-point value (could be float, double...)
FormFactorType
type of the form factors for profile calculations
void set_ff_table(FormFactorTable *ff_table)
required for reciprocal space calculation
std::string String
Basic string value.
void add_entry(Float q, Float intensity, Float error=1.0)
add intensity entry to profile