<commit_before>#ifndef DIALS_SCRATCH_LUI_HELPER_H
#define DIALS_SCRATCH_LUI_HELPER_H
#include <iostream>
#include <scitbx/vec2.h>
#include <scitbx/array_family/flex_types.h>
namespace dials { namespace scratch {
  using scitbx::af::flex_int;
  using scitbx::af::flex_double;
  using scitbx::vec2;

  int hello_tst() {
    std::cout << "Hello world (testing)\n";
    int a=5;
    return a;
  }

  flex_int tst_01(flex_int & data2d) {
    std::size_t ncol=data2d.accessor().all()[1];
    std::size_t nrow=data2d.accessor().all()[0];
    flex_int data2dtmp(data2d);
    for (int row = 0; row<=nrow-1;row++) {
      for (int col = 0; col<=ncol-1;col++) {
        data2dtmp(row,col)=row*nrow+col;

      }
    }

    return data2dtmp;

  }

  vec2<double> raw_2d_cut(flex_double & data2d, flex_int & mask2d,
      flex_double & background2d) {

      //std::size_t ncol=data2d.accessor().all()[1];
      //std::size_t nrow=data2d.accessor().all()[0];
      vec2<double> integr_data(0,1);
      /*
      for (int row = 0; row<=nrow-1;row++) {
        for (int col = 0; col<=ncol-1;col++) {
          data2dtmp(row,col)=row*nrow+col;

        }
      }
      */
      integr_data[0]=5;   // intensity
      integr_data[1]=15;  // intensity variance
      return integr_data;

    }


}}
/*

    import numpy
    n_col = numpy.size(data2d[0:1, :])
    n_row = numpy.size(data2d[:, 0:1])

    #print data2d
    i_tot = 0
    npix_bkgr = 0
    npix_mask = 0
    cont = 0
    tot_bkgr = 0
    for col in range(n_col):
        for row in range(n_row):<commit_msg>intermediate step in the scratch area<commit_after>#ifndef DIALS_SCRATCH_LUI_HELPER_H
#define DIALS_SCRATCH_LUI_HELPER_H
#include <iostream>
#include <scitbx/vec2.h>
#include <scitbx/array_family/flex_types.h>
namespace dials { namespace scratch {
  using scitbx::af::flex_int;
  using scitbx::af::flex_double;
  using scitbx::vec2;

  int hello_tst() {
    std::cout << "Hello world (testing)\n";
    int a=5;
    return a;
  }

  flex_int tst_01(flex_int & data2d) {
    std::size_t ncol=data2d.accessor().all()[1];
    std::size_t nrow=data2d.accessor().all()[0];
    flex_int data2dtmp(data2d);
    for (int row = 0; row<=nrow-1;row++) {
      for (int col = 0; col<=ncol-1;col++) {
        data2dtmp(row,col)=row*nrow+col;

      }
    }

    return data2dtmp;

  }

  vec2<double> raw_2d_cut(flex_double & data2d, flex_int & mask2d,
      flex_double & background2d) {
      double itnst=0,sigm=0;
      std::size_t ncol=data2d.accessor().all()[1];
      std::size_t nrow=data2d.accessor().all()[0];
      vec2<double> integr_data(0,1);

      for (int row = 0; row<=nrow-1;row++) {
        for (int col = 0; col<=ncol-1;col++) {
          itnst = itnst + data2d(row,col);
        }
      }

      integr_data[0]=itnst;        // intensity
      integr_data[1]=itnst*itnst;  // intensity variance
      return integr_data;

    }


}}
/*

    import numpy
    n_col = numpy.size(data2d[0:1, :])
    n_row = numpy.size(data2d[:, 0:1])

    #print data2d
    i_tot = 0
    npix_bkgr = 0
    npix_mask = 0
    cont = 0
    tot_bkgr = 0
    for col in range(n_col):
        for row in range(n_row):
{'fraction_non_alphanumeric': 0.15233259282767375, 'fraction_numerical': 0.03268803554427166, 'mean_word_length': 2.820606060606061, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '913523', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1280, 'n_words': 228}