You can subscribe to this list here.
| 2005 |
Jan
(70) |
Feb
(200) |
Mar
(222) |
Apr
(198) |
May
(122) |
Jun
(74) |
Jul
(171) |
Aug
(235) |
Sep
(118) |
Oct
(165) |
Nov
(276) |
Dec
(167) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(102) |
Feb
(124) |
Mar
(90) |
Apr
(155) |
May
(162) |
Jun
(285) |
Jul
(142) |
Aug
(136) |
Sep
(251) |
Oct
(188) |
Nov
(156) |
Dec
(144) |
| 2007 |
Jan
(231) |
Feb
(151) |
Mar
(142) |
Apr
(69) |
May
(66) |
Jun
(88) |
Jul
(61) |
Aug
(82) |
Sep
(125) |
Oct
(167) |
Nov
(115) |
Dec
(70) |
| 2008 |
Jan
(112) |
Feb
(109) |
Mar
(163) |
Apr
(239) |
May
(185) |
Jun
(147) |
Jul
(123) |
Aug
(142) |
Sep
(134) |
Oct
(106) |
Nov
(151) |
Dec
(114) |
| 2009 |
Jan
(143) |
Feb
(188) |
Mar
(121) |
Apr
(188) |
May
(193) |
Jun
(113) |
Jul
(161) |
Aug
(172) |
Sep
(95) |
Oct
(157) |
Nov
(123) |
Dec
(112) |
| 2010 |
Jan
(61) |
Feb
(115) |
Mar
(163) |
Apr
(138) |
May
(152) |
Jun
(133) |
Jul
(228) |
Aug
(135) |
Sep
(230) |
Oct
(214) |
Nov
(178) |
Dec
(225) |
| 2011 |
Jan
(197) |
Feb
(284) |
Mar
(244) |
Apr
(190) |
May
(119) |
Jun
(195) |
Jul
(305) |
Aug
(204) |
Sep
(175) |
Oct
(196) |
Nov
(166) |
Dec
(170) |
| 2012 |
Jan
(203) |
Feb
(197) |
Mar
(255) |
Apr
(153) |
May
(111) |
Jun
(130) |
Jul
(82) |
Aug
(207) |
Sep
(103) |
Oct
(173) |
Nov
(150) |
Dec
(171) |
| 2013 |
Jan
(156) |
Feb
(242) |
Mar
(216) |
Apr
(264) |
May
(116) |
Jun
(218) |
Jul
(192) |
Aug
(255) |
Sep
(157) |
Oct
(209) |
Nov
(227) |
Dec
(222) |
| 2014 |
Jan
(207) |
Feb
(214) |
Mar
(223) |
Apr
(125) |
May
(183) |
Jun
(213) |
Jul
(219) |
Aug
(230) |
Sep
(195) |
Oct
(275) |
Nov
(179) |
Dec
(163) |
| 2015 |
Jan
(227) |
Feb
(148) |
Mar
(148) |
Apr
(178) |
May
(228) |
Jun
(195) |
Jul
(155) |
Aug
(168) |
Sep
(168) |
Oct
(151) |
Nov
(259) |
Dec
(137) |
| 2016 |
Jan
(127) |
Feb
(244) |
Mar
(219) |
Apr
(266) |
May
(120) |
Jun
(366) |
Jul
(211) |
Aug
(203) |
Sep
(222) |
Oct
(155) |
Nov
(97) |
Dec
|
|
From: <ph...@us...> - 2016-10-23 22:44:19
|
Revision: 25651
http://sourceforge.net/p/cctbx/code/25651
Author: phyy-nx
Date: 2016-10-23 22:44:16 +0000 (Sun, 23 Oct 2016)
Log Message:
-----------
XFEL UI
Move handling of sentinel status lights to events to hopefully make things more thread-safe.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_controls.py
Modified: trunk/xfel/ui/components/xfel_gui_controls.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_controls.py 2016-10-23 22:12:35 UTC (rev 25650)
+++ trunk/xfel/ui/components/xfel_gui_controls.py 2016-10-23 22:44:16 UTC (rev 25651)
@@ -716,6 +716,17 @@
self.SetSizer(self.sizer)
+tp_EVT_STATUS_CHANGE = wx.NewEventType()
+EVT_STATUS_CHANGE = wx.PyEventBinder(tp_EVT_STATUS_CHANGE, 1)
+
+class StatusChange(wx.PyCommandEvent):
+ ''' Send event when status light is updated '''
+ def __init__(self, etype, eid, status=None):
+ wx.PyCommandEvent.__init__(self, etype, eid)
+ self.status = status
+ def GetValue(self):
+ return self.status
+
class SentinelStatus(CtrlBase):
def __init__(self, parent,
label='',
@@ -738,8 +749,15 @@
self.SetSizer(self.sizer)
+ self.Bind(EVT_STATUS_CHANGE, self.onChangeStatus)
+
def change_status(self, status):
+ evt = StatusChange(tp_EVT_STATUS_CHANGE, -1, status)
+ wx.PostEvent(self, evt)
+ def onChangeStatus(self, evt):
+ status = evt.GetValue()
+
if status == 'on':
bmp = wx.Bitmap('{}/16x16/led_on.png'.format(icons))
elif status == 'off':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-23 22:12:37
|
Revision: 25650
http://sourceforge.net/p/cctbx/code/25650
Author: idyoung
Date: 2016-10-23 22:12:35 +0000 (Sun, 23 Oct 2016)
Log Message:
-----------
Set ymin=0 on run stats plots.
Modified Paths:
--------------
trunk/xfel/ui/components/run_stats_plotter.py
Modified: trunk/xfel/ui/components/run_stats_plotter.py
===================================================================
--- trunk/xfel/ui/components/run_stats_plotter.py 2016-10-23 21:29:50 UTC (rev 25649)
+++ trunk/xfel/ui/components/run_stats_plotter.py 2016-10-23 22:12:35 UTC (rev 25650)
@@ -144,18 +144,22 @@
a.tick_params(axis='x', which='both', bottom='off', top='off')
ax1.scatter(t.select(~low_sel), n_strong.select(~low_sel), edgecolors="none", color ='grey', s=spot_ratio)
ax1.scatter(t.select(low_sel), n_strong.select(low_sel), edgecolors="none", color='blue', s=spot_ratio)
+ ax1.set_ylim(ymin=0)
ax1.axis('tight')
ax1.set_ylabel("strong spots\nblue: indexed\ngray: did not index", fontsize=text_ratio)
ax2.plot(t, idx_rate*100)
ax2_twin = ax2.twinx()
ax2_twin.plot(t, drop_hit_rate*100, color='green')
+ ax2_twin.set_ylim(ymin=0)
ax2.axis('tight')
ax2.set_ylabel("blue:% indexed", fontsize=text_ratio)
ax2_twin.set_ylabel("green: % droplet", fontsize=text_ratio)
ax3.scatter(t, isigi_low, edgecolors="none", color='red', s=spot_ratio)
ax3.scatter(t, isigi_high, edgecolors="none", color='orange', s=spot_ratio)
+ ax3.set_ylim(ymin=0)
ax3_twin = ax3.twinx()
ax3_twin.plot(t, hq_rate*100, color='orange')
+ ax3_twin.set_ylim(ymin=0)
ax3.axis('tight')
ax3.set_ylabel("I/sig(I)\nred: low\nyellow: %3.1f Ang" % d_min, fontsize=text_ratio)
ax3_twin.set_ylabel("line:% HQ", fontsize=text_ratio)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nks...@us...> - 2016-10-23 21:29:52
|
Revision: 25649
http://sourceforge.net/p/cctbx/code/25649
Author: nksauter
Date: 2016-10-23 21:29:50 +0000 (Sun, 23 Oct 2016)
Log Message:
-----------
cxi.merge, 1) avoid divide-by-zero when correcting for the partiality, 2) avoid linalg error when solving the normal equations, and 3) permit the choice of lorentzian or gaussian function for the RLP profile.
Modified Paths:
--------------
trunk/xfel/command_line/cxi_merge.py
trunk/xfel/cxi/postrefinement_hybrid_rs.py
trunk/xfel/cxi/postrefinement_updated_rs.py
Modified: trunk/xfel/command_line/cxi_merge.py
===================================================================
--- trunk/xfel/command_line/cxi_merge.py 2016-10-23 20:38:11 UTC (rev 25648)
+++ trunk/xfel/command_line/cxi_merge.py 2016-10-23 21:29:50 UTC (rev 25649)
@@ -217,8 +217,9 @@
.help = Option of weighting the merged terms by partiality
{
partiality_threshold = 0.2
- .type = float
+ .type = float ( value_min = 0.01 )
.help = throw out observations below this value. Hard coded as 0.2 for rs2, allow value for hybrid
+ .help = must enforce minimum positive value because partiality appears in the denominator
}
target_weighting = *unit variance gentle extreme
.type = choice
@@ -1467,7 +1468,7 @@
try:
postx.run_plain()
observations_original_index,observations,matches = postx.result_for_cxi_merge(file_name)
- except (AssertionError,ValueError),e:
+ except (AssertionError,ValueError,RuntimeError),e:
return null_data(file_name=file_name, log_out=out.getvalue(), low_signal=True)
if self.params.postrefinement.show_trumpet_plot is True:
Modified: trunk/xfel/cxi/postrefinement_hybrid_rs.py
===================================================================
--- trunk/xfel/cxi/postrefinement_hybrid_rs.py 2016-10-23 20:38:11 UTC (rev 25648)
+++ trunk/xfel/cxi/postrefinement_hybrid_rs.py 2016-10-23 21:29:50 UTC (rev 25649)
@@ -156,6 +156,8 @@
fat_selection = (self.nave1_refinery.lorentz_callable(self.get_parameter_values()) >
self.params.postrefinement.rs_hybrid.partiality_threshold) # was 0.2 for rs2
fat_count = fat_selection.count(True)
+ scaler_s = scaler.select(fat_selection)
+ p_scaler_s = p_scaler.select(fat_selection)
#avoid empty database INSERT, if insufficient centrally-located Bragg spots:
# in samosa, handle this at a higher level, but handle it somehow.
@@ -168,8 +170,8 @@
observations = self.observations_pair1_selected.customized_copy(
indices = self.observations_pair1_selected.indices().select(fat_selection),
- data = (self.observations_pair1_selected.data()/scaler).select(fat_selection),
- sigmas = (self.observations_pair1_selected.sigmas()/(scaler * p_scaler)).select(fat_selection)
+ data = (self.observations_pair1_selected.data().select(fat_selection)/scaler_s),
+ sigmas = (self.observations_pair1_selected.sigmas().select(fat_selection)/(scaler_s * p_scaler_s))
)
matches = miller.match_multi_indices(
miller_indices_unique=self.miller_set.indices(),
@@ -222,12 +224,14 @@
Rh = self.get_Rh_array(values)
rs_sq = rs*rs
denomin = (2. * Rh * Rh + rs_sq)
- dPB_dRh = -PB * 4. * Rh / denomin
+ dPB_dRh = { "lorentzian": -PB * 4. * Rh / denomin,
+ "gaussian": -PB * 4. * math.log(2) * Rh / rs_sq }[self.profile_shape]
dPB_dthetax = dPB_dRh * dRh_dthetax
dPB_dthetay = dPB_dRh * dRh_dthetay
Px_terms = P_terms * dPB_dthetax /1000.; Py_terms = P_terms * dPB_dthetay /1000.
- dPB_drs = 4 * rs * Rh * Rh / (denomin * denomin)
+ dPB_drs = { "lorentzian": 4 * rs * Rh * Rh / (denomin * denomin),
+ "gaussian": 4 * math.log(2) * PB * Rh * Rh / (rs * rs_sq) }[self.profile_shape]
Prs_terms = P_terms * dPB_drs
return [G_terms,B_terms,Prs_terms,Px_terms,Py_terms]
@@ -268,6 +272,7 @@
def build_up(pfh, objective_only=False):
values = pfh.parameterization(pfh.x)
+ assert 0. < values.G
# XXX revisit these limits. Seems like an ad hoc approach to have to set these limits
# Moreover, these tests throw out ~30% of LM14 data, thus search for another approach
assert -150. < values.BFACTOR < 150. ,"limits on the exponent, please"
Modified: trunk/xfel/cxi/postrefinement_updated_rs.py
===================================================================
--- trunk/xfel/cxi/postrefinement_updated_rs.py 2016-10-23 20:38:11 UTC (rev 25648)
+++ trunk/xfel/cxi/postrefinement_updated_rs.py 2016-10-23 21:29:50 UTC (rev 25649)
@@ -158,6 +158,8 @@
fat_selection = (partiality_array > 0.2)
fat_count = fat_selection.count(True)
+ scaler_s = scaler.select(fat_selection)
+ p_scaler_s = p_scaler.select(fat_selection)
#avoid empty database INSERT, if insufficient centrally-located Bragg spots:
# in samosa, handle this at a higher level, but handle it somehow.
@@ -170,8 +172,8 @@
observations = self.observations_pair1_selected.customized_copy(
indices = self.observations_pair1_selected.indices().select(fat_selection),
- data = (self.observations_pair1_selected.data()/scaler).select(fat_selection),
- sigmas = (self.observations_pair1_selected.sigmas()/(scaler * p_scaler)).select(fat_selection)
+ data = (self.observations_pair1_selected.data().select(fat_selection)/scaler_s),
+ sigmas = (self.observations_pair1_selected.sigmas().select(fat_selection)/(scaler_s * p_scaler_s))
)
matches = miller.match_multi_indices(
miller_indices_unique=self.miller_set.indices(),
@@ -231,7 +233,8 @@
rs = values.RS
Rh = self.get_Rh_array(values)
rs_sq = rs*rs
- dPB_dRh = { "lorentzian": -PB * 4. * Rh / (2. * Rh * Rh + rs_sq),
+ denomin = (2. * Rh * Rh + rs_sq)
+ dPB_dRh = { "lorentzian": -PB * 4. * Rh / denomin,
"gaussian": -PB * 4. * math.log(2) * Rh / rs_sq }[self.profile_shape]
dPB_dthetax = dPB_dRh * dRh_dthetax
dPB_dthetay = dPB_dRh * dRh_dthetay
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nks...@us...> - 2016-10-23 20:38:14
|
Revision: 25648
http://sourceforge.net/p/cctbx/code/25648
Author: nksauter
Date: 2016-10-23 20:38:11 +0000 (Sun, 23 Oct 2016)
Log Message:
-----------
documentation for postrefinement, using Gaussian-shaped RLP profile.
Modified Paths:
--------------
trunk/cctbx/examples/merging/samosa/Figure_2.pdf
trunk/cctbx/examples/merging/samosa/postrefinement_rs_model.pdf
trunk/cctbx/examples/merging/samosa/postrefinement_rs_model.tex
Modified: trunk/cctbx/examples/merging/samosa/Figure_2.pdf
===================================================================
(Binary files differ)
Modified: trunk/cctbx/examples/merging/samosa/postrefinement_rs_model.pdf
===================================================================
(Binary files differ)
Modified: trunk/cctbx/examples/merging/samosa/postrefinement_rs_model.tex
===================================================================
--- trunk/cctbx/examples/merging/samosa/postrefinement_rs_model.tex 2016-10-23 19:41:56 UTC (rev 25647)
+++ trunk/cctbx/examples/merging/samosa/postrefinement_rs_model.tex 2016-10-23 20:38:11 UTC (rev 25648)
@@ -119,8 +119,10 @@
\label{fig:2}
\end{center}
\begin{center}
- {Fig. 2. Two partiality models: a simple hard-sphere model ($p_A$, blue), and a soft-sphere Lorentzian
- function ($p_B$, red).}
+ {Fig. 2. Three partiality models:
+ a simple hard-sphere model ($p_A$, blue), a soft-sphere Lorentzian
+ function ($p_B$, red), and an intermediate model based on a Gaussian function
+ ($p_G$, green). }
\end{center}
\end{figure}
@@ -338,7 +340,115 @@
The derivatives of the rotation operator are already encoded in the cctbx library ({\tt scitbx/matrix/\_\_init\_\_.py}). Formulae for the rotation operator and its derivative with
respect to angle $\theta$ are given in the LaTeX documentation included in that directory.
-%%%%%%%%%%%%%%%%%%%%%
+ \subsection*{5 The model { \tt rs\_hybrid}: Additional refinement of the parameter $r_s$ }
+After refining the parameters $G$, $B$, $\theta_{x}$, and $\theta_{y}$
+we now decide to add a second minimization round to refine an additional parameter for each crystal lattice:
+$r_s$, the RLP radius, as shown in Fig. 1.
+\par We thus need the derivative of the residual $\mathscr{R}_i$ with respect to this new parameter:
+
+ \begin{equation}
+ \frac{\partial\mathscr{R}_i}{\partial r_s} =
+ \frac{\partial\mathscr{R}_i}{\partial p_B}
+ \frac{\partial p_B} {\partial r_s}
+ \text{,}
+ \label{eqn:dRrs}
+ \end{equation}
+
+where $\dfrac{\partial\mathscr{R}_i}{\partial p_B}$ has already been given by Eqn. \eqref{eqn:P_terms}.
+
+The remaining factor is derived from the partiality expression associated with the Lorentzian RLP
+profile, Eqn. \eqref{eqn:pb}. Using the quotient rule, with $N$=numerator and $D$=denominator,
+
+ \begin{equation}
+ \frac{\partial p_B} {\partial r_s} =
+ \frac{
+ \dfrac{\partial N}{\partial{r_s}} D-
+ \dfrac{\partial D}{\partial{r_s}} N
+ }
+ {D^2}
+ =
+ \frac{4{r_s}{r_h}^2}{(2r_h^2 + r_s^2)^2}
+ \text{.}
+ \label{eqn:dpb_drs}
+ \end{equation}
+
+ \subsection*{6 A Gaussian-shaped radial profile for the RLP }
+One criticism of the RLP model B and its Lorentzian-shaped radial profile $p_B (r_h)$ is that the
+profile tails off very gradually. There is still a significant partiality fraction many radii away from the
+RLP center. Perhaps this is unphysical; after all, we are trying to test the hypothesis that negative
+measurements are in fact false predictions that are in fact too far from the Ewald sphere to contribute
+any diffracted signal. Therefore, let's choose a model that would provide more sharp delineation
+between RLP and not-RLP. We'll then test if this model fits the data better, presumably by looking
+at the target functional or the correlation coefficient.
+A candidate function giving a sharper cutoff, while still being smoothly
+differentiable, is the Gaussian,
+
+ \begin{equation}
+ G =
+ \frac{1}{\sqrt{2\pi\sigma^2}}
+ \exp (- \dfrac {(x - \mu)^2}{2\sigma^2})
+ \text{,}
+ \label{eqn:gaussian}
+ \end{equation}
+
+with mean $\mu$ and standard deviation $\sigma$.
+
+As before, we develop a modified function that has an amplitude of 1 at a reciprocal-distance offset $r_h$ of 0:
+
+ \begin{equation}
+ G^{\prime} =
+ \exp (- \dfrac {r_h^2}{2\sigma^2})
+ \text{.}
+ \label{eqn:gaussprime}
+ \end{equation}
+
+To eliminate the variable $\sigma$ we set the FWHM of function \eqref{eqn:gaussprime} ,
+ \begin{equation}
+ 2 \sqrt{(2 \ln{2})\sigma^2}
+ \text{,}
+ \label{eqn:fwhmgaussprime}
+ \end{equation}
+
+to be equal to the FWHM expression worked out for models A and B in eqn \eqref{eqn:fwhm}. From this
+condition we can work out the value of the variance
+
+ \begin{equation}
+ \sigma^2 =
+ \dfrac {r_s^2} {4\ln{2}}
+ \text{,}
+ \label{eqn:gsigma}
+ \end{equation}
+
+and now eliminate $\sigma$ to arrive at a new expression for the partiality (model G):
+
+ \begin{equation}
+ p_G =
+ \exp( \dfrac {-(2 \ln{2}) r_h^2} {r_s^2}
+ )
+ \text{,}
+ \label{eqn:pg}
+ \end{equation}
+
+This function is plotted in Fig. 2 (green dots), illustrating that $p_G$ is a better
+approximation to the
+hard-sphere RLP model (blue) than is $p_B$ (red). Finally, for parameter refinement we need the
+partial derivatives of $p_G$ with respect to its constituent variables,
+
+ \begin{equation}
+ \frac{\partial{p_G}}{\partial{r_h}} =
+ - p_G \frac {(4 \ln{2}) r_h}{r_s^2}
+ \text{, }
+ \label{eqn:dpG_drh}
+ \end{equation}
+and
+ \begin{equation}
+ \frac{\partial{p_G}}{\partial{r_s}} = p_G\frac{(4 \ln{2})r_h^2}{r_s^3}
+ \text{.}
+ \label{eqn:dpG_drs}
+ \end{equation}
+
+
+%%%%%%%%%%%%%%%%%%%%%
\end{document}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-23 19:41:59
|
Revision: 25647
http://sourceforge.net/p/cctbx/code/25647
Author: phyy-nx
Date: 2016-10-23 19:41:56 +0000 (Sun, 23 Oct 2016)
Log Message:
-----------
XFEL UI
Fix up unit cell clustering in Status tab.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_controls.py
trunk/xfel/ui/components/xfel_gui_init.py
Modified: trunk/xfel/ui/components/xfel_gui_controls.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_controls.py 2016-10-23 16:11:08 UTC (rev 25646)
+++ trunk/xfel/ui/components/xfel_gui_controls.py 2016-10-23 19:41:56 UTC (rev 25647)
@@ -794,4 +794,5 @@
if self.uc_values is not None:
import xfel.ui.components.xfel_gui_plotter as pltr
plotter = pltr.PopUpCharts()
- plotter.plot_uc_histogram(info_list=[self.uc_values])
+ plotter.plot_uc_histogram(info_list=[self.uc_values], legend_list=[])
+ plotter.plt.show()
Modified: trunk/xfel/ui/components/xfel_gui_init.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_init.py 2016-10-23 16:11:08 UTC (rev 25646)
+++ trunk/xfel/ui/components/xfel_gui_init.py 2016-10-23 19:41:56 UTC (rev 25647)
@@ -611,9 +611,10 @@
return self.result
class Clusterer():
- def __init__(self, trial, runblocks, output, sample_size, threshold):
+ def __init__(self, trial, runblocks, tags, output, sample_size, threshold):
self.trial = trial
self.runblocks = runblocks
+ self.tags = tags
self.output = output
self.sample_size = sample_size
self.threshold = threshold
@@ -623,12 +624,21 @@
# 1. Get all pickle files, check if new ones arrived
run_numbers = []
rb_paths = []
+ tag_ids = set([t.id for t in self.tags])
for rb in self.runblocks:
for run in rb.runs:
if run.run not in run_numbers:
+ if len(tag_ids) > 0:
+ run_tag_ids = set([t.id for t in run.tags])
+ if len(tag_ids.intersection(run_tag_ids)) == 0:
+ continue
run_numbers.append(run.run)
- rb_paths.append(os.path.join(get_run_path(self.output, self.trial,
- rb, run), "out"))
+ # test for integration folder
+ path = os.path.join(get_run_path(self.output, self.trial, rb, run), "integration")
+ if not os.path.exists(path):
+ path = os.path.join(get_run_path(self.output, self.trial, rb, run), "out")
+ rb_paths.append(path)
+
all_pickles = []
for path in rb_paths:
@@ -663,6 +673,7 @@
parent,
trial,
runblocks,
+ tags,
output,
sample_size=1000,
threshold=250,):
@@ -670,12 +681,13 @@
self.parent = parent
self.trial = trial
self.runblocks = runblocks
+ self.tags = tags
self.output = output
self.sample_size = sample_size
self.threshold = threshold
def run(self):
- clusterer = Clusterer(self.trial, self.runblocks, self.output,
+ clusterer = Clusterer(self.trial, self.runblocks, self.tags, self.output,
self.sample_size, self.threshold)
self.clusters = clusterer.unit_cell_clustering()
@@ -1448,8 +1460,9 @@
def onClustering(self, e):
trial = self.main.db.get_trial(trial_number=self.trial_no)
runblocks = trial.rungroups
+ tags = self.selected_tags
- clustering = ClusteringWorker(self, trial=trial, runblocks=runblocks,
+ clustering = ClusteringWorker(self, trial=trial, runblocks=runblocks, tags=tags,
output=self.main.params.output_folder,
threshold=self.opt_cluster.threshold.GetValue(),
sample_size=self.opt_cluster.num_images.GetValue())
@@ -1463,7 +1476,7 @@
print 'Nothing to cluster!'
else:
counter = 0
- clusters = sorted(e.GetValue(), key=lambda x: x.members, reverse=True)
+ clusters = sorted(e.GetValue(), key=lambda x: len(x.members), reverse=True)
for cluster in clusters:
sorted_pg_comp = sorted(cluster.pg_composition.items(),
key=lambda x: -1 * x[1])
@@ -1483,12 +1496,19 @@
iso.ctr_pg.SetValue(cons_pg[0])
iso.ctr_num.SetValue(str(len(cluster.members)))
iso.ctr_uc.SetValue(uc_line)
- iso.uc_values = [i.uc for i in cluster.members]
+ iso.uc_values = [{'a' :i.uc[0],
+ 'b' :i.uc[1],
+ 'c' :i.uc[2],
+ 'alpha':i.uc[3],
+ 'beta' :i.uc[4],
+ 'gamma':i.uc[5],
+ 'n_img':1} for i in cluster.members]
self.iso_box_sizer.Add(iso,
flag=wx.EXPAND| wx.TOP | wx.LEFT | wx.RIGHT,
border=10)
counter += 1
+ if counter >= len(ascii_uppercase): counter = 0
self.iso_panel.SetSizer(self.iso_box_sizer)
self.iso_panel.Layout()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-23 16:11:10
|
Revision: 25646
http://sourceforge.net/p/cctbx/code/25646
Author: phyy-nx
Date: 2016-10-23 16:11:08 +0000 (Sun, 23 Oct 2016)
Log Message:
-----------
XFEL updates
Change default for MPI splitting of events from striping to client/server
UI: run job monitor on the run stats page to pick up changing job status
UI: update text and colors for status labels on run stats page
Modified Paths:
--------------
trunk/xfel/command_line/cxi_xtc_process.py
trunk/xfel/command_line/xtc_process.py
trunk/xfel/ui/components/run_stats_plotter.py
trunk/xfel/ui/components/xfel_gui_init.py
Modified: trunk/xfel/command_line/cxi_xtc_process.py
===================================================================
--- trunk/xfel/command_line/cxi_xtc_process.py 2016-10-22 23:44:36 UTC (rev 25645)
+++ trunk/xfel/command_line/cxi_xtc_process.py 2016-10-23 16:11:08 UTC (rev 25646)
@@ -73,7 +73,7 @@
.type = choice
.help = "Muliprocessing method"
mpi {
- method = client_server *striping
+ method = *client_server striping
.type = choice
.help = Method of serving data to child processes in MPI. client_server: \
use one process as a server that sends timestamps to each process. \
Modified: trunk/xfel/command_line/xtc_process.py
===================================================================
--- trunk/xfel/command_line/xtc_process.py 2016-10-22 23:44:36 UTC (rev 25645)
+++ trunk/xfel/command_line/xtc_process.py 2016-10-23 16:11:08 UTC (rev 25646)
@@ -219,7 +219,7 @@
.type = choice
.help = Muliprocessing method
mpi {
- method = client_server *striping
+ method = *client_server striping
.type = choice
.help = Method of serving data to child processes in MPI. client_server: \
use one process as a server that sends timestamps to each process. \
Modified: trunk/xfel/ui/components/run_stats_plotter.py
===================================================================
--- trunk/xfel/ui/components/run_stats_plotter.py 2016-10-22 23:44:36 UTC (rev 25645)
+++ trunk/xfel/ui/components/run_stats_plotter.py 2016-10-23 16:11:08 UTC (rev 25646)
@@ -191,14 +191,14 @@
tags = run_tags[idx]
status = run_statuses[idx]
if status == "DONE":
+ status_color = 'blue'
+ elif status in ["RUN", "PEND", "SUBMITTED"]:
status_color = 'green'
- elif status == "RUN":
- status_color = 'yellow'
elif status is None:
status_color = 'black'
else:
status_color = 'red'
- ax4.text(start_t, 3.85, " " + ", ".join(tags), fontsize=text_ratio, color=status_color)
+ ax4.text(start_t, 3.85, " " + ", ".join(tags) + " [%s]" % status, fontsize=text_ratio, color=status_color)
ax4.text(start_t, .85, "run %d" % run_numbers[idx], fontsize=text_ratio)
ax4.text(start_t, .65, "%d img/%d hit" % (lengths[idx], n_hits), fontsize=text_ratio)
ax4.text(start_t, .45, "%d (%d) idx" % (n_idx_low, n_idx_high), fontsize=text_ratio)
Modified: trunk/xfel/ui/components/xfel_gui_init.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_init.py 2016-10-22 23:44:36 UTC (rev 25645)
+++ trunk/xfel/ui/components/xfel_gui_init.py 2016-10-23 16:11:08 UTC (rev 25646)
@@ -925,6 +925,9 @@
self.start_prg_sentinel()
self.run_window.prg_light.change_status('on')
elif tab == 4:
+ if self.job_monitor is None or not self.job_monitor.active:
+ self.start_job_monitor()
+ self.run_window.jmn_light.change_status('on')
if self.runstats_sentinel is None or not self.runstats_sentinel.active:
self.start_runstats_sentinel()
self.run_window.runstats_light.change_status('on')
@@ -946,6 +949,9 @@
self.stop_prg_sentinel(block = False)
self.run_window.prg_light.change_status('off')
elif tab == 4:
+ if self.job_monitor.active:
+ self.stop_job_monitor(block = False)
+ self.run_window.jmn_light.change_status('off')
if self.runstats_sentinel.active:
self.stop_runstats_sentinel(block = False)
self.run_window.runstats_light.change_status('off')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-22 23:44:38
|
Revision: 25645
http://sourceforge.net/p/cctbx/code/25645
Author: phyy-nx
Date: 2016-10-22 23:44:36 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
XFEL UI
Bugfix for plotting runs w/ no data
Modified Paths:
--------------
trunk/xfel/ui/components/run_stats_plotter.py
Modified: trunk/xfel/ui/components/run_stats_plotter.py
===================================================================
--- trunk/xfel/ui/components/run_stats_plotter.py 2016-10-22 22:16:29 UTC (rev 25644)
+++ trunk/xfel/ui/components/run_stats_plotter.py 2016-10-22 23:44:36 UTC (rev 25645)
@@ -167,8 +167,9 @@
f.subplots_adjust(hspace=0)
# add lines and text summaries at the timestamp boundaries
for boundary in boundaries:
- for a in (ax1, ax2, ax3):
- a.axvline(x=boundary, ymin=0, ymax=3, linewidth=1, color='k')
+ if boundary is not None:
+ for a in (ax1, ax2, ax3):
+ a.axvline(x=boundary, ymin=0, ymax=3, linewidth=1, color='k')
run_starts = boundaries[0::2]
run_ends = boundaries[1::2]
start = 0
@@ -176,6 +177,7 @@
for idx in xrange(len(run_numbers)):
start_t = run_starts[idx]
end_t = run_ends[idx]
+ if start_t is None or end_t is None: continue
end += lengths[idx]
slice_t = t[start:end+1]
slice_hits = xtal_hits[start:end+1]
@@ -266,6 +268,8 @@
boundaries.append(tslice[-1])
lengths.append(len(tslice))
runs_with_data.append(run_numbers[idx])
+ else:
+ boundaries.extend([None]*2)
stats_tuple = get_run_stats(tset,
two_theta_low_set,
two_theta_high_set,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-22 22:16:32
|
Revision: 25644
http://sourceforge.net/p/cctbx/code/25644
Author: idyoung
Date: 2016-10-22 22:16:29 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
Color run tags in the Run Stats tab by job status (green: done, yellow: running, red: anything else, black: number of statuses did not match number of runs). Also prepare for adding legends to unit cell tab.
Modified Paths:
--------------
trunk/xfel/ui/components/run_stats_plotter.py
trunk/xfel/ui/components/xfel_gui_init.py
trunk/xfel/ui/components/xfel_gui_plotter.py
Modified: trunk/xfel/ui/components/run_stats_plotter.py
===================================================================
--- trunk/xfel/ui/components/run_stats_plotter.py 2016-10-22 19:28:24 UTC (rev 25643)
+++ trunk/xfel/ui/components/run_stats_plotter.py 2016-10-22 22:16:29 UTC (rev 25644)
@@ -121,7 +121,7 @@
tuple_of_timestamp_boundaries,
run_numbers)
-def plot_run_stats(stats, d_min, run_tags=[], interactive=True, xsize=30, ysize=10, high_vis=False):
+def plot_run_stats(stats, d_min, run_tags=[], run_statuses=[], interactive=True, xsize=30, ysize=10, high_vis=False):
plot_ratio = max(min(xsize, ysize)/2.5, 3)
if high_vis:
spot_ratio = plot_ratio*4
@@ -134,26 +134,31 @@
window, lengths, boundaries, run_numbers = stats
if len(t) == 0:
return None
+ n_runs = len(boundaries)//2
+ if len(run_tags) != n_runs:
+ run_tags = [[] for i in xrange(n_runs)]
+ if len(run_statuses) != n_runs:
+ run_statuses = [None for i in xrange(n_runs)]
f, (ax1, ax2, ax3, ax4) = plt.subplots(4, sharex=True, sharey=False)
for a in (ax1, ax2, ax3, ax4):
a.tick_params(axis='x', which='both', bottom='off', top='off')
ax1.scatter(t.select(~low_sel), n_strong.select(~low_sel), edgecolors="none", color ='grey', s=spot_ratio)
ax1.scatter(t.select(low_sel), n_strong.select(low_sel), edgecolors="none", color='blue', s=spot_ratio)
ax1.axis('tight')
- ax1.set_ylabel("strong spots\nblue: indexed\ngray: did not index").set_fontsize(text_ratio)
+ ax1.set_ylabel("strong spots\nblue: indexed\ngray: did not index", fontsize=text_ratio)
ax2.plot(t, idx_rate*100)
ax2_twin = ax2.twinx()
ax2_twin.plot(t, drop_hit_rate*100, color='green')
ax2.axis('tight')
- ax2.set_ylabel("blue:% indexed").set_fontsize(text_ratio)
- ax2_twin.set_ylabel("green: % droplet").set_fontsize(text_ratio)
+ ax2.set_ylabel("blue:% indexed", fontsize=text_ratio)
+ ax2_twin.set_ylabel("green: % droplet", fontsize=text_ratio)
ax3.scatter(t, isigi_low, edgecolors="none", color='red', s=spot_ratio)
ax3.scatter(t, isigi_high, edgecolors="none", color='orange', s=spot_ratio)
ax3_twin = ax3.twinx()
ax3_twin.plot(t, hq_rate*100, color='orange')
ax3.axis('tight')
- ax3.set_ylabel("I/sig(I)\nred: low\nyellow: %3.1f Ang" % d_min).set_fontsize(text_ratio)
- ax3_twin.set_ylabel("line:% HQ").set_fontsize(text_ratio)
+ ax3.set_ylabel("I/sig(I)\nred: low\nyellow: %3.1f Ang" % d_min, fontsize=text_ratio)
+ ax3_twin.set_ylabel("line:% HQ", fontsize=text_ratio)
for a in [ax1, ax2, ax3, ax4, ax2_twin, ax3_twin]:
xlab = a.get_xticklabels()
ylab = a.get_yticklabels()
@@ -181,15 +186,24 @@
slice_high_sel = high_sel[start:end+1]
n_idx_low = slice_low_sel.count(True)
n_idx_high = slice_high_sel.count(True)
- tags = run_tags[idx] if idx < len(run_tags) else []
- ax4.text(start_t, 3.85, " " + ", ".join(tags)).set_fontsize(text_ratio)
- ax4.text(start_t, .85, "run %d" % run_numbers[idx]).set_fontsize(text_ratio)
- ax4.text(start_t, .65, "%d img/%d hit" % (lengths[idx], n_hits)).set_fontsize(text_ratio)
- ax4.text(start_t, .45, "%d (%d) idx" % (n_idx_low, n_idx_high)).set_fontsize(text_ratio)
- ax4.text(start_t, .25, "%-3.1f%% drop/%-3.1f%% hit" % ((100*n_drops/lengths[idx]),(100*n_hits/lengths[idx]))).set_fontsize(text_ratio)
+ tags = run_tags[idx]
+ status = run_statuses[idx]
+ if status == "DONE":
+ status_color = 'green'
+ elif status == "RUN":
+ status_color = 'yellow'
+ elif status is None:
+ status_color = 'black'
+ else:
+ status_color = 'red'
+ ax4.text(start_t, 3.85, " " + ", ".join(tags), fontsize=text_ratio, color=status_color)
+ ax4.text(start_t, .85, "run %d" % run_numbers[idx], fontsize=text_ratio)
+ ax4.text(start_t, .65, "%d img/%d hit" % (lengths[idx], n_hits), fontsize=text_ratio)
+ ax4.text(start_t, .45, "%d (%d) idx" % (n_idx_low, n_idx_high), fontsize=text_ratio)
+ ax4.text(start_t, .25, "%-3.1f%% drop/%-3.1f%% hit" % ((100*n_drops/lengths[idx]),(100*n_hits/lengths[idx])), fontsize=text_ratio)
ax4.text(start_t, .05, "%-3.1f (%-3.1f)%% idx" % \
- (100*n_idx_low/lengths[idx], 100*n_idx_high/lengths[idx])).set_fontsize(text_ratio)
- ax4.set_xlabel("timestamp (s)\n# images shown as all (%3.1f Angstroms)" % d_min).set_fontsize(text_ratio)
+ (100*n_idx_low/lengths[idx], 100*n_idx_high/lengths[idx]), fontsize=text_ratio)
+ ax4.set_xlabel("timestamp (s)\n# images shown as all (%3.1f Angstroms)" % d_min, fontsize=text_ratio)
ax4.set_yticks([])
for item in [ax1, ax2, ax3, ax4]:
item.tick_params(labelsize=text_ratio)
@@ -217,6 +231,7 @@
ratio_cutoff=1,
n_strong_cutoff=40,
run_tags=[],
+ run_statuses=[],
interactive=False,
compress_runs=True,
xsize=30,
@@ -262,7 +277,7 @@
runs_with_data,
ratio_cutoff=ratio_cutoff,
n_strong_cutoff=n_strong_cutoff)
- png = plot_run_stats(stats_tuple, d_min, run_tags=run_tags, interactive=interactive,
+ png = plot_run_stats(stats_tuple, d_min, run_tags=run_tags, run_statuses=run_statuses, interactive=interactive,
xsize=xsize, ysize=ysize, high_vis=high_vis)
return png
Modified: trunk/xfel/ui/components/xfel_gui_init.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_init.py 2016-10-22 19:28:24 UTC (rev 25643)
+++ trunk/xfel/ui/components/xfel_gui_init.py 2016-10-22 22:16:29 UTC (rev 25644)
@@ -367,6 +367,7 @@
self.run_numbers = []
self.stats = []
self.run_tags = []
+ self.run_statuses = []
# on initialization (and restart), make sure run stats drawn from scratch
self.parent.run_window.runstats_tab.redraw_windows = True
@@ -395,22 +396,35 @@
if self.parent.run_window.runstats_tab.trial_no is not None:
trial = self.db.get_trial(
trial_number=self.parent.run_window.runstats_tab.trial_no)
- if len(trial.isoforms) == 0:
+ if trial is not None and len(trial.isoforms) == 0:
print "Please select a trial using isoforms."
return
selected_runs = copy.deepcopy(self.parent.run_window.runstats_tab.selected_runs)
self.run_numbers = []
+ trial_ids = []
+ rungroup_ids = []
self.stats = []
self.trgr = {}
self.run_tags = []
+ self.run_statuses = []
for rg in trial.rungroups:
for run in rg.runs:
if run.run not in self.run_numbers and run.run in selected_runs:
self.run_numbers.append(run.run)
+ trial_ids.append(trial.id)
+ rungroup_ids.append(rg.id)
self.trgr[run.run] = (trial, rg, run)
self.stats.append(HitrateStats(self.db, run.run, trial.trial, rg.id,
d_min=self.parent.run_window.runstats_tab.d_min)())
self.run_tags.append([tag.name for tag in run.tags])
+ jobs = self.db.get_all_jobs()
+ for idx in xrange(len(self.run_numbers)):
+ run_no = self.run_numbers[idx]
+ rg_id = rungroup_ids[idx]
+ t_id = trial_ids[idx]
+ for job in jobs:
+ if job.run.run == run_no and job.rungroup.id == rg_id and job.trial.id == t_id:
+ self.run_statuses.append(job.status)
self.reorder()
def reorder(self):
@@ -419,6 +433,7 @@
self.run_numbers = run_numbers_ordered
self.stats = [self.stats[i] for i in order]
self.run_tags = [self.run_tags[i] for i in order]
+ self.run_statuses = [self.run_statuses[i] for i in order]
def fetch_should_have_indexed_timestamps(self):
from xfel.ui.components.run_stats_plotter import \
@@ -452,6 +467,7 @@
ratio_cutoff=self.parent.run_window.runstats_tab.ratio,
n_strong_cutoff=self.parent.run_window.runstats_tab.n_strong,
run_tags=self.run_tags,
+ run_statuses=self.run_statuses,
xsize=(sizex-115)/82, ysize=(sizey-115)/82,
high_vis=self.parent.high_vis)
# convert px to inches with fudge factor for scaling inside borders
@@ -466,7 +482,9 @@
interactive=True,
ratio_cutoff=self.parent.run_window.runstats_tab.ratio,
n_strong_cutoff=self.parent.run_window.runstats_tab.n_strong,
- run_tags=self.run_tags, high_vis=self.parent.high_vis)
+ run_tags=self.run_tags,
+ run_statuses=self.run_statuses,
+ high_vis=self.parent.high_vis)
# ----------------------------- Unit Cell Sentinel ----------------------------- #
@@ -509,7 +527,9 @@
sizex, sizey = self.parent.run_window.unitcell_tab.unit_cell_panel.GetSize()
info_list = []
+ legend_list = []
for tag_set in tag_sets:
+ legend_list.append(str(tag_set))
cells = self.db.get_stats(trial=trial, tags=tag_set.tags, isigi_cutoff = 1.0, tag_selection_mode = tag_set.mode)()
info = []
for cell in cells:
@@ -525,6 +545,7 @@
plotter = pltr.PopUpCharts(interactive=False)
self.parent.run_window.unitcell_tab.png = plotter.plot_uc_histogram(
info_list=info_list,
+ legend_list=legend_list,
xsize=(sizex-115)/82, ysize=(sizey-115)/82,
high_vis=self.parent.high_vis)
self.post_refresh()
@@ -1413,7 +1434,7 @@
else:
plotter = pltr.PopUpCharts()
- plotter.plot_uc_histogram(info_list=[info], high_vis=self.main.high_vis)
+ plotter.plot_uc_histogram(info_list=[info], legend_list=[], high_vis=self.main.high_vis)
plotter.plot_uc_3Dplot(info=info)
plotter.plt.show()
Modified: trunk/xfel/ui/components/xfel_gui_plotter.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_plotter.py 2016-10-22 19:28:24 UTC (rev 25643)
+++ trunk/xfel/ui/components/xfel_gui_plotter.py 2016-10-22 22:16:29 UTC (rev 25644)
@@ -132,7 +132,7 @@
outliers.set_selected(data < q1_x - cut_x, True)
return outliers
- def plot_uc_histogram(self, info_list, extra_title = None, xsize = 10, ysize = 10, high_vis = False):
+ def plot_uc_histogram(self, info_list, legend_list, extra_title = None, xsize = 10, ysize = 10, high_vis = False):
"""
Plot a 3x3 grid of plots showing unit cell dimensions.
@param info list of lists of dictionaries. The outer list groups seperate lists
@@ -289,10 +289,15 @@
sub_gamma.xaxis.get_major_ticks()[0].label1.set_visible(False)
sub_gamma.xaxis.get_major_ticks()[-1].label1.set_visible(False)
- # title = 'Histogram of Unit Cell Dimensions ({} images)'.format(total)
- # if extra_title is not None:
- # title += " (%s)"%extra_title
- # fig.suptitle(title, fontsize=18)
+ # if len(legend_list) > 0:
+ # import matplotlib.patches as mpatches
+ # rgb_alphas = [a_hist[2][i] for i in range(len(a_hist[2]))]
+ # assert len(legend_list) == len(rgb_alphas)
+ # patches = [mpatches.Patch(
+ # color=rgb_alphas[i].get_facecolor(),
+ # label=legend_list[i])
+ # for i in xrange(len(rgb_alphas))]
+ # fig.legend(patches, 'upper right')
gsp.update(wspace=0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-22 19:28:26
|
Revision: 25643
http://sourceforge.net/p/cctbx/code/25643
Author: phyy-nx
Date: 2016-10-22 19:28:24 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
XFEL DB
Yup, it's another run_number vs. run_id bugfix.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_dialogs.py
Modified: trunk/xfel/ui/components/xfel_gui_dialogs.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_dialogs.py 2016-10-22 19:09:06 UTC (rev 25642)
+++ trunk/xfel/ui/components/xfel_gui_dialogs.py 2016-10-22 19:28:24 UTC (rev 25643)
@@ -1411,7 +1411,7 @@
first = int(self.runblocks_start.ctr.GetValue())
assert first > 0 and first >= self.first_avail
self.first_run = first
- startrun = self.db.get_run(run_number=first).id
+ startrun = self.db.get_run(run_number=first).run
except (ValueError, AssertionError) as e:
print "Please select a run between %d and %d." % (self.first_avail, self.last_avail)
raise e
@@ -1420,7 +1420,7 @@
last = int(self.runblocks_end.ctr.GetValue())
assert last > 0 and last <= self.last_avail and last >= first
self.last_run = last
- endrun = self.db.get_run(run_number=int(last)).id
+ endrun = self.db.get_run(run_number=int(last)).run
except (ValueError, AssertionError) as e:
print "Please select a run between %d and %d." % (self.first_run, self.last_avail)
raise e
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nks...@us...> - 2016-10-22 19:09:08
|
Revision: 25642
http://sourceforge.net/p/cctbx/code/25642
Author: nksauter
Date: 2016-10-22 19:09:06 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
cxi.merge bugfixes for rs2 and rs_hybrid algorithms.
Modified Paths:
--------------
trunk/xfel/cxi/postrefinement_hybrid_rs.py
trunk/xfel/cxi/postrefinement_updated_rs.py
Modified: trunk/xfel/cxi/postrefinement_hybrid_rs.py
===================================================================
--- trunk/xfel/cxi/postrefinement_hybrid_rs.py 2016-10-22 19:00:19 UTC (rev 25641)
+++ trunk/xfel/cxi/postrefinement_hybrid_rs.py 2016-10-22 19:09:06 UTC (rev 25642)
@@ -5,11 +5,11 @@
from dials.array_family import flex
from scitbx.math.tests.tst_weighted_correlation import simple_weighted_correlation
from xfel.cxi.postrefinement_legacy_rs import rs_parameterization
-from xfel.cxi.postrefinement_updated_rs import rs2_refinery,lbfgs_minimizer_derivatives,chosen_weights
+from xfel.cxi.postrefinement_updated_rs import rs2_refinery,lbfgs_minimizer_derivatives,chosen_weights,updated_rs
from scitbx.lstbx import normal_eqns
from scitbx.lstbx import normal_eqns_solving
-class rs_hybrid(object):
+class rs_hybrid(updated_rs):
def __init__(self,measurements_orig, params, i_model, miller_set, result, out):
measurements = measurements_orig.deep_copy()
# Now manipulate the data to conform to unit cell, asu, and space group
@@ -113,8 +113,10 @@
self.rs2_refinery = rs2_refinery(ORI=ORI, MILLER=MILLER, BEAM=BEAM, WAVE=WAVE,
ICALCVEC = I_reference, IOBSVEC = I_observed, WEIGHTS = chosen)
+ self.rs2_refinery.set_profile_shape(params.postrefinement.lineshape)
self.nave1_refinery = nave1_refinery(ORI=ORI, MILLER=MILLER, BEAM=BEAM, WAVE=WAVE,
ICALCVEC = I_reference, IOBSVEC = I_observed, WEIGHTS = chosen)
+ self.nave1_refinery.set_profile_shape(params.postrefinement.lineshape)
self.out=out; self.params = params;
self.miller_set = miller_set
@@ -143,8 +145,10 @@
self.refinery = self.nave1_refinery # used elsewhere, not private interface
def result_for_cxi_merge(self, file_name):
+ values = self.get_parameter_values()
+ self.rs2_parameter_range_assertions(values)
scaler = self.nave1_refinery.scaler_callable(self.get_parameter_values())
- values = self.get_parameter_values()
+
partiality_array = self.refinery.get_partiality_array(values)
p_scaler = flex.pow(partiality_array,
0.5*self.params.postrefinement.merge_partiality_exponent)
@@ -176,13 +180,11 @@
SWC = simple_weighted_correlation(I_weight, I_reference, observations.data())
print >> self.out, "CORR: NEW correlation is", SWC.corr
self.final_corr = SWC.corr
-
- # New range assertions for refined variables
- # XXX Likely these limits are problem-specific (especially G-max) so look for another approach
+ #another range assertion
+ assert self.final_corr > 0.1
+ # XXX Specific to the hybrid_rs method, and likely these limits are problem-specific (especially G-max) so look for another approach
# or expose the limits as phil parameters.
- assert self.final_corr > 0.1
- assert 0 < values.G and values.G < 0.5
- assert -25 < values.BFACTOR and values.BFACTOR < 25
+ assert values.G < 0.5
return observations_original_index,observations,matches
Modified: trunk/xfel/cxi/postrefinement_updated_rs.py
===================================================================
--- trunk/xfel/cxi/postrefinement_updated_rs.py 2016-10-22 19:00:19 UTC (rev 25641)
+++ trunk/xfel/cxi/postrefinement_updated_rs.py 2016-10-22 19:09:06 UTC (rev 25642)
@@ -140,9 +140,18 @@
out = self.out )
self.refined_mini = self.MINI
+ def rs2_parameter_range_assertions(self,values):
+ # New range assertions for refined variables
+ assert 0 < values.G
+ assert -25 < values.BFACTOR and values.BFACTOR < 25
+ assert -0.5 < 180.*values.thetax/math.pi < 0.5 , "limits on the theta rotation, please"
+ assert -0.5 < 180.*values.thetay/math.pi < 0.5 , "limits on the theta rotation, please"
+
def result_for_cxi_merge(self, file_name):
+ values = self.get_parameter_values()
+ self.rs2_parameter_range_assertions(values)
scaler = self.refinery.scaler_callable(self.parameterization_class(self.MINI.x))
- values = self.get_parameter_values()
+
partiality_array = self.refinery.get_partiality_array(values)
p_scaler = flex.pow(partiality_array,
0.5*self.params.postrefinement.merge_partiality_exponent)
@@ -174,15 +183,8 @@
print >> self.out, "CORR: NEW correlation is", SWC.corr
self.final_corr = SWC.corr
self.refined_mini = self.MINI
-
- # New range assertions for refined variables
- # XXX Likely these limits are problem-specific so look for another approach
- # or expose the limits as phil parameters.
+ #another range assertion
assert self.final_corr > 0.1
- assert 0 < values.G
- assert -25 < values.BFACTOR and values.BFACTOR < 25
- assert -0.5 < 180.*values.thetax/math.pi < 0.5 , "limits on the theta rotation, please"
- assert -0.5 < 180.*values.thetay/math.pi < 0.5 , "limits on the theta rotation, please"
return observations_original_index,observations,matches
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-22 19:00:21
|
Revision: 25641
http://sourceforge.net/p/cctbx/code/25641
Author: phyy-nx
Date: 2016-10-22 19:00:19 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
XFEL DB
More bugfixes regarding run_number vs. run_idj
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_controls.py
trunk/xfel/ui/components/xfel_gui_dialogs.py
trunk/xfel/ui/db/job.py
Modified: trunk/xfel/ui/components/xfel_gui_controls.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_controls.py 2016-10-22 17:56:15 UTC (rev 25640)
+++ trunk/xfel/ui/components/xfel_gui_controls.py 2016-10-22 19:00:19 UTC (rev 25641)
@@ -77,12 +77,12 @@
def __init__(self, parent, block, size=wx.DefaultSize):
self.block = block
db = block.app
- self.first_run = db.get_run(run_id=block.startrun).run
+ self.first_run = db.get_run(run_number=block.startrun).run
self.rnum = block.rungroup_id
if block.endrun is None:
self.last_run = None
else:
- self.last_run = db.get_run(run_id=block.endrun).run
+ self.last_run = db.get_run(run_number=block.endrun).run
GradButton.__init__(self, parent=parent, label='',
size=size)
Modified: trunk/xfel/ui/components/xfel_gui_dialogs.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_dialogs.py 2016-10-22 17:56:15 UTC (rev 25640)
+++ trunk/xfel/ui/components/xfel_gui_dialogs.py 2016-10-22 19:00:19 UTC (rev 25641)
@@ -1147,11 +1147,11 @@
else:
db = block.app
- self.first_run = db.get_run(run_id=block.startrun).run
+ self.first_run = db.get_run(run_number=block.startrun).run
if block.endrun is None:
self.last_run = None
else:
- self.last_run = db.get_run(run_id=block.endrun).run
+ self.last_run = db.get_run(run_number=block.endrun).run
BaseDialog.__init__(self, parent,
label_style=label_style,
Modified: trunk/xfel/ui/db/job.py
===================================================================
--- trunk/xfel/ui/db/job.py 2016-10-22 17:56:15 UTC (rev 25640)
+++ trunk/xfel/ui/db/job.py 2016-10-22 19:00:19 UTC (rev 25641)
@@ -35,13 +35,13 @@
for trial in trials:
for rungroup in trial.rungroups:
assert rungroup.active
- rg_start = app.get_run(run_id=rungroup.startrun)
+ rg_start = app.get_run(run_number=rungroup.startrun)
if rungroup.endrun is None:
# open ended run group
rg_runs = [r for r in runs if r.run >= rg_start.run]
else:
# closed run group
- rg_end = app.get_run(run_id=rungroup.endrun)
+ rg_end = app.get_run(run_number=rungroup.endrun)
rg_runs = [r for r in runs if r.run >= rg_start.run and r.run <= rg_end.run]
for run in rg_runs:
needed_jobs.append(_job(trial, rungroup, run))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-22 17:56:17
|
Revision: 25640
http://sourceforge.net/p/cctbx/code/25640
Author: phyy-nx
Date: 2016-10-22 17:56:15 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
Bugfix
Modified Paths:
--------------
trunk/xfel/ui/components/submission_tracker.py
Modified: trunk/xfel/ui/components/submission_tracker.py
===================================================================
--- trunk/xfel/ui/components/submission_tracker.py 2016-10-22 03:01:25 UTC (rev 25639)
+++ trunk/xfel/ui/components/submission_tracker.py 2016-10-22 17:56:15 UTC (rev 25640)
@@ -38,7 +38,7 @@
% self.queueing_system
def read_result(self, log_path):
- result = easy_run.fully_buffered(command=self.command % log_path).raise_if_errors()
+ result = easy_run.fully_buffered(command=self.command % log_path)
status = "\n".join(result.stdout_lines)
error = "\n".join(result.stderr_lines)
if error != "" and not "Warning: job being submitted without an AFS token." in error:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-22 03:01:28
|
Revision: 25639
http://sourceforge.net/p/cctbx/code/25639
Author: phyy-nx
Date: 2016-10-22 03:01:25 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
XFEL UI: bugfix for adding/removing multiple tags
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_dialogs.py
Modified: trunk/xfel/ui/components/xfel_gui_dialogs.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_dialogs.py 2016-10-22 01:32:50 UTC (rev 25638)
+++ trunk/xfel/ui/components/xfel_gui_dialogs.py 2016-10-22 03:01:25 UTC (rev 25639)
@@ -907,8 +907,8 @@
if r.run in run_numbers_selected:
self.selected[r.run] = [r]
for b in self.parent.all_tag_buttons:
- if b.run.run_id in self.selected.keys():
- self.selected[b.run.run_id].append(b)
+ if b.run.run in self.selected.keys():
+ self.selected[b.run.run].append(b)
def onSortDefault(self, e):
self.db_tags_selected_sort = self.db_tag_names
@@ -930,8 +930,8 @@
runs_with_tags_buttons = self.parent.all_tag_buttons
for tag in add_tags:
- for run_id in self.selected.keys():
- run, button = self.selected[run_id]
+ for run_number in self.selected.keys():
+ run, button = self.selected[run_number]
run_tags = run.app.get_run_tags(run.run_id)
run_tag_ids = [t.tag_id for t in run_tags]
if tag.tag_id not in run_tag_ids:
@@ -952,8 +952,8 @@
remove_tags = [t for t in self.db_tags if self.db_tag_names.index(t.name) in tag_indices]
for tag in remove_tags:
- for run_id in self.selected.keys():
- run, button = self.selected[run_id]
+ for run_number in self.selected.keys():
+ run, button = self.selected[run_number]
run_tags = run.app.get_run_tags(run.run_id)
run_tag_ids = [t.tag_id for t in run_tags]
if tag.tag_id in run_tag_ids:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-22 01:32:53
|
Revision: 25638
http://sourceforge.net/p/cctbx/code/25638
Author: idyoung
Date: 2016-10-22 01:32:50 +0000 (Sat, 22 Oct 2016)
Log Message:
-----------
Add another possible status of a queued job.
Modified Paths:
--------------
trunk/xfel/ui/components/submission_tracker.py
Modified: trunk/xfel/ui/components/submission_tracker.py
===================================================================
--- trunk/xfel/ui/components/submission_tracker.py 2016-10-21 23:48:06 UTC (rev 25637)
+++ trunk/xfel/ui/components/submission_tracker.py 2016-10-22 01:32:50 UTC (rev 25638)
@@ -57,7 +57,7 @@
if submission_id is None:
return "UNKWN"
status = self.interrogator.query(submission_id)
- if status in ["PEND", "RUN", "SUSP", "PSUSP", "SSUSP", "UNKWN", "EXIT", "DONE"]:
+ if status in ["PEND", "RUN", "SUSP", "PSUSP", "SSUSP", "UNKWN", "EXIT", "DONE", "ZOMBI"]:
return status
elif status == "ERR":
log_status = self.reader.read_result(log_path)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-21 23:48:08
|
Revision: 25637
http://sourceforge.net/p/cctbx/code/25637
Author: phyy-nx
Date: 2016-10-21 23:48:06 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
XFEL UI
Handle case where 'all' folder isn't present
Modified Paths:
--------------
trunk/xfel/ui/command_line/get_hit_timestamps.py
Modified: trunk/xfel/ui/command_line/get_hit_timestamps.py
===================================================================
--- trunk/xfel/ui/command_line/get_hit_timestamps.py 2016-10-21 23:09:27 UTC (rev 25636)
+++ trunk/xfel/ui/command_line/get_hit_timestamps.py 2016-10-21 23:48:06 UTC (rev 25637)
@@ -37,21 +37,28 @@
jobs = app.get_all_jobs()
for rungroup in trial.rungroups:
for run in rungroup.runs:
- job_found = None
- for job in jobs:
- if job.trial.id == trial.id and job.rungroup.id == rungroup.id and job.run.id == run.id:
- all_path = os.path.join(os.path.sep.join(job.get_log_path().split(os.path.sep)[:-2]), "all")
- assert job_found is None
- job_found = job
- assert job_found is not None
- job = job_found
+ if params.output_folder is None:
+ job = None
+ all_path = None
+ else:
+ job_found = None
+ for job in jobs:
+ if job.trial.id == trial.id and job.rungroup.id == rungroup.id and job.run.id == run.id:
+ all_path = os.path.join(os.path.sep.join(job.get_log_path().split(os.path.sep)[:-2]), "all")
+ assert job_found is None
+ job_found = job
+ assert job_found is not None
+ job = job_found
where = "WHERE event.n_strong >= %d" % params.hit_cutoff
events = app.get_all_events(trial = trial, runs = [run], only_indexed = False, where = where)
for e in events:
t = e.timestamp
ts = t[0:4] + t[5:7] + t[8:10] + t[11:13] + t[14:16] + t[17:19] + t[20:23]
- print os.path.join(all_path, "shot-" + ts + ".pickle")
+ if all_path is None:
+ print "%04d"%run.run, ts
+ else:
+ print os.path.join(all_path, "shot-" + ts + ".pickle")
if __name__ == "__main__":
run(sys.argv[1:])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nks...@us...> - 2016-10-21 23:09:29
|
Revision: 25636
http://sourceforge.net/p/cctbx/code/25636
Author: nksauter
Date: 2016-10-21 23:09:27 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
cxi.merge, rs2 model only. Initial code to represent a Gaussian (rather than Lorentzian) RLP profile.
Modified Paths:
--------------
trunk/xfel/command_line/cxi_merge.py
trunk/xfel/cxi/postrefinement_updated_rs.py
Modified: trunk/xfel/command_line/cxi_merge.py
===================================================================
--- trunk/xfel/command_line/cxi_merge.py 2016-10-21 22:33:16 UTC (rev 25635)
+++ trunk/xfel/command_line/cxi_merge.py 2016-10-21 23:09:27 UTC (rev 25636)
@@ -222,7 +222,7 @@
}
target_weighting = *unit variance gentle extreme
.type = choice
- .help = weights for the residuals in the postrefinement target (only for rs_hybrid)
+ .help = weights for the residuals in the postrefinement target (for rs2 or rs_hybrid)
.help = Unit: each residual weighted by 1.0
.help = Variance: weighted by 1/sigma**2. Doesn't seem right, constructive feedback invited
.help = Gentle: weighted by |I|/sigma**2. Seems like best option
@@ -234,9 +234,10 @@
.type = float
.help = additionally weight each measurement by partiality**exp when merging
.help = 0 is no weighting, 1 is partiality weighting, 2 is weighting by partiality-squared
- lineshape = *lorentzian
+ lineshape = *lorentzian gaussian
.type = choice
.help = Soft sphere RLP modeled with Lorentzian radial profile as in prime
+ .help = or Gaussian radial profile. (for rs2 or rs_hybrid)
show_trumpet_plot = False
.type = bool
.help = each-image trumpet plot showing before-after plot. Spot color warmth indicates I/sigma
Modified: trunk/xfel/cxi/postrefinement_updated_rs.py
===================================================================
--- trunk/xfel/cxi/postrefinement_updated_rs.py 2016-10-21 22:33:16 UTC (rev 25635)
+++ trunk/xfel/cxi/postrefinement_updated_rs.py 2016-10-21 23:09:27 UTC (rev 25636)
@@ -122,6 +122,7 @@
parameterization_class = rs_parameterization
refinery = rs2_refinery(ORI=ORI, MILLER=MILLER, BEAM=BEAM, WAVE=WAVE,
ICALCVEC = I_reference, IOBSVEC = I_observed, WEIGHTS = chosen)
+ refinery.set_profile_shape(params.postrefinement.lineshape)
func = refinery.fvec_callable(parameterization_class(current))
functional = flex.sum(func*func)
@@ -190,6 +191,20 @@
class rs2_refinery(rs_refinery):
+ def set_profile_shape(self, shape):
+ self.profile_shape = shape
+ self.get_partiality_array = {
+ "lorentzian":super(rs2_refinery, self).get_partiality_array,
+ "gaussian": self.get_gaussian_partiality_array
+ }[shape]
+
+ def get_gaussian_partiality_array(self,values):
+ rs = values.RS
+ Rh = self.get_Rh_array(values)
+ immersion = Rh/rs
+ gaussian = flex.exp(-2. * math.log(2) * (immersion*immersion))
+ return gaussian
+
def jacobian_callable(self,values):
PB = self.get_partiality_array(values)
EXP = flex.exp(-2.*values.BFACTOR*self.DSSQ)
@@ -214,7 +229,8 @@
rs = values.RS
Rh = self.get_Rh_array(values)
rs_sq = rs*rs
- dPB_dRh = -PB * 4. * Rh / (2. * Rh * Rh + rs_sq)
+ dPB_dRh = { "lorentzian": -PB * 4. * Rh / (2. * Rh * Rh + rs_sq),
+ "gaussian": -PB * 4. * math.log(2) * Rh / rs_sq }[self.profile_shape]
dPB_dthetax = dPB_dRh * dRh_dthetax
dPB_dthetay = dPB_dRh * dRh_dthetay
Px_terms = P_terms * dPB_dthetax; Py_terms = P_terms * dPB_dthetay
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-21 22:33:18
|
Revision: 25635
http://sourceforge.net/p/cctbx/code/25635
Author: phyy-nx
Date: 2016-10-21 22:33:16 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
XFEL DB
Bugfix. Found by non-contiguous run numbers compared to run ids.
Modified Paths:
--------------
trunk/xfel/ui/db/rungroup.py
Modified: trunk/xfel/ui/db/rungroup.py
===================================================================
--- trunk/xfel/ui/db/rungroup.py 2016-10-21 21:47:57 UTC (rev 25634)
+++ trunk/xfel/ui/db/rungroup.py 2016-10-21 22:33:16 UTC (rev 25635)
@@ -9,11 +9,11 @@
def __getattr__(self, name):
# Called only if the property cannot be found
if name == "runs":
- startrun = self.app.get_run(run_id = self.startrun).run
+ startrun = self.app.get_run(run_number = self.startrun).run
if self.endrun is None:
return [r for r in self.app.get_all_runs() if r.run >= startrun]
else:
- endrun = self.app.get_run(run_id = self.endrun).run
+ endrun = self.app.get_run(run_number = self.endrun).run
return [r for r in self.app.get_all_runs() if r.run >= startrun and \
r.run <= endrun]
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-21 21:48:00
|
Revision: 25634
http://sourceforge.net/p/cctbx/code/25634
Author: idyoung
Date: 2016-10-21 21:47:57 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
Bugfix for tag sets with no data, and better scaling for a/b/c lengths.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_plotter.py
Modified: trunk/xfel/ui/components/xfel_gui_plotter.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_plotter.py 2016-10-21 20:11:07 UTC (rev 25633)
+++ trunk/xfel/ui/components/xfel_gui_plotter.py 2016-10-21 21:47:57 UTC (rev 25634)
@@ -163,8 +163,11 @@
sub_beta = fig.add_subplot(gsp[7], sharey=sub_alpha)
sub_gamma = fig.add_subplot(gsp[8], sharey=sub_alpha)
total = 0
+ abc_hist_ylim = 0
for info in info_list:
+ if len(info) == 0:
+ continue
# Extract uc dimensions from info list
a = flex.double([i['a'] for i in info])
b = flex.double([i['b'] for i in info])
@@ -189,7 +192,7 @@
nbins = int(np.sqrt(len(a))) * 2
- sub_a.hist(a, nbins, normed=False,
+ a_hist = sub_a.hist(a, nbins, normed=False,
alpha=0.75, histtype='stepfilled')
sub_a.set_xlabel(
"a-edge (%.2f +/- %.2f $\AA$)" % (flex.mean(a),
@@ -197,7 +200,7 @@
).set_fontsize(text_ratio)
sub_a.set_ylabel('Number of images').set_fontsize(text_ratio)
- sub_b.hist(b, nbins, normed=False,
+ b_hist = sub_b.hist(b, nbins, normed=False,
alpha=0.75, histtype='stepfilled')
sub_b.set_xlabel(
"b-edge (%.2f +/- %.2f $\AA$)" % (flex.mean(b),
@@ -205,7 +208,7 @@
).set_fontsize(text_ratio)
self.plt.setp(sub_b.get_yticklabels(), visible=False)
- sub_c.hist(c, nbins, normed=False,
+ c_hist = sub_c.hist(c, nbins, normed=False,
alpha=0.75, histtype='stepfilled')
sub_c.set_xlabel(
"c-edge (%.2f +/- %.2f $\AA$)" % (flex.mean(c),
@@ -213,6 +216,9 @@
).set_fontsize(text_ratio)
self.plt.setp(sub_c.get_yticklabels(), visible=False)
+ abc_hist_ylim = max(1.2*max([max(h[0]) for h in (a_hist, b_hist, c_hist)]), abc_hist_ylim)
+ sub_a.set_ylim([0, abc_hist_ylim])
+
if len(info_list) == 1:
sub_ab.hist2d(a, b, bins=100)
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-21 20:11:09
|
Revision: 25633
http://sourceforge.net/p/cctbx/code/25633
Author: idyoung
Date: 2016-10-21 20:11:07 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
Compromise amount of information displayed and readability in ucell display.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_plotter.py
Modified: trunk/xfel/ui/components/xfel_gui_plotter.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_plotter.py 2016-10-21 18:51:44 UTC (rev 25632)
+++ trunk/xfel/ui/components/xfel_gui_plotter.py 2016-10-21 20:11:07 UTC (rev 25633)
@@ -153,12 +153,12 @@
# Initialize figure
fig = plt.figure(figsize=(xsize, ysize))
gsp = GridSpec(3, 3)
- sub_a = fig.add_subplot(gsp[0])
- sub_b = fig.add_subplot(gsp[1], sharey=sub_a)
- sub_c = fig.add_subplot(gsp[2], sharey=sub_a)
- sub_ab = fig.add_subplot(gsp[3])
- sub_bc = fig.add_subplot(gsp[4])
- sub_ac = fig.add_subplot(gsp[5])
+ sub_ab = fig.add_subplot(gsp[0])
+ sub_bc = fig.add_subplot(gsp[1])
+ sub_ac = fig.add_subplot(gsp[2])
+ sub_a = fig.add_subplot(gsp[3])
+ sub_b = fig.add_subplot(gsp[4], sharey=sub_a)
+ sub_c = fig.add_subplot(gsp[5], sharey=sub_a)
sub_alpha = fig.add_subplot(gsp[6])
sub_beta = fig.add_subplot(gsp[7], sharey=sub_alpha)
sub_gamma = fig.add_subplot(gsp[8], sharey=sub_alpha)
@@ -237,7 +237,10 @@
sub_ac.set_ylabel("c axis").set_fontsize(text_ratio)
# plt.setp(sub_bc.get_yticklabels(), visible=False)
- for ax in (sub_a, sub_b, sub_c, sub_ab, sub_bc, sub_ac, sub_alpha, sub_beta, sub_gamma):
+ for ax in (sub_a, sub_b, sub_c, sub_alpha, sub_beta, sub_gamma):
+ ax.tick_params(axis='both', which='both', left='off', right='off')
+ ax.set_yticklabels([])
+ for ax in (sub_ab, sub_bc, sub_ac):
ax.tick_params(axis='both', which='both', bottom='off', top='off', left='off', right='off')
ax.set_xticklabels([])
ax.set_yticklabels([])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-21 18:51:47
|
Revision: 25632
http://sourceforge.net/p/cctbx/code/25632
Author: phyy-nx
Date: 2016-10-21 18:51:44 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
XFEL DB
Putative fix for get_trial_runs and get_trial_tags if the rungroup is not closed.
Modified Paths:
--------------
trunk/xfel/ui/db/xfel_db.py
Modified: trunk/xfel/ui/db/xfel_db.py
===================================================================
--- trunk/xfel/ui/db/xfel_db.py 2016-10-21 17:58:34 UTC (rev 25631)
+++ trunk/xfel/ui/db/xfel_db.py 2016-10-21 18:51:44 UTC (rev 25632)
@@ -336,7 +336,7 @@
def get_trial_runs(self, trial_id):
tag = self.params.experiment_tag
query = """SELECT run.id FROM `%s_run` run
- JOIN `%s_rungroup` rg ON run.run >= rg.startrun AND run.run <= rg.endrun
+ JOIN `%s_rungroup` rg ON run.run >= rg.startrun AND (run.run <= rg.endrun OR rg.endrun is NULL)
JOIN `%s_trial_rungroup` t_rg on t_rg.rungroup_id = rg.id
JOIN `%s_trial` trial ON trial.id = t_rg.trial_id
WHERE trial.id=%d AND rg.active=True
@@ -352,7 +352,7 @@
query = """SELECT tag.id FROM `%s_tag` tag
JOIN `%s_run_tag` rt ON rt.tag_id = tag.id
JOIN `%s_run` run ON run.id = rt.run_id
- JOIN `%s_rungroup` rg ON run.run >= rg.startrun AND run.run <= rg.endrun
+ JOIN `%s_rungroup` rg ON run.run >= rg.startrun AND (run.run <= rg.endrun OR rg.endrun is NULL)
JOIN `%s_trial_rungroup` t_rg ON t_rg.rungroup_id = rg.id
JOIN `%s_trial` trial ON trial.id = t_rg.trial_id
WHERE trial.id=%d AND rg.active=True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-21 17:58:36
|
Revision: 25631
http://sourceforge.net/p/cctbx/code/25631
Author: idyoung
Date: 2016-10-21 17:58:34 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
Enable resize unit cell plot.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_init.py
Modified: trunk/xfel/ui/components/xfel_gui_init.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 17:32:25 UTC (rev 25630)
+++ trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 17:58:34 UTC (rev 25631)
@@ -506,6 +506,7 @@
self.parent.run_window.unitcell_light.change_status('idle')
trial = self.parent.run_window.unitcell_tab.trial
tag_sets = self.parent.run_window.unitcell_tab.tag_sets
+ sizex, sizey = self.parent.run_window.unitcell_tab.unit_cell_panel.GetSize()
info_list = []
for tag_set in tag_sets:
@@ -522,8 +523,10 @@
info_list.append(info)
import xfel.ui.components.xfel_gui_plotter as pltr
plotter = pltr.PopUpCharts(interactive=False)
- self.parent.run_window.unitcell_tab.png = plotter.plot_uc_histogram(info_list=info_list,
- high_vis=self.parent.high_vis)
+ self.parent.run_window.unitcell_tab.png = plotter.plot_uc_histogram(
+ info_list=info_list,
+ xsize=(sizex-115)/82, ysize=(sizey-115)/82,
+ high_vis=self.parent.high_vis)
self.post_refresh()
self.parent.run_window.unitcell_light.change_status('on')
time.sleep(5)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-21 17:32:27
|
Revision: 25630
http://sourceforge.net/p/cctbx/code/25630
Author: idyoung
Date: 2016-10-21 17:32:25 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
Scale run stats display correctly with window resize.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_init.py
Modified: trunk/xfel/ui/components/xfel_gui_init.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 16:34:07 UTC (rev 25629)
+++ trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 17:32:25 UTC (rev 25630)
@@ -452,7 +452,9 @@
ratio_cutoff=self.parent.run_window.runstats_tab.ratio,
n_strong_cutoff=self.parent.run_window.runstats_tab.n_strong,
run_tags=self.run_tags,
- xsize=sizex/100, ysize=sizey/100, high_vis=self.parent.high_vis) # convert px to inches
+ xsize=(sizex-115)/82, ysize=(sizey-115)/82,
+ high_vis=self.parent.high_vis)
+ # convert px to inches with fudge factor for scaling inside borders
self.parent.run_window.runstats_tab.redraw_windows = True
def plot_stats_interactive(self):
@@ -1624,7 +1626,7 @@
self.runstats_panel = wx.Panel(self, size=(900, 120))
self.runstats_box = wx.StaticBox(self.runstats_panel, label='Run Statistics')
- self.runstats_sizer = wx.StaticBoxSizer(self.runstats_box, wx.VERTICAL | wx.EXPAND)
+ self.runstats_sizer = wx.StaticBoxSizer(self.runstats_box, wx.ALL | wx.EXPAND)
self.runstats_panel.SetSizer(self.runstats_sizer)
self.trial_number = gctr.ChoiceCtrl(self,
@@ -1700,9 +1702,9 @@
self.should_have_indexed_box_sizer.Add(self.should_have_indexed_results_sizer)
self.bottom_sizer.Add(self.should_have_indexed_box_sizer, flag=wx.EXPAND | wx.ALL)
- self.main_sizer.Add(self.runstats_panel, 2,
+ self.main_sizer.Add(self.runstats_panel, 1,
flag=wx.EXPAND | wx.ALL, border=10)
- self.main_sizer.Add(self.bottom_sizer, 1,
+ self.main_sizer.Add(self.bottom_sizer, 0,
flag=wx.EXPAND | wx.ALL, border=10)
# Bindings
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2016-10-21 16:34:10
|
Revision: 25629
http://sourceforge.net/p/cctbx/code/25629
Author: phyy-nx
Date: 2016-10-21 16:34:07 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
XFEL UI
Add zoom text button
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_init.py
Added Paths:
-----------
trunk/xfel/ui/components/icons/32x32/quick_restart.png
Added: trunk/xfel/ui/components/icons/32x32/quick_restart.png
===================================================================
(Binary files differ)
Index: trunk/xfel/ui/components/icons/32x32/quick_restart.png
===================================================================
--- trunk/xfel/ui/components/icons/32x32/quick_restart.png 2016-10-21 16:14:52 UTC (rev 25628)
+++ trunk/xfel/ui/components/icons/32x32/quick_restart.png 2016-10-21 16:34:07 UTC (rev 25629)
Property changes on: trunk/xfel/ui/components/icons/32x32/quick_restart.png
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/xfel/ui/components/xfel_gui_init.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 16:14:52 UTC (rev 25628)
+++ trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 16:34:07 UTC (rev 25629)
@@ -452,7 +452,7 @@
ratio_cutoff=self.parent.run_window.runstats_tab.ratio,
n_strong_cutoff=self.parent.run_window.runstats_tab.n_strong,
run_tags=self.run_tags,
- xsize=sizex/100, ysize=sizey/100) # convert px to inches
+ xsize=sizex/100, ysize=sizey/100, high_vis=self.parent.high_vis) # convert px to inches
self.parent.run_window.runstats_tab.redraw_windows = True
def plot_stats_interactive(self):
@@ -464,7 +464,7 @@
interactive=True,
ratio_cutoff=self.parent.run_window.runstats_tab.ratio,
n_strong_cutoff=self.parent.run_window.runstats_tab.n_strong,
- run_tags=self.run_tags)
+ run_tags=self.run_tags, high_vis=self.parent.high_vis)
# ----------------------------- Unit Cell Sentinel ----------------------------- #
@@ -520,7 +520,8 @@
info_list.append(info)
import xfel.ui.components.xfel_gui_plotter as pltr
plotter = pltr.PopUpCharts(interactive=False)
- self.parent.run_window.unitcell_tab.png = plotter.plot_uc_histogram(info_list=info_list)
+ self.parent.run_window.unitcell_tab.png = plotter.plot_uc_histogram(info_list=info_list,
+ high_vis=self.parent.high_vis)
self.post_refresh()
self.parent.run_window.unitcell_light.change_status('on')
time.sleep(5)
@@ -672,6 +673,8 @@
self.params = load_cached_settings()
self.db = None
+ self.high_vis = False
+
# Toolbar
self.toolbar = self.CreateToolBar(wx.TB_TEXT)
self.tb_btn_quit = self.toolbar.AddLabelTool(wx.ID_EXIT,
@@ -682,7 +685,7 @@
self.toolbar.AddSeparator()
self.tb_btn_watch_new_runs = self.toolbar.AddLabelTool(wx.ID_ANY,
label='Watch for new runs',
- bitmap=wx.Bitmap('{}/32x32/search.png'.format(icons)),
+ bitmap=wx.Bitmap('{}/32x32/quick_restart.png'.format(icons)),
shortHelp='Watch for new runs',
longHelp='Watch for new runs')
self.tb_btn_auto_submit = self.toolbar.AddLabelTool(wx.ID_ANY,
@@ -702,6 +705,11 @@
bitmap=wx.Bitmap('{}/32x32/settings.png'.format(icons)),
shortHelp='Settings',
longHelp='Database, user and experiment settings')
+ self.tb_btn_zoom = self.toolbar.AddLabelTool(wx.ID_ANY,
+ label='Large text',
+ bitmap=wx.Bitmap('{}/32x32/search.png'.format(icons)),
+ shortHelp='Change text size',
+ longHelp='Change text size for plots')
self.toolbar.Realize()
@@ -735,6 +743,7 @@
self.Bind(wx.EVT_TOOL, self.onAutoSubmit, self.tb_btn_auto_submit)
self.Bind(wx.EVT_TOOL, self.onCalibration, self.tb_btn_calibrate)
self.Bind(wx.EVT_TOOL, self.onSettings, self.tb_btn_settings)
+ self.Bind(wx.EVT_TOOL, self.onZoom, self.tb_btn_zoom)
self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.onTabChange,
self.run_window.main_nbook)
self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self.onLeavingTab,
@@ -769,7 +778,7 @@
if block:
self.run_sentinel.join()
self.run_window.run_light.change_status('off')
- self.toolbar.SetToolNormalBitmap(self.tb_btn_watch_new_runs.Id, wx.Bitmap('{}/32x32/search.png'.format(icons)))
+ self.toolbar.SetToolNormalBitmap(self.tb_btn_watch_new_runs.Id, wx.Bitmap('{}/32x32/quick_restart.png'.format(icons)))
def start_job_monitor(self):
self.job_monitor = JobMonitor(self, active=True)
@@ -856,6 +865,9 @@
self.title = 'CCTBX.XFEL | {} | {}'.format(self.params.experiment_tag,
self.params.experiment)
+ def onZoom(self, e):
+ self.high_vis = not self.high_vis
+
def onCalibration(self, e):
calib_dlg = dlg.CalibrationDialog(self, db=self.db)
calib_dlg.Fit()
@@ -1396,7 +1408,7 @@
else:
plotter = pltr.PopUpCharts()
- plotter.plot_uc_histogram(info_list=[info])
+ plotter.plot_uc_histogram(info_list=[info], high_vis=self.main.high_vis)
plotter.plot_uc_3Dplot(info=info)
plotter.plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <id...@us...> - 2016-10-21 16:14:54
|
Revision: 25628
http://sourceforge.net/p/cctbx/code/25628
Author: idyoung
Date: 2016-10-21 16:14:52 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
Remove debugging print statement.
Modified Paths:
--------------
trunk/xfel/ui/components/xfel_gui_init.py
Modified: trunk/xfel/ui/components/xfel_gui_init.py
===================================================================
--- trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 08:01:42 UTC (rev 25627)
+++ trunk/xfel/ui/components/xfel_gui_init.py 2016-10-21 16:14:52 UTC (rev 25628)
@@ -1732,7 +1732,6 @@
if len(new_trials) > 0:
self.trial_number.ctr.Clear()
self.all_trials = [None] + all_db_trials
- print self.all_trials
for trial in self.all_trials:
if trial is None:
entry = 'None'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mge...@us...> - 2016-10-21 08:01:45
|
Revision: 25627
http://sourceforge.net/p/cctbx/code/25627
Author: mgerstel
Date: 2016-10-21 08:01:42 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
Not all publications have pages numbers. Should fix dials documentation build
Modified Paths:
--------------
trunk/libtbx/sphinx/pubmed.py
Modified: trunk/libtbx/sphinx/pubmed.py
===================================================================
--- trunk/libtbx/sphinx/pubmed.py 2016-10-21 06:26:39 UTC (rev 25626)
+++ trunk/libtbx/sphinx/pubmed.py 2016-10-21 08:01:42 UTC (rev 25627)
@@ -62,11 +62,12 @@
journal = article["Journal"]
journal_text = "| *%s*" %(journal["ISOAbbreviation"])
issue = journal["JournalIssue"]
- if issue.has_key("Volume"):
- journal_text += " **%s**, %s" %(
- issue["Volume"], article["Pagination"]["MedlinePgn"] )
+ if 'Volume' in issue:
+ journal_text += " **%s**" % issue['Volume']
+ if 'Pagination' in article:
+ journal_text += ", %s" % article["Pagination"]["MedlinePgn"]
date = issue["PubDate"]
- if date.has_key("Month"):
+ if 'Month' in date:
journal_text += " (%s %s %s)."%(date.get("Day",1), date["Month"], date["Year"])
else:
journal_text += " (%s)"%(date["Year"])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|