9 #ifndef IMPSAXS_PROFILE_H
10 #define IMPSAXS_PROFILE_H
12 #include <IMP/saxs/saxs_config.h>
22 IMPSAXS_BEGIN_NAMESPACE
24 class RadialDistributionFunction;
36 Profile(
const std::string& file_name,
bool fit_file =
false,
double max_q = 0.0);
39 Profile(
double qmin = 0.0,
double qmax = 0.5,
double delta = 0.005);
46 bool reciprocal =
false) {
48 calculate_profile_real(particles, ff_type);
50 calculate_profile_reciprocal(particles, ff_type);
60 void calculate_profile_partial(
const Particles& particles,
65 void calculate_profile_partial(
const Particles& particles1,
71 void calculate_profile_reciprocal_partial(
const Particles& particles,
81 calculate_profile_real(particles1, particles2, ff_type);
85 double calculate_I0(
const Particles& particles,
89 void calculate_profile_constant_form_factor(
const Particles& particles,
90 double form_factor = 1.0);
96 void calculate_profile_symmetric(
const Particles& particles,
102 double max_distance)
const;
108 void resample(
const Profile* exp_profile,
Profile* resampled_profile)
const;
111 void downsample(
Profile* downsampled_profile,
112 unsigned int point_number)
const;
122 double mean_intensity()
const;
131 void read_SAXS_file(
const std::string& file_name,
bool fit_file =
false,
double max_q = 0.0);
137 void write_SAXS_file(
const std::string& file_name,
double max_q = 0.0)
const;
140 void read_partial_profiles(
const std::string& file_name);
143 void write_partial_profiles(
const std::string& file_name)
const;
156 double get_intensity(
unsigned int i)
const {
return intensity_(i); }
157 double get_q(
unsigned int i)
const {
return q_(i); }
158 double get_error(
unsigned int i)
const {
return error_(i); }
159 double get_weight(
unsigned int i)
const {
164 const IMP_Eigen::VectorXf& get_qs()
const {
return q_; }
165 const IMP_Eigen::VectorXf& get_intensities()
const {
return intensity_; }
166 const IMP_Eigen::VectorXf& get_errors()
const {
return error_; }
168 double get_average_radius()
const {
return average_radius_; }
171 unsigned int size()
const {
return q_.size(); }
174 bool is_uniform_sampling()
const;
176 bool is_partial_profile()
const {
return (partial_profiles_.size()>0); }
178 std::string get_name()
const {
return name_; }
180 unsigned int get_id()
const {
return id_; }
183 void set_qs(
const IMP_Eigen::VectorXf& q) { q_ = q; }
184 void set_intensities(
const IMP_Eigen::VectorXf& i) { intensity_ = i; }
185 void set_errors(
const IMP_Eigen::VectorXf& e) { error_ = e; }
187 void set_intensity(
unsigned int i,
double iq) { intensity_(i) = iq; }
192 void set_average_radius(
double r) { average_radius_ = r; }
194 void set_average_volume(
double v) { average_volume_ = v; }
196 void set_name(std::string name) { name_ = name; }
198 void set_id(
unsigned int id) { id_ = id; }
200 void set_beam_profile(std::string beam_profile_file) {
201 beam_profile_ =
new Profile(beam_profile_file);
208 void add_noise(
double percentage = 0.03);
211 void sum_partial_profiles(
double c1,
double c2,
bool check_cashed =
true);
214 void add(
const Profile* other_profile,
double weight = 1.0);
217 void add_partial_profiles(
const Profile* other_profile,
double weight = 1.0);
220 void add(
const Vector<Profile*>& profiles,
221 const Vector<double>& weights = Vector<double>());
224 void add_partial_profiles(
const Vector<Profile*>& profiles,
225 const Vector<double>& weights = Vector<double>());
228 void background_adjust(
double start_q);
231 void scale(
double c);
234 void offset(
double c);
237 void copy_errors(
const Profile* exp_profile);
240 static const double modulation_function_parameter_;
245 void init(
unsigned int size = 0,
unsigned int partial_profiles_size = 0);
248 void calculate_profile_reciprocal(
const Particles& particles,
251 void calculate_profile_reciprocal(
const Particles& particles1,
255 void calculate_profile_real(
const Particles& particles,
258 void calculate_profile_real(
const Particles& particles1,
264 void squared_distributions_2_partial_profiles(
267 double radius_of_gyration_fixed_q(
double end_q)
const;
270 IMP_Eigen::VectorXf q_;
271 IMP_Eigen::VectorXf intensity_;
272 IMP_Eigen::VectorXf error_;
274 double min_q_, max_q_;
279 std::vector<IMP_Eigen::VectorXf> partial_profiles_;
283 double average_radius_;
284 double average_volume_;
287 std::map<double, unsigned int> q_mapping_;
297 IMPSAXS_END_NAMESPACE
unsigned int size() const
return number of entries in SAXS profile
void calculate_profile(const Particles &particles, FormFactorType ff_type=HEAVY_ATOMS, bool reciprocal=false)
computes theoretical profile
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Common base class for heavy weight IMP objects.
Various general useful macros for IMP.
#define IMP_UNUSED(variable)
double get_delta_q() const
return sampling resolution
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
double get_min_q() const
return minimal sampling point
A shared base class to help in debugging and things.
FormFactorType
type of the form factors for profile calculations
void set_ff_table(FormFactorTable *ff_table)
required for reciprocal space calculation
void calculate_profile(const Particles &particles1, const Particles &particles2, FormFactorType ff_type=HEAVY_ATOMS)
computes distribution functions
double get_max_q() const
return maximal sampling point
double radius_of_gyration(const Particles &particles)
compute radius_of_gyration