9 #ifndef IMPSAXS_PROFILE_H
10 #define IMPSAXS_PROFILE_H
12 #include <IMP/saxs/saxs_config.h>
22 IMPSAXS_BEGIN_NAMESPACE
24 class RadialDistributionFunction;
42 Profile(
const std::string& file_name,
bool fit_file =
false,
double max_q = 0.0,
int units = 1);
45 Profile(
double qmin = 0.0,
double qmax = 0.5,
double delta = 0.005);
52 bool reciprocal =
false) {
54 calculate_profile_real(particles, ff_type);
56 calculate_profile_reciprocal(particles, ff_type);
66 void calculate_profile_partial(
const Particles& particles,
71 void calculate_profile_partial(
const Particles& particles1,
77 void calculate_profile_reciprocal_partial(
const Particles& particles,
87 calculate_profile_real(particles1, particles2, ff_type);
91 double calculate_I0(
const Particles& particles,
95 void calculate_profile_constant_form_factor(
const Particles& particles,
96 double form_factor = 1.0);
102 void calculate_profile_symmetric(
const Particles& particles,
108 double max_distance)
const;
114 void resample(
const Profile* exp_profile,
Profile* resampled_profile)
const;
117 void downsample(
Profile* downsampled_profile,
118 unsigned int point_number)
const;
128 double mean_intensity()
const;
138 void read_SAXS_file(
const std::string& file_name,
bool fit_file =
false,
double max_q = 0.0,
int units = 1);
144 void write_SAXS_file(
const std::string& file_name,
double max_q = 0.0)
const;
147 void read_partial_profiles(
const std::string& file_name);
150 void write_partial_profiles(
const std::string& file_name)
const;
163 double get_intensity(
unsigned int i)
const {
return intensity_(i); }
164 double get_q(
unsigned int i)
const {
return q_(i); }
165 double get_error(
unsigned int i)
const {
return error_(i); }
166 double get_weight(
unsigned int i)
const {
171 const Eigen::VectorXf& get_qs()
const {
return q_; }
172 const Eigen::VectorXf& get_intensities()
const {
return intensity_; }
173 const Eigen::VectorXf& get_errors()
const {
return error_; }
175 double get_average_radius()
const {
return average_radius_; }
178 unsigned int size()
const {
return q_.size(); }
181 bool is_uniform_sampling()
const;
183 bool is_partial_profile()
const {
return (partial_profiles_.size()>0); }
185 std::string get_name()
const {
return name_; }
187 unsigned int get_id()
const {
return id_; }
190 void set_qs(
const Eigen::VectorXf& q) { q_ = q; }
191 void set_intensities(
const Eigen::VectorXf& i) { intensity_ = i; }
192 void set_errors(
const Eigen::VectorXf& e) { error_ = e; }
194 void set_intensity(
unsigned int i,
double iq) { intensity_(i) = iq; }
199 void set_average_radius(
double r) { average_radius_ = r; }
201 void set_average_volume(
double v) { average_volume_ = v; }
203 void set_name(std::string name) { name_ = name; }
205 void set_id(
unsigned int id) { id_ = id; }
207 void set_beam_profile(std::string beam_profile_file) {
208 beam_profile_ =
new Profile(beam_profile_file);
215 void add_noise(
double percentage = 0.03);
218 void sum_partial_profiles(
double c1,
double c2,
bool check_cashed =
true);
221 void add(
const Profile* other_profile,
double weight = 1.0);
224 void add_partial_profiles(
const Profile* other_profile,
double weight = 1.0);
227 void add(
const Vector<Profile*>& profiles,
228 const Vector<double>& weights = Vector<double>());
231 void add_partial_profiles(
const Vector<Profile*>& profiles,
232 const Vector<double>& weights = Vector<double>());
235 void background_adjust(
double start_q);
238 void scale(
double c);
241 void offset(
double c);
244 void copy_errors(
const Profile* exp_profile);
247 static const double modulation_function_parameter_;
252 void init(
unsigned int size = 0,
unsigned int partial_profiles_size = 0);
255 void calculate_profile_reciprocal(
const Particles& particles,
258 void calculate_profile_reciprocal(
const Particles& particles1,
262 void calculate_profile_real(
const Particles& particles,
265 void calculate_profile_real(
const Particles& particles1,
271 void squared_distributions_2_partial_profiles(
274 double radius_of_gyration_fixed_q(
double end_q)
const;
276 double find_max_q(
const std::string& file_name)
const;
280 Eigen::VectorXf intensity_;
281 Eigen::VectorXf error_;
283 double min_q_, max_q_;
288 std::vector<Eigen::VectorXf> partial_profiles_;
292 double average_radius_;
293 double average_volume_;
296 std::map<double, unsigned int> q_mapping_;
306 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