Last modified: December 2023

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/box1d.html
AHELP for CIAO 4.16 Sherpa

box1d

Context: models

Synopsis

One-dimensional box function.

Syntax

box1d

Description

The model is flat between xlow and xhi (both limits are inclusive), where it is set to the ampl parameter. Outside this range the model is zero.


Example

>>> create_model_component("box1d", "mdl")
>>> print(mdl)

Create a component of the box1d model and display its default parameters. The output is:

mdl
   Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   mdl.xlow     thawed            0 -3.40282e+38  3.40282e+38           
   mdl.xhi      thawed            1 -3.40282e+38  3.40282e+38           
   mdl.ampl     thawed            1 -3.40282e+38  3.40282e+38           

ATTRIBUTES

The attributes for this object are:

Attribute Definition
xlow Coordinate of the lower cut-off.
xhi Coordinate of the upper cut-off.
ampl The amplitude of the box.

Notes

The functional form of the model for points is:

f(x) = ampl if xlow <= x <= xhi
     = 0       otherwise

and for an integrated grid it is:

f(lo,hi) = ampl         if lo >= xlow and hi <= xhi
         = 0            if hi <= xlow or lo >= xhi
         = ampl * g     where g is the fraction of lo,hi
                        that falls within xlo,xhi

This behavior is different to how the amplitude is handled in other models, such as const1d .

Changes in CIAO

Changed in CIAO 4.16

The default value for the xhi parameter has been changed from 0 to 1, and the range of ampl now matches xlow and xhi rather than being set to -1 to 1.


Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

models
box2d, const1d, delta1d, scale1d, stephi1d, steplo1d