TABLE OF CONTENTS


::pwtk::nebi::deleteImageCharges

SYNOPSIS

proc ::pwtk::nebi::deleteImageCharges {args} {

USAGE

   ::pwtk::nebi::deleteImageCharges index1 ?index2 ...?
 or
   ::pwtk::nebi::deleteImageCharges { index1 ?index2 ...? }

PURPOSE

Delete TOTAL_CHARGE of index1, index2... images from the POSITIONS card.

The first image has index == 1; last image has index == end

Indices can be also specified as end-N, which means N-th image before the last one (e.g., if there are 4 images, end-1 means the 3rd image).

ARGUMENTS

REMARK

This command is not related to the "num_of_images" variable, but to FIRST_IMAGE, INTERMEDIATE_IMAGE..., LAST_IMAGE specs in the POSITIONS card (aka BEGIN_POSITIONS / END_POSITIONS).

SOURCE

    set nimages [::pwtk::nebi::getNImages]    

    # store POSITIONS to data array
    ::pwtk::nebi::positions2data_ data

    foreach index [lsort -decreasing -integer [concat {*}$args]] {
        set index [image_in_range_ $index $nimages]    
    
        # delete the image charge

        if { [info exist data(charge,$index)] } {
            unset data(charge,$index)
        }
    }

    # load POSITIONS from data
    POSITIONS [::pwtk::nebi::data2positions_ data]    
}