public class GridRescaler extends Transformer implements SequenceActor
This actor converts an ascii raster grid file into another ascii grid file
with different extent and cell spacing A ASC grid file is read as input. (The
file name(s) are connected to the input port.)
The xllcorner, yllcorner, cellsize, numrows and numcols of the desired grid
are also input and a new ASC file is created. Algorithms are disk based
meaning that very large rasters can be handled.
The input is a multiport so multiple input file names can be attached to that port. Multiple tokens are output in a sequence if multiple input filenames are attached. Token consumption and production rates are automatically calculated
A useExistingFile boolean parameter has been added. When true, the actor checks to see if the output file already exists. If it does, it is just sent to the output port without repeating the calculation.
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
StringParameter |
algorithm
This is the algoritm to be used in calculating cell values in the output
grid from the values in the input grid Currently there are two choices:
'Nearest Neighbor' or 'Inverse Distance Weighted'
|
Parameter |
cellsize
The cell size of the output grid.
|
Parameter |
numcols
The number of columns (cells in the x-direction) in the output grid.
|
Parameter |
numrows
The number of rows (cells in the y-direction) in the output grid.
|
FileParameter |
outputFilename
This is the name to be given to the output file.
|
Parameter |
useDisk
Boolean setting to determine whether or not to use disk for storing grid
data rather than putting all data in RAM arrays
|
Parameter |
useExistingFile
Boolean setting to determine whether or not to use currently existing
output file, if it exists
|
Parameter |
xllcorner
The x-value of the lower left corner of the output grid Usually this is a
longitude.
|
Parameter |
yllcorner
The y-value of the lower left corner of the output grid Usually this is a
latitude.
|
input, output
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
GridRescaler(CompositeEntity container,
java.lang.String name)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
connectionsChanged(Port port)
Resets the output token production rate based on width of input port
|
void |
fire()
Creates rescaled ascii grid for each input grid using the input
parameters Uses the 'Grid' class that is disk-based, thus allowing very
large grids.
|
boolean |
postfire()
Post fire the actor.
|
boolean |
prefire()
Pre fire the actor.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, stop, stopFire, terminate
addInitializable, initialize, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public Parameter xllcorner
public Parameter yllcorner
public Parameter cellsize
public Parameter numrows
public Parameter numcols
public StringParameter algorithm
public FileParameter outputFilename
public Parameter useExistingFile
public GridRescaler(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained by the proposed
container.NameDuplicationException
- If the container already has an actor with this name.public void connectionsChanged(Port port)
connectionsChanged
in class AtomicActor<TypedIOPort>
port
- The port that has connection changes.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If there is no director.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.