Commit 2708e285 authored by Romain Pacanowski's avatar Romain Pacanowski

Added the missing files for several rational fitting tests.

parent 302c0464
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ALTA FUNC HEADER
#CMD --L2 0.183918 --Linf 0.499867 --fitter librational_fitter_quadprog.dylib --input Test_Smooth_Step_1d_Asymetric_vs.txt --min-np 1 --min-nq 1 --np 20 --nq 20 --output Test_Smooth_Step_1d_Asymetric_vs.func
#DIM 1 1
#PARAM_IN UNKNOWN_INPUT
#ALTA HEADER END
#FUNC rational_function
#MIN 1.0000000000000000208166817117216851329430937767028808593750000000e-03
#MAX 1.0000000000000000000000000000000000000000000000000000000000000000e+00
#NP 5
#NQ 5
0 -4.8547834151256288523490489694722782587632536888122558593750000000e-03
1 -2.9115809924854196832910702141816727817058563232421875000000000000e-01
2 -1.1543984970214502538965462008491158485412597656250000000000000000e+00
3 -2.8111621083076978599990525253815576434135437011718750000000000000e+00
4 5.0380032212042866746060099103488028049468994140625000000000000000e+00
0 1.0000000000000000000000000000000000000000000000000000000000000000e+00
1 1.0583012711311871711927778960671275854110717773437500000000000000e+01
2 4.0733031020268896327252150513231754302978515625000000000000000000e+01
3 6.3564091321502282028177432948723435401916503906250000000000000000e+01
4 3.9430052080167577344127494143322110176086425781250000000000000000e+01
#ALTA FUNC HEADER
#CMD --L2 0.0322845 --Linf 0.0495705 --dt 0.05 --fitter librational_fitter_quadprog.dylib --input /Users/pac/alta-current-master/sources/tests/Test_Smooth_Step_1d_no_vs.txt --min-np 1 --min-nq 1 --np 20 --nq 20 --output Test_Smooth_Step_1d_no_vs.func
#DIM 1 1
#PARAM_IN UNKNOWN_INPUT
#ALTA HEADER END
#FUNC rational_function
#MIN 1.0000000000000000208166817117216851329430937767028808593750000000e-03
#MAX 1.0000000000000000000000000000000000000000000000000000000000000000e+00
#NP 5
#NQ 5
0 3.6001191649999909893953287109980010427534580230712890625000000000e-02
1 5.5117072595247951216634874072042293846607208251953125000000000000e-01
2 1.4479374252816765711315838416339829564094543457031250000000000000e+00
3 -1.4101195231668063101437837758567184209823608398437500000000000000e+01
4 1.2183327405403781895643078314606100320816040039062500000000000000e+01
0 1.0000000000000000000000000000000000000000000000000000000000000000e+00
1 7.8365884509725631801302370149642229080200195312500000000000000000e+00
2 1.7773174356294664022470897180028259754180908203125000000000000000e+01
3 -4.9959574767620464896822340961080044507980346679687500000000000000e+00
4 1.0003308549786389392011187737807631492614746093750000000000000000e+01
# ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
# Copyright (C) 2017, CNRS
# This file is part of ALTA.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# author: Romain Pacanowski: romain.pacanowski@institutoptique.fr
#
##############################################################################################
# Construct a dictionary that contains the following keys (string type)
# L1, LInf,
# TODO: CHECK FOR CONVERSION ERROR ?
# ##############################################################################################
def read_brdf_fit_file( brdf_fit_file ):
file_handle = open(brdf_fit_file, 'r')
row = file_handle.readlines();
fit_info = {}
for line in row:
#print 'CURRENT:' + line + "____"
#print 'Current print_info' + str(fit_info)
if line.startswith("#CMD"):
#TODO: get the L2 and LINF norm
tokens = line.split(' ')
if '--L2' in tokens:
l2_index = tokens.index('--L2')
fit_info['--L2'] = float(tokens[l2_index+1])
#end if
if '--Linf' in tokens:
linf_index = tokens.index('--Linf')
fit_info['--Linf'] = float(tokens[linf_index+1])
#end if
elif line.startswith("#FUNC"):
func_token, func_name = line.split(' ')
fit_info[func_name.strip('\n')] = True
elif (line != "\n" and not(line.startswith("#")) ):
token, token_value = line.split()
if fit_info.has_key(token):
fit_info[token] += [float(token_value.strip('\n'))]
else:
fit_info[token] = [float(token_value.strip('\n'))]
#end_if_else
#end_if_else
#end_for
return fit_info
#end_def
\ No newline at end of file
Markdown is supported
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