Commit c0e5ada7 authored by myron's avatar myron
Browse files

added rafaella tests

parent 6635dbbb
......@@ -13,7 +13,7 @@ test:
only:
- cdi
tags:
- scisoft10
- scisoft11
before_script:
- unset HTTP_PROXY
- unset HTTPS_PROXY
......@@ -31,11 +31,13 @@ test:
script:
- cd nonregressions/xes
- - /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python xes_analysis.py > output
- /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python xes_analysis.py > output
- cd ../xrs_raman
- /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python non_reg_testing_XRS.py > output1
- /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python non_reg_testing_XRS_small.py > output2
- /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python non_reg_testing_XRS_raman_extraction.py > output3
- cd ../volumes/test1
- python test.py > output
- deactivate
after_script:
- pwd
......
create_rois_galaxies :
expdata : "/data/scisofttmp/mirone/raffaela/kapton_00001_01.nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07" ##-- this pointsto, inside a hdf5 file, a stack of images z,y,x
filter_path : "/data/scisofttmp/mirone/raffaela/mymask.h5:/mymask" # the target destination for rois
roiaddress : "results/myrois.h5:/ROIS" # the target destination for rois
\ No newline at end of file
loadscan_2Dimages_galaxies_foilscan :
roiaddress : "/data/scisofttmp/mirone/raffaela/myrois.h5:/ROIS" # the same given in create_rois
expdata : "/data/scisofttmp/mirone/raffaela/kapton_00001_01.nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07"
signalfile : "results/response.h5" # Target file for the signals
isolateSpot : 7
superR_fit_responses :
foil_scan_address : "results/response.h5:/Scan0"
nref : 2 # the number of subdivision per pixel dimension used to
# represent the optical response function at higher resolution
niter_optical : 100 # the number of iterations used in the optimisation of the optical
# response
beta_optical : 0.1 # The L1 norm factor in the regularisation
# term for the optical functions
pixel_dim : 1 # The pixel response function is represented with a
# pixel_dim**2 array
niter_pixel : 2 # The number of iterations in the pixel response optimisation
# phase. A negative number stands for ISTA, positive for FISTA
beta_pixel : 1000.0 # L1 factor for the pixel response regularisation
## The used trajectories are always written whith the calculated response
## They can be reloaded and used as initialization(and freezed with do_refine_trajectory : 0 )
## Uncomment the following line if you want to reload a set of trajectories
## without this options trajectories are initialised from the spots drifts
##
# reload_trajectories_file : "results/response.h5"
######
## The method first find an estimation of the foil scan trajectory on each roi
## then, based on this, obtain a fit of the optical response function
## assuming a flat pixel response. Finally the pixel response is optimised
##
## There is a final phase where a global optimisation
## is done in niter_global steps.
##
## Each step is composed of optical response fit, followed by a pixel response fit.
## If do_refine_trajectory is different from zero, the trajectory is reoptimised at each step
##
niter_global : 20
## if do_refine_trajectory=1 the start and end point of the trajectory are free
## if =2 then the start and end point are forced to a trajectory which is obtained
## from a reference scan : the foil scan may be short, then one can use the scan of
## an object to get another one : key *trajectory_reference_scan_address*
##
do_refine_trajectory : 1
## optional: only if do_refine_trajectory = 2
trajectory_reference_scansequence_address : "results/demo_newrois.h5:/ROI_FOIL/images/scans/"
trajectory_threshold : 0.1
## if the pixel response function is forced to be symmetrical
simmetrizza : 1
## where the found responses are written
target_file : "results/responses_bis.h5:/"
filter_rois : 0
\ No newline at end of file
superR_recreate_rois :
### we have calculated the responses in responsefilename
### and we want to enlarge the scan by a margin of 3 times
### the original scan on the right and on the left
### ( so for a total of a 7 expansion factor )
responsefilename : "results/responses_bis.h5:/"
nex : 1
## the old scan covered by the old rois
old_scan_address : "results/response.h5:/Scan0"
## where new rois and bnew scan are written
target_filename : "results/newreponse.h5:newrep/"
filter_rois : 0
filter_path : "/data/scisofttmp/mirone/raffaela/mymask.h5:/mymask" # the target destination for r ois
loadscan_2Dimages_galaxies :
# roiaddress : "/data/scisofttmp/mirone/raffaela/myrois.h5:/ROIS" # the same given in create_rois
roiaddress : "results/newreponse.h5:/newrep" # the same given in create_rois
expdata : "/data/scisofttmp/mirone/raffaela/GS9_dataGalaxies/GS9_%05d_01.nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07"
scan_interval : [1,257] # from 1 to 256 included
Ydim : 16
Zdim : 16
Edim : 19
signalfile : "results/extracted.h5" # Target file for the signals
superR_scal_deltaXimages :
sample_address : results/extracted.h5:/E{iE}
delta_address : results/newreponse.h5:/newrep/Scan0
nbin : 1
# optional_solution : results/SEPT_vol.h5:/VOL1_423_548/Volume
target_address : results/scalprods.h5:/VOL_E{iE}/scal_prods
superR_getVolume :
scalprods_address : results/scalprods.h5:/VOL_E{iE}/scal_prods
target_address : results/volumes.h5:/VOL_E{iE}/Volume
niter : 1000
beta : 0.05
eps : 2e-06
debin : [1, 1]
import glob
import os
import h5py
import numpy as np
if(1):
inputs = glob.glob("0*yaml")
inputs.sort()
for fn in inputs:
if fn != "01_create_rois_galaxies.yaml":
res = os.system("mpirun -n 1 XRS_swissknife %s" % fn )
assert(res==0)
templates_list = [ open("06_superR_scalarProducts.yaml_template").read(),
open("07_superR_getVolume.yaml_template") .read()
]
for iE in range(16) :
for template in templates_list :
s = template.format(iE=iE)
open("input.par","w").write(s)
res = os.system("mpirun -n 1 XRS_swissknife input.par" )
assert(res==0)
f = h5py.File("results/volumes.h5", "r")
stack = []
for i in range(16):
stack.append( f["VOL_E%d/Volume"%i][:,:,45:65] )
h5py.File("results/volumes_all_energies.h5","w")["volume"] = np.array(stack)
ref_stack = h5py.File("/data/scisofttmp/mirone/raffaela/volumes_all_energies_reference.h5","r")["volume"][()]
assert (np.abs( ref_stack- stack ).max()<1.0 ) , "difference between stack and reference stack too big"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment