5#ifndef GEMMI_XDS_ASCII_HPP_
6#define GEMMI_XDS_ASCII_HPP_
18 return std::fabs(wavelength - 1.5418) < 0.0019 ||
19 std::fabs(wavelength - 0.7107) < 0.0002 ||
20 std::fabs(wavelength - 2.29) < 0.01;
77 int frame()
const {
return (
int) std::floor(zd + 1); }
88 isets.emplace_back(
id);
95 read_stream(*
input.create_stream(),
input.path());
104 double z =
refl.zd - starting_frame + 1;
105 return starting_angle + oscillation_range * z;
110 double length = rotation_axis.length();
112 fail(
"unknown rotation axis");
113 return rotation_axis / length;
118 double length = incident_beam_dir.length();
120 fail(
"unknown incident beam direction");
121 return incident_beam_dir / length;
125 for (
int i = 0;
i < 3; ++
i)
126 if (cell_axes[
i][0] == 0 && cell_axes[
i][1] == 0 && cell_axes[
i][2] == 0)
135 Vec3 z = get_rotation_axis();
137 Vec3 x = get_s0_direction();
138 Vec3 y = z.cross(x).normalized();
140 x = y.cross(z).normalized();
141 return Mat33::from_columns(x, y, z);
145 if (!has_cell_axes())
146 fail(
"unknown unit cell axes");
147 Vec3 a = cell_axes.row_copy(0);
148 Vec3 b = cell_axes.row_copy(1);
149 Vec3 c = cell_axes.row_copy(2);
150 Vec3 ar = b.cross(c).normalized();
151 Vec3 br = c.cross(a);
152 Vec3 cr = ar.cross(br).normalized();
154 return Mat33::from_columns(ar, br, cr);
void vector_remove_if(std::vector< T > &v, F &&condition)
GEMMI_DLL XdsAscii read_xds_ascii(const std::string &path)
read possibly gzipped file
std::array< int, 3 > Miller
A synonym for convenient passing of hkl.
bool likely_in_house_source(double wavelength)
void fail(const std::string &msg)
XdsAscii read_xds_ascii_file(const std::string &path)
Vec3 get_rotation_axis() const
Vec3 get_s0_direction() const
bool has_cell_axes() const
void read_stream(AnyStream &reader, const std::string &source)
Mat33 calculate_conversion_from_cambridge() const
Return transition matrix from "Cambridge" frame to XDS frame.
Mat33 get_orientation() const
double rot_angle(const Refl &refl) const
XdsAscii(const XdsAsciiMetadata &m)
void gather_iset_statistics()
void eliminate_overloads(double overload)
void apply_polarization_correction(double p, Vec3 normal)
Iset & find_or_add_iset(int id)
void eliminate_batchmin(int batchmin)
void read_input(T &&input)
Utilities. Mostly for working with strings and vectors.