Documentation for pp_lib

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

./

pp_editablecube__define.pro


Author information

Author

Paulo Penteado (pp.penteado@gmail.com), Oct/2009

Other file information

Uses:

pp_getcubeheadervalue, pp_extractfields, pp_buffered_vector, pp_setcubeheadervalue

Class description for pp_editablecube

Inheritance

All ancestor classes: pp_readcube IDL_OBJECT

Properties

Properties in pp_readcube

Properties in pp_editablecube

backnames set
backplanes set
backunits set
bottomnames set
bottomplanes set
bottomunits set
core set
file init
orcube init
preservespecial init
sidenames set
sideplanes set
sideunits set
special init
wavelengths set
wavelengthunits set

Fields

Fields in pp_readcube

Fields in IDL_OBJECT

Fields in pp_editablecube

BINLENGTH 0LL
HLENGTH 0L
LLENGTH 0L
NEWFILE ''
OLDBINLENGTH 0LL
OLDHISTORY ptr_new()
OLDHLENGTH 0L
OLDLABELS ptr_new()
OLDLLENGTH 0L
PRESERVESPECIAL 0S

Routines

Methods inherited from pp_readcube

Routines from pp_editablecube__define.pro

result = pp_editablecube::init( [orcube=orcube] [, file=file] [, special=special] [, preservespecial=preservespecial])

Initializes am editablecube object, either from a readcube object, or from a file.

pp_editablecube::setproperty [, core=core] [, backplanes=backplanes] [, sideplanes=sideplanes] [, bottomplanes=bottomplanes] [, backnames=backnames] [, sidenames=sidenames] [, bottomnames=bottomnames] [, wavelengths=wavelengths] [, backunits=backunits] [, sideunits=sideunits] [, bottomunits=bottomunits] [, wavelengthunits=wavelengthunits]

Changes one or more properties of the cube, according to the data given in the keywords.

pp_editablecube::updatedatainfo, names=names, type=type, core=core
pp_editablecube::updatesuffix, name, ind, dimschanged, typechanged, suffix=suffix
pp_editablecube::updatecore, core, dimschanged, typechanged
pp_editablecube::updatelocations
pp_editablecube::headeredit [, key=key] [, value=value] [, append=append] [, history=history]

Changes values contained in the label or history part of the cube header.

pp_editablecube::write, filename

Writes the cube in the object to a cube file.

pp_editablecube::export, file, format=format

Exports the cube in the object to a fits or csv file.

pp_editablecube::cleanup
pp_editablecube__define

Object to read, edit and write an ISIS cube.

Routine details

top source pp_editablecube::init

result = pp_editablecube::init( [orcube=orcube] [, file=file] [, special=special] [, preservespecial=preservespecial])

Initializes am editablecube object, either from a readcube object, or from a file.

Keywords

orcube in optional

A readcube or editablecube object from which a copy will be created to be edited in this object. The original object is unchanged.

file in optional

The filename from which to read the cube directly. If provided, orcube is ignored.

special in optional default=0

Same as pp_readcube::init's special:

Determines the type of special value replacement to use:

0 uses the default special values

1 uses the special values found in the header

2 disables special value replacement

preservespecial in optional default=0

If set, the special values used in the original cube are kept (unless data type changes). Otherwise, default values are used.

Examples

See the example on pp_editablecube__define.

Author information

Author:

Paulo Penteado (pp.penteado@gmail.com), Oct/2009

Statistics

Lines:
38 lines
Cyclomatic complexity:
10
Modified cyclomatic complexity:
10

top source pp_editablecube::setproperty

pp_editablecube::setproperty [, core=core] [, backplanes=backplanes] [, sideplanes=sideplanes] [, bottomplanes=bottomplanes] [, backnames=backnames] [, sidenames=sidenames] [, bottomnames=bottomnames] [, wavelengths=wavelengths] [, backunits=backunits] [, sideunits=sideunits] [, bottomunits=bottomunits] [, wavelengthunits=wavelengthunits]

Changes one or more properties of the cube, according to the data given in the keywords. All keywords are optional.

Keywords

core in optional

An array to replace the core data with. Can be of any size, but must be 3D, and can be of any numeric type. The object's data type gets replaced by the type of core, if it is different. This is the only way to change the cube's data type. To remove existing suffixes, change the 3 core dimensions without providing corresponding suffix arrays.

backplanes in optional

An array to replace the backplana data with. Must have the first two dimensions equal to the cube's core, can have any number of planes (must be 3D). Most useful to add new backplanes.

sideplanes in optional

An array to replace the sideplane data with. Must have the last two dimensions equal to the cube's core, can have any number of planes (must be 3D).

bottomplanes in optional

An array to replace the bottom data with. Must have the first and last dimensions equal to the cube's core, can have any number of planes (must be 3D).

backnames in out optional

A string array with each element containing the name of each backplane. If the number of backplanes is changed and this is not provided, the backplane names get changed to default values.

sidenames in out optional

A string array with each element containing the name of each sideplane. If the number of backplanes is changed and this is not provided, the sideplane names get changed to default values.

bottomnames in out optional

A string array with each element containing the name of each bottomplane. If the number of backplanes is changed and this is not provided, the bottomplane names get changed to default values.

wavelengths in out optional

A string array where each element is the wavelength of each core band. If the number of core bands is changed and this is not provided, the wavelengths get changed to their default value 'UNKNONW'.

backunits in out optional

A string array with each element containing the name of each backplane's unit. If the number of backplanes is changed and this is not provided, the backplane units get changed to default values 'UNKNOWN'.

sideunits in out optional

A string array with each element containing the name of each sideplane's unit. If the number of backplanes is changed and this is not provided, the sideplane units get changed to default values 'UNKNOWN'.

bottomunits in out optional

A string array with each element containing the name of each bottomplane's unit. If the number of backplanes is changed and this is not provided, the bottomplane units get changed to default values 'UNKNOWN'.

wavelengthunits in optional

A string array with the name of the core bands unit.

Examples

See the example on pp_editablecube__define.

Author information

Author:

Paulo Penteado (pp.penteado@gmail.com), Oct/2009

Statistics

Lines:
62 lines
Cyclomatic complexity:
22
Modified cyclomatic complexity:
22

top source pp_editablecube::updatedatainfo

pp_editablecube::updatedatainfo, names=names, type=type, core=core

Keywords

names
type
core

Statistics

Lines:
18 lines
Cyclomatic complexity:
11
Modified cyclomatic complexity:
8

top source pp_editablecube::updatesuffix

pp_editablecube::updatesuffix, name, ind, dimschanged, typechanged, suffix=suffix

Parameters

name
ind
dimschanged
typechanged

Keywords

suffix

Statistics

Lines:
53 lines
Cyclomatic complexity:
14
Modified cyclomatic complexity:
8

top source pp_editablecube::updatecore

pp_editablecube::updatecore, core, dimschanged, typechanged

Parameters

core
dimschanged
typechanged

Statistics

Lines:
43 lines
Cyclomatic complexity:
12
Modified cyclomatic complexity:
6

top source pp_editablecube::updatelocations

pp_editablecube::updatelocations

Statistics

Lines:
23 lines
Cyclomatic complexity:
2
Modified cyclomatic complexity:
2

top source pp_editablecube::headeredit

pp_editablecube::headeredit [, key=key] [, value=value] [, append=append] [, history=history]

Changes values contained in the label or history part of the cube header. Can set values of exisiting keys, add new keys, remove exisitng keys, or just append lines to the header.

Keywords

key in optional

Key name to be edited.

value in optional

Value to be assigned to the named key. If absent, the key is removed.

append in optional

Passed to pp_setcubeheadervalue as is. A string scalar or array of lines to be inserted into the header. If provided, key and value are ignored. No processing is done on the given lines, it is the user's responsability to ensure they are valid.

history in optional default=0

If set, editing is done to the history part of the header, instead of the label part.

Examples

See the example on pp_editablecube__define.

Author information

Author:

Paulo Penteado (pp.penteado@gmail.com), Oct/2009

Statistics

Lines:
9 lines
Cyclomatic complexity:
7
Modified cyclomatic complexity:
7

top source pp_editablecube::write

pp_editablecube::write, filename

Writes the cube in the object to a cube file.

Parameters

filename

The name of the file to which the cube will be written. Optional only if the object already contains a name in the newfile field from a previous call of write.

Examples

See the example on pp_editablecube__define.

Author information

Author:

Paulo Penteado (pp.penteado@gmail.com), Oct/2009

Statistics

Lines:
15 lines
Cyclomatic complexity:
4
Modified cyclomatic complexity:
4

top source pp_editablecube::export

pp_editablecube::export, file, format=format

Exports the cube in the object to a fits or csv file.

Parameters

file

The name of the file to which the cube will be written.

Keywords

format

Examples

See the example on pp_editablecube__define.

Author information

Author:

Paulo Penteado (pp.penteado@gmail.com), Oct/2009

Statistics

Lines:
24 lines
Cyclomatic complexity:
12
Modified cyclomatic complexity:
12

top source pp_editablecube::cleanup

pp_editablecube::cleanup

Statistics

Lines:
5 lines
Cyclomatic complexity:
4
Modified cyclomatic complexity:
4

top source pp_editablecube__define

pp_editablecube__define

Object to read, edit and write an ISIS cube. Read functionality is the same as that of the pp_readcube class (it is inherited from it, see its documentation for details and examples on reading). Once the object is instantiated, either from a file or from another editable cube, its data and metadata can be changed, and it can be written to a file.

Initialization parses the cube into the object, other methods retrieve parts of it, edit it, or write it to a file.

On reading, makes the same assumptions (inherits them) from the pp_readcube class: All suffix items are the same data type as core items, cube has 3 axes in BSQ order, and records have fixed length. On writing, these assumptions are maintained.

The only methods intended to be public are: getproperty, getspecialvalues, getfromheader, getsuffixbyname, getbandbywavelength, setproperty, headeredit, and write.

See the documentation of the method setproperty for the most useful edit and write example, or getproperty for the most useful read example.

Examples

For read use, see the example on pp_readcube__define.

To initialize from the cube CM_1553510065_1_ir.cub:

a=obj_new('pp_editablecube',file='CM_1553510065_1_ir.cub')
To add a dummy backplane:
a->getproperty,backplanes=back,backnames=bnames,lines=lines,samples=samples backplanes=[[[backplanes]],[[findgen(lines,samples)]]] backnames=[backnames,'DUMMY'] a->setproperty,backplanes=back,backnames=bnames
To remove the first core band:
a->getproperty,core=core,wavelengths=wavs core=core[*,*,1:*] & wavs=wavs[1:*] a->setproperty,core=core,wavelengths=wavs
To add lines to the history part of the header:
app=['GROUP = testedit','date = '+strcompress(systime(),/remove),'END_GROUP = testdate'] a->headerset,append=app
To write the edited cube to 'testedit.cub':
a->write,'testedit.cub'
To write the edited cube to 'testedit.fits':
a->export,'testedit.cub'
Destroy the object when done with it:
obj_destroy,a

Author information

Author:

Paulo Penteado (pp.penteado@gmail.com), Oct/2009

Other attributes

Uses:

pp_readcube

Statistics

Lines:
6 lines
Cyclomatic complexity:
10
Modified cyclomatic complexity:
10

File attributes

Modification date: Tue Nov 17 10:08:17 2015
Lines: 296
Docformat: rst rst