9 #ifndef IMPSAXS_PROFILE_H
10 #define IMPSAXS_PROFILE_H
12 #include <IMP/saxs/saxs_config.h>
22 IMPSAXS_BEGIN_NAMESPACE
24 class RadialDistributionFunction;
48 bool reciprocal=
false,
50 double variance_tau=0.1) {
52 "variance not implemented in reciprocal calculation");
53 if(!reciprocal) calculate_profile_real(particles, ff_type,
54 variance, variance_tau);
55 else calculate_profile_reciprocal(particles, ff_type);
86 double variance_tau=0.1) {
87 calculate_profile_real(particles1, particles2, ff_type,
88 variance, variance_tau);
97 Float form_factor = 1.0);
102 void calculate_profile_symmetric(
const kernel::Particles& particles,
unsigned int n,
107 Float max_distance)
const;
114 void resample(
const Profile* exp_profile,
116 bool partial_profiles=
false)
const;
120 void downsample(
Profile* downsampled_profile,
unsigned int point_number)
const;
137 void read_SAXS_file(
const String& file_name,
bool fit_file =
false);
143 void write_SAXS_file(
const String& file_name,
Float max_q=0.0)
const;
146 void read_partial_profiles(
const String& file_name);
149 void write_partial_profiles(
const String& file_name)
const;
163 Float get_intensity(
unsigned int i)
const {
return intensity_[i]; }
164 Float get_q(
unsigned int i)
const {
return q_[i]; }
165 Float get_error(
unsigned int i)
const {
return error_[i]; }
167 Float get_variance(
unsigned int i,
unsigned int j)
const
168 {
unsigned a=std::min(i,j);
unsigned b=std::max(i,j);
169 return variances_[a][b-a]; }
170 Float get_average_radius()
const {
return average_radius_; }
173 unsigned int size()
const {
return q_.size(); }
176 bool is_uniform_sampling()
const;
178 std::string get_name()
const {
return name_; }
180 unsigned int get_id()
const {
return id_; }
184 void set_intensity(
unsigned int i,
Float iq) { intensity_[i] = iq; }
189 void set_average_radius(
Float r) { average_radius_ = r; }
191 void set_average_volume(
Float v) { average_volume_ = v; }
193 void set_name(std::string name) { name_ = name; }
195 void set_id(
unsigned int id) { id_ = id; }
200 intensity_.push_back(intensity);
201 error_.push_back(error);
208 void add_noise(
Float percentage = 0.03);
211 void sum_partial_profiles(
Float c1,
Float c2);
214 void add(
const Profile* other_profile,
Float weight = 1.0);
217 void add_partial_profiles(
const Profile* other_profile,
Float weight = 1.0);
220 void add(
const std::vector<Profile*>& profiles,
221 const std::vector<Float>& weights = std::vector<Float>());
224 void add_partial_profiles(
const std::vector<Profile*>& profiles,
225 const std::vector<Float>& weights = std::vector<Float>());
228 void background_adjust(
double start_q);
234 void offset(
Float c);
237 void copy_errors(
const Profile* exp_profile);
240 static const Float modulation_function_parameter_;
243 void init(
bool variance =
false);
254 bool variance =
false,
255 double variance_tau = 0.1);
260 bool variance =
false,
261 double variance_tau = 0.1);
267 double variance_tau=0.1);
269 void squared_distributions_2_partial_profiles(
270 const std::vector<RadialDistributionFunction>& r_dist);
272 double radius_of_gyration_fixed_q(
double end_q)
const;
275 std::vector<double> q_;
276 std::vector<double> intensity_;
277 std::vector<double> error_;
279 Float min_q_, max_q_;
283 std::vector<std::vector<double> > variances_;
286 std::vector<std::vector<double> > partial_profiles_;
289 Float average_radius_;
290 Float average_volume_;
293 std::map<float, unsigned int> q_mapping_;
301 IMPSAXS_END_NAMESPACE
unsigned int size() const
return number of entries in SAXS profile
void calculate_profile(const kernel::Particles &particles, FormFactorType ff_type=HEAVY_ATOMS, bool reciprocal=false, bool variance=false, double variance_tau=0.1)
computes theoretical profile
#define IMP_UNUSED(variable)
Float get_delta_q() const
return sampling resolution
Float get_min_q() const
return minimal sampling point
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
void calculate_profile(const kernel::Particles &particles1, const kernel::Particles &particles2, FormFactorType ff_type=HEAVY_ATOMS, bool variance=false, double variance_tau=0.1)
Float get_max_q() const
return maximal sampling point
Various general useful macros for IMP.
computes distribution functions
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Common base class for heavy weight IMP objects.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
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
A shared base class to help in debugging and things.
std::string String
Basic string value.
void add_entry(Float q, Float intensity, Float error=1.0)
add intensity entry to profile