Пример #1
0
static int write_stream_reflections_2_3(FILE *fh, RefList *list,
                                        struct image *image)
{
	Reflection *refl;
	RefListIterator *iter;

	fprintf(fh, "   h    k    l          I   sigma(I)       "
	            "peak background  fs/px  ss/px panel\n");

	for ( refl = first_refl(list, &iter);
	      refl != NULL;
	      refl = next_refl(refl, iter) )
	{

		signed int h, k, l;
		double intensity, esd_i, pk, bg;
		double fs, ss;
		double write_fs, write_ss;
		struct panel *p = NULL;

		get_indices(refl, &h, &k, &l);
		get_detector_pos(refl, &fs, &ss);
		intensity = get_intensity(refl);
		esd_i = get_esd_intensity(refl);
		pk = get_peak(refl);
		bg = get_mean_bg(refl);

		/* Reflections with redundancy = 0 are not written */
		if ( get_redundancy(refl) == 0 ) continue;

		p = find_panel(image->det,fs,ss);
		if ( p == NULL ) {
			ERROR("Panel not found\n");
			return 1;
		}

		write_fs = fs-p->min_fs+p->orig_min_fs;
		write_ss = ss-p->min_ss+p->orig_min_ss;

		fprintf(fh,
                          "%4i %4i %4i %10.2f %10.2f %10.2f %10.2f "
                          "%6.1f %6.1f %s\n",
                           h, k, l, intensity, esd_i, pk, bg,
                           write_fs, write_ss, p->name);

	}
	return 0;
}
Пример #2
0
static int write_peaks_2_3(struct image *image, FILE *ofh)
{
	int i;

	fprintf(ofh, PEAK_LIST_START_MARKER"\n");
	fprintf(ofh, "  fs/px   ss/px (1/d)/nm^-1   Intensity  Panel\n");

	for ( i=0; i<image_feature_count(image->features); i++ ) {

		struct imagefeature *f;
		struct rvec r;
		double q;
		struct panel *p;
		double write_fs, write_ss;

		f = image_get_feature(image->features, i);
		if ( f == NULL ) continue;

		r = get_q(image, f->fs, f->ss, NULL, 1.0/image->lambda);
		q = modulus(r.u, r.v, r.w);

		p = find_panel(image->det, f->fs, f->ss);
		if ( p == NULL ) {
			ERROR("Panel not found\n");
			return 1;
		}

		/* Convert coordinates to match arrangement of panels in HDF5
		 * file */
		write_fs = f->fs - p->min_fs + p->orig_min_fs;
		write_ss = f->ss - p->min_ss + p->orig_min_ss;

		fprintf(ofh, "%7.2f %7.2f %10.2f  %10.2f   %s\n",
		        write_fs, write_ss, q/1.0e9, f->intensity, p->name);

	}

	fprintf(ofh, PEAK_LIST_END_MARKER"\n");
	return 0;
}
// static
void LLPanelDirFindAllInterface::search(LLFloaterDirectory* inst,
										const LLFloaterSearch::SearchQuery& search, bool show)
{
	bool secondlife(gHippoGridManager->getConnectedGrid()->isSecondLife());
	LLPanelDirFind* find_panel(secondlife ? inst->findChild<LLPanelDirFind>("web_panel") : sFindAll);
	LLPanel* panel(find_panel);
	if (secondlife)
		LLFloaterSearch::search(search, find_panel->mWebBrowser);
	else
	{
		bool has_url(!getSearchUrl().empty());
		if (has_url) find_panel->search(search.query);
		if (sFindAllOld)
		{
			sFindAllOld->search(search.query);
			if (!has_url) panel = sFindAllOld;
		}
	}
	if (show && panel)
	{
		inst->findChild<LLTabContainer>("Directory Tabs")->selectTabPanel(panel);
		panel->setFocus(true);
	}
}