Oasys.THIS.Curve class

Constants

Curve.AFTER

Insertion of curve data option

Curve.BEFORE

Insertion of curve data option

Properties

property Curve.average(read only): float

Curve average value

property Curve.colour: integer

The Colour of the curve

property Curve.directory: string

Directory the curve came from

property Curve.entity_id: integer

The ID of the entity that the curve was generated from

property Curve.entity_type: integer

The Entity type that the curve was generated from

property Curve.file: string

Filename the curve came from

property Curve.hic(read only): float

Curve HIC value - returns 0.0 if the HIC hasn’t been calculated

property Curve.hic_tmax(read only): float

End of HIC time windows - returns 0.0 if the HIC hasn’t been calculated

property Curve.hic_tmin(read only): float

Start of HIC time windows - returns 0.0 if the HIC hasn’t been calculated

property Curve.hicd(read only): float

Curve HIC(d) value - returns 0.0 if the HIC(d) hasn’t been calculated

property Curve.hicd_tmax(read only): float

End of HIC(d) time windows - returns 0.0 if the HIC(d) hasn’t been calculated

property Curve.hicd_tmin(read only): float

Start of HIC(d) time windows - returns 0.0 if the HIC(d) hasn’t been calculated

property Curve.id(read only): integer

Curve ID

property Curve.is_null(read only): integer

Returns 1 if the curve is None

property Curve.label: string

Curve label

property Curve.model: integer

The ID of the model that a curve was read from

property Curve.npoints(read only): integer

Number of curve points

property Curve.regr_rsq(read only): float

Pearson’s R^2 value for regression curve, returns 0.0 if the curve has not come from the regression operation

property Curve.regr_sdgrad(read only): float

Standard deviation of the linear regression gradient value, returns 0.0 if the curve has not come from linear regression

property Curve.regr_sdicpt(read only): float

Standard deviation of the linear regression intercept value, returns 0.0 if the curve has not come from linear regression

property Curve.regr_sdyx(read only): float

Standard deviation of the linear regression values ‘y = bx + c’, returns 0.0 if the curve has not come from linear regression

property Curve.rms(read only): float

Curve RMS value

property Curve.style: integer

The LineStyle used to draw the curve

property Curve.symbol: integer

The Symbol style for a curve

property Curve.tag: string

Curve tag. If a FAST-TCF script is running then this is the FAST-TCF tag

property Curve.title: string

Curve title

property Curve.tms(read only): float

3ms Clip value - returns 0.0 if the 3ms Clip value hasn’t been calculated

property Curve.tms_tmax(read only): float

End of 3ms clip time windows - returns 0.0 if the 3ms Clip hasn’t been calculated

property Curve.tms_tmin(read only): float

Start of 3ms clip time windows - returns 0.0 if the 3ms Clip hasn’t been calculated

property Curve.unit_system: integer

The Curve UnitSystem

property Curve.width: integer

The LineWidth used to draw the curve

property Curve.x_at_ymax(read only): float

X axis value at the Y axis maximum

property Curve.x_at_ymin(read only): float

X axis value at the Y axis minimum

property Curve.x_axis_label: string

Curve X axis label

property Curve.x_axis_unit: integer

The X axis Units

property Curve.xmax(read only): float

X axis maximum value

property Curve.xmin(read only): float

X axis minimum value

property Curve.y_axis_label: string

Curve Y axis label

property Curve.y_axis_unit: integer

The Y axis Units

property Curve.ymax(read only): float

Y axis maximum value

property Curve.ymin(read only): float

Y axis minimum value

Constructor

classmethod Curve(lcid, tag=Oasys.gRPC.defaultArg, line_label=Oasys.gRPC.defaultArg, x_axis_label=Oasys.gRPC.defaultArg, y_axis_label=Oasys.gRPC.defaultArg)

Create a new Curve object. The curve will be added to all the currently active graphs

Parameters:
  • lcid (integer) – Curve number

  • tag (string) – Optional. Tag used to reference the curve in FAST-TCF scripts

  • line_label (string) – Optional. Line label for the curve

  • x_axis_label (string) – Optional. X-axis label for the curve

  • y_axis_label (string) – Optional. Y-axis label for the curve

Returns:

Curve object

Return type:

dict

Example

To create a new curve with label 200

l = Oasys.THIS.Curve(200)

Static methods

classmethod Curve.AddFlaggedToGraph(flag, *graph)

Adds flagged curves to a graph

Parameters:
  • flag (Flag) – Flag to check on the curve

  • graph (int) – Graph to add the curve to. If undefined then the curve is added to all graphs This argument can be repeated if required. Alternatively a single array argument containing the multiple values can be given

Returns:

No return value

Return type:

None

Example

To add curves flagged with flag f to graphs 1 and 3:

Oasys.THIS.Curve.AddFlaggedToGraph(f,1,3)

To add curves flagged with flag to all graphs:

Oasys.THIS.Curve.AddToGraph(f)
classmethod Curve.Copy(source, target)

Copies a curve

Parameters:
  • source (integer) – ID of curve to copy from

  • target (integer) – ID of curve to copy to

Returns:

No return value

Return type:

None

Example

To copy curve 1 to curve 4:

Oasys.THIS.Curve.Copy(1,4)

To copy curve a to curve b,

Oasys.THIS.Curve.Copy(a.id,b.id)
classmethod Curve.Delete(curve)

Deletes a curve

Parameters:

curve (integer) – ID of curve to delete

Returns:

No return value

Return type:

None

Example

To delete curve n

Oasys.THIS.Curve.Delete(n)
classmethod Curve.DeleteFlagged(flag)

Deletes flagged curves

Parameters:

flag (Flag) – Flag to check on the curve

Returns:

No return value

Return type:

None

Example

To delete curves flagged with flag f

Oasys.THIS.Curve.DeleteFlagged(f)
classmethod Curve.Exists(curve)

Checks if a curve exists

Parameters:

curve (integer) – ID of curve to check

Returns:

True if the curve exists, otherwise False

Return type:

bool

Example

To check if a curve n exists

exists = Oasys.THIS.Curve.Exists(n)
classmethod Curve.First()

Returns the first curve

Returns:

Curve object (or None if there are no more curves in the model)

Return type:

Curve

Example

To get the 1st curve

curve = Oasys.THIS.Curve.First()
classmethod Curve.FirstFreeID()

Returns the ID of the first free curve

Returns:

ID of first unsued curve

Return type:

int

Example

To get the ID of the first free curve:

curve = Oasys.THIS.Curve.FirstFreeID()
classmethod Curve.FirstID()

Returns the ID of the first curve

Returns:

ID of the first curve defined

Return type:

int

Example

To get the 1st curve

curve = Oasys.THIS.Curve.FirstID()
classmethod Curve.FlagAll(flag)

Flags all of the curves with a defined flag

Parameters:

flag (integer) – Flag to set on the curves

Returns:

No return value

Return type:

None

Example

To flag all of the curves with flag f:

Oasys.THIS.Curve.FlagAll(f)
classmethod Curve.GetFlagged(flag)

Returns a list of all curves flagged with a given flag

Parameters:

flag (Flag) – Flag for which to return flagged objects

Returns:

List of Curve objects (or None if no curves are flagged)

Return type:

list

Example

To get the curves flagged with flag f:

curve_list = Oasys.THIS.Curve.GetFlagged(f)
classmethod Curve.GetFromID(id)

Returns the curve object for a curve ID

Parameters:

id (integer) – ID of curve to return object for

Returns:

Curve object (or None if the curve does not exist

Return type:

Curve

Example

To get the curve n

curve = Oasys.THIS.Curve.GetFromID(n)
classmethod Curve.HighestID()

Returns the ID of the highest curve currently being used

Returns:

ID of highest curve currently being used

Return type:

int

Example

To get the highest curve ID

id = Oasys.THIS.Curve.HighestID()
classmethod Curve.Pick(prompt, modal=Oasys.gRPC.defaultArg)

Picks a single curve

Parameters:
  • prompt (string) – Text to display as a prompt to the user

  • modal (boolean) – Optional. If selection is modal (blocks the user from doing anything else in T/HIS until this window is dismissed). If omitted the selection will be modal

Returns:

Curve object (or None if the user cancels the pick operation)

Return type:

Curve

Example

To pick a curve, giving the prompt ‘Pick curve’:

curve = Oasys.THIS.Curve.Pick('Pick curves')
classmethod Curve.RemoveFlaggedFromGraph(flag, *graph)

Removes flagged curves from a graph

Parameters:
  • flag (Flag) – Flag to check on the curve

  • graph (int) – Graph to remove the curve from. If undefined then the curve is removed from all graphs This argument can be repeated if required. Alternatively a single array argument containing the multiple values can be given

Returns:

No return value

Return type:

None

Example

To remove curves flagged with flag f from graphs 1 and 3:

Oasys.THIS.Curve.RemoveFlaggedFromGraph(f,1,3)

To remove curves flagged with flag f from all graphs:

Oasys.THIS.Curve.RemoveFlaggedFromGraph(f)
classmethod Curve.Select(flag, prompt, modal=Oasys.gRPC.defaultArg)

Allows the user to select curves

Parameters:
  • flag (integer) – Flag to use when selecting curves

  • prompt (string) – Text to display as a prompt to the user

  • modal (boolean) – Optional. If selection is modal (blocks the user from doing anything else in T/HIS until this window is dismissed). If omitted the selection will be modal

Returns:

Number of items selected or None if menu cancelled

Return type:

int

Example

To select curves, flagging those selected which flag f, giving the prompt ‘Select curves’:

num = Oasys.THIS.Curve.Select(f, 'Select curves')
classmethod Curve.UnflagAll(flag)

Unsets a defined flag on all of the curves

Parameters:

flag (integer) – Flag to unset on the curves

Returns:

No return value

Return type:

None

Example

To unset the flag f on all of the curves:

Oasys.THIS.Curve.UnflagAll(f)

Instance methods

Curve.AddPoint(xvalue, yvalue)

Adds a point at the end of the curve

Parameters:
  • xvalue (real) – The x value of the point

  • yvalue (real) – The y value of the point

Returns:

No return value

Return type:

None

Example

To add the point x=3.5, y=5.5 to curve l:

l.AddPoint(3.5,5.5)
Curve.AddToGraph(*graph)

Adds a curve to a graph

Parameters:

graph (int) – Graph to add the curve to. If undefined then the curve is added to all graphs This argument can be repeated if required. Alternatively a single array argument containing the multiple values can be given

Returns:

No return value

Return type:

None

Example

To add a curve (c) to graphs 1 and 3:

c.AddToGraph(1,3)

To add a curve (c) to all graphs:

c.AddToGraph()
Curve.ClearFlag(flag)

Clears a flag on the curve

Parameters:

flag (integer) – Flag to clear on the curve

Returns:

No return value

Return type:

None

Example

To clear flag f for curve l:

l.ClearFlag(f)
Curve.DeletePoint(ipt)

Deletes a point in a curve. The input for the point number should start at 1 for the 1st point not zero

Parameters:

ipt (integer) – The point you want to insert the data before or after

Returns:

No return value

Return type:

None

Example

To delete the 3rd point in curve l:

l.DeletePoint(3)
Curve.Flagged(flag)

Checks if the curve is flagged or not

Parameters:

flag (integer) – Flag to check on the curve

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if curve d has flag f set on it:

d.Flagged(f) )
Curve.Freeze(graph, freeze_option)

Freezes an unblanked curve on one or all graphs

Parameters:
  • graph (integer) – Graph number to freeze curve on or 0 for all graphs

  • freeze_option (integer) – No argument or 1 to freeze the curve, 0 to unfreeze

Returns:

No return value

Return type:

None

Example

To freeze a curve c on graph 3:

c.Freeze(3,1)
Curve.GetPoint(row)

Returns x and y data for a point in a curve. The input for the point number should start at 1 for the 1st point not zero. In the list returned array[0] contains the x axis value and array[1] contains the y-axis value

Parameters:

row (integer) – The point you want the data for

Returns:

Array of point values

Return type:

list

Example

To get the curve data for the 3rd point for curve l:

if l.npoints >= 3:
    point_data = l.GetPoint(3)
Curve.InsertPoint(ipt, xvalue, yvalue, position)

Inserts a new point before or after the specified point

Parameters:
  • ipt (integer) – The point you want to insert the data before or after

  • xvalue (real) – The x value of the point

  • yvalue (real) – The y value of the point

  • position (integer) – Specify either before or after the selected pioint. Use ‘Curve.BEFORE’ for before, and ‘Curve.AFTER’ for after

Returns:

No return value

Return type:

None

Example

To insert the values after the 3rd row to x=3, y=5 for curve l:

l.InsertPoint(3, 3, 5, Oasys.THIS.Curve.AFTER)
Curve.Next()

Returns the next curve in the model

Returns:

Curve object (or None if there are no more curves in the model)

Return type:

Curve

Example

To get the curve in model m after curve l:

curve = l.Next()
Curve.Previous()

Returns the previous curve in the model

Returns:

Curve object (or None if there are no more curves in the model)

Return type:

Curve

Example

To get the curve in model m before this one:

curve = curve.Previous()
Curve.RemoveFromGraph(*graph)

Removes a curve from a graph

Parameters:

graph (int) – Graph to remove the curve from, If undefined then the curve is removed from all graphs This argument can be repeated if required. Alternatively a single array argument containing the multiple values can be given

Returns:

No return value

Return type:

None

Example

To remove a curve (c) from graphs 1 and 3:

c.RemoveFromGraph(1,3)

To remove a curve (c) from all graphs:

c.RemoveFromGraph()
Curve.SetFlag(flag)

Sets a flag on the curve

Parameters:

flag (integer) – Flag to set on the curve

Returns:

No return value

Return type:

None

Example

To set flag f for curve l:

l.SetFlag(f)
Curve.SetPoint(ipt, xvalue, yvalue)

Sets the x and y values for a specified point in a curve

Parameters:
  • ipt (integer) – The point to set the data for

  • xvalue (real) – The x value of the point

  • yvalue (real) – The y value of the point

Returns:

No return value

Return type:

None

Example

To set the values for the 3rd point to x=3, y=5 for curve l:

l.SetPoint(3, 3, 5)
Curve.Update()

Updates a curve properties (min,max, average values etc)

Returns:

No return value

Return type:

None

Example

To update the properties of curve l:

l.Update()
Curve.YatX(xvalue)

Returns the y value of the curve at a given x value, interpolating if requested x value lies between data points

Parameters:

xvalue (real) – The x value

Returns:

Y value

Return type:

float

Example

To get the y value of curve c when x=1.4:

y = c.YatX(1.4)