Refactoring #1700

Feature #284: === Fit ===

Implement FitSuite::printParameters (or ::parametersToString.)

Added by wuttke about 3 years ago. Updated about 3 years ago.

Status:RejectedStart date:01 Dec 2016
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Now GISASSimulation::printParameters() reports parameter names which are different from what FitSuite has.

# example step4_sample_builder.py

# GISASSimulation::printParameters()
'/GISASSimulation/Instrument/Beam/Intensity':0 
'/GISASSimulation/Instrument/Beam/Wavelength':0.1 
'/GISASSimulation/Instrument/Beam/InclinationAngle':0.00349066 
'/GISASSimulation/Instrument/Beam/AzimuthalAngle':0 
'/GISASSimulation/SampleBuilder/length_parameter':5 
'/GISASSimulation/SampleBuilder/decay_length':10

# attempt to add fit parameter with the name "/GISASSimulation/SampleBuilder/length_parameter" leads to exception,
# saying that following list is available:
'/FitSuiteObjects/FitObject/GISASSimulation/Instrument/Beam/Intensity'
'/FitSuiteObjects/FitObject/GISASSimulation/Instrument/Beam/Wavelength'
'/FitSuiteObjects/FitObject/GISASSimulation/Instrument/Beam/InclinationAngle'
'/FitSuiteObjects/FitObject/GISASSimulation/Instrument/Beam/AzimuthalAngle'
'/FitSuiteObjects/FitObject/GISASSimulation/SampleBuilder/length_parameter'
'/FitSuiteObjects/FitObject/GISASSimulation/SampleBuilder/decay_length'

Do we need all these prefixes?

History

#1 Updated by pospelov about 3 years ago

  • Status changed from New to Rejected

Made it more consistent within #1730 and #1478. Now all objects, including FitSuite, have methods ::treeToString() and ::parametersToString(), where parametersToString() contains flat representation of ::treeToString. Unnecessary prefix "FitSuiteObjects" have gone. Other prefixes, to my opinion, should stay.

For example, in the example SimultaneousFitOfTwoDataset.py, following output will be triggered


>>> print(fit_suite.treeToString())

FitSuite
....FitObject0
........GISASSimulation
............Instrument
................Beam ('Intensity':0 'Wavelength':0.1 'InclinationAngle':0.00174533 'AzimuthalAngle':0)
................SphericalDetector
............MultiLayer ('CrossCorrelationLength':0)
................Layer0 ('Thickness':0)
....................ParticleLayout
........................Particle ('PositionX':0 'PositionY':0 'PositionZ':0)
............................HemiEllipsoid ('RadiusX':4 'RadiusY':4 'Height':4)
................LayerInterface
................Layer1 ('Thickness':0)
....FitObject1
........GISASSimulation
............Instrument
................Beam ('Intensity':0 'Wavelength':0.1 'InclinationAngle':0.00698132 'AzimuthalAngle':0)
................SphericalDetector
............MultiLayer ('CrossCorrelationLength':0)
................Layer0 ('Thickness':0)
....................ParticleLayout
........................Particle ('PositionX':0 'PositionY':0 'PositionZ':0)
............................HemiEllipsoid ('RadiusX':4 'RadiusY':4 'Height':4)
................LayerInterface
................Layer1 ('Thickness':0)

print(fit_suite.parametersToString())

'/FitSuite/FitObject0/GISASSimulation/Instrument/Beam/Intensity':0
'/FitSuite/FitObject0/GISASSimulation/Instrument/Beam/Wavelength':0.1
'/FitSuite/FitObject0/GISASSimulation/Instrument/Beam/InclinationAngle':0.00174533
'/FitSuite/FitObject0/GISASSimulation/Instrument/Beam/AzimuthalAngle':0
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/CrossCorrelationLength':0
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer0/Thickness':0
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/PositionX':0
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/PositionY':0
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/PositionZ':0
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/HemiEllipsoid/RadiusX':4
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/HemiEllipsoid/RadiusY':4
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/HemiEllipsoid/Height':4
'/FitSuite/FitObject0/GISASSimulation/MultiLayer/Layer1/Thickness':0
'/FitSuite/FitObject1/GISASSimulation/Instrument/Beam/Intensity':0
'/FitSuite/FitObject1/GISASSimulation/Instrument/Beam/Wavelength':0.1
'/FitSuite/FitObject1/GISASSimulation/Instrument/Beam/InclinationAngle':0.00698132
'/FitSuite/FitObject1/GISASSimulation/Instrument/Beam/AzimuthalAngle':0
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/CrossCorrelationLength':0
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer0/Thickness':0
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/PositionX':0
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/PositionY':0
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/PositionZ':0
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/HemiEllipsoid/RadiusX':4
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/HemiEllipsoid/RadiusY':4
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer0/ParticleLayout/Particle/HemiEllipsoid/Height':4
'/FitSuite/FitObject1/GISASSimulation/MultiLayer/Layer1/Thickness':0

In the case of more complex fit setup, like fitting of scale and background like in FitScaleAndShift example, more parameters will appear under "/FitSuite/FitObject1" branch.

So rejecting this issue, since subject was already resolved.

Also available in: Atom PDF