<commit_before>#!/usr/bin/env python

import sys, h5py
import numpy as np
import scipy.ndimage as ndimage
import matplotlib
import spimage
import argparse

parser = argparse.ArgumentParser(prog='domosaic.py', description='Create a mosaic of all results and compute R factors.')
parser.add_argument('-c', '--coacsfile',  metavar='COACSFILE', type=str, default='invicosa72orig.mat', help='COACS results file')
parser.add_argument('-a', '--coacsphase',  metavar='COACSPHASE', type=str, default='vs72/phasing.h5', help='Phasing results for coacsed patterns')
parser.add_argument('-b', '--origphase', metavar='ORIGPHASE', type=str, default='rs72f2/phasing.h5', help='Phasing result for non-coacsed patterns')
parser.add_argument('-r', '--dor', metavar='RMODE', type=str, default='a', help='Compute R factors for coacs (a) or orig (b)')
args = parser.parse_args()


with h5py.File(args.coacsfile, 'r') as f:
    intensities = f['r3b'][:]
    f2 = np.reshape(f['f2'][:],(256,256))
    strucfactors = np.sqrt(np.fft.fftshift(intensities * f2))
    vs = np.sqrt(np.clip(f['vs'], 0, 1000))

f1 = h5py.File(args.coacsphase, 'r+')
images1 = f1['super_images']

f2 = h5py.File(args.origphase, 'r+')
images2 = f2['super_images']

M = 50
mosaic = np.ones((319,314), dtype=np.complex128) * 0.035
Rs = np.zeros((M))
Rsvs = np.zeros((M))

if args.rmode == 'a':
    rf = f1<commit_msg>Variable name issue<commit_after>#!/usr/bin/env python

import sys, h5py
import numpy as np
import scipy.ndimage as ndimage
import matplotlib
import spimage
import argparse

parser = argparse.ArgumentParser(prog='domosaic.py', description='Create a mosaic of all results and compute R factors.')
parser.add_argument('-c', '--coacsfile',  metavar='COACSFILE', type=str, default='invicosa72orig.mat', help='COACS results file')
parser.add_argument('-a', '--coacsphase',  metavar='COACSPHASE', type=str, default='vs72/phasing.h5', help='Phasing results for coacsed patterns')
parser.add_argument('-b', '--origphase', metavar='ORIGPHASE', type=str, default='rs72f2/phasing.h5', help='Phasing result for non-coacsed patterns')
parser.add_argument('-r', '--dor', metavar='DOR', type=str, default='a', help='Compute R factors for coacs (a) or orig (b)')
args = parser.parse_args()


with h5py.File(args.coacsfile, 'r') as f:
    intensities = f['r3b'][:]
    f2 = np.reshape(f['f2'][:],(256,256))
    strucfactors = np.sqrt(np.fft.fftshift(intensities * f2))
    vs = np.sqrt(np.clip(f['vs'], 0, 1000))

f1 = h5py.File(args.coacsphase, 'r+')
images1 = f1['super_images']

f2 = h5py.File(args.origphase, 'r+')
images2 = f2['super_images']

M = 50
mosaic = np.ones((319,314), dtype=np.complex128) * 0.035
Rs = np.zeros((M))
Rsvs = np.zeros((M))

if args.dor == 'a':
    rf = f1
{'fraction_non_alphanumeric': 0.182882223847842, 'fraction_numerical': 0.036576444769568395, 'mean_word_length': 5.435294117647059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1293446', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1053, 'n_words': 233}