Home

ACT-REACT User`s Manual Part II – MSHELL Development

image

Contents

1. Line 10 Cot 1 ProVIEW User s Guide Appendix B Internal Functions 93 dct8x8 Discrete Cosine Transform 8x8 Syntax dct8x8 a Description Computes the discrete cosine transform of each 8 x 8 block within the specified array a decimate Signal Decimation Syntax decimate a rowskip columnskip Description Extracts a sub sampled version of the input signal where a is the input array rowskip and columnskip are the number of rows and columns respectively to be skipped in each direction Example A 512 x 512 input image a can be decimated to a 128 x 128 image b using the following MSHELL statement ready b decimate a 4 4 dirlist Returns the list of subdirectories files Syntax dirlist path options or sys_dirlist path optons Description This function returns the list of the subdirectories or files of a given directory The first input argument is a string containing the directory name The second input argument is one of the following d s or p When d is used the function will return only the list of subdirectories Otherwise only the files are listed When s is used the function will return the list of files along with their size When p is used the function will list the path of the files Note this function uses as the delimiter Example 94e Internal Functions REACT MSHELL User s Manual 11 12 200
2. ready _ rindex Range Index Syntax rindex a minval maxval Description This function finds the location of all the elements of an input array which fall within a specified range of values where a is the input array and minval and maxval are scalar values specifying the selection range This function returns a 1 x M complex array where M is the number of points equal to the specified value and whose array elements contain the coordinates of each point encoded as follows the real part contains the column index and the imaginary part contains row index of the point If no elements are matched the value 1 is returned Example The following illustrates the function using the array a 0 19 0 39 0 33 rindex a 0 ProVIEW User s Guide Appendix B Internal Functions 217 rindexc Range Index Complement Syntax rindexc a minval maxval Description This function finds the location of all the elements of an input array which fall outside within a specified range of values where a is the input array and minval and maxval are scalar values specifying the selection range This function returns a 1 x M complex array where M is the number of points equal to the specified value and whose array elements contain the coordinates of each point encoded as follows the real part contains the column index and the imaginary part contains row index of the point If no elements are matched t
3. strhex2int Converts Hex String to Integer Syntax strhex2int string Description Returns an array where hex values in the string delimeted by commas or linefeeds are converted to integer values and then saved in an array variable Values delimeted by commas are stored in the same array row The linefeed n is used as the row delimeter when copying into the array See Also str2float strlen str2int Example See str2int example strlow2up Converts lowercase to uppercase Syntax strlow2up lowercase Description The output is a string whereby all lowercase characters have been changed to uppercase str Strip WhiteSpace Removes whitespaces at the beginning and at the end of a string Syntax strStripWhiteSpace to_be_stripped Description This function removes the whitespaces characters along with t n and everything that matches s in a regular expression at the beginning and at the end of the input string 258e Internal Functions REACT MSHELL User s Manual 11 12 2007 The result is returned as a string strStarts With check for string start match Syntax strStartWith a pattern Description This function return the value of 1 if it finds the string pattern pattern at the start of the input string a Otherwise it returns the value 0 Example see sirSection example strSection extract section of a String Syntax strSection a delimiter start end Descrip
4. Sftp_rmdir Remove Directory from the FTP Server Syntax ftp_rmdir dirname Description This function works after an ftp_session_init and removes the specified subdirectory from the FTP Server If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error ftp_session_close Close Current FTP Session Syntax ftp_session_close Description Closes the current FTP session if any was established If successful it returns O otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see ftp_list example ftp_session_init Open an FTP Session Syntax ftp_session_init params where 124e Internal Functions REACT MSHELL User s Manual 11 12 2007 params host port username password Description Opens an FTP session with the specified host name using the specified port number if no port number is specified port 21 will be used username and password are optional if FTP server does not require them for logging in If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error NOTE THE ftp_ related functions are only supported in the version of MSHELL that runs under ACT s REACT Example see ftp_list example ProVIEW User s Guide Appendix B Internal Funct
5. ncnew Create new NetCDF file Syntax ncnew fname dims varinfo 6varname 180 Internal Functions REACT MSHELL User s Manual 11 12 2007 Description Creates a new NetCDF file Parameter fname is the filename to use The parameter dims should contain the list of dimension names for the new file separated by newlines The varinfo parameter should match the dims variable and provide the size for each respective dimension Finally varname should contain the NetCDF variable name to create in the new file Currently MSHELL will only create a single variable NetCDF file Example The following demonstrates the process A new file called newfile nc is created with two dimensions called dim1 and dim2 A 100x100 variable using these two dimensions is created called myvariable ncols Number of Columns Syntax ncols a or a ncols Description Returns the number of columns in the input array Example The following demonstrates the process ready a 0 255 1 10356 create 10357x256 matrix ready ncols a 256 ready a ncols this is an equivalent command 256 ncread NetCDF Variable reader Syntax ncread fname varname or ncread fname varname start edges Description Returns the data from a NetCDF variable varname from fname The first form reads in the entire variable The second form allows an N dimensional region of interest to be read from the variable The start variable gives the start pos
6. Performs the operation and then checks the result Appendix B Internal Functions 261 ready a randu 2 2 create a 2 x 2 random array ready a row 0 0x23 row 1 0 16 ready svd call ready ready row 0 0 23 row 1 0 16 0x u 0 55 d 0 v 0 initialize u d v prior to call svd function test output svd a u d v u d v 0 36 0 55 system Syntax Description Thi Issues Operating System Command system string s function allows you to issue an operating system command It invokes the operating system command processor to execute a command batch file or other program named by the string command To be located and executed the program must be in the current directory or in one of the directories listed in the PATH string in the environment In the case of the string consisting of a an executable command batch file or program you will be returned to the MSHELL prompt upon completion of the execut returning to MSHELL wil able If the the string consists of a non executable statement or is null then require you to type exit at the DOS prompt The COMSPEC environment variable is used to find the command processor program file so that file need not be in the current directory Example ready the file ready ready ready window c gt rem c gt rem c gt rem c gt exit ready continue ready ready rea
7. successful reada Read Array or Image Syntax reada fname Smode cntvec Description Reads an array or image from disk The mode string specifies the format of the data to be read from the disk If the wrong mode is used with a given file the image will not load properly The image file formats or modes supported are summarize in the following table followed by a more in depth description of earch format mode If fname contains any environment variables in the form VAR those are expanded to their values see expand command See Also Importing Data page 36 Table 1 Summary of Read Array Writea Array Format Modes Format Brief Description Bytes pixel Read Write Mode supportin Support in MSHELL MSHELL all Tries to figure out Yes N A if the input image is char gif float bmp jpeg or any other format At this time it does not cover all the possible formats supported by reada This format make use of the system variable M_maxdim which ProVIEW User s Guide Appendix B Internal Functions 207 determines the maximum image dimension to use char MSHELL simple format with a 9 byte header 1 byte pixel Yes Yes flex MSHELL reader with powerfull region of interest reader Multiple Yes N A Fits Flexible Image Transfer format IEEE float Yes Yes simple format Tiff Gif pds Indust
8. E END Ends Execution of a Script Syntax END Description Used within a script to end the execution It is to be placed at the end of the script when to be completed No error condition or message is generated when this function is called eqindex Equality Index Syntax eqindex a b Description Finds the locations of all the elements in an input array which equal a constant value where a is the input array and b is the constant scalar quantity This function returns a 1 x M complex array where M is the number of points equal to the specified value and whose array elements contain the coordinates of each point encoded as follows the real part contains the column index and the imaginary part contains row index of the point If no elements are matched a NULL array is returned Example Cases with matches and without are illustrated below ready x 0 5 1 ready eqindex x 3 3 Oi ready y eqindex x 10 NULL ARRAY ready y eqindex x 10 ready y ncols 0 See Also finite_index gt_index leindex ltindex geindex nan_index The following illustrates the use of some of these functions 106 Internal Functions REACT MSHELL User s Manual 11 12 2007 Syntax ProVIEW User s Guide z 0 zero value show z minf 1 0 infinity show minf nan 1 0 1 0 generates a Not a Number now nan print index v index to elements that are
9. Example see example in dbfopen dbfgetrecords read the records from the dbf file Syntax dbfgetrecords hdbf 1 1 dbfgetrecords hdbf recVec fieldVec Description This function is used to read the records from the dbf file The input parameters are the hdbf dbffile handle recVec an arrary variable containing the record indices zero based you wish to extract If set to 1 then all records are extracted fieldVec an array variable containing the field indices zero based you want to extract If set to 1 then all fields are extracted The output is a string containing the field values separated by for the specified rows or all the rows Example see example in dbfopen ProVIEW User s Guide Appendix B Internal Functions 91 dbrsgetcolnames Returns column names in a result set Syntax dbrsgetcolnames Description Returns a comma separated list of the column names in a result set To be called after a SELECT query call to sqlexec Any expressions in the SELECT statement may be returned as an empty column name DB driver dependent unless the AS operator is used The column name should match the AS identifier properly 92e Internal Functions REACT MSHELL User s Manual 11 12 2007 dbsqltr Transacts with an external database Syntax dbsaltr query lt filename gt Description Use this command to post the passed string as the next query for the previously connected database The ou
10. expand Environment variables expansion Syntax expand string Description Expand any system environment variable contained in string to its value Environment variables must be specifed in the form VARY Example ready expand Qt dir is QTDIR Ob dir is DB Or s 357 ProVIEW User s Guide Appendix B Internal Functions 109 ffi 1 D Fast Fourier Transform Syntax fft a or a fft Description Computes the one dimensional Fourier transform of the rows of the input array a The input as well as the output of this function may be a complex array Note that the row dimension of the input array must be a power of two Example If a is an input array with dimensions of 64 x 64 then the one dimensional Fourier transform of each row can be computed as fft a ffe 2 D Fast Fourier Transform Syntax fft2 a or a fft2 Description Computes the two dimensional Fourier transform of the input array The input as well as the output of this function may be a complex array Itis expected that the dimensions of the input array are a power of two Example If x is an input array with dimensions of 64 x 64 then its power spectrum in dB can be estimated using the following construction Power_spectrum 20 real log10 fft2 x See Also spectrum msf Appendix B External Function fileinfo Returns detailed information of a file Syntax fileinfo fname Description Returns the size of an ex
11. 0 255 1 10356 create 10357x256 matrix ready nrows a 10356 ready a nrows this command is equivalent 10356 184e Internal Functions REACT MSHELL User s Manual 11 12 2007 O ones Initialize an Array to all ones Syntax ones n m Description Create an array of the specified dimensions with all elements set equal to 1 Example The following MSHELL statement will create a 512 x 512 array with all entries set to 1 ready a 300 0 4 print first 5 elements in row 301 ready a ones 512 512 J row 0 1 00 1 00 1 00 T00 1 00 openf Open a file for Formatted I O Syntax openf unit fname mode Description This function is used to open a disk file for formatted input or output The unit number can be any positive integer value The selected integer value will identify the opened file from then on The file name fname must be a valid file name in DOS The mode string must be one of the followings r for read w for write or a for append If the write or append modes are tried on a non existing file the file will be created The openf returns a 0 into status if successful The system variable M_path will determine which directories in addition to the current directory to be searched If fname contains any environment variables in the form VAR those are expanded to their values see expand command See Also writef and closef Example The followi
12. Example XLR 2UL ze F fov 45 a aaa pthres fov deg2rad yc mosaic0 nco ove feT rovion teapropengl out bap ACT Prot Mumber triangles 114203 controling parameters nove C ACTWPreview temp apengi out bap C VACT ProN D angles move C ARET rovke tonpiopengi out bap C ACT Prot Number triangles 114203 move MeT revien tesp opengi out bap C RCT Prot Mumber triangles 114203 daha in COMMAND around line 30 SSberror 235 wcrundefined variable or functii se caer stopped process stopped Pprerecane stopped process stopped ni igen stopped eon GeO DOEENERS OSS e Proview 2000 Bno m B wscomemacrs era SORAGA ArI ran gmtimenow current GMT time Syntax gmtimenow Description Returns the GreenWich mean time Columns 0 5 correspond to year month day hour minute second Column 6 is the day of the week Sunday 0 Column 7 is the Julian day If x gmtimenow then x text will have a nicely formatted time string Example t gmtimenow 10 0 X row 0 2004 00 5 53233 4 00 190 00 t text 2004 07 08T14 45 53 328 ProVIEW User s Guide Appendix B Internal Functions 135 gtclipto Greater than Clip to Syntax gtclipto a tval newval Description Set all the values in the input array above a selected threshold to a new desired value where a is the input array tval is the threshold value and newval is the desired new
13. Generate a 1 D or 2 D ramp Syntax start_value end_value step_size 1 D start_value end_value step_size number_of_rows 2 D Description returns a 1 D or 2 D ramp of values Example The following applications illustrate the use of the 1 D and 2 D ramp function ready 0 3 1 generate a 1 D row 0 00 1 00 2 00 3 00 ready 0 1 0 2 generate 1 D row with fractional step size 0 00 0 20 0 40 0 60 0 80 ready 3 0 1 2 generate a 2 D matrix 3 00 2 00 1 00 0 00 3 00 2 00 1 00 0 00 ready pi 3 14159 define PI ready plot 2 cos 0 4 pi pi 4 create a plot ProVIEW User s Guide Appendix B Internal Functions B 55 Figure 1 Array Addition Syntax a b Description The operator symbol is used to perform the addition of two array expressions The actual sum is implemented as Ci aj b for all j i where j and i are respectively row and column indices If b is a scalar and a is not then b will be added to each of the elements in a Example The following MSHELL statements illustrate simple examples of array addition Var ready a 10 15 1 creates row vector a Var ready b a copies a into b ready c add corresponding elements in a and b ready c prints the c row vector 10 0 X row 0 20 00 22 00 24 00 26 00 28 00 30 00 ready ct5 add 5 to every element in c 10 0 X
14. Maximum file size does not only determined by the file format itself but operating system file system capabilities as well Look here for details ERDAS Imagine has different file format for large files where 32 bit pointers cannot be used Look for details here Maximum file size ProVIEW User s Guide Appendix E Geographic Data Abstraction Library 321 Appendix F RECENT CHANGES List of Capabilities recently added to REACT MSHELL e Added table of index in the manual to all internal function The index is by category of functions e Added XML parser e 9 8 2002 added M_no_data system variable e 12 2002 added M_logfile and M_logmode e Improved interface to NetCDF library e Added interface to the CFITS library e Added support for double precision version of MSHELL e Added support for OpenGL e Added interface to the USGS projection library PROJ4 e 5 2003 Added regulars expressions capability similar to Perl syntax e Enhanced documentation with embedded examples e Improved ODBC retrieval speed e 2 2003 Ported MSHELL Interpreter to LINUX e 3 2003 Added M_processid system variable e 4 2003 Added support to writing geotiff files via writea 322 Internal Functions REACT MSHELL User s Manual 11 12 2007 e 5 2003 added additional support to dworld such that vector shoreline can now be drawn on any supported USGS cartographic map projections e 5 2003 a
15. Syntax Description geindex Greater than or Equal Index geindex a b Similar to eqindex but it returns an index to all elements in a greater or equal The following illustrates the operation ready a geo 2 8 ready geindex a 16 row 0 4 00 0 00i 6 00 0 004 geo Geometric Series geo a n Generates a vector whose elements are the first n terms of the geometric series of the input scalar a It is expected that a be a real or complex scalar Mathematically geo a n generates the row vector a a Example ProVIEW User s Guide gra The following illustrates the operation ready geo 2 8 row 0 10047200 4 00 8 00 16 00 32 00 64 00 128 00 Appendix B Internal Functions 127 Geo2Cart Geographic to Cartographic conversion Syntax out Geo2Cart IIgrid pcontrol Description This function converts from geographic coordinates to cartographic coordinates and viceversa There is a script function wrapper called geo2cart that simplifies the usage to this function This function is used extensively by MSHELL to generate cartographic products The inputs to this MSHELL function are ligrid complex array with latitude imaginary part and longitude values in degrees pconirol used to control the cartographic projection as described in the USGS projection software Use pcontrol 1 for forward projection from geographic to cartographic or
16. V This function permanently modifies the content of X The following MSHELL instruction make use of this function with internal checking for not corrupting shared arrays a groi a b a groi b Hence try to use the above as opposed to directly using ladd2groi Example The following illustrates the operation 0 10 1 x 2 rindex x 5 8 x groi 2 print x float2str x 7 0f n al x al x2 print al float2str al 7 0f a2 x n a2 groi print a2 float2str a2 7 0 a3 x2 a3 groi b print a3 float2str a3 7 0 n a4 x2 n a4 groi x groi 2 print a4 float2str a4 7 0 The above code generates the following output n XS 03 hy 2 3 oA 5 6 7 8 9 10 al 0 2 6 12 20 30 42 56 72 90 110 a 0 1 2 3 4 6 7 8 9 9 10 a3 0 1 4 9 16 600 1260 2352 4032 81 100 Appendix B Internal Functions 153 a4 0 1 4 9 16 0 0 O 0 81 100 leclipto Lower or Equal Clip to Syntax leclipto a tval newval Description Set all the values in the input array a that are less than or equal to a selected threshold value tval to a new desired value newval Example The following illustrates the operation ready a randu 1 7 ready a row 0 0 43 0 43 0 57 0 09 0 78 0 56 ready leclipto a 50 1 row 0 1 00 1 00 0 57 leindex Lo
17. e 6 2006 added support for bsq array IO e g xyz band const or array e 3 2007 added readtext_and_status function Allows to control flow if the event that the readtext fails e 1 2007 Added variable M_execution_mode It allows to know which environment the script is running under Provides more information than M_OS e 5 2007 Added new functions allocate_array url_copy_to_file mshift_u16 mshift_u32 and react_get_carto_info react_set_carto_map_info e 9 2007 Added new functions react_load_mlt react_update_layers react_enable_view react_get_property react_get_properties react_set_property polygonorient sys_cat react_open_url 324e Internal Functions REACT MSHELL User s Manual
18. entl text Scontrol gmap geo2cart g cnt1 gmapr gmap real gmapi gmap imag view gmapr view gmapi entl inverse transformation entl text Scontrol ginv geo2cart gmap cnt1 ginvr ginv real ginvi ginv imag view ginvr view ginvi errabs abs g ginv view errabs wtile EXAMPLE END ProVIEW User s Guide Appendix B Internal Functions 129 130 Internal Functions Bie Edt Search Image Bot Date Futons Operators Window Heb Sistas LAN led Ll Jal tla generate test wee Somds 6260 vai g cgrid 160 180 g real j imaq There are a large number of projections supported by Geo2Cart A list of projections can be obtained from the following command proj 1 result syscall cmds result text i e aea AlbersEqualArea fouc Foucaut aeqd AzimuthalEquidistant fouc_s FoucautSinusoidal airy Airy gall Gall GallStereographic aitoff Aitoff gins8 Ginsburg VIII TsNIIGAiK alsk Mod StererographicsofAlaska gn_sinu GeneralSinusoidalSeries apian ApianGlobularl gnom Gnomonic august AugustEpicycloidal goode GoodeHomolosine bacon BaconGlobular gs48 Mod Stererographicsof48U S bipe Bipolarconicofwesternhemisphere gs50 Mod Stererographicsof50U S boggs BoggsEumorphic hammer Hammer amp Eckert Greifendorff bonne Bonne Wernerlat_1 90 hatano HatanoAsymmetricalEqualArea cass Cassini imw_p ce CentralCylindrical InternationalMapoftheWorldPolyco cea EqualAreaC
19. row 0 25400 27 00 29 00 31 00 33 00 35 00 Array Subtraction Syntax a b Description The operator symbol is used to perform the subtraction of two array expressions The actual subtraction is implemented as c 4 5 forallj i where j and i are row and column indices respectively If b is a scalar and a is not then b will be subtracted from all the elements in a Example The following MSHELL statement will subtract array b from a and store the result in c ready c a b 56e Internal Functions REACT MSHELL User s Manual 11 12 2007 Matrix Multiplication Syntax a b Description The operator symbol is used to perform the multiplication of two matrices or arrays The multiplication follows the rules of matrix multiplication used in linear algebra Ci gt a Ds for all j i where j and i are row and column indices respectively An error message will be generated if the number of columns in a is not equal to the number of rows in b If a is a scalar and b is not or vice versa every element in b will be multiplied by a Example The following MSHELL statements illustrate simple examples of array multiplication ready ones 3 3 creates 3 x 3 matrix with all ones ready ones 1 3 creates 1 x 3 vector with all ones ready prints a row ready prints b row 0 1 00 1 00
20. select from Data_Control dbsqlexec query dbrsrowcount c temp out txt DataSet Processing_Cost Scols Processing_Now dbrsgetrows srow erow ns1 n s1 dbrsgetrows srow erow fname ns2 n s2 dbrsgetrows cols srow erow s3Xn ss83 dbrsgetrows cols srow erow fname ns4 n s4 Example getting floating point data Scols fields must be numeric columns erow Scols s5 print status 10 Processing_Cost Processing_Now dbrsgetrowsfloat cols srow erow ns5 n float2str s5 dbclose Appendix B Internal Functions 87 Syntax Description Example Syntax where 88e Internal Functions Pro IEW 2002 File Edit Search Image Plot Data Functions Operators Window Help Tjele Sisal ve Ac ACT Proview Temp test msh dbconnect default_wipe select from Data_Control dbsqlexec query dbrsrowcount status Squery status nrec ne 3 c temp out txt DataSet Processing Cost cols Processing Now srow erow Sfname Scols cols un uu s1 Seas N print nsl n s1 s2 dbrsgetrows srow erow fname print ns2 n s2 s3 dbrsget rows S cols srow erow print e3 nite Sas s4 dbrsgetrows Scols srow erow Sfname print ns4 n s4 Example getting floating point data cols fields must be numeric columns 10 Processing Cost Processi
21. 0 0 255 modify content of y this trigger a deep copy of the values in x follow by a modification of the values in y To see update in screen user must trigger screen update e g view y view y view TY print q text right after the q y assignment gt q text n q 1 1 0 the element change triggers q to make its own deep copy of the array values print q text right after q 1 1 was set to 0 gt q text n note that above the text attribute is not copied in a deep copy EXAMPLE END xf print within fuction x text x text was received from the caller n outl x make a copy of x In actuality this is a copy on write allocation MSHELL uses copy on write COW to save memory The actual copy happens when one of the arrays is modified For example see the following block of code 11 12 2007 x 0 0 255 mofify value of x 0 0 element within subroutine This will trigger a decoupling of the local x variable from the x in the caller application and from the local out variable if out1 0 0 x 0 0 print within function element out 0 0 was not modified due to implicit deep copy n outl text str save some text in the out text attribute out2 xt x Include Files msh Include files are not function files hence they do not erase local variables upon termination Include files are simpler than
22. Description Finds the locations of all the elements in an input array which are not equal to a constant value where a is the input array and b is the constant scalar quantity This function returns a 1 x M complex array where M is the number of points not equal to the specified value and whose array elements contain the coordinates of each point encoded as follows the real part contains the column index and the imaginary part contains row index of the point If all elements are matched a null value is returned Example The following MSHELL statement will compute the ProVIEW User s Guide Appendix B Internal Functions 183 ready moe 1 2 3 ready neqindex moe 1 row0 O 00 1 007 0 00 2 00i nint Nearest Integer Syntax nint a or a nint Description Compute the nearest integer for each element in the array Example The following MSHELL statement will compute the nearest integer for each element of the input array a and store the result in c ready a randu 2 4 create a random 2x4 matrix ready nint a row 0 0 00 T row 1 1 00 Ls nlines Returns number of Lines Syntax nlines string Description This function returns the number of lines contained in the string string nrows Number of Rows Syntax nrows a or a nrows Description Returns the number of rows in the input array Example The following demonstrates the process ready a
23. GDT_CF GDT_CF te nt16 t16 nt32 t32 oat32 oat 64 nt1l6 nt32 loat32 loat64 1 318 Internal Functions 2 3 4 5 6 7 r REACT MSHELL User s Manual 11 12 2007 status gdal_build_overviews hdl resampling_method overview_list band_list Creates overviews for the dataset if the driver for that dataset supports them hdl dataset handle resampling_method AVERAGE NEAREST others in future overview_list vector of reduction factors to use creating overviews band_list vector of bands to generate overviews for band s start at 1 status gdal_contour_generate hdl band contour_interval contour_base fixed_level_count fixed_levels use_nodata shapefile attr_name use_3d hdl handle for an open dataset contour_interval The elevation interval between contours generated contour_base The base relative to which contour intervals are applied This is normally zero but could be different To generate 10m contours at 5 15 25 the ContourBase would be 5 fixed_level_count The number of fixed levels If this is greater than zero then fixed levels will be used and ContourInterval and ContourBase are ignored fixed_levels The list of fixed contour levels at which contours should be generated It will contain FixedLevelCount entries and may be NULL if fixed levels are disabled FixedLevelCount 0 use_nodata If this is 1 and if the dataset band
24. It is required that the kernel k be of odd dimension say 2P 1 x 2Q 1 where P and Q are non negative integers satisfying 2P 1 lt N and 2Q0 1 lt M The input kernel samples are assumed to map into a row range of P to P and acolumn range of Q to Q 7860 Internal Functions REACT MSHELL User s Manual 11 12 2007 k p o ee K pro The result of the convolution is the array g _p_o tt E N P M Q 8 gt EN P 1 0 E N P M 0 whose elements g ji are given by P Q Eji ke Aj piq p P q Q By construction indices outside of the specified range of values in the above g matrix are zero Note that the output of convol will have dimensions of N 2P M 2Q See Also convolt below Example convolt below convolt Truncated Discrete Convolution Syntax convolt k a Description This function is similar to convol in many instances you may only be interested in determining how the elements in the range of a are affected by the convolution operation This function truncates the convolution results by only evaluating g over the range of a i e a row range of 0 to N 1 and a column range of 0 to M 1 The implementations used in convol and convolt are computationally efficient for small kernel sizes However for large kernels an FFT implementation of the convolution should be considered Example For arrays a and kK as define convol and convolt are
25. REACT MSHELL User s Manual 11 12 2007 e or from the Openlmage toolbar icon This will open the Openlimage Panel i e Directories Files bmp jpeg png tiff Look in q react images Files of Type Name display as file list view v Qimages bird tif eatth2 pg eqohare chr ingrid asc luntopo fit mandel chr mars_albedo bmp mars_dted bmp mshell bmp mshells bmp limit output dimension to 300 vf File Name info Close use bands v V treat as RGB triplet if possible Help J auto browse Dpen image assign to myraster Z using map type play loop control IV single pass Movie Loop STOP Figure 3 Use this panel to navigate and select an image to open Many file formats are supported e g JPEG PNG TIFF Geo data formats NASA s Planetary Data System Data formats Once the image is open you can exercise a good deal of control over how it is displayed Additionally you can use the scroll bars that are part of the image window to slide the image horizontally or vertically or use the cursor to travel over the image Notice that as you move the cursor over the image it s row position column position and corresponding pixel value are tracked in the status bar at the bottom left of REACT s Main Window If cartographic or latitude amp longitude information is available it will also be displayed Script File Window In
26. Sh 0x01 Ox0f Oxff strhex2int Sh 256 Internal Functions REACT MSHELL User s Manual n x al Example 1 cxenpie 2 alas 108 x bees 2 06 5 00 dt art new row Example 3 J ce Satis 4 1076 X ro w 2 808 3 68 8 68 8 68 ro a 5 09 6 00 7 00 8 00 Example 5 18 08 x ro A 15 09 255 60 _ tready _ J strContains check for substring occurance Syntax strContains a pattern Description This function return the number of times substring pattern occurs in the input string a Example see sirSection example strEnds With check for string termination match Syntax strEndsWith a pattern Description This function return the value of 1 if it finds the string pattern pattern at the end of the input string a Otherwise it returns the value 0 Example see sirSection example strlen Computes the Length of a String Syntax strlen string ProVIEW User s Guide Appendix B Internal Functions 257 Description Returns a1 x 1 array with the number of characters in a string See Also _ str2float str2ind Example The following generates a string variable and then calculates str2float sstr2ind and strlen of the variable ready Sstrvalue 4 356 define string variable ready str2float strvalue example of str2float 4 356 ready str2int S strvalue example of str2int 4 ready strlen Sstrvalue example of srtlen 5
27. Values are in degrees decimal e v0 complex array with user provided velocity cm sec components in U east positive and V north positive i e v0 complex U V This array has the same dimensions as LL e posStart complex column vector Nx1 with longitude and latitude positions to use as starting point Input is in degrees decimal e params row vector with interval value of seconds to use and number of points to use in the tracing e g params deltaT num_points e Traj return complex array with trajectories computed The dimension of this array is posStart ncols X num_points Each row is a single particle trajectory The first point in the row corresponds to the starting input position Eo Views Dadon Help fags Windows Helo 9 86 BAR fle id ELCUIESa Foma OSES sexo 82e Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide Appendix B Internal Functions 83 read the lat amp long U V components in raw form Sfname M_proviewdir react_data nasa_ca nrl ne tcdf u3d_2004110900 nc u LL depth time ncom4d_nc_extract fname Sfname M_proviewdir react_data nasa_ca nrl ne tcedf v3d_2004110900 nc v LL depth time ncom4d_nc_extract fname LL rmirror LL roi wdef 0 0 LL nrows LL ncols v0 rmirror complex u roil0 v roi 0 will hold the inputs u_x amp v_y components groi eqindex v0 real 99 set no
28. after having entered this command at the command line window Example _ pixval x Now click in the image x where you would like placement and intensity status The following is returned lt row position gt lt column position gt lt intensity gt lt button value gt The lt button value gt is 1 for a left click or 2 for a right click Also if the selection is made outside of the image then the first three values are all 1 plot Plot a Vector Syntax plot y or plot x y Description Plots a row vector The parameter in the plot function is an optional integer 0 to 255 that selects the plot screen where the plot will be placed If an integer number from 0 to 255 is provided in this field the generated plot can be indexed from then on by that number For example if x is a row vector then plot10 x will plot the vector on plot screen number 10 If you would like to free that screen later on you can type free plot10 Note that the plot function can have either one or two arguments Single Argument Case When one argument is used in the plot function as in plot y the row vector y will be plotted against an internally generated ramp of integer values If y is a complex vector then the real part of y will be used as the abscissa and the imaginary part of y as the ordinate Two Argument Case When two arguments are used with the plot function as in plot x y the first argument
29. and b has dimensions P x Q the resulting ARRAY will have dimensions N P 1 M Q 1 The implementation used in xcorr is computationally efficient for small arrays For large array sizes an FFT implementation should be considered See Also xcorrt Example Example with xcorrt xcorrfft Cross correlation of two FFT s Syntax xcorrfft FFT1 FFT2 Description This is used to find the cross corrleation between two computed FFT s of certain previous arrays This command is especially advantageous where a cross correlation of two large arrays would be processor comsumptive therefore an FFT being much smaller would be much faster to compare xcorrt Truncated Cross Correlation Syntax xcortt a b Description This function is similar to xcorr except that it only evaluates the cross correlation in the range of the second array This function xcorrt truncates the cross correlation results by only evaluating the cross correlation over the range of b Note that a is assumed to have odd dimensions Example The following illustrates the use of xcorr and xcorrt ProVIEW User s Guide Appendix B Internal Functions 299 ZEER 0 2 1 xcorr x y example of xcorr 2 00 8 00 10 00 4 00 zp xcorrt x y example of xcorrt zp 00 xline Extract Pixel Values along Line Segment Syntax xline a row1 col1 row2 col2 Description This function extracts the pixel values along a line segmen
30. firstrow lastrow nnchar colvec cntvec text The text portion of the control vector contains the delimiter to use for ascii reading Note that the non numeric charecter flag value nnchar is assigned to any array entry encountered in the read process ProVIEW User s Guide Appendix B Internal Functions 211 that does not contain an ascii numeric data The syntax for this format is then reada test asc asciiflex cntvec Example Reading a portion of the test asc file ready cntvec 1 1 999 0 2 read rows 1 to end columns 0 and 2 won r ready cntvec text ready data reada test asc asciiflex cntvec ready data 10 0 X 999 00 999 00 Note that in the above example only the numeric data was extracted from the array entries of column 2 in those cases rows 3 and 5 that contained non numeric data the designated nnchar value has bee assigned This flexability in extraction of numeric information from ascii text commented data arrays is a very powerful processing tool BMP The bmp format is the windows Bit Map Format BMP This format can be used for both the reading and writing of images Example Reading a file in bmp format ready x reada mandel bmp bmp PDS The PDS format used is the implementation of the Planetary Data System Format adopted by the Clementine mission Within MSHELL there are other functions to support the reading of PDS type data see i
31. fits_get_num_hdus of HDUs 112 fits_get_num_keywords of keywords 113 fits_get_size of rows and columns 116 fits_movabs_hdu Moves to a specified HDU 112 fits_open_file Open a fits file 112 fits_read_ keyword_value Returns Key value 115 fits_read_col_str Reads column strings 117 fits_read_col_values Reads column values 117 fits_read_keyn_comment Returns comment 115 fits_read_keyn_name Returns keyname 114 fits_read_keyn_value Returns a keyvalue 114 Appendix B Internal Functions e B 51 fits_read_keyword_comment Returns comment 115 MSHELL GDAL bindings to the GDAL library 314 NetCDF ncaddvar NetCDF Add Variable 179 ncinq NetCDF File Inquiry 179 ncinqvar NetCDF Variable Inquiry 180 ncnew create new NetCDF file 180 ncread variable reader 181 nevarattstr Variable Attribute String 182 nevarattval Variable Attribute Value 182 newrite write variable 182 newriteatt Write Attribute 183 PDS pdsfindobj Get list of objects 186 pdskwdstr PDS keyword value 186 Shapefile shp_from_csv_ll create shapefile from ASCII input file 237 shp2contour Shapefile to Contour Image 238 shp2fillimage Shapefile Image Fill 242 shp2image Shapefile to Image 240 shp2vector Retrieve verticies from a shapefile 242 shpGetInfo provides info on a shapefile 243 shpwriteroi Copy a subset of a shapefile 243 Virtual V Virtual Varia
32. format ready ready view x The flex format can be used to read almost any image that can be described with the flex cntvec structure The syntax for this format is then wow x reada eqohare chr char The flex format provides you significant flexibility when reading various byte pixel types of data You can read the whole image or just specified subregions of the image This is accomplished by using an additional argument cntvec This is a vector with specific data read criteria and is formated as follows cntvec in_sizej in_sizei hsize jstart istart jend iend jstep istep number of rows in input image number of col in input image header size in bytes to skip start row start column end row end column read every jstep row read every istep column reada eqohare chr flex_type cntvec The format specifier is flex_type this string can be any of the following char PC16 PC32 SUN16 SUN32 ProVIEW User s Guide Appendix B Internal Functions 209 PCFLOAT SUNFLOAT PCDOUBLE Example Reading a portion of the eqohare chr image using flex ready eqohare reada eqohare chr char 256232563 19 212823 2 1282225525255 23221 ready view eqohare This format is easier to use from the
33. getenv MYVAR value ProVIEW User s Guide Appendix B Internal Functions 197 qgauss Area Under Gaussian Density Syntax qgauss a or a qgauss Description Let Z x be the one dimensional Gaussian density function with zero mean and unit variance defined as 1 A ale 2 then qgauss returns the integral of Z x from x to infinity Zod aji for each element in the input array Example The following MSHELL expressions compute the area under the Gaussian density function the probability for values of O to 5 standard deviations qgaussinv Inverse of qgauss Syntax qgaussinv a or a qgaussinv Description Given an input array with values with 0 0 lt a lt 1 0 that correspond to probabilities under the normalized Gaussian density function qgaussinv computes the decision threshold values t A that will generate those probability values That is qgaussinv computes the values of such that the area under the normalized Gaussian density between f and infinity equals aj gt ie Example The following MSHELL expression computes the ordinate values under the Gaussian density function for a row vector with values of 0 25 0 50 and 0 75 198 Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide Appendix B Internal Functions 199 randg Gaussian Random Number Generator Syntax randg n m Description This function is similar to randu except tha
34. s Manual 11 12 2007 Extendibility of the Environment In addition to the internal funtions included and listed above you can further extend the capabilities of MSHELL by System level access Accessing your own C funtions or by Accessing other applications that support Dynamic Data Exchange MSHELL permits the users to trigger the execution of stand alone programs via the system command The use of this functions is discussed in page 262 Dynamic Data Exchange MSHELL is capable of communicating with other applications that support dynamic data exchange DDE The following MSHELL commands are used to establish communications links with other applications via DDE ACT REACT MSHELL User s Manual DDEInit this command is used to start a conversation on a particular topic with the server application Syntax chan DDEInit Application Name Topic Application Name is the name of the application you want to communicate with Ex MSAccess and Topic is the name of the particular topic This command returns a channel number associated with the conversation you are requesting or 1 if the operation fails DDETerm this command terminates a conversation Syntax DDETerm chan chan is the number returned by DDEInit DDEExec this command is used to send a command to the server application once the DDE conversation is established Syntax DDEExec chan cmd chan is the channel number returned b
35. topic Sdatabase SQL chanl DDEInit MSAccess Stopic Stemp SELECT NEW_IMAGENAME status DDEPoke chanl SQLText S temp Stemp FROM header status DDEPoke c Stemp y ERE status EPoke c Stemp ENSOR_NAME UVVIS status DDEPoke c Stemp D AND MAP wie status ke c Stemp D x CENTE status DDEPoke c temp D CENTER GITU status DDE ke c Stemp status DDE res DDERegS c ke c if strlen res nan nan nan nan nan nan nan nan gt 1 SO L SO L SO FILTER B AND L SO CENTER _ LATITUDE lt 35 0 1 SO CENTER DE lt 30 0 1 SO 1 SO 0 LText Stem LText Stem LText Stem LText Stemp LATITUDE gt 14 0 LText Stemp LONGITUDE gt 25 0 LText Stem LText Stem Lis Datiast xy query Squery n S res DDETerm chan1 42 e Table of Contents MISSION_PHASE LUNAR REACT MSHELL User s Manual 11 12 2007 Dynamic Link Libraries DLL MSHELL permits the users to provide their own functions via dynamic link libraries Following are the steps required to make use of this capability First write a C program containing the code you want to execute Include user h in the header section user h is included as part of the installation The functions that can be called from MSHELL must
36. w Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT T fits ready handle 1 fits_get_num_hdus Returns the number of HDUs Syntax num_of_hdus fits_get_num_hdus handle Description Returns the number of HDU Header and Data Unit from a previously opened fits file Note that an HDU may consist entirely of a header with no data records Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT Ta fits ready num_of_hdus fits_get_num_hdus handle ready num_of_hdus 2 fits_movabs_hdu Moves to a specified hdu number Syntax hdu_type fits_movabs_hdu handle hdu_number Description Moves to the specified hdu_number so hdu_number is less or equal to num_of_hdus HDU type IMAGE_HDU 0 Primary Array or IMAGE HDU ASCIIL_TBL 1 ASCII table HDU 112e Internal Functions REACT MSHELL User s Manual 11 12 2007 BINARY_TBL 2 Binary table HDU Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT WM fits ready num_of_hdus fits_get_num_hdus handle num_of_hdus 2 ready HDU_type fits_movabs_hdu handle 1 ready HDU_type 0 fits_get_hdu_type Returns type number of current HDU Syntax type_num fits_get_hdu_type handle Description Returns the type number of current HDU The possible types are IMAGE_HDU 0 Primary Array or IMAGE HDU ASCII_TBL 1 ASCII table HDU BINARY_TBL 2 Binary tab
37. zero n index v print n finite_index v index to elements that finite n finite_index v print n eqindex v zZz index to elements equal to 0 n eqindex v w print n eqindex v minf index to elements equal infinity n eqindex v minf print n eqindex v nan index to elements equal to NaN n eqindex v nan print n nan_index v index to Not a Number elements n nan_index v print n ltindex v uno index to elements less than one n ltindex v uno print n rindex v 1 0 1000 index to all elements between minus infinity and 1000 n rindex v 1 0 1000 print n geindex v 1 index to all elements gt 1 n geindex v 1 eqindexS Equality Index String eqindexS a b Appendix B Internal Functions 107 Description Finds the locations of all the elements in an input string which equal a defined substring where a is the input string and b is the substring This function returns a 1 x M complex array where M is the number of points equal to the specified value and whose array elements contain the coordinates of each string position encoded as follows the real part contains the column index and the imaginary part contains row index of the location If no elements are matched the value 1 is returned See Also The functions strContains a b strStartWith a b and strEndsWith a b may be more convenient to use depend
38. 1 for inverse projection Pcontrol text contains all the detail controlling parameters for the mapping transformation It follows the USGS Cartographic Projection Program syntax see Appendix D Cartographic Library for syntax details The output is out complex array with corresponding carthographic values Real part has x component and imaginary part has y component Note Geo2Cart makes direct use of a DLL based on the Cartographic Projection Program developed by U S Geological Survey version 4 4 3 See Cartographic Projection Procedures for the UNIX Environment A User s Manual Evenden 1990 Open file report 90 284 A web reference can be found at http www remotesensing org proj See Also Geo_cs2cs Some of the function using this Geo2Cart and Geo_cs2cs are dworld and MI_geo2cart msf Map_Image msf Example This function can also be accessed using the external function script called geo2cart msf This script acts as a trivial wrapper around Geo2Cart 128 Internal Functions REACT MSHELL User s Manual 11 12 2007 EXAMPLE START generate test matrix of geographic data points g cgrid 180 180 90 90 1 1 gr g real gi g imag view gr view gi wtile construct controlling parameters for the mapping transformation SLF n Scontrol proj sinu 2 E AN ellps clrk66 oSLF T AN lat_0 00 ESSLE Lon_0 00 2 SLF no_defs entl 1 forward transformation
39. 167 ncols Number of Columns 181 nint Nearest Integer 184 nrows Number of Rows 184 ones Initialize an Array to all ones 185 real Real Part of an Array 215 show Display Variables Information 244 sign Sign of Array Elements 245 sqrt Square Root 254 sum Sum All Elements 260 sume Sum Column Vectors in an Array 260 sumcum Row Wise Cumulative Sum 260 sumr Sum Row Vectors in an Array 260 syd Singular Value Decomposition 261 trace Sum Diagonal Elements 282 vartype Returns the Variable Type 287 zeropad Expand an Image with Zeroes 304 zeros Initialize Array to all Zeros 304 Intensity Mapping IO Look up Table Operators heqlut Histogram Equalization LUT 137 hyplut Hyperbolic Histogram 139 select Selects an Output Look Up Table 236 weolut Color Look up Table 292 wolut Windows Output Look up Table 294 xlut Look Up Table Transformation 301 scale255 Scale to 8 bit Range 235 Selected Pixels bthresh Binary Threshold 73 geclipto Greater or Equal Clip to 126 gtclipto Greater than Clip to 136 leclipto Lower or Equal Clip to 154 Itclipto Lower than Clip to 158 Ithresh Less than Threshold 158 Data Formats FITS fits_close_file closes a fits file 118 fits_get_colnum Returns the column 116 fits_get_coltype Returns the column type 117 fits_get_hdu_type Returns HDU Type 113
40. 2 00 The following MSHELL commands will assign to the string variable str1 the concatenation of two strings ready str SSS creates a string ready strl S str last name concatenates another string ready str1 SSS last name ProVIEW User s Guide Appendix B Internal Functions 61 Column Augmentation Syntax a b Description Given two arrays with the same number of columns this operation will append the corresponding columns of one array to the other array Example The following MSHELL statement will append the columns of b to the columns of a and store the result in c ready c a b The number of rows in c equals the sum of the number of rows in a and b The following MSHELL commands illustrate the above ready a 0 3 1 creates a column vector ready b ones 2 1 creates a 2 d identity column vector ready c a b augments a with b and assigns result toc Assignment Syntax c a Description This operator symbol is used to assign the output of an MSHELL expression to a variable MSHELL will not allow you to assign an array expression to an already defined string variable or vice versa Example The following MSHELL statement will assign the sum of two constants to the newly defined variable c ready c 4 sqrt 3 333 If the variable c has already been defined its content will be changed
41. Fast Fourier Transform 110 fft2 Two dimensional Fast Fourier Transform 110 ifft Inverse one dimensional Fast Fourier Transform 143 ifft2 Inverse two dimensional Fast Fourier Transform 143 Spectral Windows blackw Blackman Harris Window 71 hammiw Hamming Window 137 Spatial Operations Correlation Operations convol Discrete Convolution 78 convoltl Truncated Discrete Convolution 79 spatf Spatial Filter 247 xcorr Cross Correlation 299 xcorrfft Cross correlation of two FFT s 299 xcorrt Truncated Cross Correlation 299 Interpolation Resampling blinterp Bi linear Interpolation 72 decimate Signal Decimation 94 linterp Linear Interpolation 154 zinterp Zero Order Interpolation 304 Local Statistics covm Covariance Matrix Estimation 81 82 gauss N Dimensional Gaussian Density 126 hist Histogram Generator 138 hist255 Histogram of 8 bit data 138 qgauss Area Under Gaussian Density 198 qgaussinv Inverse of qgauss 198 randg Gaussian Random Generator 200 randinit Random Number Seed Initializer 200 randu Uniform Random Generator 200 Morphological img2contour create contour image 147 skeleton Binary Conversion Filter 246 Flow Control and Relational Operators Single Line Comment 58 continuation line delimeter 58 lt gt logical operators 63 END Ends Execution of a Script 106 exit Exit MSHELL
42. Guide Appendix B Internal Functions 233 opening a Remote MSHELL session Ssrvr rmshell_session_init 212 48 10 150 if srvr W print Error opening Remote MSHELL session return loading data coverage request template from file Scov readtext idbTemplate txt nSecsToWait 5 performing request asynchronously and checking for errors status rw_getMosaicXMLAsync S srvr Sidb if status status text return now waiting for the response to be ready print waiting int2str nSecsToWait seconds isBusy rw_waitForMosaicXML srvr nSecsToWait while isBusy print server is still busy n print waiting int2str nSecsToWait seconds isBusy rw_waitForMosaicXML S srvr nSecsToWait print server is ready if request has been performed successfully isBusy text contains the XML MOSAIC string Smosaic isBusy text Smosaic closing the Remote MSHELL session status rmshell_session_close S srvr 234e Internal Functions REACT MSHELL User s Manual 11 12 2007 S SatVIEW computes spacecraft geometry info Description this function has been changed to an external stand alone application See Appendix save Saves Arrays or Strings to Disk Syntax save savefile array1 array2 arrays save savefile all save savefile all_ local save savefile allstr Description Used to save arrays to disk wherby one specifies the desi
43. IP addr of the client This is the root www directory which is used when in cgi mode Contains the requested output document type HTTP header Content type This must be set when provweb exe is called i e http server com cgi bin provweb exe _xtype text html Note the variable name there is _xtype The output behaviour is as follows Blank ProVIEW Web begins a text html document with fixed font formatting cHTML gt lt PRE gt If you don t want the fixed font lt PRE gt mode you must specify the output document type such as text html explicitly This simple default behaviour is called ProVIEW Web Calculator mode dynamic ProVIEW web sends NO Content type header It is up to the script being executed to output this string It must be of the format Content type type sub type n n i e print Content type text html n n The blank line is essential for separating the header from the document data type sub type ProVIEW Web will send the Content type header using the specified type sub type i e text plain or image jpeg Image file output format when using view command in ProVIEW Web Selects the manner in which math errors or exceptions are reported and handled If M_matherrflag 0 no Appendix B Internal Functions 165 166e Internal Functions errors are reported If M_matherrflag 1 mathematical exceptions are reported and script file execution halted unti
44. If the relation in the expression returns a non zero value the first group of statements is executed otherwise the second group of statements is executed An early exit from an if block can be performed using the ifbreak statement While Statement while expression statements The while statement causes repeated execution of its statements as long as the expression results in a non zero value The relation is tested before each execution of its range and if the relations is false control passes to the next statement beyond the range of the while statement The traditional for statement used in the C language i e for expression relation expression2 statements can be constructed using the while statement as REACT MSHELL User s Manual 11 12 2007 Always use parenthesis when using relational logical or equality operators Do not assume a specific precedence lt gt lt gt expression while relation statements expression2 An early exit from a while loop can be performed using the wbreak statement Control Expression with Numeric Values The statements in an if or while block are executed depending on the value returned by the control expression The control expression can include relational equality and logical expressions Relational logical and equality operators all have the same precedence Hence parenthesis should be used to obtain the des
45. MOE LARRY LA RBA TEEEMP_MAX CURLY print n n print Note Anchor are used to limit a match to a particualr location in the string n print a for the start of the string n print for the end of the string n TAY print a at the beginning of a string means that it must match the beginning of the string n Spattern mo b preg_match a pattern print INPUT STRING n Sa n print SEARCH PATTERN is Spattern n print nOUTPUT of preg_match i e b text n b text n print nOUTPUT of preg_match i e b n s float2striby S0 22 n0 print Note a at the end of the regular expression string means that it must match the end of the string n pattern m ing use m to activate inline option to use to match after and to match before internal new lines b preg_match a pattern print INPUT STRING n S a n print SEARCH PATTERN is S pattern n print nOUTPUT of preg_match i e b text n b text n print nOUTPUT of preg_match i e b n float2str b 0 n print Note all characters within a are treated as a set of acceptable characters n Spattern LAR AB b preg_match a pattern print INPUT STRING n Sa n print SEARCH PATTERN is Spattern n print nOUTPUT of preg_match i e b text n b text n print nOUTPUT of preg_match i e b n float2str b 0 n Spattern M A E N allo
46. Returns the WKT string for this SRS proj4 osr_export_to_proj4 osr_hdl Returns the PROJ 4 string for this SRS 320e Internal Functions REACT MSHELL User s Manual 11 12 2007 Table 2 GDAL Supported Raster Formats see http www remotesensing org gdal formats_list html updates Accessbile Long Format Name Code Creation Georeferencing From MSHELL Arc Info Binary Grid ad aw e e e a ao M Microsoft Windows Device Independent Bitmap bmp BMP Yes Ys i AGB BSB Nautical Chart Format kap B8 MNM Ys D Po ooo CEOS Spot for instance os MN mmy E First Generation USGS DOQ Lao boar Mo kse k New Labelled USGS DOQ do Do2 Mo vs ECE Military Elevation Data dt0 dtlh DTED MN Yes ENVI hdr Labeled Raster EM Ys Yes MNolims Envisat Image Product a Envisat No No o Bo EOSAT FAST Formt FAST No Ys O Do fe msaa TS Yes m Graphics Interchange Format gif GF Yes INo o ooo Po GRASS Rasters o eass Mo ws o Booo TIFF GeoTIFF ci 0 one Yes Ys 4GB Hierarchical Data Format Release 4 HDF BDF4 Yes Yess B amp B ooo Erdas Imagine im HFA Yes Yes Nolim O Atlantis MFF O W Ys Ys Nolms O o Japanese DEM mem mMm m Y D Poo JPEG JFIF ipe JPEG Ye Yes 6550x6550 IPEG2000 Gip221 oxo Ye s D eEG2000 i220 xak Ye vs D E E ea E C intibiieekGuiinua me We Ne Pe etph apap jem ves INOS Ie limits SY kil Pimap pm J ves Ino
47. Syntax dbclose database Description Use this command to close the alerady opened database Example see dbrsgetrows example dbrsrowcount Returns the result set count Syntax dbrsrowcount Description This function works after a dbconnect and dbsqlexec After a query this function when invoked will return the number of rows in the result set Example see dbrsgetrows example dbrsgetrows Returns the result set as a string data Syntax dbrsgetrows srow erow dbrsgetrows srow erow fname dbrsgetrows colnames srow erow dbrsgetrows colnames srow erow fname where srow start row number erow end row number fname output file name string colnames list of requested field names Description This function works after a dbconnect and dbsqlexec After a query this function when invoked will return the result set data as a string The columns are separated by a and rows are 86 Internal Functions REACT MSHELL User s Manual 11 12 2007 separated by new lines This function may be called multiple times on the same result set There are different ways to extract the results of the query using this function Example case ProVIEW User s Guide The following example shows most of the dbrs function being utilized on a simple test status Squery status nrec srow erow Sfname Scols Scols Ssl print s2 print s3 print s4 print dbconnect default_wipe
48. UniversalTransverseMercator UTM nicol NicolosiGlobular vandg _ vanderGrinten I nsper _ _ Near sidedperspective vandg2 vanderGrintenII nzmg NewZealandMapGrid vandg3 vanderGrintenIlI ob_tran GeneralObliqueTransformation vandg4 vanderGrintenIV ocea ObliqueCylindricalEqualArea vitk1 Vitkovskyl oea OblatedEqualArea wagl Wagnerl Kavraisky VI omere ObliqueMercator wag2 Wagnerll ortel OrteliusOval wag3 Wagnerlll ortho Orthographic wag4 WagnerIV conic PerspectiveConic wags WagnerV oly Polyconic American wag6 WagnerVI putp1 PutninsP1 wag7 WagnerVII utp2 PutninsP2 weren WerenskioldI utp3 PutninsP3 wink WinkelI utp3p PutninsP3 wink2 Winkelll putp4p PutninsP4 wintri WinkelTripel putpS PutninsP5 utp5p PutninsP5 utp6 PutninsP6 putp p PutninsP6 qua_aut QuarticAuthalic For additional details on each projection see page 306 Geo_cs2cs geo coordinate system transformation Syntax out Geo_cs2cs proj4IN proj4OUT xy direction Description This function converts from the input array xy from one coordinate system to another The coordinate system must be provided by proper PROUJ4 string proj4IN scalar with text attribute set to the projection string that describes the input proj4OUT scalar with text attribute set to the projection string that describes the input direction if direction 1 gt forward transformation i e IN to OUT otherwise it will perform OUT to IN xy input coordi
49. User s Manual 11 12 2007 ready Sip getMyIP ready Sip 192 168 0 1 212 48 10 150 getpos Finds String Position Within a Line Syntax getpos str pattern Description Given a string variable str this function can be used to find the position within a line where the string pattern appears for the first time Example The following example illustrates the function Sa Now n is the n time n for all b a 2 b getpos b i getpos b e ProVIEW User s Guide Appendix B Internal Functions 133 glflyover generate perspective view of terrrain Syntax glflyover DTED mosaic CNTL dummy PandO Description Generates a perspective view of an image mosaic using input terrain elevation DTED This functions can be better understood by looking at the flyover msh script file This function is implemented using OpenGL s implementation under the respective OS The coordinate system used is depicted below An Orthographic Viewing volume Top Clipping val op Clipping value Far Clipping alue Let Clipping Value Right Clipping alue Near Clipping alue Bottom Clipping value A Perspective Viewing Volume Far Clipping alue Top Clipping value 7 Let Clipping Value Near Clipping alue Right Clipping lue Bottom Clipping value dew point 134e Internal Functions REACT MSHELL User s Manual 11 12 2007
50. a simple manner There are two types of script files in MSHELL i e FUNCTION files and Include files Function Files msf AMSHELL function file or external function permits the user to define its own functions using the MSHELL language syntax Local variables defined within a FUNCTION file are automatically erased by the MSHELL interpreter when the script file is finished Syntax A valid MSHELL function must follow the following rules e The instructions of a MSHELL function must be stored in a file with the same name as the function e g if the function name was MYFUNCG then the file name must be MYFUNC MSF Notice the addition of the msf extension e Only one function per file e Array and string variables can be used as input e A function can only return Array variables at least one must be returned Strings can be returned in the text attribute of an array variable e Ifa variable is not defined at the present function level the interpreter will not look for it at the previous function level The exception to this are system variables M_ which are treated as global e The first eight characters in the file must be the string FUNCTION follow by the list of output arguments equated to the function name and followed by the list of input arguments The following is a simple MSHELL function file 32 e Table of Contents REACT MSHELL User s Manual 11 12 2007 FUNCTION out1 out2 MYFUNC inl in2 i
51. argument in array expressions Example 1 The following statements will set all the pixels in an image X which fall within the values of 100 and 110 to 0 zroi rindex X 100 110 X zroi 0 Example 2 The following statements will compute the mean value of all those pixels in an image X which have an amplitude less than or equal to the brightest pixel in X zroi Itindex X X max mean X zrol Generalized region of interest allows for the manipulation of disjoint regions of interest in an image In this method the pixel coordinates are stored as a complex row vector The length of the vector corresponds to the number of pixels identified within the generalized region of interest The real part of the row vector serves as a column index while the complex part serves as a row index Program Flow Control and Relational Operators The if if else and while statements are used in MSHELL to alter the flow within a script file or to cause iteration The range of each of these statements is a compound statement consisting of statements enclosed in brackets ACT REACT MSHELL User s Manual Table of Contentse 27 28 e Table of Contents IF Statement if expression statements if expression statements j else statements The if statement causes execution of its compound statements if and only if the relation in the expression results in a non zero value The if else has two groups of compound statements
52. can be used to retrieve a brief description of the error rmshell_putvar Putan ARRAY variable to the remote MSHELL Syntax rmshell_putvar handle varname Description This function works after an rmshell_session_init and can be used to put the content of an ARRAY variable in the remote MSHELL interpreter It takes tow arguments a valid string handle to a previously opened remote MSHELL interpreter and the name of the ARRAY variable we want to put the content If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see rmshell_getvar example rmshell_putvarS Puta string variable to the remote MSHELL Syntax rmshell_putvarS handle varname Description This function works after an rmshell_session_init and can be used to put the content of a string variable in the remote MSHELL interpreter It takes tow arguments a valid string handle to a previously opened remote MSHELL interpreter and the name of the string variable we want to put the content If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error rmshell_session_close Close connection to a remote MSHELL interpreter Syntax rmshell_session_close IP_address Description This function works after an rmshell_session_init and can be used to close a connection to a remote MSHELL
53. closed polygons to an ESRI compliant shapefiles The first argument is the input file the second argument is the output directory and the third argument is a prefix to be put in the output filenames The input file contains ASCII text lines with comma separated values The first line is the header and contains the names again comma separated of the data columns Those names need to be less or equal than 12 characters in length Two of the columns must be lonv and latv containing the longitude and latitude coordinates of the geometric features If a feature has more than one vertex the corresponding coordinates have to be separated by double colon In case of closed polygons the lon lat coordinates of the first and the last vertex must coincide Here is an example of input file feat_i descr lonv latv pi point 140 0 82 5 l2 open 120 3 130 0 60 6 79 8 p2 closed 180 140 140 180 180 82 82 87 87 82 The function returns a status code and in case of errors a brief message is returned in the text attribute Status code legend ProVIEW User s Guide Appendix B Internal Functions 237 0 No errors 1 Input file not found 2 Cannot read input file 7 Column names gt 12 characters 8 Exactly one lonv and one latv column must be present 21 lonv and latv coordinates do not match in feature 22 Missing lonv latv columns 9 Line fiel
54. conform to the following declaration ARRAY fname ARRAY ARRAY ARRAY ARRAY ARRAY where ARRAY is a data structure defined in user h Note that the declaration requires five ARRAY inputs but the user need not use the five inputs The functions the user wants to call from MSHELL must be exportable Second generate a 32 bit dynamic link library The C compiler linker you use must be able to generate a 32 bit DLL Consult your compiler reference manual Note The memory allocation routines that MSHELL uses are contained in mem dll If you plan to use memory allocation routines in your code i e malloc calloc realloc free strdup it is strongly recommended that you use instead the functions contained in mem dll i e NewMalloc NewCalloc NewRealloc NewFree NewStrdup The file prvmem h is provided with the MSHELL installation Include it in your source code if you are going to make use of the mem dll memory allocation routines If you are using Microsoft Visual C include the import library memvc lib in your project If you are using Borland C C include the import library membc lib in your project Both memve lib and membc lib are included as part of the MSHELL installation From within MSHELL s Command Shell Window register the DLL using the following command loadDLL fullpath dllname where fullpath is the path to the DLL including drive letter and dllname is the name of the DLL Note that loadDLL will return 0 if t
55. console mode only Shows the WINDOWS Root directory WIN32 Only Shows the PROVIEW root directory contains name of error script to execute in the event of an error If empty no error script is executed By default MSHELL starts M_errorscript empty String output of last error encountered The ProVIEW MSHELL version number Note After version 3 significant changes in the handling of the color palette where introduced via the x LUT image attribute Entering this alone will send a screenshot to the current default printer GUI only M_inputfocus provides name of image that has the present or last input focus of the GUI Obsolete see array window operators m_viewx0 and m_viewy0 Obsolete see array window operators m_viewx0 and m_viewy0 O send output to STDOUT only default 1 send output to M_logfile 2 send output to STDOUT and M_logfile REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide Math Related M_logfile M_OS M_processid used as the output file including path provides the operating system under which the interpreter is running UNIX or Windows_NT provides process id on current session M_execution_mode CGI mode M_cgi M_ipaddr M_wwwroot M_xtype M_cgiview M_matherrflag provides execution mode for the version of the executable that is using MSHELL e g GUI or CGI or CONSOLE 1 means running in cgi model 0 otherwise Only in web based mode show the
56. cos angle 6926 128 sin angle 256 256 flyby V roi i itl meter 1 var Variance Syntax var a or a var Description Given an input array a var a computes the variance of the elements in a The variance is computed using the following expression 1 I 1 J 1 var a a where J I i 0 j 0 dn a 5 a is the sample mean of a for all j i J I i 0 j 0 where j andi are respectively row and column indices varname Returns the Variable Name Syntax x varname Description returns the name of the variable as a string i e x For example mystring x varname See Also M_inputfocus 286 Internal Functions REACT MSHELL User s Manual 11 12 2007 vartype Returns the Variable Type Syntax vartype variable Description This is used to pass the type of the specified variable to the screen so that the user knows what type a particular variable is Type is a number which can be one of the following possibilities 0 means that the variable does not exist 1 signifies an integer or array 2 signifies a string vec2image Vector Format to Image Format Syntax vec2image Description converts from vector format into an image representation in memory UNDER DEV viewout Closes array viewing window Syntax viewout image Description Closes array viewing window associated with the image variable GUI only view Enables Screen Disp
57. data while hist255 below is optimized for integer data in the range of 0 to 255 hist255 Histogram of 8 bit data Syntax hist255 a or a hist255 Description Generate a histogram of the distribution of intensity values in the input array The data values within the input array must assume only integer values in the range of 0 to 255 inclusive The returned vector has 256 entries where a k positive value in the 1 entry implies there were k elements in the input array which assumed the P value 1386 Internal Functions REACT MSHELL User s Manual 11 12 2007 Figure 3 Example The following is a typical application ready x reada eqohare chr char ready plot hist255 x 8000 00 D 4000 00 4 hyplut Hyperbolic Histogram LUT Syntax hyplut a imin imax Description Computes the 256 entries 8bit look up table or intensity transformation which when applied to the input image will result in a hyperbolic distribution of intensity values The input arguments are the input image a and the intensity limits min and imax respectively the minimum and the maximum values that any intensity value in a can be map to Both imin and imax must be between 0 and 255 inclusive It is expected that the input image is representative of an image with 8 bits pixel An advantage of using a hyperbolic lut is that it accounts for the assumed logarithmic or cube roo
58. day If x localtimenow then x text will have a nicely formatted time string Example 156e Internal Functions REACT MSHELL User s Manual 11 12 2007 ready t localtimenow ready t 10 0 X row 0 2004 00 4 00 190 00 ready t text 2004 07 08T10 43 59 578 see also gmtimenow log Natural Logarithm Syntax log a or a log Description Computes the natural logarithm of each array element The actual mathematical expression computed is given by c log a forallj i where j and i are row and column indices respectively The Log of zero is not defined and will generate an error where as the Log of a negative number will generate a complex number Example The following MSHELL statement will compute the natural logarithm of a and store the result in c ready c log a log10 Base 10 Logarithm Syntax log10 a or a log10 Description Compute the base 10 logarithm of each array element The Log10 of zero is not defined and will generate an error whereas the Log10 of a negative number will generate a complex number The actual mathematical expression computed is given by Chia log 9 a for all j i where j andi are row and column indices respectively Example The following MSHELL statement will compute the base 10 logarithm of a and store the result in c ProVIEW User s Guide Appendix B Internal Functions 157 ready c logl10 a ltclipto Low
59. directory 264 sys_copy copies files 272 sys_del delete files or empty directories 274 sys_deltree deletes an entire directory tree 275 sys_dir directory listing 267 sys_dirlist controlled directory listing 267 Appendix B Internal Functions B 53 sys_dirsize size of a directory tree 276 asin Inverse Sine 69 sys_filesize size of a file 277 atan Inverse Tangent 69 sys_mkdir creates a directory 266 atan2 Inverse Tangent 70 syS_move moves or renames files or directories 269 cos Cosine 81 sys_pwd current working directory 263 cosh Hyperbolic Cosine 81 sys_ren renames files or directories 271 sin Sine 245 sys_sendmail sends mail to destination 263 sinc Sinc Function 245 system Issues Operating System Command 262 sinh Hyperbolic Sine 246 Trigonometric Functions tan Tangent 279 acos Inverse Cosine 65 tanh Hyperbolic Tangent 279 B 54e Appendix B Internal Functions REACT amp MSHELL User s Manual 11 12 2007 Internal Functions Alphabetical List Much of REACT power resides in the MSHELL Interpreter With over 140 internal commands REACT has a flexible structure that readily permits tailoring to specific applications through User Defined external functions and script files This appendix is an alphabetical listing with descriptions and examples of all the current REACT MSHELL Internal Functions Symbols a b s n
60. except for small errors resulting ProVIEW User s Guide from computer round off errors 141 Appendix B Internal Functions ident Generate an Identity Array Syntax ident n Description Create an N x N array in memory in which the main diagonal elements are set to value 1 and all off diagonal elements are set to zero Example The following MSHELL statement will create a 4x4 identity array in memory ready row 0 1 00 row 1 0 00 row 2 0 00 row 3 0 00 IF ELSE IF ELSE Conditionals Syntax if expression statements or if expression statements jelse statements Description This condition is used to execute the statements if the expression is considered true 142e Internal Functions REACT MSHELL User s Manual 11 12 2007 ifft Inverse 1 D FFT Syntax ifft a or a ifft Description Compute the one dimensional inverse Fourier transform of the input array It is expected that the row dimension of the input array is a power of two Note that the output of this operation is a complex array ifft2 Inverse 2 D FFT Syntax ifft2 a or a ifft2 Description Compute the two dimensional inverse Fourier transform of the input array It is expected that the dimensions of the input array are powers of two Note that the output of this operation is a complex array imag Imaginary Part Syntax imag a or a imag Description For a complex input array extract the imaginary part
61. from the savefile See Also save loadDLL Loads a DLL for Execution Syntax loadDLL pathname Description Used to load a DLL for later execution using calIDLL The path and name of the DLL must be passed as a string Example The following will load the delaunay dll Notice that the path to this file has also been included ready loadDLL c proview bin delaunay d1l1 ProVIEW User s Guide Appendix B Internal Functions 155 LOCAL Declare a locally scoped variable Syntax LOCAL my_array Description Declares a variable local to the MSF function Only necessary when in the LOCALOFF mode LOCALON Turn on locally scoped variables Syntax LOCALON Description Used in an MSF function Variables referenced after this command will NOT affect top level variables but will reference local function variables By default MSF functions are in the LOCALON state LOCALOFF Turn off locally scoped variables Syntax LOCALOFF Description Used in an MSF function Variables referenced after this command will affect variables defined outside of the local function instead of referencing local function variables Use with caution By default MSF functions are in the LOCALON state localtimenow Local Time Now Syntax localtimenow Description Returns the current system time as a column vector Columns 0 5 correspond to year month day hour minute second Column 6 is the day of the week Sunday 0 Column 7 is the Julian
62. ftp_get remotefile localfile Description This function works after an ftp_session_init and downloads the specified remote file from the FTP server assigning the specified local file name to the local copy Multiple file names can be specified by using new lines as file name delimiters If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see ftp_list example ftp_list List FTP Server Files and Subdirectories Syntax ftp_list Description This function works after an ftp_session_init and can be used to retrieve as a string variable the list of files and subdirectories of the current FTP Server directory If no connection is established with an FTP Server it returns an empty string Example The following example shows most of the FTP functions being utilized on a simple test case 122e Internal Functions REACT MSHELL User s Manual 11 12 2007 username and password are not required for connecting to the FTP server s ftp_session_init ftp csc noaa gov 21 whenever the returned status is a non zero value an error occurs if s s text return changing to a different directory s ftp_cd incoming ameredith act Lf ees f s text return print Current directory is ftp_cwd listing subdirectories and files of curtrent directory ftp_list downloading a file from the F
63. function Description Applies a user selected or user defined spatial filter to the input array The filter is implemented over a moving window through out the whole input array The dimensions of the window are N xM The window must be able to fit within the dimensions of a otherwise an error message will be generated The final argument function is the name of a single argument internal MSHELL function which returns a scalar value e g var mean max min ProVIEW User s Guide Appendix B Internal Functions 247 Example This module provides significant flexibility for performing arbitrary spatial filtering functions For example the local mean and variance over the array a using a N x N window can be computed respectively using the following MSHELL calls spatf a N N mean spatf a N N var Likewise the local maximum over a 9 x 9 window can be computed with spatf a 9 9 max sqlite_create Creates an empty SQLite database Syntax sqlite_create db_filename Description This function creates an empty SQLite database and stores it in db_filename absolute path Note that db_filename is created by the sqlite_create function and must not exist before If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error sqlite_connect Connects to an SQLite database Syntax sqlite_connect database De
64. has a nodata value associated with it the nodata value will be honoured That is no contours will be generated for nodata pixels shapefile The name of the shapefile to generate The name does not require an extension the shp shx dbf and prj extensions will be added as needed If the shapefile already exists it will be deleted and a new one created attr_name The name of the attribute that should be created in the shapefile and used for elevations This may be NULL if no elevation attribute is required use_3d 1 if the produced shapefile should be 3D with the contour elevation associate with each vertex in the file Note that 3D shapefiles are not nearly as widely supported by applications as 2D shapefiles Example see example in function shape2contour ProVIEW User s Guide Appendix E Geographic Data Abstraction Library 319 REACT MSHELL OGR within GDAL Library Support osr_hdl osr_new_spatial_reference WKT Creates a new OpenGIS Spatial Reference System SRS object and returns a handle to this object The input WKT is optional An empty string can be passed status osr_destroy_spatial_reference osr_hdl Destroys the SRS object status osr_import_from_proj4 osr_hdl proj4 Import PROJ 4 coordinate string The OpenGIS Spatial Reference object is initialized from the passed PROJ 4 style coordinate system string Example pszProj4 proj utm zone 11 datum WGS84 WKT osr_export_to_wkt osr_hd1
65. has been added to allow just read access 0 or read and write access 1 MSHELL Virtual variable formats Format1 Byte Format 2 PC16 Format 3 Sun16 Format 4 PC float Format 5 Sun float Format 6 PC32 Format 7 Sun32 Format 8 PC16 unsigned Format 9 Sun16 unsigned See Also Vclose Vnew Note that V is a special variable in MSHELL a virtual variable With this variable you can manipulate an image file which can be as large as the whole disk space available in the system If the user has a huge image in a file or is going to be working with an image that can not be easily hold in memory then he or she can still manipulate pieces of the large image using MSHELL s virtual variable Once a link is established between a file in disk and the virtual variable V then the user can access rectangular regions of interest in the disk file for read or write operations the user must always provide a rectangular region of interest when writing or reading from the V The following example illustrates the use of a virtual variable It corresponds to the script file flyby msh located in the MSHELL msh distribution directory M_cwd proview images clemen moonbrus roi wdef 0 0 1 1 V Vopen allmoon chr 5760 11521 1 0 ro0i 0 flyby 0 ProVIEW User s Guide Appendix B Internal Functions 285 view flyby i 0 while i lt 35 meter flyover virtual image i 35 100 angle i 35 6 28 roi wdef 2336 128
66. has side lobes that are 92dB below the main lobe Example The following generates a 256 x 256 Blackman Harris Window y blackw 256 256 YSpectrum spectrum y view Yspectrum roi wdef 256 16 256 16 32 32 plot3d YSpectrum roi Figure 2 ProVIEW User s Guide Appendix B Internal Functions 71 blinterp Bi linear Interpolation Syntax blinterp f z Description Blinterp will bi linearly interpolate between data points located in a two dimensional square grid e g an image Where f is a 2 dimensional real data array containing the input image The data points in f correspond to points in a square grid with an assumed interpixel distance of 1 in the row or column axis and z is a complex data array containing the vertices at which the input image is to be bi linearly interpolated Specifically the real part of z contains the fractional column positions and the imaginary part contains the fractional row positions at which the input image is to be interpolated Note that for every point that extrapolation is attempted the result is set to the system variable M_no_data The value of this variable can be modified by the MSHELL user Example The following example generates a simple test pattern image over a 4x4 grid The image is then bilinearly interpolated at the row coordinate 2 2 and column coordinate 1 2 ready f hammiw 4 4 test image ready f 04 0 08 0 04 29 0 54 0 29
67. in the string delimeted by commas or linefeeds are converted to float values and then saved in an array variable Values delimeted by commas are stored in the same array row The linefeed n is used as the row delimeter when copying into the array See Also str2int strlen str2float strhex2int float2str Example The following is an example of str2float usage with a 2x3 array creation ready Sstr 4 56 34 25 67 02 n12 28 34 64 3 23 define string variable ready str2float str example of str2float 10 0 X row 0 4 56 34 25 row 1 12 28 34 64 ProVIEW User s Guide Appendix B Internal Functions 255 str2int Converts Numeric String to Integer Syntax str2int string Description Returns an array where numeric values in the string delimeted by commas or linefeeds are converted to integer values and then saved in an array variable Values delimeted by commas are stored in the same array row The linefeed n is used as the row delimeter when copying into the array See Also _ str2float strlen sir2float strhex2int int2str Example See code below for example usage of str2int st2float and strhex2int Example 1 str2int x Example 2 172 34 7 5 str2int Sy note that 3 and 4 are skipped by str2int Example 3 str2int z note The use of linefeed to start new row note Automatic convertion of 1 2 to 1 Example 4 str2float z Example 5
68. inputbox enter new value INPUT MENU 1 INPUT MENU enter new value Figure 4 inputfocus Array Variable with Current Focus Syntax X inputfocus Description Sets the defined variable equal to the variable whose window currently has focus See Also M_inputfocus int Integer part Syntax int a or a int Description Computes the integer part for each element in the input array a int2str Convert an Integer to a String Syntax int2str a Description Converts the input scalar to an integer number and then to a string Example ProVIEW User s Guide Appendix B Internal Functions 151 invm Inverse of an Array Syntax invm a Description Computes the inverse of matrix a so that a multiplyed by its inverse equals the identity matrix Ll lolx File Edit Search Image Plot Data Functions Operators Window Help Ag a wese Slede axlelai ee EO o x iam xX 3 1 1 3 ready Xinv invm X Haar sai ready ready ready ready ready ready ready Line 3 Col 7 itoa Integer to Ascii same as int2str Syntax itoa x Description Converts the integer x to a string See int2str 152e Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide L ladd2groi local add of constant to selected pixels Syntax ladd2groi X groi V Description Increments every pixel in X groi by scalar or row vector
69. of REACT and MSHELL REACT MSHELL provides powerful scientific image and signal processing and visualization capability by affording you e Algebraic and matrix operations using mathematically intuitive syntax e Support of relational operators and flow control through the built in ACT s MSHELL image signal processing interpreter language e Double precision image processing computations for high accuracy which support both real and complex number operations e Over 300 operators FFT convolution edge detection ProVIEW is no longer supported by ACT and it has been replaced by REACT 11 12 2007 e Geometric operations re size and rotate images using unequal horizontal and vertical scaling e The ability to call your own functions as stand alone executables or Dynamic Link Library DLL for MS Windows implementations e The ability to access SQL database engines via ODBC e Flexible multiple document interface MDI for the display of images plots and scripts e Contrast processing linear stretching intensity range remapping e Pseudo Color Lookup Tables for each Image with as many colors as the hardware permits e Interactive graphics i e 2D 3D and Contour Plots e Ability to support multiple image format support ASCII 8 bits pix floating point in addition to key standard formats such as TIFF BMP FITS PGM PPM PDS e Interpreter access to many industry standard geo data formats via the ope
70. of their use is found in the section Appendix A List of Internal Functions Throughout most of this manual the terms image array or matrix can be interchanged without loss of generality The upper left element in an image or array is denoted as element row 0 col 0 16 e Table of Contents There are four basic types of variables e Array variables holding floating point numbers e String variables holding character strings and e System variables used to control the interpreter environment e Virtual Variable Array Variables The basic variable in MSHELL s interpreter is a two dimensional array structure More specifically if a is the name of an array then it points to an array structure of the form Ao 0 Ay 0 Aora aio Qa CU Ara aa i Ajao Ajaa 0 Ajari where J is the number of rows in the array and I is the number of columns note volumetric access is discussed in a following section The MSHELL array structure follows the convention that array indices start at zero Having the basic variable as a two dimensional array provides a unified way to treat scalars one dimensional signals and two dimensional signals images MSHELL array variables may be either real or complex valued i e hold imaginary numbers This is particularly advantageous in Fourier transform computations The following are valid statements x randu 5 10 generate an array of random numbers x 0 0 extract ele
71. prj file can contain a WKT well known text representation of the coordiate system recn can be a Nx2 array a Nx1 array or 0 e If recn is a Nx2 array for each row the first column contains the shapefile record id and the second column contains the value to use to fill in the corresponding polygon e if itis a Nx1 array the column vector contains the shapefile ids to extract from the shapefile and e if itis 0 then all the shapefile records are extracted The value used to fill in the polygons in the second and third case is determined by the content of the system variable M_plotcolor The returned image is a combination of the input image and the filled in polygons Example The following example illustrates the function z ones 180 360 100 Sfile react_data global place_find admin98 shp c shp2fillimage file z 180 90 180 90 0 view c shp2vector Retrieve verticies from a shapefile Syntax shp2vector dbf_filename ID 242e Internal Functions REACT MSHELL User s Manual 11 12 2007 Description Given a shapefile name shp return the verticies for the given shapefile object identifier ID shpGetInfo provides information on a shapefile Syntax info getshpinfo filename or info shpGetInfo filename Description This function returns an array of information about the shapefile the description of the output follows file_cd 9994 fileSize version shapeT
72. remotely status rmshell_execute S srvr x x scale255 status rmshell_execute Ssrvr Ss smodify s pine VEN y getting back results x rmshell_getvar srvr x s rmshell_getvarS Ssrvr s view x s closing Remote MSHELL session status rmshell_session_close S srvr rmshell_getvarS Geta string variable from the remote MSHELL Syntax rmshell_getvarS handle varname Description This function works after an rmshell_ session_init and can be used to retrieve the content of a string variable defined in the remote MSHELL interpreter It takes tow arguments a valid string handle to a previously opened remote MSHELL interpreter and the name of the string variable we want to retrieve the content If the specified variable does not exist or if a an error occurs it returns an empty string Example see rmshell_getvar example ProVIEW User s Guide Appendix B Internal Functions 221 rmshell_putfile Upload a file from the remote MSHELL Syntax rmshell_getfile handle filelist Description This function works after an rmshell_session_init and can be used to upload a file to the remote MSHELL interpreter It takes tow arguments a valid string handle to a previously opened remote MSHELL interpreter and a comma separated string containing the input file name and the output file name If successful it returns 0 otherwise it returns a non zero value and the text attribute
73. see alternateBSQ example alternateBSQ describe array as a BSQ volume Syntax alternateBSQ x Nrows Ncols Nbands Description Use this command to let MSHELL know that when accessing the user specified variable say x to use an alternate volumetric representation In essence this commands sets the internal variable attributes x m_voltype 1 i e a band sequential BSQ representaionand It also sets the x m_voldim to x m_voldim Nrows Ncols Nbands If the user provided alternate representation is not possible it will return an error message Once the alternateBSQ command is executed any view command will make use of the alternate representation To read the voldim information use x m_nrows3d x m_ncols3d and x m_nband3d Example ProVIEW User s Guide Appendix B Internal Functions 67 free all load an image and creatre a BSQ representation using shifted version of the image xp reada eqohare chr char load image y shiftc xp 1 1 shift by one pixel z shiftc xp 15 15 shift by 15 pixels layers xp y z create BSQ cube show layers if 1 alternateBSQ layers xp nrows xp ncols 3 arrange layers text Band sequential image with 3 bands n Each band are shifted versions of the same image view layers request view myColorImage layers alternateRGB myColorImage view myColorImage roi wdef 0 0 xp nrows xp ncols green_extracted layers
74. server in the variable srvrlP This function does not resolve the name of the machine it must be the IP address The function will return a status value The text component of the status can be checked for any error message The input parameters are srvrlP IP address of mail server to use from email address of sender ProVIEW User s Guide Appendix B Internal Functions 263 to subject message Example Sending email SsrvrIP Sfrom Sto Ssubject message status status text email address of receiver subject string message string 207 87 28 34 me actgate com info actgate com test Just a test of sendmail sys_sendmail srvrIP Sto Ssubject Smessage Syntax Description sys_cd sys_cd newdir Changes the current directory This function changes the current working directory to newdir If successful it returns 0 otherwise it returns a non zero value and the text attribute is set with a brief description of the error see the table below Example Changing the current directory 264e Internal Functions Return value text attribute Meaning 0 Not set Success 1 Set The directory does not exist 2 Set The argument is not a directory 3 Set Cannot access the directory REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide Sdir sys_pwd print Current directory before S dir s sys
75. tree 4 Set Directory access denied Example Reading the file size of a directory tree 276 Internal Functions size of the current directory size sys_dirsize size of the data directory size sys_dirsize data if size lt 0 print An error occurred size text return REACT MSHELL User s Manual 11 12 2007 sys_filesize Returns the size of a file Syntax sys_filesize filename Description Returns the size of an existing file in bytes If an error occurred it returns a negative value and the text attribute is set with a brief description of the error see the table below Return value text Meaning attribute Size in bytes Not set Success 1 Set filename does not exists 2 Set filename is not a file 3 Set filename is not readable Example Reading the file size file fatfile dat size sys_filesize file if size lt 0 print An error occurred size text return print file size is int2str size sys_cat Concatenates input files Syntax sys_cat input_files output_file ProVIEW User s Guide Appendix B Internal Functions 277 Description Concatenates the input files and writes the result in the specified output file The input files list Sinput_files is comma separated If an error occurs it returns an exit code greater than zero with the text attribut
76. txt slhdr sqlite_getrows 0 0 if sihdr slhdr text return sl sqlite_getrows srow erow if si sl text return print SQLITE Test 1 extraction of records s int2str srow through int2str erow print slhdr text sl text n s2hdr sqlite_getrows S cols 0 0 if s2hdr s2hdr text return s2 sqlite_getrows cols srow erow if s2 s2 text return print SQLITE Test 2 extraction of records s int2str srow through int2str erow provided column names n print s2hdr text s2 text n s3hdr sqlite_getrows 0 0 filename if s3hdr s3hdr text return following Appendix B Internal Functions 251 Syntax where 252 Internal Functions s3 sqlite_getrows srow erow filename if s3 s3 text return print SQLITE Test 3 extraction of records s int2str srow through int2str erow Result is also written into the specified file n print s3hdr text s3 text n s4hdr sqlite_getrows cols 0 0 filename if s4hdr s4hdr text return s4 sqlite_getrows cols srow erow filename if s4 s4 text return print SQLITE Test 4 extraction of records s int2str srow through int2str erow following provided column names Result is also written into the specified file n print s4hdr text s4 text n Scols lat1 lon1 erow 10 s5 sqlite_getrowsfloat S cols srow erow prin
77. unsigned long sizei unsigned char type fn void SetFree void fn _Free void ARRAY a fn ROKK RK KI RRR A kk kk kk kk kkk kkk kkk kkk kkk kk kk AAA A eA A ee oe kkkkkkk kk ARRAY test ARRAY al ARRAY a2 ARRAY a3 ARRAY a4 ARRAY a5 UN32 i J ARRAY c InitA test al gt sizej al gt sizei 0 for i 0 i lt al gt sizej i 44 e Table of Contents REACT MSHELL User s Manual 11 12 2007 for j 0 j lt al gt sizei j e gt re i j al gt re i j 10 0 return c For illustration a web version of the MSHELL engine can be accessed at http www actgate com pcalc htm MSHELL commands can be typed on the left hand side and executed on the server side De ER Yew Feot Tock te Hk OJA Osean Graces Gem 9 be OO do ProVIEW Web en line fecummeatation Laternal Fancien Brest Copyrigh r 1989 199 ky Applied Coherent Trehmolingy AN Rigihts Reserved vampirs nean y Input Box for Commands 3d plot of Test Image Execute Command Clear the form Note The file keywords txt located on the same main directory where MSHELL is residing can be used to specify all commands that remote users are not allowed to execute This is used as safety measurement ACT REACT MSHELL User s Manual Table of Contentse 45 46 e Table of Contents REACT MSHELL User s Manual Appendix A MSHELL SCRIPTS External Functions Tree
78. velocity over ground v0 groi complex 0 0 set to 0 those points for which we do not have valid data values v0abs v0 abs view v0abs select starting trajectory points to use resolution 0 5 rlong maxmin LL real rlat maxmin LL imag llv cgrid rlong 0 1 rlong 0 0 rlat 0 0 rlat 0 1 resolution resolution create a grid of interesting points llv llv convtov convert grid to a vector invoke trajectory function secPerHour 3600 tpnts 24 4 24hours 4 days params secPerHour tpnts traj curveTraj LL v0 llv params convert trajectory output to row amp columns on the screen UL LL 0 0 LR LL LL nrows 1 LL ncols 1 NROWS LL nrows NCOLS LL ncols inlist traj trajRC latlong2rc UL LR NROWS NCOLS inlist allocate output image and select a LUT out v0abs output image out m_viewmaxval out max out m_viewminval out min REACTpal 1 84e Internal Functions REACT MSHELL User s Manual 11 12 2007 REACTpal text q react palettes noaa_cw modis_sst REACTrgb get_noaa_palette REACTpal if ncols out LUT 0 out LUT 0 255 1 3 if ncols out LUTdef 0 out LUTdef out LUT out LUT REACTrgb out trajRC convtov 100 lastpos trajRC trajRC ncols 1 out lastpos 255 out groi view out wtile ProVIEW User s Guide Appendix B Internal Functions 85 dbclose Closes access to an external database
79. x format y complex x x format 8 2 print nUsing floatzstr controlling format with controlling format with controlling format with controlling format with controlling format on complex array with format format format format format format wy nt mnr ready read ready ready ready ready ready ready ready ready array values 1678 X row 8 227 37 row 1 289 13 315 36 429 48 345 31 307 44 Using float2str with free format 227 37 315 36 429 48 289 13 345 31 307 44 Using float2str controlling format 227 4 315 4 429 5 289 1 345 3 307 4 Using float2str controlling format 227 4 315 4 429 5 289 1 345 3 307 4 Using float2str controlling format 227 37 315 36 429 48 289 13 345 31 307 44 withss 1F with 2 1F with 8 2F floatzstr y format i Using float2str controlling format with 14 2g 2 3e 002 3 2e 002 4 3e 002 2 2 9e 002 3 5e 002 3 1e 002 y complex x x format 8 0f print nUsing float2str on complex array with format float2str y format Using float2str controlling format with 14 2e 2 27e 662 3 15e 662 4 29e 662 2 89e 662 3 45e 662 3 07e 662 mnr Using float2str on complex array with 8 2f 227 37 227 37 315 36 315 36 429 48 429 48 289 13 289 13 345 31 345 31 307 44 30
80. z ready z 10 0 X row 0 0 00 ready eqindex y 1 0 3 Oi The mshell index operators can be useful at locating and tracking array elements with valid or not valid numeric values e g nan_index ONLY way to identify NaN elements finite_index Itindex leindex eqindex neqindex gtindex geindex rindex rindexc The following instructions can illustrate how to use index type of functions to locate elements in an array that are NaN or finite ACT REACT MSHELL User s Manual Table of Contentse 39 z 0 zero value show z minf 1 0 infinity how minf 1 0 1 0 generates a Not a Number now nan print index v index to elements that are zero n index v print n finite_index v index to elements that finite n finite_index v print n eqindex v zZ index to elements equal eqindex v Zz print n eqindex v minf index to elements equal infinity n eqindex v minf print n eqindex v nan index to elements equal n eqindex v nan print n nan_index v index to Not a Number elements n nan_index v print n ltindex v uno index to elements less than one n ltindex v uno print n rindex v 1 0 1000 index to all elements between minus infinity and 1000 n rindex v 1 0 1000 print n geindex v 1 index to all elements gt 1 n geindex v 1 40 e Table of Contents REACT MSHELL User
81. 0 0000 176e Internal Functions 0 0000 REACT MSHELL User s Manual 11 12 2007 momentr Row Wise Moment Syntax momentr a x Description Compute the x moment along each row of the input array where x can be real or complex The moment of the row is defined as a ncols aj i 0 Example The MSHELL statements on the following page will compute the second moment of each row of the array a and assign the values to b ready a randu 100 5 ready b momentr a 2 ready show a zes a S data type is number of rows 100 number of columns 5 maximum value 0 995382 minimum value 0 00161857 ready show b ee data type is number of rows 1 number of columns 5 maximum value 7 25416 minimum value 5 92651 ready b 6 48 L625 ce mshift_ul6 Bitwise shifting 16 bits unsigned integer Syntax mshift_u16 values nbits left_or_right Description Compute the bitwise shifting considering values as an ARRAY of 16 bits unsigned integers nbits is the number of bits to shift and left_or_right is the direction 0 for left shifting 1 for right shifting It returns the shifted ARRAY or a NULL ARRAY in case of an error the text attribute contains the reason Example ProVIEW User s Guide Appendix B Internal Functions 177 Syntax Description 00000 2 00000 00000 4 00000 mshift_ul6 a 1 0 00000 4 00000 00000 8 00000 mshift_u32 Bitw
82. 00 ready x x row 0 1 00 27 00 row 1 256 00 3125 00 Matrix Transpose Syntax a Description The operator symbol is used to generate the transpose of an array Mathematically this operation is implemented as Cow i col j Grows j col i for all Jt where j and i are row and column indices respectively in a Example These MSHELL statements assigns the transpose of a to c 60 Internal Functions REACT MSHELL User s Manual 11 12 2007 data randg 3 3 generate a 3x3 random array data print data 36 423 58 transpose of data Concatenate Arrays or Strings Syntax aib Description Given two arrays with the same number of rows this operation will append the corresponding rows of one array to the other array Likewise given two strings which can be considered one row arrays or row vectors this operation will append the two strings Example For the arrays a and b the following MSHELL statement will append the rows of a to the rows of b and store the result in c ready c a b The number of columns in c is equal the sum of the number of columns in a and b The following MSHELL commands will assign to the variable y the concatenation of two arrays ready a creates a row vector ready is concatenates 2 vectors ready row 0 1 00 2 00 ready y row 0 1 00 2 00 1 00
83. 00 45 view255 bounds_dat M_wdb c act proview wdb coasts dat coasts_dat dworld rv 300 300 45 view255 coasts_dat M_wdb c act proview wdb rivers dat rivers_dat dworld rv 300 300 45 view255 rivers_dat all_sources coasts_dat groi_rivers index rivers_dat groi_bounds index bounds_dat all_sources groi_rivers 100 all_sources groi_bounds 150 view all_sources REACT MSHELL User s Manual 11 12 2007 Edt Search mage pot Qata Functions Operators window Hep 127 fermerni proj ortho nel ipes GS84 niat_O 6S n Ls dworid rv 200333003345 view255 vorid dar E ci act proview wab bounds dat bounds_dat dworid rv 300 2300 245 view2SS bourmts_dat vib e act proview wab coasts dat coasta_dat dvor Id ev 300 300 45 view2SS coasts dat Bud c act proview udb rivers dat tivers_dat dvor id rv 300 300 245 view S rivers_dat ali_sources coasts dat groi_rivers index rivers_dat groil bounds index bounds dat ali Sources groi_rivers 100 11_sources groi_bounds 150 Additional examples can be obtained by executing the following code ProVIEW User s Guide Appendix B Internal Functions 103 104e Internal Functions M_wdb M_wdb M_wdb print gap orows ocols weqe LLw view255 world M_wdb M_wdb print weqc LLcO view255 print c act proview wdb bounds dat C ACT Proview wdb world dat view of t
84. 100 0 COON m_viewx0 0 OON m_viewy0 0 OON m_viewwidth MOON ncols 50 OON m_viewheight MOON nrowst 50 OON m_viewflag 1 make image visible view MOON k ADD TEXT TO OUTPUT IMAGE row 10 col 10 Stext Clementine Global Lunar Image Combined With Derived Altimetry Data textoverlay MOON text Times New Roman 24 col row 9 1 1 row 40 col 10 Stext UV VIS 750nm calibrated image mosaic spatial resolution 50Km textoverlay MOON text Times New Roman 18 col row 9 1 1 row MOON nrows 30 col 10 Stext Image Processing by ACT Corp textoverlay MOON text Times New Roman 18 col row 9 1 1 row MOON nrows 15 col 10 text Refined Topographic Map From NASA Goddard textoverlay MOON text Times New Roman 18 col row 9 1 1 290 Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide Appendix B Internal Functions 291 wclose Closes all Screen Windows Syntax wclose Description Closes all the windows presently opened in the MSHELL environment weolut Color Look up Table Syntax wcolut Description Used to list and define all three rows red green blue of a color look up table Use the select command or the m_viewlut intrinsic with wolut to choose one of the palettes for viewing O gray 1 inverse gray 2 pseudocolor 3 inverse pseudocolor 4 user defined Note starting in MSHELL vers
85. 11 12 2007 ACT REACT User s Manual Part IT MSHELL Development Environment Al Applied Coherent Technology Corp Rapid Environmental Assessment Composition Tools ACT REACT MSHELL User s Manual Table of Contentse iii MSHELL an image and signal processing language Copyright 1988 2007 Applied Coherent Technology Corp ProVIEW a Professional Virtual Image Processing Environment for Windows Copyright 1994 2007 Applied Coherent Technology Corp ACT REACT ACT s Rapid Environmenal Assessment Composition Tools Copyright 2004 2007 Applied Coherent Technology Corp GDAL Geographic Data Abstraction Library is under copyright by Frank Warmerdam See appendix iv e Table of Contents REACT MSHELL User s Manual 11 12 2007 Table of Contents OPV ERY A T DA E A O EEEE AE E AE O EEE 8 WHATISTHEREAC E vinin ene aa a a E a a E upstate a a IST 8 WHO SHOULD USE REAC T MSHE 2 rai na a n AA EE RERE 10 REACT S DEVELOPMENT ENVIRONMENT ccsssccssssscssssccssssccssssccssscscssssscsssssssssssoesssseees 11 REACT ANALYSIS AND DEVELOPMENT ENVIRONMENT ccccssecesssscecseccecsececsceeeseceesaceeesaeeesnaeeees 11 Monitoring Pah lri tate suas etc iteneaa a crates Latta ned Ma vied sia a a unites taka R R 11 Image Window donean a eae A a ea Nib aan EE A erst 12 AATA AA ATTO ON coos stows E A EE E E E debacedeces 13 MSHELL INTERPRETER LANGUAGE esssessseessocescosssocessccssocesocescosesecssocesocesooses
86. 54 1 00 0 54 0 29 0 54 0 29 ready x complex 2 2 1 2 ready blinterp f x 0 573856 bresen Compute Line Segment Points Syntax bresen z or z bresen Description Given the coordinates of two or more end points in the plane this function computes the points along the line segment between the points using the Bressenham s Line Drawing Algorithm This function is particularly useful to define a region of interest make out of line segments The argument z is a complex row data vector in which the nearest integer of the real part of z is used as the column positions and the nearest integer of the complex part of z as the row positions Example The following uses bresen to connect to points in a list 72e Internal Functions REACT MSHELL User s Manual 11 12 2007 0 200 10 x 0 8 generate points on a parabola xy complex x y before bresen image zeros y max 1 x max 1 image xy 255 view image after bresen image image 0 image bresen xy 100 view image Ki j lolx Be Edt Search image Pot Qata Punctons Operators window bep Image imagel Image imageO complex x y before bresen imageO zeros y max 1 x max 1 imagel image0 imaged xy 255 view imaged after bresen imagel bresen xy 255 view imagel bthresh Binary Threshold Syntax bthresh a tval Description Given an input array a and a threshold value tval
87. 66806 22 00060 16 00900 43 00060 1 97239 reconstructed from mjd trace Sum Diagonal Elements Syntax trace a or a trace Description Sums the elements on the diagonal of the input square array Example Generate a square array and calculate trace ready randg 3 3 x ready x row 0 0 85 row 1 Late 1 08 row 2 0 88 0 80 ready trace x 1 52219 282e Internal Functions REACT MSHELL User s Manual 11 12 2007 U url_copy_to_file Save a remote resource to a file Syntax status url_copy_to_file url local_file Description This command can be used to retrieve a remote resource and save it to the specified local file path It returns 0 upon success 1 otherwise In case of an error the text attribute of the returned ARRAY contains a brief description of the error Example ready status url_copy_to_file http www actgate com home c temp act homepage htm ready status 0 00 ready V V Virtual Variable Syntax Vv Description This variable is used to hold the association to the virtual file All access to any array opened virtually will be performed using this variable Example The following screen shows the usage of the virtual format to read a large mosaic of Mars ncols 46080 nrows 22528 Only a portion of the file is in the display window As the user moves the scroll bar it gets resposition to the right viewing locatio
88. 7 to print directories their sizes and the full path Sout dirlist c temp dsp to print the directory listing only This will not print files Sx dirlist F crism_pds_archive trdr TRDR d diskfreespace returns disk info Syntax diskfreespace c temp Description This function returns an array variable containing three values The first value is the total number of bytes in the disk the second value is the total number of free bytes in the disk and the third value is the total number of free bytes per caller this can be used if disk quotas are setup per user The input argument is a string containing a path UNC are allowed Example ready freespace diskfreespace e ready freespace diskfreespace hyper cdrive dt2mjd Returns the modified Julian Date Syntax dt2mjd Year Month Day Hour Minute Second Description This function returns the modified Julian date the input argument is year month day hour minute and seconds includes fractions of seconds Note In the single precision version of MSHELL using mjd2dt after dt2mjd is accurate to within minutes In the double precision version it is accurate to mseconds Example see tdiff DDEExec Sends a command to the server app Syntax DDEExec chan cmd Description This command is used to send a command to the server application once the DDE conversation is established chan is the c
89. 7 44 Using float2str on complex array with 8 6F 227 227 315 315 289 289 345 345 ready _ EE 429 307 429 307 Line 7 Cok 7 floor floor a or a floor Floor of Input Array Syntax Description For each element in a compute the largest integer not greater than that element i e returns the Greatest Integer Value for each element of the array Example The following illustrates the function ready floor 3 3 4 5 row 0 3 0 4 0 fmod fmod a b Floating Point Modulus Syntax Description Compute the floating point modulus of every element in the input array Example The following illustrates the function 120 Internal Functions REACT MSHELL User s Manual 11 12 2007 ready J a 4 6 1 create row vector ready fmod a 5 3 row 0 1225 0 2 50 0 50 free Free Variable from Memory Syntax freeab c Description Used to erase a list of already defined variables from memory also have free all free plot plot plot The variable list can contain array variables or string variables To erase all variables from memory use free all As you delete image variables the total memory available will increase However the amount of memory increase may not correspond directly to the size of the object just released This is due to the fact that MSHELL can have two different variable
90. 8 by Applied Coherent Technology All Rights Reserved examples Input Box for Commands ly reada eqohare chr char z textZimage hello world You can modify the above code Press Execute Command to see results Execute Command Clear the form Figure 5 tiff computes elapse time Syntax tdiff tend tstart Description computes the elapse time in seconds between two times points Example The following example illustrates the use of localtimenow tdiff and dt2mjd The function tdiff makes all its internal computations in double precision M format 000000000 00000 t1 localtimenow pause 2 t2 localtimenow print s ss n print t1 t float2str t1 nt1 text t t1l text n print t2 t float2str t2 nt2 text t t2 text n print t2 t1 float2str tdiff t1 t2 n t1mjd dt2mjd t1 compute modified julian date for t1 print t1 as mjd float2str t1lmjd n print tlr t float2str mjd2dt t1mjd reconstructed n ProVIEW User s Guide Appendix B Internal Functions 281 tle 2003 90008 1 69006 22 00090 16 00900 43 00009 1 97300 3 00099 22 000900 6 06000 ti text 2003 81 22T16 43 61 973 t2 2003 090009 1 00000 22 00009 16 00909 43 00000 3 97600 3 00099 22 00990 0 09099 t2 text 2003 01 22T16 43 03 976 t2 t1 2 00301 tl es mjd 52661 69655 tir 2003 81 1
91. B ProVIEW User s Guide Appendix C Remote Access 305 PROJ CopyRight Notice Appendix D Cartographic Library The MSHELL function Geo2Cart is based on the PROJ cartographic program library developed by USGS Copyright to PROJ and usage description follows CopyRight Notice associated to the Cartographic DLL All source data files and other contents of the PROU 4 package are available under the following terms Note that the PROJ 4 3 and earlier was public domain as is common with US government work but apparently this is not a well defined legal term in many countries am placing everything under the following MIT style license because believe it is effectively the same as public domain allowing anyone to use the code as they wish including making proprietary derivatives Though have put my own name as copyright holder don t mean to imply I did the work Essentially all work was done by Gerald Evenden Copyright c 2000 Frank Warmerdam Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense 306 Internal Functions REACT MSHELL User s Manual 11 12 2007 and or sell copies of the Software and to permit persons to whom the Software is furnished to do s
92. Data Description This function takes as parameters the remote server handle the name of the WIPE Server a string containing a list of data set names comma separated a string containing the field names to extract from the SQL table the ROI ullon ullat Irlon Irlat start time and end time The output is a string containing the metadata requested for all the data items in the SQL table that meets the ROI and TOI constraints Example ready S MetaData rs_getMetaData rsl ACTTest Sar TEDS_3Dte mp DataSet ID 180 90 180 90 ready rs_init loads msh32rs dll Syntax rs_init Description This function loads dynamically msh32rs dll This DLL contains all the CORBA client code to connect and invoke methods on a remote WIPE Object server If it succeeds it returns 0 otherwise 1 Example ready status rs_init ready rs_connect connect to a remote WIPE Object Syntax rs_connect erie actgate com 12000 ProVIEW User s Guide Appendix B Internal Functions 225 Description This function is used to connect to a remote WIPE object It takes two parameters a string containing the ip address of the WIPE Object host machine and a port number this is where WIPE Object Factory Server is set up to listen in If Successful it returns a handle number otherwise it returns 1 The handle number is used as a parameter in the other functions Example ready rsl
93. Example x reada egohare chr char open and image view x gray scale palette y Xx assign x to y y LUT 255 0 1 3 assign an inverse palette to y view y inverted palette z LUT reada M_proviewdir palettes apl_wind asc ascii color palette view z color palette All the palettes available are located in the palettes directory ProVIEW User s Guide Appendix B Internal Functions 159 M_ System Variables Description System variables are used to control different functions within the MSHELL environment Some of the MSHELL system variables are strings while others are numbers All system variables are prefixed by M_ For example to initialize the x axis label to the string Time use M_xlabel Time If you create your own M_ variable e g M_mine 3 it will behave as system variable i e it will be accessible from inside any script of function Note that system string variables do not required the symbol normally associated with user defined string variables System variables can be read into other user defined variables e g message M_xlabel is a legal construction Approximately three quarters of the system variables are used in controlling the plot and plot3d function output The following list categorize and describes the various the system variables See include system files in this section for sysedit msh which allows the user to change all syste
94. Integer to Ascii 152 nlines Returns number of Lines 184 Regular Expression Support preg_match regular expression matching 191 preg_replace regular expression replace 195 smodify String Replace 247 str2float Converts Numeric String to Float 255 str2int Converts Numeric String to Integer 256 strContains check for substring occurance 257 strEndsWith string termination match 257 strhex2ing Converts Hex string to integer 258 strlow2up Converts lowercase to uppercase 258 strSection extract section of a String 259 strStartsWith string start match 259 strStripWhiteS pace string whitespace strip 258 strup2low Converts uppercase to lowercase 259 XML Parsing xmlattrvalues Extracts the attribute values 301 xmlparse parse an XML string 302 xmltextvalue Extracts the text value of a 302 xmltextvalues Extracts the text values 302 System all Allows for all Variables to be included 66 dirlist returns list of subdir files 94 diskfreespace returns disk info 95 fileinfo Returns detailed information of a file 110 filesize Returns the size of a file 111 findfiles Locate Files in Directory Structure 111 getenv Get Environment Variable 132 getMyIP Get the local IP addresses 132 help Invokes the Help Utility 137 M_ System Variables 160 putenv assign to sys env variable 197 sys_ sys_cat 277 sys_cd changes the current
95. Introduction With over 140 internal functions and over 100 external functions scripts MSHELL is a powertul and flexible environment in which to perform signal and image processing The REACT installation tree contains a scripts directory that is broken in subdirectories The subdirectories contain functional categories The user is encourages to explore this directory for high level functions implemented in the MSHELL scripting language All this functions can be tested within REACT from the Analysis panel i e B 48e Appendix B Internal Functions REACT amp MSHELL User s Manual 11 12 2007 Appendix B Internal Functions by Category and Alphabetical Listing ProVIEW User s Guide Appendix B Internal Functions B 49 REACT MSHELL Internal Functions by Category A complete list by category of the internal functions is presented on the following pages See the External functions tree discussed in Appendix A for additional functionality Bitwise Operators and Bitwise AND operator 69 mshift_u16 Bitwise shifting 16 bits unsigned interger 177 mshift_u32 Bitwise shifting 32 bits unsigned interger 178 data base operations db_functions dbclose closes access to an external database 86 dbconnect Connects to database for access 88 dbfopen Returns a handle to the opened dbf file 89 dbrsgetcolnames Returns column names in a result set 92 dbrsgetrows returns result set as a string 86 db
96. L Wait the number of specified seconds 233 Satellite Image Mapping Geo_cs2cs geo coordinate system tranformation 131 Geo2Cart Geographic to Cartographic conversion 128 glflyover generate perspective view of terrrain 134 image2surface project planar image to a surface 144 SatVIEW computes spacecraft geometry info 235 Shapefile polygonorient 191 Statistics mean Mean of Array Elements 173 median Compute Median Value 173 medianr Row Wise Median 173 momentr Row Wise Moment 177 rcoeff Correlation Coefficient 201 Sorting ProVIEW User s Guide max Maximum in Array 171 maxmin Max and Min values in Array 171 maxminx Max and Min values with exclusion 171 maxof Element by Element Maximum 172 maxr Row Maximum 172 min Minimum in Array 175 minof Element by Element Minimum 175 minr Row Minimum 176 sortr Row Wise Sorting 247 stats Computes Array Basic Statistics 254 statsx Computes Statistics with exclusion values 254 var Variance 286 String Operations string String Access Control 63 eqindexS Equality Index String 107 evaltext Evaluates a String 108 expand Environment variables expansion 109 float2str Convert Array to formatted String 118 getline Finds Line Matching String Pattern 132 getpos Finds String Position Within a Line 133 int2str Convert an Integer to a String 151 itoa
97. MSHELL function files and are not constrained by the FUNCTION rules The user may think of an include file as a sequence of commands that can be invoked with a simple include call Typically include files are saved to disk with the extension msh Virtual Include Files vsh A modification to the standard msh is the vsh extension this allows MSHELL to automatically execute the entire contents of the script when opened using the Image Open menu item or reada syntax of MSHELL It is particularly used with Virtual variables ACT REACT MSHELL User s Manual Table of Contentse 35 Importing and Exporting Data Importing Data Text or array data can be imported in a number of different ways and supportint a number of industry standard formats Must of the support for loading array or image data is via the the internal reada function see page 203 The following table provide a simple description of all basic loading functions 36 e Table of Contents Basic loading functions Brief Description readtext readf Use this function to load a text file into a memory Note It also has the nice ability to read files over HTTP This function is used to perform a formatted read of a scalar or a string from a file unit reada Reads an array or image from disk Multiple file formats or modes are supported Including a generic one that tries to figures the input data format MSHELL
98. OTE THIS FUNCTION IS REPLACED BY writeRGB Used to write a color image to disk using the three red r green g blue b image color arrays The image type string is simply the type of image to be written tiffjpeg png ProVIEW User s Guide Appendix B Internal Functions 295 writeRGBA Writes an RGB or RGBA Color Image Syntax writeRGB file r g b type writeRGBA file r g b a type Description Used to write a color image to disk using the three red r green g blue b image color arrays The image type string type is simply the type of image to be written e g BMP GIF JPEG PBM PGM PNG PPM XBM XPM Example 365 scale255 0 N 1 1 N scale255 hammiw N N 255 r q r g b alternateRGB q view q a r writeRGB M_proviewdir temp color png r g b PNG writeRGBA M_proviewdir temp color_rgba png r g b a PNG F rgba reada M_proviewdir temp color_rgba png all view rgba 296 Internal Functions REACT MSHELL User s Manual 11 12 2007 writef Formatted File Write Syntax writef unit format arrayname or writef unit format stringname Description This function is used to perform a formatted write to a file unit which has already being open using the openf command Note that only one value or string can be written ata time The first command above is used for doing a formatted write of an already existing 1 x 1 ar
99. ProVIEW 108 IF ELSE Conditional Flow 142 include Invoke an MSHELL Script File 147 pause Suspend Execution for N Seconds 186 return Returns From an Include File 216 REACT amp MSHELL User s Manual 11 12 2007 stop_process terminates execution with message 254 while While Loop 294 GUI addmenuitem Adds a User Defined Menu Item 65 Graphical User Interface Details 11 iboxlist Input Box List 140 inputbox Prompt User for Input 150 mbox Text Box 173 menusel creates a Menu List Box 174 meter Displays a Metering Toolbar 174 REACT react_enable_view shows a REACT panel 204 react_get_carto_info Retrieve Cartographic Viewer Information 202 react_get_properties get values for a set of properties 205 react_get_property get the value of a REACT property 205 react_load_mlt load an MLT file into REACT 202 react_open_url Opens an URL in a browser window 204 react_set_carto_map_info Set Cartographic Viewer Map Info 202 react_set_property set the value of a property 206 react_update_layers update layers 203 view activate image display 287 view activate image display with scaling 289 viewout closes image display window 287 wclose Closes all Screen Windows 292 wtile Tiles all Screen Windows 298 Image amp Volumetric Data Representation alternateBSQ describe array as a BSQ volume 67 alternateRGB describe array a
100. RANTIES OF MERCHANTABLLITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE 312 Internal Functions REACT MSHELL User s Manual 11 12 2007 REACT MSHELL GDAL Interface REACT MSHELL has incorporated support to the open source Geographic Data Abstraction Library GDAL REACT MSHELL mostly leverages on GDAL to facilitate the access to many geographical raster data formats see Table 2 and to read and convert widely used spatial reference systems SRS representations in the open source community proj4 and WKT formats A number of functions in the MSHELL scripts tree subdirectory use of the GDAL low level functions In particular the cartographic map projection script functions i e map_image msf cartographic map of a single image file map_images msf cartographic mosaic of a list of image files map_image_to_file msf creates cartographic mosaic on disk good for HUGE mosaics which are located in the Proview SCRIPTS Satellite_Image_Mapping Mosaics directory These script function are by themselves great examples within MSHELL on the use of the low level GDAL functions The above script functions can handle input files that use ground control points GCP for geo re
101. Se aha he EELE a a chic EAE ES Ua ESE E E E A od 186 Bil Dons fs anole hea tah alien E dala E Oh rn tae aa ued ate sa ant aera E E tL on Lar ace se bce lel Ns 198 SOP rescued aecheth cnt tate a e telat at cid E a aa desl sods E 200 BS ei cel E E a loth ras uate ode E s ou aeh Lalit hte A Alana ie ote ab ene oh Date E 235 EDs SARTO aS Re PRA TEE REC SDE APPL PRC DOSER DTT RRP ee BACAR TOT DAA ON E eT UREA EEN EO EEE RE 279 E E Sd aici E EASE Aa ileal PU A Ade ait Re Rh La Ge Me il Rat RR EL a Se 283 AVe laa lesa cil a nek DES euler a AU ESOS 5 ens A al Ld katate A a ya bas ne N ts 283 SW Erho iie a E O ceeds Alek eats nia i tak ded al ates ta tae hs Cott deet ioe las titer oats etn ede can hess 292 D Pe se E E EEE E salou dee ec ois wus oe aks AE ass a vate wesc cus ethan dec AE A 299 AIOE RRNA SEPA MEP TREE SORE ITS REPS PETES SEPT PROMI RADEDTS REET ACEREO IC RED ADCS ROT BRIO PEPER RESON SET RRR STOUT BESTE A 304 APPENDIX C REMOTE ACCESS wssdesiscevcivesssatcssndscesccciacdssiedececsassvavecdeissdevsedscecedspeatebisdsdecesevves 305 INTRODUCTION aeniea a l a N n a N aa a a es 305 APPENDIX D CARTOGRAPHIC LIBRARY eessssecessseccssececssccecsssscceessoceesseceessccecessseceesseceessse 306 PROJ COPYRIGHT NOTIGE sessin areia aaa aaa anarai 306 NAME slamu a a a T S E NE Maas ta 307 SYNOPSIS Sra Na A A aaa a es 307 D S CRP O N a A N E NA 307 EXAMPLE USAGE aN a a a Mal ena A Aa A eN 309 SI rA E O E E E EE E E SE T 310 HOME PAGE FOR THIS CODE mnnon d
102. Syntax centroid x 1 Description computes the centroid based on the amplitude values in an image This function uses all pixels in the image for the computation ProVIEW User s Guide Appendix B Internal Functions 75 closef Close a File Syntax closef unit Description This function is used to close a disk file previously opened using the openf function It s argument unit is the integer file number assigned when openf was initially invoked Failure to close a file could result in a future error when doing disk i o See Also openf cmirror Mirrors an Image Column Wise Syntax cmirror a or a cmirror Description Mirrors the columns of the input array or image a Example The following illustrates the operation on the array aa ready aa 1 2 3 4 5 6 7 8 9 ready aa row 0 1 00 row 1 4 00 row 2 7 00 8 00 9 00 ready cmirror aa print mirror array of aa row 0 3 00 2 00 1 00 row 1 6 00 5 00 4 00 row 2 9 00 8 00 7 00 cmplxoverlap 2 D range index Syntax cmplxoverlap x roi Description UNDER CONSTRUCTION 76e Internal Functions REACT MSHELL User s Manual 11 12 2007 colplot Plots a Row from an Array Syntax colplot N array column colplot N array 1 for interactive plot Description Used to plot a particular column from an array See also rowplot complex Creates a Complex Array Syntax complex x y Description Giv
103. TP server print Getting file gbrevecnts txt s ftp_get gbrevecnts txt local txt if s s text return print done closing FTP connection ftp_session_close if s s text return ftp_mkdir Create New Directory in the FTP Server Syntax ftp_mkdir newdir Description This function works after an ftp_session_init and creates a new specified subdirectory in the FTP Server If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error ProVIEW User s Guide Appendix B Internal Functions 123 ftp_put Upload a File to the FTP Server Syntax ftp_put localfile remotefile Description This function works after an ftp_session_init and uploads the specified local file to the FTP server assigning the specified remote file name to the remote copy Multiple file names can be specified by using new lines as file name delimiters If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error ftp_rename Rename a File in the FTP Server Syntax ftp_rename newfilename Description This function works after an ftp_session_init and renames the specified file name in the FTP server If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error
104. TPUT of preg_match i e b n float2str b 0 n print Note a S at the end of the regular expression string means that it must match the end of the string n pattern m ingS use m to activate inline option to use to match after and to match before internal new lines b preg_match a pattern print INPUT STRING n Sa n print SEARCH PATTERN is pattern n print nOUTPUT of preg_match i e b text n b text n 194e Internal Functions REACT MSHELL User s Manual 11 12 2007 print nOUTPUT of preg_match i e bn piloatastr bo 4 08 E n print Note a S at the end of the regular expression string means that it must match the end of the string n Sa Hi I am 44 years old and I can do 45 push ups in seconds pattern 0 9 years old 0 9 push ups 0 9 seconds use m to activate inline option to use to match after and to match before internal new lines b preg_match a pattern print INPUT STRING n a n print SEARCH PATTERN is pattern n print nOUTPUT of preg_match i e b text n b text n print nOUTPUT of preg_match i e b n float2str b 0 n preg_replace Reqular Expression Replace Syntax preg_replace str_to_search regular_expression_pattern replacement_expression Description Regular expression string replace support Example The following MSHELL expression illustr
105. _cd temp if s print An error occurred s text return Sdir sys_pwd print Current directory after Appendix B Internal Functions 265 sys_mkdir Creates a directory Syntax sys_mkdir newdir Description This function create the directory newdir If successful it returns 0 otherwise it returns a non zero value and the text attribute is set with a brief description of the error see the table below Return value text attribute Meaning 0 Not set Success 1 Set File already exists 2 Set Directory already exists 3 Set Object already exists 4 Set Permission denied Example Creating a new directory s sys_mkdir data if s print An error occurred s text return 266 Internal Functions REACT MSHELL User s Manual 11 12 2007 sys_dir Directory listing Syntax sys_dir thedir Description This function returns a string containing the list of files and directories located within the directory thedir if thedir is an empty string the function lists the content of the current directory Also if thedir does not exists is not a directory or is not readable NULL is returned Example Showing the content of a directory listing the current directory sys_dir listing the content of data list sys_dir data if list W print An error occurred retur
106. a Script File Window you can create edit or display a text file of MSHELL commands The easy to use built in editor supports the standard Cut Paste Search and Replace operations found in most windows applications Executing a Script File From the Graphical User Interface To execute the script file located in a Script File Window ACT REACT MSHELL User s Manual Table of Contentse 13 MSHELL Interpreter Language Z x 7 Z Language Syntax Introduction Hint The system At the heart of REACT is the MSHELL interpreter developed by ACT variable M_version MSHELL is a 32 or 64 bit image signal processing language which Canoe USEAT allows you to perform complex operations using a simple syntax In the determine if the 32bit a pe eile as following sections we will introduce you to this language and discuss it s or the 64bit version is syntax being executed Variable Names and Types In general a variable name can be any alphanumeric string starting with a letter followed by a combination of letters and or digits The following are legal alphanumeric variable names Hint Use the show command to get a list of all the variables loaded in memory r x10 OutputImage Note that variable names should be kept under 15 characters Additionally there are a number of reserved keywords and symbols used by the interpreter that cannot be used as variable names A list of these keywords together with a description
107. advantage is that memory usage is maintained low until it is absolutely necessary to allocate more memory Region of Interest Manipulation 26 e Table of Contents MSHELL supports two types of regions of interest rectangular regions of interest ROI and non connected regions of interest also called generalized regions of interest GROI ROls provide a simple way to refer and access rectangular regions within an image while GROls provide a simple way to refer to a list of pixels in an image as an entity ROI A rectangular region of interest can be constructed in the following ways e Using the window definition function e g roi wdef row0 col0 nrows ncols e interactively using the mouse This option is selected using the IMAGE SET ROI menu option If the ROI is a valid region of interest it can be used as an argument of a MSHELL variable Regions of interest can be specified in any of the following operations REACT MSHELL User s Manual 11 12 2007 Assignments x wmove roi 25 40 x roi e Within expressions x roi y roi Z roi q roi GROI Generalized regions of interest provide a powerful syntax to perform operations on pixels that do not fall within a rectangular region in an image A number of functions can return generalized regions of interest e g gtindex Itindex and eqindex finite_index nan_index Once a generalized region of interest has been defined it can be used as an
108. ady select Selects an Output Look Up Table Syntax select wolut Description This is used to select the desired look up table The sign will be replaced with the corresponding number for the look up table desired NOTE THIS FUNCTION IS NOT USED BY REACT Example The following will select look up table 2 ready select wolut2 setroi Interactively sets an ROI from Syntax setroi image Description This is used to set a roi from the screen using the mouse for input After having released the left mouse buton and clicking the right button the roi will be saved as the rectangular region selected 236 Internal Functions REACT MSHELL User s Manual 11 12 2007 Example The following sets the variable roi equal to the complex array of pixels defining the dragged out contained region within image ready roi setroi image shiftc Cyclic Shift of an Image Syntax shiftc a row col Description This function is used to shift or translate an input array or image by a specified number of columns and rows The shift is cyclic i e border pixels will wrap around Note that the values of row and col must be non negative Example Included with example of shiftt shp_from_csv_ll create shapefile from ascii input file Syntax status shp_from_csvi II inputCSV output prefix Description This function is used to convert a CSV formatted list of geometric features points open or
109. akes two arguments a valid string handle to a previously opened remote MSHELL interpreter and a command string to be executed If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error rmshell_wait Wait the number of specified seconds Syntax rmshell_wait handle n_sec Description This function works after an rmshell_session_init and an rmshell_execute_async It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and the number of seconds to wait If it is 1 this function blocks until the remote server is finished executing the command Otherwise it waits the number of seconds specified If the remote server has not yet finished executing the command when the number of seconds elapsed or if an error occurs it returns a non zero value otherwise it returns 0 and the text attribute holds the output string generating by the execution of command rmshell_getfile Download a file from the remote MSHELL Syntax rmshell_getfile handle filelist Description This function works after an rmshell_ session_init and can be used to download a file from the remote MSHELL interpreter It takes tow arguments a valid string handle to a previously opened remote MSHELL interpreter and a comma separated string containing the input file name and the output file name If successful it returns 0 otherwise it returns a non
110. and store the result in tA Cc ready c asin a atan Inverse Tangent Syntax atan a or a atan ProVIEW User s Guide Appendix B Internal Functions 69 Description Compute the inverse tangent of each array element The output is in radians The actual mathematical expression computed is given by C atan q for all j i where j and i are row and column indices respectively The returned values are between n 2 and 7 2 Example The following MSHELL statement will compute the inverse tangent of a and store the result in ready c atan x atan2 Inverse Tangent Syntax atan2 y x Description Computes the inverse tangent of each array element The output is in radians Returns the arc tangent of y x in the range r to atan2 produces correct results even when the resulting angle is near 7 2 or n 2 i e x near 0 Note that the input values must be in the range of 1 to 1 otherwise incorrect results will be generated also note that if both x and y are set to 0 atan2 y x is set equal to 1 70 Internal Functions REACT MSHELL User s Manual 11 12 2007 B blackw Blackman Harris Window Syntax blackw n m Description Generates a 2 D 4 coefficient Blackman Harris Window The n element of the 1 D Blackman Harris Window is defined as n 2 2 2 W C G cos En c cos 2n c cos 3n where Cy 0 35875 c 0 48829 c 0 14128 and c 0 01168 This window
111. andle Returns detail information about the given open dataset_handle gdal_get_metadata dataset_handle or gdal_get_metadata dataset_handle SUBDATASETS Returns metadata information gdal_get_raster_size dataset_handle Returns the raster size as a vector array bands rows columns geo_xform gdal_get_geo_transform dataset_handle Returns the affine transformation coefficients as a vector array These coefficients satisfy the following equations which transform between pixel line P L raster space and projection coordinates Xp Yp space 314e Internal Functions REACT MSHELL User s Manual 11 12 2007 P pixel L line Xp geo_xform 0 0 P geo_xform 0 1 L geo_xform 0 2 Yp geo_xform 0 3 P geo_xform 0 4 L geo_xform 0 5 gdal_set_geo_transform dataset_handle geo_xform Sets the affine transformation coefficients from a vector array These coefficients satisfy the following equations which transform between pixel line P L raster space and projection coordinates Xp Yp space P pixel L line Xp geo_xform 0 0 P geo_xform 0 1 L geo_xform 0 2 Yp geo_xform 0 3 P geo_xform 0 4 L geo_xform 0 5 proj_ref gdal_get_projection_ref hdl Returns the projection definition string for the dataset The return string defines the projection coordinate system of the image in OpenGIS WKT format It should be suitable for use with the OGRSpatialReference fu
112. apping regions As each polygon is being filled in the value of the pixels inside the polygon gets increment by the fill value for that record In this way if you assign the same fill value to every record areas of overlap will have a greater value than the fill value Example The following example illustrates the function z ones 256 256 100 M_plotcolor 1 c shp2image d temp sed shp z 78 015 33 001 74 992 36 009 0 2 view c show c aay ies data type is number of rows number of columns maximum value 6 minimum value 0 the maximun value of 6 indicates there were overlapping regions otherwise the maximum value would have been 1 ProVIEW User s Guide Appendix B Internal Functions 241 shp2fillimage Shapefile Image Fill Syntax shp2fillimage filename image bbox recn Description This function is useful when performing polygon fill of shapefile records of type 5 polygons filename is a string containing the name of the shapefile file image is an array variable used as input to the polygon fill routine it serves as a background image bbox is a 1x4 array containing the bounding box of the region of interest Xmin Ymin Xmax Ymax bbox text optional input containing the proj4 string that describes the coordinate system of the vector features Note This option will be executed as long as there is a valid prj file associated with the shape file The
113. artographic Library 307 alternate method to specify inverse projection Redundant when used with invproj 0 Selects binary output only see b option A specifies a character employed as the first character to denote a control line to be passed through without processing This option applicable to ascii input only is the default value e string String is an arbitrary string to be output if an error is detected during data transformations The default value is t Note that if the b i or o options are employed an error is returned as HUGE_VAL value for both return values E causes the input coordinates to be copied to the output line prior to printing the converted values I p Pl lelu jid List projection identifiers with l lp or IP expanded that can be selected with proj l id gives expanded description of projection id List ellipsoid identifiers with le that can be selected with ellps or lu list of cartesian to meter conversion factors that can be selected with units T This options reverses the order of the expected input from longitude latitude or x y to latitude longitude or y x S This options reverses the order of the output from x y or longitude latitude to y x or latitude longitude S Causes estimation of meridinal and parallel scale factors area scale factor and angular distortion and maximum and minimum scale factors to be listed between lt gt for each input point For conformal proj
114. associated with array variables For example these attributes can control the way a variable is displayed and interpolated Most of these attributes can be inspected and changed by the user The following presents all the intrinsic attributes associated with array variables and their associated syntax Controlling these attributes can give you finer control You may not need to use them since default values are normally applied But for completeness let us denote x as an existing array variable Then x m_interpflag This function is not yet implemented Selects the type of interpolation to be performed while accessing an element in an array variable by setting x m_interpflag 0 for zero order interpolation x m_interpflag 1 for liner interpolation along the values of a row x m_interpflag 2 for bi linear interpolation when trying to access the values in an array For example in the following two lines of code the interpolation flag is set to 2 resulting in a request to use bi linear interpolation x m_interpflag 2 y x 10 3 12 7 You can read the value of this attribute x m_viewflag Controls if an image is visible for display or not by setting x m_viewFlag 1 forces the image to be displayed x m_viewFlag 0 disables the display of the image Note that the default value for this atribute is zero not to display the variable x m_viewheight Controls the height of the display window x m_viewwidth Controls the width o
115. atch the AS identifier properly Example see sqlite _getrows example sqlite_getrows Returns the result set as a string data Syntax sqlite_getrows srow erow sqlite_getrows srow erow fname sqlite_getrows colnames srow erow sqlite_getrows colnames srow erow fname where srow start row number erow end row number fname output file name string colnames list of requested field names Description This function works after a sqlite_connect and sqlite_exec After a query this function when invoked will return the result set data as a string The columns are separated by a and rows are separated by new lines This function may be called multiple times on the same result set There are different ways to extract the results of the query using this function If an error occurs it returns a non zero value and the text attribute can be used to retrieve a brief description of the error ProVIEW User s Guide Appendix B Internal Functions 249 Example The following example shows most of the SQLite functions being utilized on a simple test case 250 Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide status sqlite_connect test sqlite if status status text return Squery select from RobinsonTargets status sqlite_exec query if status status text return sqlite_rowcount srow erow Scols site_name lat1 lon1 Sfilename sqlite
116. ates the use of the regulars expression capabilities ProVIEW User s Guide Appendix B Internal Functions 195 Sa Fred Flintstone nBarney Rubble nWilma Flintstone nBetty Rubble n Sc preg_replace Sa w w wt S1 Fred Flintstone Barney Rubble Wilma Flintstone Betty Rubble F Flintstone B Rubble W Flintstone B Rubble General documentation on using regular expressions can be found here http www perldoc com perl5 8 0 pod perlre html These functions are based on the Perl Compatible Regular Expressions library PCRE Information on PCRE can be found at http www pcre org The topics in the PCRE manual pages on usage of regular expressions within the C API are applicable to the MSHELL functions which make use of them print Formatted Print Syntax print Description Prints scalar values or strings to the standard output Example The following MSHELL expression illustrates the use of the print statement ready M_format 000 000000 ready x 3 ready print The value of x x n The value of x 3 000000 196e Internal Functions REACT MSHELL User s Manual 11 12 2007 puteny Assign to sys environment variable Syntax putenv assignment Description Assigns an operating system environment variable given an assignment expression in assignment Example The following MSHELL statement will assign an environment variable ready putenv MYVAR value ready
117. ayed on the screen Output LUTs have 256 entries numbered 0 through 255 corresponding to the 256 possible different intensity values or colors Output LUTs Before an image in memory is displayed on the screen it goes through an output LUT The image s pixel values are used as indices into the output look up table the output of which is displayed on the screen Image data is transformed through the currently selected output LUT whenever an image is being displayed on the screen Using the select command the user can select which is the active output look up table For example to select olut3 as the active LUT use the following command select wolut3 The user can read the first 3 output look up tables For example x weolut0 copy olut0 intox Inspecting x will show that it corresponds to 3 rows of data each row with 256 entries corresponding to the red green and blue components of the pseudo color LUT Look up table wcolut4 is a user defined output look up table e g weolut3 is set to the histogram equalization LUT of image X i weolut4 heqlut X The following lines modify weolut3 to provide intensities of red initialize wcolut4 red 0 255 1 green 0 255 1 blue 0 255 1 weolut4 red O green O blue ACT REACT MSHELL User s Manual Table of Contentse 31 MSHELL Script Files msf msh vsh Script files provide a powerful tool to achieve repetitive processing tasks in
118. be used to retrieve a brief description of the error Example 230 Internal Functions REACT MSHELL User s Manual 11 12 2007 opening a Remote MSHELL session Ssrvr rmshell_session_init 212 48 10 150 if S srvr print Error opening Remote MSHELL session return loading data extraction request template from file Sidb readtext idbTemplate txt performing request and checking for errors s rw_getMosaic Sh Sidb if status status text return if request has been performed successfully s text contains the XML MOSAIC string Smosaic s text Smosaic if xmlparse Smosaic print nErrors in XML mosaic string n return SmosaicImageRelPath xmltextvalue Output Image SmosaicDataRelPath xmltextvalue OutputData the __WROOT__ macro contains the WIPE Server root directory string where the output image file is located fn _ WROOT__ SmosaicImageRelPath images mosaic jpg retrieving output image file status rmshell_getfile h fn mosaiciImage reada images mosaic jpg all view mosaicImage closing the Remote MSHELL session status rmshell_session_close S srvr rw_getMosaicAsync Retrieve MOSAIC XML String does not block Syntax rw_getMosaicAsync handle request Description This function works after an rmshell_session_init and behaves essentially like the rw_getMosaicXML function but it retur
119. ble 283 Vclose Closes Virtual Variable 284 Vnew Makes Disk Space for Virtual Image 284 Vopen Makes Virtual Variable Link to File 285 VPF vec2image Vector Format to Image Format 287 Dynamic Data Exchange DDEExec Sends a command to the server app 95 DDEInit initialize DDE server application 96 DDEPoke POKE DDE server 96 DDERedqS Requests value from DDE server 96 DDEReqV Requests value from DDE server 96 DDETerm close a DDE conversation 97 Dynamic Link Library calIDLL Calls a DLL for execution 75 loadDLL Loads a DLL for Execution 155 Formatted closef Close a File 76 openf Open a file for Formatted I O 185 readf Formatted File Read 214 writef Formatted File Write 297 input waits user input 150 load Loads saved arrays or strings from a file 155 print Formatted Print 196 reada Read Array or Image 207 readtext Loads Text File 215 readtext_and_status Loads Text File with check 215 save Saves Arrays or Strings to Disk 235 writea Write Array to Disk 295 writecolor Writes a Color Image 295 296 Mirror and Shift Operators cmirror Mirrors an Image Column Wise 76 rmirror Row Mirror 218 shifte Cyclic Shift of an Image 237 shiftt Shift an Array or Image 243 Plot B 52e Appendix B Internal Functions colplot Plots a Row from an Array 77 contour Generates a contour plot 77 dworld draws wo
120. cmplx x Description converts real array to complex form Example The following demonstrates the operation ready y makecmp1x 5 ae ready y row 0 BP vON maskofEQ mask of elemens where a Syntax maskofEQ a b Description return image mask with a value of one for all the pixels where a j i b j i All of the maskofXX functions e g maskofGE maskofLE only accept real input arrays Example The following code demonstrates maskofGE maskofGT maskofLT and maskofLE maskofBitPlane mask of bit plane n Syntax maskofBitPlane a N n ProVIEW User s Guide Appendix B Internal Functions 167 Description return image mask with value of 0 or 1 The values will hold the bit plane n Itis assumed that the input array a is holding unsiged integer values coming from an integer with Nth bits Say N 2 then value highest value representable is 3 and bit plane n 0 corresponds to the least significant This function is usefull to extract encoded mask planes into integer arrays For example one bit plane could be storing a land mask and another cloud masks maskofGE mask of elemens where a gt b Syntax maskofGE a b Description return image mask with a value of one for all the pixels where a j i gt b j i All of the maskofXX functions e g maskofGE maskofLE only accept real input arrays Example The following code demonstrates maskofGE maskofGT maskofLT an
121. d To Execute xereada eqohare chr char view x test image v Standard Output Info Table Function Tracer Figure 2 Monitoring Panels is on the right and Multiple Document Interface MDI for images on the left The user can toggle the view of the Monitoring panel from its corresponding tool bar icon i e Commands typed in the Command To Execute text region are submitted and executed by the MSHELL interpreter It is from within this window that script files are normally invoked see MSHELL Script Files msf msh vsh on page 32 Also any text output is normally sent to this window Note that in REACT many of the GUI commands are are converted directly to commands in the MSHELL Interpreter Language see page 15 In addition to the Monitoring Panel the user can send commands to MSHELL using the Scripts Tool Panel R This will will be discussed in a later section Image Window Prior to enabling the display of an image the user can control many attributes that will affect how the image is to be displayed 12 e Table of Contents An image window provides a visual representation of a two dimensional array of numbers The simplest way to enable the view of an array is using the view command In REACT MSHELL there are several different ways to enable an image window for the display of an existing array variable e from the Command Shell Window using the view command see Appendix B
122. d maskofLE 168 Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide free all y hammiw 256 256 test pattern image view255 y show y tests array against a constast le maskofLE y 0 5 view255 le lt maskofLT y 0 5 view255 lt gt maskofGT y 0 9 view255 gt ge maskofGE y 0 9 view255 ge wtile pause 1 free all test and array against another array zl reada M_proviewdir images egohare chr char z2 hammiw zl nrows zl ncols 255 view255 zl view255 z2 Z1LEz2 maskofLE z1 z2 view255 z1LEz2 Appendix B Internal Functions 169 Syntax Description Syntax Description ACT s Rapid Environmental Assessment Composition Tools REACT copyright 2004 ACT Corp PROTOTYPE DER File View Execution Help Image Windows Help WK Weak maskofGT mask of elemens where a gt b maskofGT a b return image mask with a value of one for all the pixels where a j i gt j i maskofLE mask of elemens where a lt b maskofLE a b return image mask with a value of one for all the pixels where a j i lt b j i Syntax 170e Internal Functions maskofLT mask of elemens where a lt b maskofLT a b REACT MSHELL User s Manual 11 12 2007 Description return image mask with a value of one for all the pixels where aj j i lt b j i max Maximum in Array Syntax max a or a max Description Find the
123. dded support to the KAKADU JPEG2000 reader and writer e 6 2003 Added support to the Geographic Data Abstraction Library GDAL gt read write support to GeoTiff NITF ERDAS HDF JPEG2000 NITF CEOS ENVISAT e Incorporated OpenGIS WKT cartographic description methods e 10 2003 writea and reada will save and restore the x text attribute e 10 2003 added support to perform raster two Shape files conversion on large input files e 10 2003 added statsx function to allow statistics computation with exclusion of certain input values e 11 11 2003 added dbrsgetcolnames function and improved database access e 12 2004Added new set of mapping scripts Map_Image msf Map_Images msf Map_Image_to_file msf These functions can map project any GDAL supported input file e 2 13 04 added support for formatted float2str i e float2str x format e 2 17 2004 added stop_process error_string function e 3 22 2004 ladd2groi a groi o can support b to be a row vector very useful for implementing fast accumulators e 3 2004 added additional support for CFITS library e 4 2004 added capability to MSHELL to be under the control of a license server with floating licenses e 4 2004 fixed documentation for functions menusel and iboxlist e 7 2004 added example for function gdal_contour_generate e 1 2005 added a number of additional function bindings between MSHELL and GDAL e 2 2005 fixed documentation of vi
124. dinates that define the variable region of interest vroi of an already defined variable say X and assigns it to a user defined variable called regionc ready regionc X vroi The notation X vroi can be viewed as if vroi is an attribute of X allows access to the actual pixel values defined by the region of interest associated with an array Given an array variable say X the actual pixel values can be easily accessed in the command line by appending aoi to the image name For example ready subimage X aoi Table of Contentse 19 extracts the subimage defined by X vroi and assigns it to a user defined variable called subimage This could also be done using the following notation ready subimage X X vroi MSHELL provides different ways to operate over regions of interest For example to add 10 to all pixels falling within the defined region of interest and updating the display type ready X X vroi X aoi 10 ready view X This could also be done as follows ready regionc X vroi ready X regionc X regionc 10 ready view X The following set of image attributes are related to image mensuration They all start with m_ just as the above intrinsic attribute commands did x m_x0 x m_dx x m_dy x m_xunit x m_yunit x m_flag user defined horizontal position of upper left pixel in image user defined spacing between two adjacent horizontal pixels as you move from le
125. ds number does not match the header 26 Cannot write feature 6 Cannot create feature 3 Shapefile driver not available 4 Creation of output file failed 5 Layers creation failed shp2contour Shapefile to Contour Image Syntax shp2contour filename bbox size recn Description This function generates an image containing a view of the shapefile for a given region and number of records filename is a string containing the name of the shapefile file bbox is a 1x4 array containing the bounding box of the region of interest Xmin Ymin Xmax Ymax bbox text optional input containing the proj4 string that describes the coordinate system of the vector features Note This option will be executed as long as there is a valid prj file associated with the shape file The prj file can contain a WKT well known text representation of the coordiate system size is a 1x2 array containing the desired image size rows columns and recn is either a Nx2 array or O If recn is a Nx2 array the first column contains the shapefile record id and the second column contains the value to use when drawing the contour for that record if it is 0 then all the shapefile records are used and the value contained in the system variable M_plotcolor is used for the contour The generated image can be used as an overlay to another image Example The following example illustrates the function 238 Int
126. dy stores a ready directory 262 Internal Functions returns to the The following operations illustrate the function system edit c autoexec bat go to DOS edit when done ready ProVIEW prompt directly system opens a DOS at the DOS prompt you can execute operating system commands batch files or other DOS programs when done type EXIT rem to return to the ProVIEW prompt ready to working in ProVIEW system dir s b gt dir lst creats and listing Slist readtext dir 1st of files ina REACT MSHELL User s Manual 11 12 2007 SYS_ Issues Operating System Commands In this group you will find the following system functions sys_pwd syS_cd syS_mkdir sys_dir sys_move syS_ren sys_copy syS_del sys_deltree sys_dirsize sys_filesize sys_sendmail Detail syntax and examples are provided below sys_pwd Prints the current working directory Syntax sys_pwd Description This function returns a string containing the absolute path of the current working directory Example Printing the current directory Sdir sys_pwd print Current directory is Sdir sys_sendmail Sends mail Syntax sys_sendmail srvrlP from to subject message Description This function sends an email to email address specified in to The user must provide the IP address of the mail
127. e 202 Internal Functions REACT MSHELL User s Manual 11 12 2007 The returned value will be 0 on success otherwise an error code is returned along with a description of the error in the text attribute Example Sfile_mlt my_layers mlt result react_load_mlt file_mlt 0 if result error result result text react_update_layers Updates Layers visualization Syntax result react_update_layers Description Updates the Cartographic Viewer with the visualization of the current layers tree loaded in the Layers Manager The returned value will be 0 on success otherwise an error code is returned along with a description of the error in the text attribute Example result react_update_layers if result error result result text ProVIEW User s Guide Appendix B Internal Functions 203 react_enable_view Shows a REACT panel Syntax result react_enable_view panel Description Makes sure that the specified REACT panel is visible Currently these are the supported panels V_LAYERS Layers Rendering Tree V_3D 3D Viewer V_SITES Target Panel V_ANALISYS Development Environment The returned value will be 0 on success otherwise an error code is returned along with a description of the error in the text attribute Example result react_enable_view V_LAYERS if result error result re
128. e containing a brief description of the error see the table below Return value text Meaning attribute 0 Not set Success 1 Set input_files some do not exist 2 Set input_files is not a list of files 7 Set Cannot open output_file 6 Set Cannot read some input_files 5 Set output_file already exists Example Sinputfiles fileA txt fileB txt Sout merged txt status sys_cat Sinputfiles Sout if status print An error occurred status text return 278 Internal Functions REACT MSHELL User s Manual 11 12 2007 T tan Tangent Syntax tan a or a tan Description Compute the tangent of each array element Note that the input is expected in radians tanh Hyperbolic Tangent Syntax tanh a or a tanh Description Compute the hyperbolic tangent of each array element The hyperbolic tangent of a is evaluated as tanh a sinh a cosh a for alli j where j and i are respectively row and column idices textoverlay Annotates an Image with Text Syntax textoverlay image text Font PointSize row col color overlay orientation Description This is used to place a text overlay on an image where text is the string to be displayed and Font is a string specifying the font to use Row and column are the corresponding starting pixels for the text on the image Color is the color of the text with the folowi
129. e data is real or complex 1 complex O real ACT REACT MSHELL User s Manual Table of Contentse 37 Internal Functions The user can locate a specific function by first looking into the Classes of MSHELL s Built in Functions where commands are divided into functional areas see Appendix A Given a function name or symbol the user can locate specific information about its use under the alphabetical listing of internal functions see Appendix B MSHELL array expressions can be used as arguments to other MSHELL functions In most of the following functions the input to the functions are arrays and the output result is another array Math Error Handling and Indexing 38 e Table of Contents In MSHELL floating point exceptions generate either results in the form of NOT A NUMBER NAN infinity INF or minus infinity INF The user must inspect an array for such an occurance to determine if invalid number are present in the array The example below illustrates manipulations that result in NAN or INF or INF The user can control how math related errors are reported using the system variable M_matherrflag described under M_ in Appendix B REACT MSHELL User s Manual 11 12 2007 ready cos 1e38 NAN ready INF ready INF ready NAN ready ready INF ready NAN ready log 0 INF ready log 1 O 3 14159i ready 0 0 1 ready y ready 10 0 X row 0 00 ready
130. e n is the number of rows and m is the number of columns Example Takes a2 x 2 array and pads it to a3 x 5 array ready ready row 0 ready zeropad x 3 5 ready zeros Initialize Array to all Zeros Syntax zeros n m Description Create an array in memory with all the elements set to 0 Example The following MSHELL statement will create the 512 x 512 array c in memory with all entries set to 0 C zeros 512 512 zinterp Zero Order Interpolation Syntax zinterp f x 304e Internal Functions REACT MSHELL User s Manual 11 12 2007 Description This is used to perform zero order interpolation on an array f by expanding the data to a range specified by the x array which will list the abscissa and ordinate indices for each new desired element Appendix C Remote Access Introduction A new feature under development is the communication between two MSHELL engines located in different machines This is done via CORBA The following table contains the present set of function calls that are being tested and that have been added to the MSHELL language The following internal functions defined in Appendix B support remote invocations of MSHELL using CORBA rs_init rs_connect rs_release rs_exec rs_exec_async rs_wait rs_getString rs_getArray rs_availWipeServers rs_availDataSets rs_getMetaData rs_extractData See detail discussion of the above functions in Appendix
131. eady open with an openf statement and that the variables x and name are respectively an array variable and a string variable then the following MSHELL statements are legal readf statements status readf 1 s Sname status readf 1 Sf x status readf 1 4 2f x status readf 1 g x status readf 1 e x 214e Internal Functions REACT MSHELL User s Manual 11 12 2007 readtext Loads Text File Syntax readtext fname Description This function is used to load a text file into a memory string If fname contains any environment variables in the form VAR those are expanded to their values see expand commana Example load a file into a memory string x readtext M_proviewdir scripts filtering spatial_ops gradie nt_ops gradient msf print x print the content of the string load a URL into a string x readtext http www actgate com readtext_and_status Loads Text File with check Syntax readtext_and_status fname Description This function is used to load a text file It returns a status variable see example code If the value is zero the operation was a success Similar to readtext it can be used also to read URLs If fname contains any environment variables in the form VAR those are expanded to their values see expand command Example file M_proviewdir scripts fi
132. ections meridinal and parallel scales factors will be equal and angular distortion zero Equal area projections will have an area factor of 1 m mult The cartesian data may be scaled by the mult parameter When processing data in a forward projection mode the cartesian output values are multiplied by mult otherwise the input cartesian values are divided by mult before inverse projection If the first two characters of mult are 1 or 1 then the reciprocal value of mult is employed f format Format is a printf format string to control the form of the output values For inverse projections the output will be in degrees when this option is employed If a format is specified for inverse projection the output data will be in decimal degrees The default format is 2f for forward projection and DMS for inverse wlW n N is the number of significant fractional digits to employ for seconds output when the option is not specified w3 is assumed When W is employed the fields will be constant width and with leading zeroes V causes a listing of cartographic control parameters tested for and used by the program to be printed prior to input data Should not be used with the T option 308 Internal Functions REACT MSHELL User s Manual 11 12 2007 V This option causes an expanded annotated listing of the characteristics of the projected point v is implied with this option T ulow uhi vlow vhi res umax vmax This option creates a s
133. ee Reda Was ed sds Lg a a ieia 310 APPENDIX E GEOGRAPHIC DATA ABSTRACTION LIBRARY ccsssssccssssseceesseees 311 EIDIN EE COPY ALEIS HINTON HLE S E ASE E E A 311 REACT MSHELL GDAL INTERFACE coc ccssscs sasedesesscsched e niie ai a hadia es SEENE 313 REACT MSHELL GDAL LIBRARY SUPPORT cccscscccccsecssssssnsecececceseeesenseaeeeseceeseeesseaeeeseeseseeenaaeas 314 APPENDIX F RECENT CHANGES giiscosccsscconocsscesocesedoccessedaseensecendesdssentseseenssdsnsedadbsssennsvsccevennce 322 List of Capabilities recently added to REACT MSHELL ssccccessessecesesnseceeecssececeesseeeeesssaeeeenes 322 vi e Table of Contents REACT MSHELL User s Manual Overview What Is the REACT REACT stands for Rapid Environmental Assessment Composition Tools It provides a number of high level tools e g e Development Environment e Network Centric Data Access e Decision Support Tools and e Institutional Answers This document concentrates on the development and analysis tools of REACT REACT is a GUI application with many functionality modules A core compoment of REACT s development environment is the interface with ACT s MSHELL image signal processing interpreter language The REACT MSHELL GUI interface inherits many of the concepts from ProVIEW The combination of REACT MSHELL exposes an interactive command line and menu driven Image and Signal Processing Environment which runs under all major OS environments The combination
134. en x and y as real arrays with equal dimension this function constructs an array z of the form z x iy where i sqrt 1 Example The following is a simple application of the function ready complex 0 3 4 3 10 0 X row 0 0 00 4 00i 3 00 3 00 conj Array Conjugate Syntax conj a or a conj Description This function returns the complex conjugate of each element in the input array a i e it changes the sign of the complex part Example For example if x 443i then conj x returns 4 3i contour Generates a contour plot Syntax contour z zlevels or contour z yaxis xaxis zlevels Description This function generates a contour plot of the image or sub image region selected where 2 is a real array with at least 2 rows and 2 columns zlevels is the row vector with the contour levels that will be used and is the Plot Screen Number Instead of zlevels you can use the following instruction to generate 11 different levels between the maximum and minimum value of z ProVIEW User s Guide Appendix B Internal Functions 77 z mint z max z min 0 1 0 1 The parameter in the contour function is an optional integer number between 0 and 255 that selects the plot screen where the plot will be placed If an integer number from 0 to 255 is provided in this field the generated plot can be indexed from then on by that number For example if x is an arra
135. ensing org proj 310 Internal Functions REACT MSHELL User s Manual 11 12 2007 Appendix E Geographic Data Abstraction Library GDAL CopyRight Notice we a translator library for raster geospatial data formats that is released under an X MIT style Open Source license As a library it presents a single abstract data model to the calling application for all supported formats The related OGR library which lives within the GDAL source tree provides a similar capability for simple features vector data More information can be found at http www remotesensing org gdal index html GDAL is under copyright by Frank Warmerdam Copyright notice follows Copyright c 2000 Frank Warmerdam Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions The above copyright notice and this permission notice shall be included ProVIEW User s Guide Appendix E Geographic Data Abstraction Library 311 in all copies or substantial portions of the Software THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WAR
136. er s Manual 11 12 2007 cos Cosine Syntax cos a or a cos Description Returns the cosine of each array element The input is expected to be in radians Example The following MSHELL statement will compute the cosine of a divided by 2 and store the result in c ready c cos a 2 cosh Hyperbolic Cosine Syntax cosh a or a cosh Description Computes the hyperbolic cosine of each array element The hyperbolic cosine of x is evaluated as cosh x ene 2 covm Covariance Matrix Estimation Syntax covm a or a covm Description Computes an unbiased estimate of the covariance matrix established by the column vectors in a The actual estimation is done using the following equation 1 I 1 a a a a ra 2 4 a a 4 where a is the F column in a and a sumc a is the column vector resulting by averaging each row in a See Also Fukunaga K Introduction to Statistical Pattern Recognition for a detailed definition ProVIEW User s Guide Appendix B Internal Functions 81 curveTraj particle Trajectory flow builder Syntax traj curveTraj LL v0 posStart params Description Computes trajectory flow of particles by solving Lagrangian equations with marching and iteration Note The original implementation of this algorithm was in FORTRAN and provided by Dr Ko at NRL SSC The inputs to this routine are e LL latitude and longitude planes complex array
137. er than Clip to Syntax Itclipto a tval newval Description Set all the values in the input array a below a selected threshold value tval to a new desired value newval Example Using the array a previously defined in leclipto ready ltclipto a 0 5 0 2 row 0 0 20 0 20 0 57 0 20 0 78 0 56 0 74 lthresh Less than Threshold Syntax Ithresh a b Description This sets all values within a which are less than the treshold b equal to the threshold Itindex Lower Index Syntax Itindex a b Description Similar to eqindex but it returns an index to all elements in a lower than b Example Using the array a previously defined in leclipto ready ltindex a 5 row 0 0 00 0 00i 1 00 0 00i 3 00 0 00i 158e Internal Functions REACT MSHELL User s Manual 11 12 2007 Syntax Description Look up Table LUT associated to image x LUT and x LUTdef Note This capability was incorporated in MSHELL version 3 Given an image x you can set or read an associated look up table to this variable using the x LUT Once assigned if the user sents the image for display using view or view255 the view command will make use of the assigned LUT x LUTdef is used to save a copy of the default palette that gets loaded when the image is read from disk If the user modifies x LUT the original state can be restored with x LUT x LUTdef
138. ernal Functions REACT MSHELL User s Manual 11 12 2007 generate a test image testimage hammiw 256 256 view255 testimage save image as a GDAL file image testimage Sstatus gdal_driver_init Sfname c temp ohare dat Sdriver GTiff sizev 1 image nrows image ncols dtype 6 hdl gdal_create driver fname sizev dtype 0 wf 1 xoff 0 yoff 0 xsize image ncols ysize image nrows my_array image band_map 1 npix_spc 0 nline_spc 0 nband_spc status gdal_rasterio hdl wf xoff yoff xsize ysize my_array band_map npix_spc nline_spc nband_spc set parameters to call gdal_contour_generate band 1 cinterval 1 cbase 0 flevels 0 5 0 25 0 1 0 01 flevelcount flevels ncols use_nodata 0 Sshapefilename c temp shapeout Sattr temperature_values use3d 0 status gdal_contour_generate hdl band cinterval chase flevels use_nodata shapefilename Sattr use3d status gdal_close hdl View created shapefile as contours M_format 00000000000 0000 Sshpfile Sshapefilename shp ifo getshpinfo shpfile xmin ifo 0 4 ymin ifo 0 5 xmax ifo 0 6 ymax ifo 0 7 bounds xmin ymin xmax ymax sz image nrows image ncols recn 0 shp_result shp2contour S shpfile bounds sz recn view shp_result wtile See Also gdal_contour_generate and functions whose name start with shp shp2image shp2fillimage ProVIEW User s Guide Appendi
139. et of bivariate Chebyshev polynomial coefficients that approximate the selected cartographic projection on stdout The values low and hi denote the range of the input where the u or v prefixes apply to respective longitude x or latitude y depending upon whether a forward or inverse projection is selected Res is an integer number specifying the power of 10 precision of the approximation For example a res of 3 specifies an approximation with an accuracy better than 001 Umax and vmax specify maximum degree of the polynomials default 15 See also fproj 1 The args run line arguments are associated with cartographic parameters and usage varies with projection and for a complete description see Cartographic Projection Procedures for the UNIX Environment A User s Manual and supplementary documentation for Release 4 Additional projection control parameters may be contained in two auxilliary control files the first is optionally referenced with the init file id and the second is always processed after the name of the projection has been established from either the run line or the contents of init file The environment parameter PROJ_LIB establishes the default directory for a file reference without an absolute path One or more files processed in left to right order specify the source of data to be transformed A will specify the location of processing standard input If no files are specified the input is assumed to be from stdin For ASCII i
140. ew255 e 2 2005 added documentation for the x LUT image attribute which control image palettes e 3 2005 added support for a new raster reading function call x reada input all This function tries to determine the input file type and read it See also the new M_maxdim system variable e 4 2005 added new string manipulation functions strEndsWith strStartsWith strContains e 4 2005 added volumetric handling capabilities for variables loaded in memory See x m_voltype x m_voldim and the function alternateRGB plus alternateBSQ ProVIEW User s Guide Appendix F RECENT CHANGES 323 e 4 2005 added documentation of gdal_get_metadata e 4 2005 added information for reading of voldim information i e x m_nrowsed x m_ncols3d x n_nband3d e 4 2005 added to interpreseter strContains strEndsWith strStartWith strUniqueList type of string functions NOT documented yet e 5 2005 added function writeRGB fname r g b format where format can be PNG or JPEG This function is using a more portable approach to implement similar functionality as in writecolor e 5 2005 added x mapinfo It is similar to x text but it is used to track map_information e 7 2005 added maskofLT maskofGT maskofGE maskofLE maskofEQ e 8 2005 added ftp _ rw rmshell getMyIP network related functions e 8 2005 added sqlite_ support e 2 2005 added curvTraj function
141. f description of the error see the table below Return value text Meaning attribute 0 Not set Success Set source does not exist 2 Set Permission denied case source gt dest 3 Set Permission denied case source gt dest source 4 Set Cannot move to a non directory Set First argument is neither file nor directory Example Moving and renaming files and or directories ProVIEW User s Guide Appendix B Internal Functions 269 270 Internal Functions rename file or directory s sys_move filel txt better_name txt s sys_move dirl newdir moves file2 dat to data_dir file2 dat s sys_move file2 dat data_dir moves old_tree to backup old_tree s sys_move old_tree backup to catch errors if s print An error occurred s text return REACT MSHELL User s Manual 11 12 2007 sys_ren Renames files or directories Syntax sys_ren oldname newname Description This function just renames the oldname it can be either a file or a directory to newname Note that this function is provided for convenience but the same functionality can be achieved with sys_move If successful it returns 0 otherwise it returns a non zero value and the text attribute is set with a brief description of the error see the table below Retu
142. f band numbers to read write interpixel spacing in bytes 0 default datatype size interline spacing in bytes 0 default datatype size buffer width interband spacing in bytes 0 default nline_spc buffer height nbands requested If xsize or ysize is different than the size of my_array the GDAL library will decimate or replicate to fit the my_array buffer The float or double data in my_array will be converted just clipping and casting values not scaled to whatever data type the dataset is defined to be new_hdl gdal_create_copy driver_name filename hdl options Creates anew GDAL dataset in filename using existing open dataset referenced by hdl The driver_name is the short name for the dataset format which are shown in the output of the gdal_driver_info function The options are for future general and format specific options Returns a new dataset handle may be read only ProVIEW User s Guide Appendix E Geographic Data Abstraction Library 317 hdl_new gdal_create driver_name filename size_vector datatype_code 0 Creates a new GDAL dataset from scratch The driver_name is the short name for the dataset format which are shown in the output of the gdal_driver_info function The size_vector should always be 3 values given as bands rows columns The datatype_code is the pixel datatype code used by GDAL GDT_By GDT_UI GDT_In GDT_UI GDT_In GDT_F1 GDT_F1 GDT_CI GDT_CI
143. f columns in the volumetric cube x m_nbands3d when the x m_voltype 0 this call will return the effective number of bands in the volumetric cube Once the alternateRGB or alternateBSQ representation are enabled the user can access a rectangular region of interest roi using the following notation x roi iband where e _iband is a non negative integer value gving the desired band number starting at zero e roi is a valid rectangular region of interest within a single band e This construct can be used for reading Assignments needs to be implemented x iband where provides a short notation to select the whole band i e e The delimiter is used in this particular example to denote the whole set of rows and columns in the selected image plane e _iband is a non negative integer value gving the desired band number starting at zero e This construct can be used for reading and assignments See example code in alternateBSQ ACT REACT MSHELL User s Manual Table of Contentse 21 String Variables A string is defined as a sequence of alpha numeric characters enclosed within quotes similar to the C language In general string variable names start with For example the string variable message can be assigned a string as follows message hello world MSHELL allows the use of control characters within a string such as n linefeed t tabulation b backspace backslash r carr
144. f the display window x m_viewhscrollpos Controls the horizontal scroll position of the display window x m_viewvscrollpos Controls the vertical scroll position of the display window 18 e Table of Contents REACT MSHELL User s Manual 11 12 2007 x m_viewx0 x m_viewy0 x m_viewlut x m_viewmaxval x m_viewminval x m_viewtext x text X vroi X aoi ACT REACT MSHELL User s Manual Controls the horizontal position of the upper left corner on the display Controls the vertical position of the upper left corner on the display Contains the active look up table to be used for x Controls the maximum value to be displayed on the screen Controls the minimum value to be displayed on the screen Allows one to view the text which is part of an image Allows you to access either read or set the text attribute of the image Image variables may contain associated text which can be accessed by adding text to the variable name For exaple x 4 x text my number print x text n Extracts the coordinates of the variable region of interest Every image variable has associated with it a rectangular region of interest When a variable is created this region of interest is set to be the whole image The coordinates of the defined region of interest can be easily accessed at the command line by appending vroi to the image name For example the following line of code extracts the coor
145. ferencing or that are already in cartographic projection space Single Precision Version 32bit Running Exanple of shapefile Reader Contour node Pelpgen Filled node File C ACT Proview inages SAR Gat_01_cr19 jpz size 13259918 mage pixel resolution is being computed fron GCPS at center of image x pixel_spacing at the center of the image 50 05 yopixel_ spacing at the center of the image 49 71 ready include geo zoo ready include geo_zoon ready include geo_zoon ready _ Figure 7 Map_Image msf Sample ouput screen showing results in ProVIEW User s Guide Appendix E Geographic Data Abstraction Library 313 REACT MSHELL GDAL Library Support driver_list gdal_driver_init Initializes the GDAL dataset drivers Returns a list of registered dataset drivers This must be done before accessing any of the GDAL related functions dataset_handle gdal_open dataset_name or gdal_open data_name R WMODE Attempts to open a dataset with GDAL library and returns a non zero dataset handle integer number which is used to reference that file in other functions in many cases dataset_name is just a file name RWMODEZ 0 for opening on read only mode and RWMODE 1 for opening using write update mode gdal_close dataset_handle Closes the dataset gdal_dataset_info dataset_handle Returns some general information about the given open dataset_handle gdal_dataset_info_detail dataset_h
146. for each element in the array Example The following MSHELL statement will extract the imaginary part of the 2D Fourier Transform of a and store the result in c ready c imag fft2 a ProVIEW User s Guide Appendix B Internal Functions 143 image2surface project planar image onto a surface Syntax image2surface image xy z cntl1 cntl2 cntl3 Description Given an input image defined over a rectangular grid this command will drape the input image intensities on a surface grid defined by xy amp z Note This function is primarily used in MSHELL to go from sensor projection or sersor scan into a cartographic map representation when a dense rectangular grid of ground control points is available in this case z is set to a constant value of zero and cntl3 0 image xy Real array with amplitude values for the image xy complex x y with values to be used for the projection The number of rows and columns in xy must match the dimensions of image If set to the zero scalar a rectangular grid of xy with monotonically increasing values will be internally generated entl1 Real array with height values to be used in the projection The number of rows and columns in xy must match the dimensions of image cntl1 ns outrows outcols non_valid_pixel background_level Where ns 1 8 used to control the sampling of the input xyz grid ns 1 is most accurate and ns 8 is the least accurate ou
147. ft to rightx m_y0 user defined vertical position of upper left pixel in image user defined spacing between two adjacent pixels in the same column as you move from top to bottom string describing the units of x m_x0 string describing the units of x m_y0O if this flag is set to 1 the user defined image mensuration will be used when viewing the x image Volumetric Access of an Array Variable The following attributes are related to the use of alternative volumetric representation of the data loaded in memory x m_voltype 20 e Table of Contents describes the alternative volume type representation to be used for visualization This variable is read only Its value can only be modified by the function REACT MSHELL User s Manual 11 12 2007 alternateRGB and alternateBSQ voltype 0 gt normal 2d array representation voltype 1 gt band sequential representation voltype 3 gt RGB band sequential x m_voldim similar use to x m_voltype It actually contains a string with the Nrows Ncols and Nbands to be used in the alternative representation See the example of alternateBSQ and alternateRGB to undertand the volume type representation better To read the voldim information use x m_nrowssd x m_ncols3d and x m_nbands3d x m_nrows3d when the x m_voltype 0 this call will return the effective number of rows in the volumetric cube x m_ncols3d when the x m_voltype 0 this call will return the effective number o
148. ge view4d project planar image into an xyz grid Syntax view4d image xy z rot tilt nout ns Note this function is being replaced by image2surface Description Given an input image defined over a rectangular grid this command will reproject the image intensities to a user requested xyz grid The command is called view4d because it uses amplitude and xyz information 4dimensions It also applies a rotation of rot and a tilt of tilt generating and output image of nout rows columns The sampling of the input xy or z place is controlled via ns 1 8 where ns 1 is most accurate and ns 8 is the least accurate Example 1 The following example uses view4d to take the albedo image of the moon and and a height image of the moon and generate a draped version of the albedo image over the Digital Terrain elevation image In the script file below the uvvis750 flt file corresponds to the lower image in the top image this file has been altitude enhanced with the topography image luntopo 4 ProVIEW User s Guide Appendix B Internal Functions 289 M_cwd M_proviewdir IMAGES luntopo reada luntopo f1t float uvvis750 reada uvvis750 chr char uvvis750 decimate uvvis750 2 2 luntopo shiftc luntopo 0 180 luntopo scale255 luntopo view luntopo OON view4d uvvis750 0 luntopo 4 10 70 800 5 OON m_viewflag 0 OON zeropad MOON MOON nrows 100 MOON ncols OON shiftc MOON
149. given as ProVIEW User s Guide Appendix B Internal Functions 79 ready a 1 3 1 ready k 3 1 1 ready convol a k example of convol row 0 3 00 8 00 14 00 8 00 3 00 ready convolt a k example of convolt row 0 8 00 14 00 8 00 convtol Convert Row Vector to Image Syntax convtoi a ncols Description Converts a 1 D row array a to a 2 D array where you specify the column dimension ncols The resulting number of rows must be an integer That is if the row vector had dimensions 1 x M and the you are questing a column dimension of N the output array will have dimensions of M N x N i e N must be a factor of M Example The following converts the row array a to a 2 D array ready a 1 2 1 2 create row vector ready convtoi a 2 convert row vector to 2 col array row 0 1300 2 00 row 1 1 00 2 00 convtov Convert Image to Row Vector Syntax convtov a or a convtov Description Converts the 2 D input array to a 1 D array containing only one row That is if the input array a had dimensions N x M the output array will have dimensions of 1 x N M Example The following converts the 2 D array a to a row array ready creates a 2x2 matrix ready row 0 1 00 row 1 1 00 2 00 ready convtov a converts matrix to row vector row 0 1 00 2i 800 Internal Functions REACT MSHELL Us
150. hannel number returned by DDElInit and cmd is a string you want the server to execute DDExec will return 0 if the server accepted the command 1 otherwise Example See User s Manual page 54 ProVIEW User s Guide Appendix B Internal Functions 95 DDEInit initialize DDE server application Syntax chan DDEInit Application Name Topic Description This command is used to start a conversation on a particular topic with the server application Application Name is the name of the application you want to communicate with Ex MSAccess and Topic is the name of the particular topic This command returns a channel number associated with the conversation you are requesting or 1 if the operation fails Example See User s Manual page 54 DDEPoke POKE DDE server Syntax DDEPoke chan item val Description This command is used to request the server application to accept an unsolicited data item value Chan is the channel number returned by DDElInit item is a string that identifies the data item you wish to send a value a value for and val is a string containing the value DDEPoke will return 0 if the server accepted the data item value 1 otherwise Example See User s Manual page 54 DDEReqS Requests value from DDE server Syntax var DDEReqS chan item Description This command is used to request the server application to provide the value of a data item var is a MSHELL string variable chan
151. has a special variable V called the virtual variable With this variable the user can manipulate an image file which can be as large as 264 pixels It supports many formats 1bytes pixel floating point double precision unsigned inteter fits Use this class of functions to load Flexible Image Tranfer System FITS formatted data This format is used extensibely in the Astronomy community The reada function can be then used to read particular data objects gdal_ Use this class of functions to load raster data using the Open Source Geographic Data Abstraction Library GDAL The MSHELL GDAL interface provides extensive access to many geographic raster data formats e g GEO Tiff CEOS HDF See discussion in Appendix ncread Use this function to load NetCDF type of data pds_ Use this class of functions to load and manipulate Planetary Data System data headers The reada function can also be used to read some PDS data objects REACT MSHELL User s Manual 11 12 2007 Exporting Data MSHELL can write image or array data in a number of different output formats see the writea and reada functions Data stored in the MSHELL s char and float format contains a simple 9 byte header The first 4 bytes contain the number of rows unsigned 32bits number the next 4 bytes contain the number of columns unsigned 32bits number and the last byte contains a flag indicating if th
152. he DLL is successfuly loaded and 1 otherwise Call the function in the DLL using the following MSHELL command callDLL dllname functionname arg1 arg2 arg3 arg4 arg5 functionname is the name of the function in the DLL you want to call arg1 arg2 arg3 arg4 and arg5 are the arguments you want to pass to the function ACT REACT MSHELL User s Manual Table of Contentse 43 Example of User Provided Functions as Dynamic Link Libraries include lt stdio h gt include user h ifdef __BORLANDC__ ARRAY _export test ARRAY al ARRAY a2 ARRAY a3 ARRAY a4 ARRAY a5 endif ifdef _MSC_VER __declspec dllexport ARRAY test ARRAY al ARRAY a2 ARRAY a3 ARRAY a4 ARRAY a5 endif ROKK RK KK kkk A kk kk kk kk kk k k kk kk kk kkk k kkk Ae AAA kk kk kkk kkk kk KR KK Include the following two functions in your code MSHELL will call SetInitA and SetFree upon loading the DLL to pass the addresses of the functions inside MSHELL that InitA and Free will call It is very important that you initialize variables of type ARRAY using InitA You must pass to InitA a name you want to assign to the variable the number of rows the number of columns and the type 0 real 1 complex KKEKKKKKKK KKK KK KK KKK KKK KK KKK KKK KKK KKK KKK KKK KKK KKK KKKKKKKKKKKKEK kkkkkkk kk void SetInitA void fn _InitA ARRAY char ptr unsigned long sizej
153. he value 1 is returned rmirror Row Mirror Syntax rmirror a or a rmirror Description This function yields the mirror image of the input array over its rows e g the last row will become the first row See Also cmirror Example Creates array a and then does the row reflection ready randu 3 3 ready row 0 42 0 93 231 0 90 0 58 0 65 rmirror a rmshell_execute Execute a command in the remote MSHELL Syntax rmshell_execute handle command Description This function works after an rmshell_ session_init and can be used to execute a command in the remote MSHELL interpreter It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and a command string to be executed This function will block until the execution is finished If successful it returns 0 and the text attribute holds the output string 218e Internal Functions REACT MSHELL User s Manual 11 12 2007 generated by the execution of command If an error occurs it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see rmshell_getvar example rmshell_execute_async Execute a command in the remote MSHELL does not block Syntax rmshell_execute_asynce handle command Description This function works after an rmshell_session_init and behaves essentially like the rmshell_execute function but it returns immediately It t
154. he whole world centered at longitude 0 n 45 180 360 dworld 90 90 180 180 o0rows ocols gap 255 weqc LLw equi distance cylindrical view of the C ACT Proview wdb coasts dat view of the whole world centered at longitude 0 n dworld 90 90 180 180 o0rows ocols gap 255 weqce LLCO eqc view of the world centered at long 0 view of the whole world centered at longitude 0 midpoint between 0 360 n weqc LLc180 view255 r rv rv text dworld 90 90 0 360 0orows ocols gap 255 weqc LLc180 10e6 SsSrlirsy lt 2erer2 7r proj sinu nellps wGS84 nlat_0 90 nlon_0 0 nno_defs wview sinu dworld rv orows ocols gap 255 wview view255 sinu M_wdb M_wdb x rv rv text C ACT Proview wdb world dat 10e6 SP A aa A re 2 ee proj moll nellps wWGS84 nlat_0 90 nlon_0 0 nno_defs wview mollweid dworld rv orows ocols gap 255 wview view255 mollweid rv rv text 3 e6 S ors a E A proj ortho nellps WGS84 nlat_0 65 nlon_0 155 nno_defs centered on Alaska wview dworld rv 300 300 ortho_AK 255 wview view255 ortho_AK 2 5e6 REACT MSHELL User s Manual 11 12 2007 rv rv text proj ortho nellps WGS84 nlat_0 40 nlon_0 13 nno_defs centered on ITALY wview dworld rv 300 300 45 ortho_IT 255 wview view255 ortho_IT ProVIEW User s Guide Appendix B Internal Functions 105
155. his function is used to extract the text values of a particular node in the DOM tree The input argument is a string where the node names in the hierarchy are separated by Example ready nbc xmltextvalue metadata idinfo spdom bounding northbc ready xmitextvalues Extracts the text values Syntax xmltextvalues northbc Description This function is used to extract the text values associated with tags that share the same name The input argument is a string containing the tag name Example ready S txtvals xmltextvalues northbc ready xpolyc Extracts Coordinates of a Polygon Syntax xpolyc image 302 Internal Functions REACT MSHELL User s Manual 11 12 2007 Description Used to list the coordinates along a polygonal region of interest Once the command has been issued in the command window then one is prompted to click the vertices of the desired polygonal region within the image of interest xpolyv Extracts Vertices of a Polygon Syntax xpolyv image Description Used to list the vertices of a polygonal region of interest Once the command has been issued in the command window then one is prompted to click the vertices of the desired polygonal region within the image of interest ProVIEW User s Guide Appendix B Internal Functions 303 zeropad Expand an Image with Zeroes Syntax zeropad a n m Description Add zeros to the input array a wher
156. iable names in the file The format of the array is Number of dimensions Number of variables Number of Global attributes The unlimited Dimension ID if any These numbers come directly from call to NetCDF library function nc_ing_var The text portion of the return variable will contain a list of the variable names from the file separated by newlines Example The following demonstrates the process The example NetCDF file has 3 dimensions 4 variables no global attributes and no variables with an unlimited dimension ProVIEW User s Guide Appendix B Internal Functions 179 ready netcdfinfo ncing temp nc ready netcdfinfo 10 0 X row 0 3 00 4 00 0 00 1 00 ready netcdfinfo text Longitude Latitude Depth temperature ncinqvar NetCDF Variable Inquiry Syntax ncinqvar fname varname Description Returns the size and shape of variable varname within NetCDF file fname in a 1xN array where N is the number of dimensions of the requested variable The format of the array is Size of dimension 1 Size of dimension 2 Size of dimension 3 Size of dimension N The text portion of the return variable will contain a list of the N dimension names the variable makes use of Example The following demonstrates the process ready varinfo ncingvar temp nc Temperature ready varinfo 10 0 X row 0 34 00 51 00 51 00 ready varinfo text Depth Latitude Longitude
157. iables Display basic parameters of a list of arrays or of all arrays in memory Also have show all Note that this command can not be used within an expression Example Generate some variables and then invoke show 244e Internal Functions REACT MSHELL User s Manual 11 12 2007 ramp 0 255 1 256 a randg 3 100 name Carlos 5 00 show all ready show a ee ee data type is number of rows number of columns maximum value minimum value 100 real defined at level 1 1 real defined at level 256 256 real defined at level 1 6 string real 3 100 2 75168 2 92469 sign Sign of Array Elements Syntax sign a or a sign Description Compute the sign of each element in the array For every element in a it returns 1 if the element is greater than or equal to zero and 1 otherwise This function does not accept complex inputs Example Generate a vector and then apply the sign function to the vector ready a geo 2 7 generate a row vector ready sign a example of sign row 0 1 00 1 00 1 00 200 1 00 1 00 1 00 sin Sine Syntax sin a or a sin Description Compute the sine of each array element Note that the input is expected in radians sinc Sinc Function Syntax sinc a or a sinc ProVIEW User s Guide Appendix B Internal Functions 245 Description Evaluates the sinc function for each element in the input array The sine function is defined a
158. iage return The above control characters can be used to control the format of strings on the output If x is a string and r1 r2 are row numbers and c1 c2 are column numbers its content can be accessed using the following syntax x c1 c2 select characters between column c1 and c2 independent of any linefeeds or row number This notation is particularly fast in execution since it does not requires to make two passes over the string x r1 c1 c2 select characters between columns c1 and c2 in row r1 x c1 c2 select all characters in all rows between columns 1 c1 amp c2 x r1 select all characters in row r1 If a is a row vector say x 0 3 1 then x a extracts all the lines specified by the list in a x a c1 c2 extracts all the lines specified by the list in a 22 e Table of Contents REACT MSHELL User s Manual 11 12 2007 but only the characters between column c1 amp c2 Note Relational Operations are permitted on strings See Program Flow Control for more info System Variables The majority of the system variables are used for plotting purposes by the plot and plot3d functions Others are used to control the behaviour of REACT MSHELL and to hold basic system configuration information A complete list of these variables can be found in the dictionary of internal functions under M Some of the REACT MSHELL system variables are strings while others are number
159. ificing computational performance A single statement in MSHELL can be equivalent to a large number of statements in other languages such as C or FORTRAN REACT s GUI components allows to rapidly visualize the data expeciting the process of algorithm development Based on the understanding that both image processing and multi dimensional signal processing share the same mathematical foundations MSHELL was developed from the onset as an image and signal processing language With MSHELL at it s core REACT provides an Image and Signal Processing Environment that is powerful compact and simple to use This makes REACT an excellent tool for work in many diverse application areas such as e Calibration and Reduction of Satellite Imagery coherent as well as non coherent image data e Visualization of Multi Spectral Image Data e Modeling of Electro Optical Imaging Systems To effectivly use REACT MSHELL a working knowledge of Linear Algebra Image Processing and Computer Programming is recommended REACT MSHELL User s Manual 11 12 2007 REACT s Development Environment REACT Analysis and Development Environment To use REACT development environment some familiarity with the Graphical User Interface GUI is assumed This is discussed in more detail in a companion manual that address the GUI and REACT s targeting capabilities With REACT MSHELL you can have multiple images open at the same time i e multiple document i
160. ils allstr allstr Description keyword used by save function See save for details all Allows for all Variables to be included Syntax free all Description Use this command to access all variables at one time It can be used with show all to free all variables or with free all to free all variables Example The following line will free all variables from memory ready free all allocate_array Allocate an array and set its values Syntax allocate_array nrows ncols value Description Allocate a new ARRAY variable with the specified dimension and set all its elements to the specified value Example 66 Internal Functions REACT MSHELL User s Manual 11 12 2007 ready x allocate_array 10 10 0 same as x zeros 10 10 ready x allocate_array 10 10 1 same as x ones 10 10 See also ones zeros alternateRGB describe array as an RGB volume Syntax alternateRGB x Description Use this command to let MSHELL know that when accessing the user specified variable say x to use an alternate volumetric representation In essence this commands sets the internal variable attributes x m_m_ 3 and x m_voldim to match a band sequential RGB representation Once the alternateRGB command is executed any view command will make use of the alternate representation To read the voldim information use x m_nrows3d x ncols3d and x m_nband3d Example
161. ing on the user needs Example ready ready string This is an example to demonstrate the use of eqindexS ready x eqindexS string de gt ready x C18 gt X ow A 22 68 48 8681 ow 49 00 6 86i ready _ evaltext Evaluates a String Syntax evaltext str Description This function allows you to send a string to the MSHELL interpreter for execution You can use this function to create variable names within a script file Example The following lines of code illustrate the application i 1 str x int2str i hammiw 32 32 255 evaltext Sstr view x1 num 5 evaltext string This is a very good manual string exit Exit MSHELL Syntax exit Description This command will exit the MSHELL Interpreter and confirm if you want to exit the MSHELL environment and if so return you to the host operating system 108 Internal Functions REACT MSHELL User s Manual 11 12 2007 exp Inverse Natural Logarithm Syntax exp a or a exp Description Computes the inverse natural logarithm of each array element in a i e raise e to the power of each array element The actual mathematical expression computed is given by em aji Cua 5e for all j i where j and i are row and column indices respectively and e ln 1 Example The following MSHELL statement will compute the inverse logarithm of a and store the result in c ready c exp a
162. interpreter It takes a valid string handle to a previously opened remote MSHELL interpreter If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error 222 Internal Functions REACT MSHELL User s Manual 11 12 2007 Example see rmshell_getvar example rmshell_session_init Connect to a remote MSHELL interpreter Syntax rmshell_session_init handle Description This function is used to connect to a remote MSHELL interpreter It takes the IP address as a string of the remote machine where the MSHELL interpreter is running If successful it returns a valid string handle otherwise it returns en empty string Example see rmshell_getvar example rowplot Plots a Row from Array Syntax rowplot N array row Rowplot N array 1 for interactive plots Description Used to plot a particular row from an array ProVIEW 2002 File Edit Search Image Plot Data Functions Operators Window Help meres ldla Yel AEE ali EE Sel S lolx ETET 0 x 300 00 column index column index 100 00 200 00 200 00 row index Untitled bala 4ij image reada eqohare chr char view image lrowplot0 image 100 rowplotl image 1 active row plot PE ProVIEW User s Guide Appendix B Internal Functions 223 rs_availWipeServers Returns available WIPE Server Syntax WipeServers rs_availWipeServers rs1 Desc
163. ion 3 the scheme for tracking lookup tables associated with array variables was changed See array attribute x LUT for details That is a color palette can be assigned to each individual array wdef Define a Region of Interest Syntax wdef ul_row ul_col nrows ncols Description This function is used to define a region of interest or window where ul_row and ul_col are the upper left pixel coordinates of the region of interest nrows and ncols are respectively the number of rows and columns contained in the region of interest 292 Internal Functions REACT MSHELL User s Manual 11 12 2007 Example The following command defines roi1 to be a 16 x 16 rectangular region of interest with upper left corner at row 8 and col 6 ready roil wdef 8 6 16 16 ready froi f roil extracts subimage ProVIEW User s Guide Appendix B Internal Functions 293 while While Loop Syntax while condition statements counter Description This is a type of loop which runs until the condition stated is nolonger met wmove Move a Region of Interest Syntax wmove roi row col Description Given a valid rectangular region of interest roi originally defined using wdef this function will generate a new region of interest which is a translated version of the input ROI where row and col are the row and column coordinates of the upper left of the translated region of interest and roi is the input
164. ion on using regular expressions can be found here http www perldoc com per15 8 0 pod perire html See also preg_replace Example The following MSHELL expression illustrates the use of the regulars expression capabilities Given the following code ProVIEW User s Guide Appendix B Internal Functions 191 Sa moe nTEMP_MAX IMG_MAX IMG_MIN IMG_MEAN MOE LARRY CURLY b preg_match Sa IMG_ print input string n Sa n print noutput of preg_match i e b text n b text n print noutput of preg_match i e b n float2str b S 0 n once executed it generates input string moe TEMP_MAX IMG_MAX IMG_MIN IMG_MEAN MOE LARRY CURLY output of preg_match i e b text IMG_MAX MAX output of preg_match i e b T3z21 17 20 Row 0 of b contains the start and end position of the first occurrence of the pattern Subsequent rows will contain any captured substrings called out in the pattern with s Note end position is returned as one character beyond the match found a convenient start position value to use to continue search of rest of input string Also b text will contain the all the substrings specified in b one per line The following provides additional examples By no means this is a complete set of examples 192e Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide noe ntest ing nTEMP_MAX IMG_MAX IMG_MIN IMG_MEAN
165. ions 125 gauss N Dimensional Gaussian Density Syntax gauss a invcov det Description Given a covariance matrix this function evaluates the Zero Mean Multi Dimensional Gaussian Density Function The gaussian density function is evaluated for each column vector in a The actual mathematical expression evaluated for each column vector in a is 1 eee Zx 22 zy ey Lae x 7 where amp is the covariance matrix of the Gaussian density function with dimensions N x N N is the dimension of the columns in a Xg is a column vector in the input array the function is evaluated for each column in x is the matrix inverse of the covariance matrix and is the determinant of the covariance matrix The output of this function is a row vector of length equal to number of columns present in the input array A a geclipto Greater or Equal Clip to Syntax geclipto a tval newval Description Set all the values in the input array greater than or equal to a selected threshold to a new desired value where a is the input array tval is the threshold value and newval is the desired new value Example The following illustrates the operation ready x 0 3 1 x row0 0 00 1500 2 00 3 00 ready y geclipto x 2 999 0 00 1 00 999 00 999 00 126e Internal Functions REACT MSHELL User s Manual 11 12 2007 Syntax Description than b Example
166. ired groupings For example in the following statement there is no ambiguity due to the use of parenthesis if i 4 8 amp amp p lt 3 X Yy Relational Operators The expression syntax when using a relational operator is expression rel op expression2 where the relational operators are less than greater than less or equal to greater or equal to ACT REACT MSHELL User s Manual Table of Contentse 29 Equality Operators The expression syntax when using an equality operator is expression equality op expression2 where the equality operators are test for equality l test for inequality Logical Operators The expression syntax when using a logical operator is expression1 logical op expression2 where the logical operators are amp amp logical and Il logical or Control Expression with Strings The following are the valid comparisons that can be done with strings s1 s2 s1 s2 s1 lt s2 s1 gt s2 Remember that these type of comparisons are only meaningfull if used within the control expression in a while or if statement For example the following code performs a test on the string a and displays itself as an image depending on the result of the test a hello if a hello 30 e Table of Contents REACT MSHELL User s Manual 11 12 2007 x text2image a view x Look Up Table Manipulation Look up tables are primarily used to map intensity values displ
167. is the channel number returned by DDEInit and item is a string that identifies the data item you are requesting the value of Example See User s Manual page 54 DDEReqV Requests value from DDE server Syntax DDEReqV chan item Description This command is used to request the server application to provide the value of a data item Syntax var DDEReqV chan item var is a MSHELL array variable chan is the channel number returned by DDElnit and item is a string that identifies the data item you are requesting the value of Example See User s Manual page 54 96e Internal Functions REACT MSHELL User s Manual 11 12 2007 DDETerm close a DDE conversation Syntax DDETerm chan Description This command terminates a conversation DDETerm chan where chan is the number returned by DDEInit Example See User s Manual page 54 dworld draws world coastline map Syntax dworld lrange outcntl or dworld xyrange outcntl Description There are two modes of usage for this function Both modes use the world data file pointed by the system variable M_wdb Under your MSHELL installation directory see the subdirectoy wab for a list of possible files to use First usage mode In this mode dworld generates an image corresponding to the coastline map of the world for the selected range of latitudes and longitudes in degrees In this mode the output map is generated faster and in si
168. is to establish precedence in the example below ProVIEW User s Guide Appendix B Internal Functions 63 if 1 4 8 amp amp P gt 3 x y 64e Internal Functions REACT MSHELL User s Manual 11 12 2007 z abs Absolute Value Syntax abs a or a abs Description Returns the absolute value of each element in the array Example The following MSHELL statement will compute the absolute values for each element of a ready a ready row 0 1 00 acos Inverse Cosine Syntax acos a or a acosor Description Returns the inverse cosine of each array element The output is in radians The actual mathematical expression computed is given by Cui acos d for all j i where j andi are row and column indices respectively Example The following MSHELL statement will compute the inverse cosine of a and store the result in C ready c acos a addmenuitem Adds a User Defined Menu Item Syntax addmenuitem myscript msh Description Use this command to add the capability of invoking user defined script files from within the graphical user interface where myscript msh is a valid script file Example The following line will add the mdemo msh file to the menu item list under User ProVIEW User s Guide Appendix B Internal Functions 65 ready addmenuitem mdemo msh all_local all_local Description keyword used by save function See save for deta
169. ise shifting 32 bits unsigned integer mshift_u32 values nbits left_or_right Compute the bitwise shifting considering values as an ARRAY of 32 bits unsigned integers nbits is the number of bits to shift and left_or_right is the direction 0 for left shifting 1 for right shifting It returns the shifted ARRAY or a NULL ARRAY in case of an error the text attribute contains the reason Example Syntax Description 178 Internal Functions 00000 2 00000 00000 4 00000 mshift_u32 a 1 0 00000 4 00000 00000 8 00000 Mtype Returns type of array Mtype a Returns zero if a is a real array and one if it is a complex array REACT MSHELL User s Manual 11 12 2007 N nan_index Index of all NaN elements Syntax nan_index a ncaddvar NetCDF Add Variable Syntax ncaddvar fname varname vardims Description Adds a new variable to an existing NetCDF file The variable must use existing dimensions from the NetCDF file and specify them in order in vardims Example The following demonstrates the process The example NetCDF file has 3 dimensions plane lat and lon ready status ncaddvar temp nc mydata plane nlat nlon n ready status ncaddvar temp nc planeinfo plane n ncing NetCDF File Inquiry Syntax ncing fname Description Returns size and shape of NetCDF file fname in a 1x 4 array and a list of the var
170. isting file in bytes and the date and time created If the file does not exist it returns 1 110e Internal Functions REACT MSHELL User s Manual 11 12 2007 filesize Returns the size of a file Syntax filesize fname Description Returns the size of an existing file in bytes If the file does not exist it returns 1 findfiles Locate Files in Directory Structure Syntax findfiles path type Description This function can be used to find all files starting at a given directory level path and satisfying a matching criteria type The function returns a string with all the files that satisfy the matching criteria If path contains any environment variables in the form VAR those are expanded to their values see expand command Example The following returns all files with extension chr in c proview ready Sstr findfiles c proview chr ready str proview IMAGES EQOHARE CHR proview IMAGES MSHELL CHR Cc c proview IMAGES MANDEL CHR c proview IMAGES RM000 CHR ProVIEW User s Guide Appendix B Internal Functions 111 finite_index Index of all non infinite elements Syntax finite_index a fits_open_file Open a fits file Syntax handle fits_open_file file_name r Description Opens a FITS file and returns a handle for use with reading and writing functions The second parameter specifies reading r or writing
171. ithin the image of interest xlut Look Up Table Transformation Syntax xlut a lut Description Performs a permanent look up table transformation on the given input array a using a user supplied look up table lut Example Suppose it is desired to transform an array region of interest in image f using an inverse ramp mapping This can be done using f reada eqohare chr char roi wdef 0 0 20 30 f roi xlut f rorik 255 0 1 xmlattrvalues Extracts the attribute values Syntax xmlattrvalues keyword value Description this function is used to extract the attribute values associated with tags that share the same name The input arguments are the tag name and the attribute name Example ready tag name keyword attribute name value ready Sattr xmlattrvalues keyword value ProVIEW User s Guide Appendix B Internal Functions 301 xmlparse parse an XML string Syntax xmlparse meta Description This function is used to parse an XML string When excuted it loads dynamically behind the scene msh32xml dll The input argument is an XML string It returns 1 if the parsing was successful otherwise it returns 0 Example ready status xmlparse Smeta Smeta is an XML string ready xmltextvalue Extracts the text value of a Syntax xmltextvalue metadata idinfo spdom bounding northbc Description T
172. ition for each dimension of the variable The edges variable gives the length of each of the dimension to read Example The following demonstrates the process The MSHELL variable img will contain 51 rows and 51 columns from the first plane of the variable Temperature MSHELL arrays storing more than one plane will be filled sequentially with each plane requested ProVIEW User s Guide Appendix B Internal Functions 181 ready img ncread temp nc Temperature 0 0 0 1 51 ready show img img data type is number of rows number of columns maximum value minimum value nevarattstr NetCDF Variable Attribute String Syntax ncevarattstr fname varname attname Description Returns the contents of the attribute attname attached to variable varname from NetCDF file fname as a string An error will occur if the variable does not exist A blank string will be returned if the attribute does not exist Example The following demonstrates the process ready ncvarattstr temp nc Temperature units degC nevarattval NetCDF Variable Attribute Value Syntax Description Returns the value of the attribute attname attached to variable varname from NetCDF file fname as an array An error will occur if the variable does not exist A blank string will be returned if the attribute does not exist Returns a Null string if attribute contains an unknown numeric type E
173. its content If successful it returns 0 otherwise it returns a non zero value and the text attribute is set with a brief description of the error see the table below NOTE If an error e g Permission Denied occurs while deleting a file or a sub directory the function returns with error 4 but files and directories removed before the error has occurred are permanently deleted Return value text attribute Meaning 0 Not set Success 1 Set dirname does not exists 2 Set dirname is not a directory 3 Set Cannot remove current or parent directory 4 Set Cannot delete the entire tree Set Directory access denied Example Deleting a directory tree s sys_deltree old_data if s print An error occurred s text return ProVIEW User s Guide n Appendix B Internal Functions 275 sys_dirsize Syntax sys_dirsize dirname Description Returns the size of a directory tree Returns the size of the entire dirname directory tree The total size is computed by summing the sizes of all files recursively found within dirname If an error occurs it returns a negative value and the text attribute is set with a brief description of the error see the table below Return value text Meaning attribute Size in bytes Not set Success 1 Set dirname does not exists 2 Set dirname is not a directory 3 Set Error reading the sub
174. l to the number of rows in the input array a Example The following demonstrates the process ready a randu 7 100 ready medianr a row 0 0 46 0 53 0 47 0 48 0 47 0 53 0 48 menusel creates a Menu List Box Syntax menusel title options Description creates a menu list box using the title and options provided to the function Every row in options is treated as a different option Execution is stopped until the user selects an option and hits OK The function returns with the row number of the option selected Example item menusel my title options a noptions b noption c my title Options Selection options b meter Displays a Metering Toolbar Syntax meter string value Description Draws a meter toolbar on the lower right hand corner of the screen The first argument string is a text string used for description purposes The second argumet value is a scaler whose value controls the behavior of the meter toolbar If value lt 0 the meter toolbar is erased if 0 lt value lt 100 the meter toolbar is drawn with value as a percent If value gt 100 an error occurs Example The following script file draws a meter toolbar 174e Internal Functions REACT MSHELL User s Manual 11 12 2007 i 0 while i lt 100 josie meter hello i meter hello 1 min Minimum in Array Syntax min a or a mi
175. l you acknowledge by clicking in a popup window If M_matherrflag is set equal to 2 mathematical exceptions are reported and script file execution is halted M_NaN holds the representation of an IEEE NaN Interpolation Related M_interp Indicates which interpolation method is preferred zero order nterpolation M_interp 0 or linear bilinear interpolation M_interp 1 M_no_data Blinterp will not interpolate if an intensity value in an image is set to M_no_data Data Loading Related M_maxdim This variable is used by the reada fname all call In particular when loading raster data using the all mode it determines the maximum dimension of the array that the input image is loaded into This is particularly usefull when loading large raster images e g 10 000 x 5 000 pixels M_no_data Blinterp will not interpolate if an intensity value in an image is set to M_no_data REACT MSHELL User s Manual 11 12 2007 m_ Array Window Operators Syntax m_XXxx a Say x is an image then image m_x0 is an image attribute A detail list of all the static attributes can be found in the section Intrinsic Attributes Associated with Array Variables see page 18 See include imgedit msh which allows the user to change all image attributes at one time from a table Also under the Image menu one can find the Edit Image Attributes item which calls imgedit msh makecmplx converts a real array to complex Syntax make
176. lay of an Image Syntax view myimage Description From the command line or from a script file use this command to enable the display of any image variable i e myimage that already exits in memory Note after version 3 of MSHELL you can assign indivudal palettes to the image before it is displayed by setting the x LUT attribute Example ProVIEW User s Guide Appendix B Internal Functions 287 non x reada eqohare chr char open and image view x y assign x to y y LUT 255 0 1 3 assign an inverse palette to y view y 2886 Internal Functions REACT MSHELL User s Manual 11 12 2007 view255 Enables Screen Display of a Scaled Image Syntax view255 myimage view255 myimage exclude_val_vec Description From the command line or from a script file use this command to enable the display of any image variable i e myimage that already exits in memory The display image will be set to use autoscaling In the second usage usage the user can control the automatic scaling such that a range of values provided by exclude_val_vec are not used in the computation This is particularly usefull to avoid non image data values Example Image hammiw 256 256 view255 Image autoscales the image Image2 Image make a copy Image2 0 0 1 0 introduce an outliner Image2 5 5 100 introduce another outliner view255 Image2 1 0 100 will display a nice ima
177. le HDU Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT fits ready type_num fits_get_hdu_type handle ready type_num note that 0 fits_get_num_keywords Returns of existing keywords Syntax num_keywords fits_get_num_keywords handle Description Returns the number of existing keywords not counting END keyword Example ProVIEW User s Guide Appendix B Internal Functions 113 ready handle fits_open_file C NXEROS_0001 XRS00053 FIT uy Me rts ready num_keywords fits_get_num_keywords x ready num_keywords 738 fits_read_keyn_name Returns keyname Syntax keyname fits_read_keyn_name handle keynum Description Returns a string keyname for the key number keynum Note that keynum can not exceed the number of existing keywords Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT HOME ey ready num_keywords fits_get_num_keywords handle ready Skeyname fits_read_keyn_name handle keynum keynum lt 738 ready Skeyname from previous example num_keywords is 738 TTYPE173 for keynum 647 fits_read_keyn_value Returns a keyvalue Syntax keyvalue fits_read_keyn_value handle keynum Description Returns a string keyvalue for the key number keynum Note that keynum can not exceed the number of existing keywords Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT fits ready
178. le col Description Reads the column values converted to strings starting with firstrow firstelem and continuing for nelem crossing into new rows if needed The coldata output will always be a 1xN vector using this form Even if the column is a vector Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT Ns tfrts j ready colstr fits_read_col_str handle col firstrow firselem melem fits_close_file closes a fits file Syntax status fits_close_file handle Description Closes a previously open fits file Example ready status fits_close_file handle handle 1 from the previous example ready status 0 FLEVEL internal keyword to MSHELL Syntax Description internal keyword used by MSHELL float2str Convert Array to a formatted String Syntax float2str a or float2str a format Description Converts the input array a to a string representation The user can control the format of each element by providing a controlling string i e format which follows the standard C 1186 Internal Functions REACT MSHELL User s Manual 11 12 2007 language approach If the input is complex the data will be displayed in groups of of x y or real imaginary Example The following gives usage examples follow by the actual output ProVIEW User s Guide ets print array values n x randu 2 3 0 5 1000 print Using float2str with free format n float2
179. le will look like 3 3 0 1 0 1 2 0 2 1 0 1 where the first row is a three element header containing the number of rows the number of columns and the real complex flag 0 real 1 complex This header is followed by the image data stored lexico graphically in ASCII This format can be used for both the reading and writing of data Example Creating writing and then reading in a file in ascii format writea out asc randu 3 3 ascii wow reada out asc ascii asciiflex The asciiflex format permits you to load selected rows and columns from an ascii file Note that the elements in the ascii file must be comma delimited A typical ASCII flex could look like test asc below This is a sample user file 3 1 gain 2 tint 3 1 O gain 22 tint 3 2 1 gain n a tint 3 0 2 gain 3 tint 0 This is the end of the file where ascii text can be mixed in with the numerical data to be extracted Note that this read process searches for and accepts the first number it encounters after a delimiter The syntax is similar to that of char flex using a control vector cntvec to provide the specific read parameters The control vector structure which is differs from that of charflex is formated as follows first_row first row to read last_row last row if 1 read to last row nnchar non numeric character flag hdrsubset vector of column numbers to read cntvec
180. lows to edit basic system variables from a drop down box 148 Internal Functions REACT MSHELL User s Manual 11 12 2007 System Variables Editor d qreg sarktopo mga 115 JC Proview C Proview mg m M_echo jo Cancel oo00000 00 M_time Mformat 0000000 00 M_ptsize 12 IMuavis i M_blabel Orbit 226 0000000 00 Sets the current working directory M_ewd c directory ProVIEW User s Guide Appendix B Internal Functions 149 index Index of Non Zero Elements Syntax index a b Description Similar to eqindex but it returns an index to all elements different than zero Example The following illustrates the indexing ready a 2 2 2 2 row 0 0 00 2 00 0 00 2 00 ready index a row 0 0 00 0 00i 2 00 0 00i 0 00 1 00i4 2 00 1 002 input waits user input Syntax input a Description Pauses for input from console does not work in GUI only console MSHELL then assigns the input value to string or array variable inputbox Prompt User for Input Syntax inputbox prompt title default Description Prompts for input through a dialog box where all the input arguments are strings This function returns a string which can be convert to a number See Also str2int and str2float Example The following illustrates the instructions and the Dialog Box 150e Internal Functions REACT MSHELL User s Manual 11 12 2007 ready
181. ltering spatial_ops gradient_ops gr adient msf status readtext_and_status file if status 0 print x print the content of the string real Real Part of an Array Syntax real a or a real Description Returns real part for each element in the array a ProVIEW User s Guide Appendix B Internal Functions 215 Example The following MSHELL statement will extract the real part of the Fourier Transform of a and store the result in c c real fft2 a ready evaltext x regionand Defines a ROI as Common of Two Syntax regionand roi roi2 Description Defines a new region of interest which is the common overlapping area of two other regions of interest roi and roi2 return Returns From an Include File Syntax return Description Stops the execution of an include file and returns control to the calling process rfill Fills a subregion Syntax rfill a b Description Finds the subregion of an image b which is all points contained within a created groi from a list of polygonal vertices a Example 216 Internal Functions REACT MSHELL User s Manual 11 12 2007 ready groi complex 26 128 complex 286 26 gt complex 280 236 complex 136 126 gt ready x zerost255 2555 ready groi rfill groi wdef 6 8 255 255 gt gt ready x groi2z gt 168 ready groid pfill groi wdef 8 6 128 1285 gt ready xtgroi3 gt 268
182. m variables at one time from a table Also under the Edit menu one can find the Edit System Variables item which calls sysedit msh Plot Related Variables M_axis When using plot3d you can control if a numeric axis is drawn or not using the M_axis string string variable If M_axis is set to xyz all the axis will be drawn If x y or z is omitted from the string the corresponding axis is also omitted M_blabel Bottom label used in plots string variable M_device Output plot device values 0 DT2861 AL860HRG 1 plot file format 2 Windows Screen default M_fxaxis Used to control the number of digits used in the x axis see M_format for more information M_fyaxis Similar to M_fxaxis but for the y axis M_fzaxis Similar to M_fxaxis but for the z axis 160 Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide M_hidden M_holdx M_holdy M_holdz M_linetype M_panel M_phit M_phi2 M_tlabel M_xdir M_xlabel M_xlog M_xmax M_xmin M_xnice M_xtic If set to 0 hidden line removal will not be used in plot3d default value is 1 use hidden line removal Sets axis display if 0 display is the extent of the data if 1 display is limited by M_xmin and M_xmax Similar to M_holdx but for y Similar to M_holdx but for z Sets plot line type style Valid line styles are 0 for symbol 1 for solid line and 2 for spikes If set to 1 a side panel will be used i
183. maximum value of all the elements in the input array Note that this function is only valid for real input arrays Example The following demonstrates the operation ready a randu 1 8 1 ready a row 0 0 02 0 46 0 64 0496 0 34 0 57 0 08 0 60 ready max a 0 95636 maxmin Max and Min values in Array Syntax maxmin a or a maxmin Description Find the maximum and minimum values of all the elements in the input array Note that this function is only valid for real input arrays Example The following demonstrates the process ready a randu 1 100 create a vector of random numbers ready maxmin a row 0 1 00 0 01 maxminx Max amp Min values in Array with exclusion Syntax maxminx a exclude Description Find the maximum and minimum values of all the elements in the input array after excluding all the values in array exclude Note that this function is only valid for real input arrays Example The following demonstrates the process ProVIEW User s Guide Appendix B Internal Functions 171 ready a randu 100 100 ready a 0 0 200 ready maxminx a 200 row 0 1 00 0 01 maxof Element by Element Maximum Syntax maxof a b Description Computes the maximum on an element by element basis In general the two input arrays must have the same dimensions The only exception to this is when one of the input arrays is a scalar Note that this function is only
184. ment value at row 0 column 0 x 1 2 3 extract elements 2 and 3 on row 1 REACT MSHELL User s Manual 11 12 2007 he Gt dmh pop fet ata Fitores extract all values between columnes 4 amp 6 and for all rows extract all column values for row 2 extract values from row1 to row3 and column2 to column5 and assigned this to the array variable y Dosos wim to aini x DAN Ska ee ea Sial S D renn aini xj cieo x rou ea oo cree x rov Ba 073 rere x rov e 0 7 aa row t 0 95 0 92 row 2 aes oa ready sL 0 95 en em 0 55 en LEN 8 65 0 95 e 92 e e a7 0 92 0 93 0 26 0 77 0 2 0 91 0 69 0 16 8 00 Tne 9 Col 5 Figure 4 Retrieving array values using row amp column ranges There are different schemes that facilitate the reading from or writing to an array variable These are discussed in the Region of Interest Manipulation section on page 26 Note Included in the region of interest manipulations is a special case that extends the 2D array into a 3D representation for easy visualization and manipulation which is quite usefull for working with hyperspectral data For formatted printing of array values see the float2str function ACT REACT MSHELL User s Manual Table of Contentse 17 Intrinsic Attributes Associated with Array Variables There are many intrinsic attributes
185. ments to a Power Syntax a b Description The operator symbol or caret is used to raise the elements of an array to a given constant power or the power specified by the corresponding elements of another array The above statement will raise the elements in array a to the power specified by the elements in array b where a and b have the same dimensions For a and b input arrays we have the following If a and b have the same dimension the actual operation is implemented as c a forallj i ji 72 ji J If b is a scalar i e a 1 x 1 array and a is not the operation is implemented as boo toe cC a forallj i ProVIEW User s Guide Appendix B Internal Functions 59 If a is a scalar i e a 1x1 array and b is not the operation is implemented as b i aa c a forall j i joi 0 0 where j and i are row and column indices respectively Note that in each case the result c is an array only in the case of both a and b scalars will c be a scalar Example ready ae ive creates a 2 by 2 matrix ready hf print x row 0 1 00 row 1 4 00 5 00 ready 2 x vaise 2 to x row 0 2 00 8 00 row 1 16 00 32 00 ready x 0 5 raises x to 0 5 row 0 1 00 Lets row 1 2 00 2 24 ready x x vaises corresponding elements row 0 1 00 27 00 row 1 256 00 ready M_format 00000
186. menu with the File Image Open option since a dialog box illustrated in Figure 4 is provided to facilitate the input of the data read criteria FLEX Reader Options x BYTE C PCFLOAT number of rows E C PC16 C SUN FLOAT number of cols fo C PC 32 header size fo C SUN 16 C SUN 32 start row fO start col fo end row fo end col fo row step fi col step fi Figure 4 Charflex dialog box The float format is a MSHELL The float format is similar to the char format but the data is stored in floating point internal format for storing single using 4 bytes pixel floating point arrays real or complex Example Creating writing and then reading in a file in float format ready y writea out flt randu 3 3 float x ready reada out f1t float The double format is a MSHELL The double format is similar to the char format but the data is stored in double internal format for storing single precision using 8 bytes pixel double precision point arrays real 210 Internal Functions REACT MSHELL User s Manual 11 12 2007 or complex Example Creating writing and then reading in a file in double format ready y writea out db1l randu 3 3 double x ready The ascii format is a MSHELL internal format for storing arrays as ASCII values reada out db1 double The ascii format stores images in ASCII A typical ASCII fi
187. mple cylindrical type of projection llrange a 1x4 row vector that determines the area of interest in latitude and longitude e g llrange latmin latmax longmin longmax outcntl a 1x2 row vector that control the number of rows and columns in the output image e g coldim 300 600 will It is optional to add a third parameter to outcntl This third parameter can be used to read every gap pixel from the input world data file For example if the output image is 300 rows and 400 columns and you desire to read every 25 point from the input world data file then coldim 300 400 25 The maximum gap value recommended is 45 For global coverage large gap sizes can be used but for small map areas of interest smaller values in the gap size generate a more accurate coast line output The default value of gap is internally adaptive depending on the coverage size of the selected area Second usage mode In this mode dworld generates the output in any of the supported cartographic projections accessible via the function Geo2Cart ProVIEW User s Guide Appendix B Internal Functions 97 xyrange a 1x4 row vector corresponding to the desired region in the cartographic domain default units are meters e g xyrange ymin ymax xmin xmax xyrange text must be set to the desired proj4 string see examples and Geo2Cart description If dworld detects any content in xyrange text it will assume tha
188. n print list sys_dirlist Controlled directory listing Syntax sys_dirlist path options Description This function returns the list of the subdirectories or files of a given directory The first input argument is a string containing the directory name The second input argument is one of the following d s or p where e d if used the function will return only the list of subdirectories Otherwise only the files are listed e gs if used the function will return the list of files along with their size e p if used the function will list the path of the files ProVIEW User s Guide Appendix B Internal Functions 267 Note this function uses as the delimiter for each field in a record Example to print directories their sizes and the full path Sout dirlist c temp dsp to print the directory listing only This will not print files Sx dirlist F crism_pds_archive trdr TRDR d 268 Internal Functions REACT MSHELL User s Manual 11 12 2007 syS_move Moves or renames files or directories Syntax sys_move source dest Description If the dest argument is a directory this function moves the source argument in it Otherwise source is renamed to dest Note that source can be either a file or a directory If successful it returns 0 otherwise it returns a non zero value and the text attribute is set with a brie
189. n source Geographic Data Abstraction Library GDAL e Ability to project geo raster data to any of the standard USGS cartographic map projections e REACT MSHELL and MSHELL are the software development tool kit for ACT s WWW Information Processing Environment WIPE and Planetary Information Processing Environment PIPE Expert or novice independent of your experience REACT MSHELL allows you to manipulate images and signals in a simple manner releasing you from the constant tracking of image attributes such as image dimensionality REACT MSHELL permits you to process a large volume of images in a fully automatic fashion e g large scale reduction calibration and analysis of satellite based digital images If you work with NASA s Planetary Data System PDS data REACT MSHELL enhances your productivity by providing the following additional capabilities e Adoption of the PDS reader libraries e Virtual Image variable which can bigger than 4Gbytes ACT REACT MSHELL User s Manual Table of Contentse 9 Who Should Use REACT MSHELL 10 e Table of Contents REACT MSHELL has been developed by and for professionals working in the areas of image and signal processing who desire to concentrate on algorithmic development and data visualization rather than on low level programming REACT MSHELL can significantly reduce the time required for the development and implementation of image and signal processing algorithms without sacr
190. n Description Find the minimum value of all the elements in the input array Note that this function is only valid for real input arrays Example The following demonstrates the process 1 00 ready min a 2 minof Element by Element Minimum Syntax minof a b Description Compute the minimum on an element by element basis In general the two input arrays must have the same dimensions The only exception to this is when one of the input arrays is a scalar Note that this function is only valid for real input arrays Example The following demonstrates the process ProVIEW User s Guide Appendix B Internal Functions 175 ready b 4 4 2 2 ready b 0 200 2 200 42 ready a ready a row 0 0 00 row 1 0 00 1 00 2 00 ready minof a b row 0 4 00 2 00 0 00 row 1 4 00 2 00 0 00 minr Row Minimum Syntax minr a Description these values as a column vector Computes the minimum for each row of array a and strores mjd2dt Convert Modified Julian Date Syntax mjd2dt mjd_value Description Converts a Modified Julian Date to a vector giving year month day hour minute second Example The following MSHELL statement will find the date vector given a julian day number of a given year jdoy 10 find date for the 10th day of 2002 2 jy dt2mjd 2002 1 1 0 0 0 dt mjd2dt jy jdoy 1 dt 10 0 X row 0 2002 0000 1 0000 10 0000
191. n of Interest 292 wmove Move a Region of Interest 294 wsize Size of a Region of Interest 298 xline Extract Pixel Values along Line Segment 300 xlinec Extracts Coordinates of Line 300 xlinev Extracts Vertices of Line 301 xpolyc Extracts Coordinates of a Polygon 302 xpolyv Extracts Vertices of a Polygon 303 Remote Access url_copy_to_file Save a remote resource to a file 283 Remote Access FTP Protocol Functions ftp_cd Changes Current FTP Server Directory 121 ftp_cwd Get Current FTP Server Directory 121 ftp_del Delete a file in the FTP Server 121 ftp_get Download a File from the FTP Server 122 ftp_list List FTP Server Files and Subdirectories 122 ftp_mkdir Create New Directory in the FTP Server 123 ftp_put Upload a File to the FTP Server 124 ftp_rename Rename a File in the FTP Server 124 ftp_rmdir Remove Directory from the FTP Server 124 ftp_session_close Close Current FTP Session 124 ftp_session_close Open an FTP Session 124 REACT amp MSHELL User s Manual 11 12 2007 Remote Access to MSHELL rmshell_ execute Execute a command in the remote MSHELL 218 rmshell_execute_async Execute a command in the remote MSHELL does not block 219 rmshell_getfile Download a file from the remote MSHELL 219 rmshell_getvar Get an ARRAY variable from the remote MSHELL 220 rmshell_getvarS Get a string variable from the remote MSHELL 221 rmshell_pu
192. n on the map ProVIEW User s Guide Appendix B Internal Functions 283 a De UR h p Dt Dia Fictions Gersons edor teb platy ixa izi l troftset rot access T aday TADAS e2006 wah BD See Also Vopen Vnew Vclose Vclose Closes Virtual Variable Link Syntax Vclose V Description This function is used to close the link between the virtual variable V and the disk file it was previously attached to by Vopen See Also Vnew and Vopen Vnew Makes Disk Space for Virtual Image Syntax Vnew fname nrows ncols bytes_per_pixel Description This function is used to allocate disk space in a disk file where fname is the string variable holding the file name to use nrows is the number of rows in fname ncols is the number of columns in fname and bytes_per_Pixel is the number of bytes per pixel in fname Returns status of 0 for good See Also Vclose Vopen 284e Internal Functions REACT MSHELL User s Manual 11 12 2007 Vopen Makes Virtual Variable Link to File Syntax V Vopen fname M N format offset roi access Description This function establishes a link between the Virtual Variable V and a disk file fname where M is the number of rows in fname N is the number of columns in fname byte format is determined by the list below offset is the header size in bytes and roi is a valid rectangular region of interest within fname Also the access parameter
193. n the plot3d default value is 0 Select rotation around z axis in 3dplot values range between 90 and 90 degrees Select out of plane angle in 3dplot values range between 90 and 90 degrees Title label string variable If set to 0 only the lines of constant x values will appear in a plot3d default value is 1 X axis label string variable Log scale of x axis valid values are 0 1 2 or 3 If set to 0 the option is disabled 1 2 or 3 yield logarithmic scaling with increasing resolution applicable to plot only Set maximum x axis value use M_holdx 0 to cancel M_holdx 1 to restore Set minimum x axis value use M_holdx 0 to cancel M_holdx 1 to restore If set to 1 the max and min for the x axis are computedsuch that a nice set of numbers is selected Used to control the spacing of tic marks along the x axis default value is 1 Only applies if M_xnice is set to zero M_ydir Similar to M_xdir but for y M_ylabel Similar to M_xlabel but for y M_ylog Similar to M_xlog but for y axis Appendix B Internal Functions 161 162e Internal Functions M_ymax Set maximum y axis value use M_holdy 0 to cancel M_holdy 1 to restore M_ymin Set minimum y axis value use M_holdy 0 to cancel M_holdy 1 to restore M_ynice Similar to M_xnice but for y axis M_ytic Similar to M_xtic but for y axis M_zlabel Similar to M_xlable but for z M_zmax Maximum z axis value M_zmin Minimum z a
194. n3 in4 This is a dummy function a 10 inl b 3 in2 print The string passed was in4 n outl inl in2 out2 inl in2 in3 a b Notice that the variables a and b in the above example only exist during the duration of subroutine Variables needed within the function must be passed to the function and new variables not implicitly declared in the calling statement will be automatically declared as LOCAL variables An actual call to the above example function could be x hammiw 32 32 y gtclipto x 0 5 0 5 Z X y resl res2 MYFUNC x y z where res1 and res2 will contain the result to the external function call It is possible to embed example code in a function to describe its usage better The following block of code demonstrates this ACT REACT MSHELL User s Manual Table of Contentse 33 34 e Table of Contents REACT MSHELL User s Manual FUNCTION out1 out2 myfunc333 x str This is an example function To test look at the behaviour of the interpreter when passing information into a function or making copies of arrays EXAMPLE START Smystring hello world x hammiw 256 256 255 test image x text hola initialize text attribute Ly z myfunc333 x mystring call the test function print back from function call float2str x 0 0 n print y text n print text to screen view y view variable as image y
195. names sharing the same array structure in memory as long as they have an identical content To erase all of the variables in the current function s scope only use free local ftp_cd Changes Current FTP Server Directory Syntax ftp_cd dirname Description This function works after an ftp_session_init and changes the current working directory into the user specified one can be used to change to the parent directory If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see ftp_list example ftp_cwd Get Current FTP Server Directory Syntax ftp_cwd Description This function works after an ftp_session_init and can be used to retrieve the current FTP Server working directory as a string variable If no connection is established with an FTP Server it returns an empty string Example see ftp_list example ftp_del Delete a File in the FTP Server Syntax ftp_del filename ProVIEW User s Guide Appendix B Internal Functions 121 Description This function works after an ftp_session_init and deletes the specified remote file in the FTP server Multiple file names can be specified by separating them with new lines If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error ftp_get Download a File from the FTP Server Syntax
196. nate values Real part has x component and imaginary part has y component The units of xy most be consistent with the units of the projection space that it represents out output array with transformed values Note see also Geo2Cart ProVIEW User s Guide Appendix B Internal Functions 131 getenv Get Environment Variable Syntax getenv sitring Description Returns a string which is the currently held value for the string passed in parenthesis This string is the environment variable for which information is to be retreived ready getenv PATH C WINNT40 SYSTEM32 getline Finds Line Matching String Pattern Syntax getline str Spattern Description Given a string variable str this function can be used to find the line where the string pattern appears for the first time Example The following example illustrates the function ready Sa Now n is the n time n for all ready Sa Now is the time for alieu ready line getline Sa time ready Sb Sa line ready b time See Also eqindexS getpos getMyIP Get the local IP addresses Syntax getMyIP Description This function can be used to retrieve the local IP addresses as a new line delimited string variable NOTE This function is only supported in the version of MSHELL that runs under ACT s REACT Example The following example illustrates the function 132e Internal Functions REACT MSHELL
197. nctions status gdal_set_projection hdl proj_ref Set the projection reference string for this dataset The string should be in OGC WKT or PROJ 4 format An error may occur because of incorrectly specified projection strings because the dataset is not writable or because the dataset does not support the indicated projection Many formats do not support writing projections Some formats do not support PROJ 4 strings directly Convert to WKT with OGRSpatialReference functions first gcps gdal_get_gcps hdl Returns the internal Ground Control Points GCPs for the dataset as a Nx5 array where N is the number of GCPs and the 5 columns are arranged as follows line pixel X Y Z ProVIEW User s Guide Appendix E Geographic Data Abstraction Library 315 Sets the ground control points GCPs geo_xform contains the geo transformation and WKT is the as string with the OGC Well lknown Text that provides the spatial reference system to be associated with the ground control points gcp_proj gdal_get_gcp_projection hdl Returns the projection space a WKT string for the X Y Z values returned from gdal_get_gcps count gdal_get_overview_count hdl band Returns the number of overview layers available ctable gdal_get_raster_color_table hdl bandnum Returns an array with the color table ndatav gdal_get_raster_no_data_value hdl bandnum Returns the no data value for this band number
198. ne comments will follow All characters that follow this symbol within a given physical line will be ignored Example The following illustrates the use of the single line delimiter ready pi 4 atan 1 this text will be ignored Array Division by Scalar Syntax a b Description The operator symbol is used to perform the division of each element of an array by a scalar An error message will be generated if b is not a scalar i e a 1x1 array The actual division is implemented as 5860 Internal Functions REACT MSHELL User s Manual 11 12 2007 c a j b forallj i where j and i are row and column indices respectively Element Array Division Syntax a b Description The operator symbol is used to perform the division of corresponding elements between two arrays An error message will be generated if a and b do not have the same dimensions The actual division is implemented as C 4 b forallj i where j and i are row and column indices respectively Example The following MSHELL statement will divide the elements in array a by the elements in array b and attempt to divide elements in array a by a scalar generates a row vector ready ready divide corresponding elements ready row 0 1 00 1 00 1 00 ready a 4 since x is not 1x1 an error occurs gt gt gt error 4 incompatible dimensions A Raise Array Ele
199. ng possibilities 0 black 1 dark gray 2 blue 3 cyan 4 gray 5 yellow ProVIEW User s Guide Appendix B Internal Functions 279 6 magenta 7 red 8 green 9 white The actual image is not modified with use of this function Itis just an overlay Overlay determines the background of the text where 0 gives a background of white or 1 gives a transparent background Orientation specifies whether the text is vertical 0 or horizontal 1 textremove Removes Text annoation Syntax textremove image text Description Used to remove the desired string text from an image if it was created using the command textoverlay Only works under MSHELL i e the GUI mode text2image Converts Text to an Image Syntax text2image sexpr Description Given a single line input string text2image converts the input string into a two dimensional array where sexpr is a string expression Once the text exists in image form it can be manipulated just as any other image Example The ProVIEW screen of Figure 5 illustrates this application 280e Internal Functions REACT MSHELL User s Manual 11 12 2007 E Welcome to ACT s ProvVIEW Web Microsoft Internet Explorer File Edit view Favorites Tools Help Bak gt fat Qisearch Favorites CBristory Ay 8 A Address E3 http www actgate comfpcale htm ProVIEW Web online documentation Extemal Function Browser Copyright c 1989 199
200. ng will open test out for output as unit number 1 and test in for input as unit number 2 ready status openf 1 test out w ready status openf 2 test in r ProVIEW User s Guide Appendix B Internal Functions 185 pause Suspend Execution for N Seconds Syntax pause N Description Will causes MSHELL to stop execution for N seconds If the value of N is negative a pause dialog box will be opened Note that N can be a fractional number of seconds pdsfindobj Get a list of objects within a PDS file Syntax pdsfindobj fname Description Returns the name of each PDS object found in fname Object examples would be IMAGE or BROWSE_IMAGE pdskwdstr Retrieve a PDS keyword value Syntax pdskwdstr label_ string kwd_name Description Returns the value of the PDS keyword specified in kwd_name if found in the complete PDS label label_string Example The following MSHELL code will retrieve two keywords from a PDS file ready eqohare reada C PROVIEW IMAGES eqohare pds pds ready Shdr eqohare text ready pdskwdstr hdr PDS_VERSION_ID PDS3 ready pdskwdstr S hdr IMAGE LINES 256 pixval Displays Pixel Status of Mouse Syntax pixval a 186e Internal Functions REACT MSHELL User s Manual 11 12 2007 Description This displays the pixel value and intensity corresponding with the placement of the mouse when clicked within an image a
201. ng_Now dbrsget rowsfloat cols srow erow ns5 n float2str s5 dbclose ready ready ready ready ready ready ready ready ready s1 LandWaterHMask DataSets 6 Parallel 6 9999 Default land Linear 6 1 LandWater2color_pal chr 6 1 MGS_MOC_red DataSets 6 Parallel 6 5 Default zpan 1e32 eqindex lt img gt 1 6 8 MGS_HMOLA DataSets 6 Parallel 6 5 Default zpan_def ndex lt img gt 1e32 eqindex lt img gt 1 6 6 52 LandWaterask DataSets 8 Parallel 8 9999 Default land Linear 6 1 LandWater2color_pal chr 6 1 MGS_MOC_red DataSets 6 Parallel 6 5 Default zpan 1e32 eqindex lt img gt 1 6 6 MGS_MOLA DataSets 6 Parallel 6 5 Default zpan_def ndex lt img gt 1e32 eqindex lt img gt 1 6 8 s3 LandWaterHask 6 6 NGS _MOC_red 6 6 MGS MOLA 8 8 sh LandWaterHMask 6 6 NGS_MOC_red 6 6 MGS MOLA 8 6 s5 666 666 666 666 666 666 25 666 666 666 ready _ AMA Line 9 Cok 19 dbconnect dbconnect database Connects to database for access Use this command to connect to an external datbase The string passed is the name which has been previouly defined for the database in the ODBC administration tool Returns a value of zero if it is successful see dbrsgetrows example dbrsgetrowsfloat Returns the result set as an array dbrsgetrowsfloat srow e
202. nput data the two data values must be in the first two white space separated fields and when both input and output are ASCII all trailing portions of the input line are appended to the output line Input geographic data longitude and latitude must be in DMS format and input cartesian data must be in units consistent with the ellipsoid major axis or sphere radius units Output geographic coordinates will be in DMS if the w switch is not employed and precise to 0 001 with trailing zero valued minute second fields deleted EXAMPLE Usage The following script proj proj utm lon_0 112w r lt lt EOF 45d15 33 1 111 5W 45d15 551666667N 111d30 45 25919444444 111d30 000w EOF will perform UTM forward projection with a standard UTM central meridian nearest longitude 112 W The geographic values of this example are equivalent and meant as examples of various forms of DMS input The x y output data will appear as three lines of 460769 27 5011648 45 ProVIEW User s Guide Appendix D Cartographic Library 309 SEE ALSO Cartographic Projection Procedures for the UNIX Environment A User s Manual Evenden 1990 Open file report 90 284 Map Projections Used by the U S Geological Survey Snyder 1984 USGS Bulletin 1532 Map Projections A Working Manual Synder 1988 USGS Prof Paper 1395 An Album of Map Projections Snyder amp Voxland 1989 USGS Prof Paper 1453 HOME PAGE FOR THIS CODE http www remotes
203. ns a row vector whose first element is the minimum value in a its second element is the maximum value in a its third element is the mean value of the elements of a and its last element is the standard deviation of the elements of a The statistics are computed omitting any values present in the exclude array stop_process terminates execution with message Syntax stop_process error_message Description forces a script to stop its execution similar to hitting the ESC key and uses the user provided error_message string as the message that will initialize the system variable 254e Internal Functions REACT MSHELL User s Manual 11 12 2007 M_errorstring This function is useful when errors are being trapped by M_errorscript since the user provided error_message can be recorded in a database or in a log file STDOUT Standard out identifier Syntax writecolor STDOUT r g b TIFF Description Reserved word used to specify the Standard Out instead of a file name Only works for the console and web versions of MSHELL not the GUI Example The following MSHELL code will write a JPEG image for a web request coming from an lt IMG SRC gt tag print Content type image jpeg n n writecolor STDOUT red_plane green_plane blue_plane JPEG str2float Converts Numeric String to Float Syntax str2float string Description Returns an array where numeric values
204. ns immediately It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and the MOSAIC request XML string If successful it ProVIEW User s Guide Appendix B Internal Functions 231 returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see rw_waitForMosaic example rw_waitForInventory Wait the number of specified seconds Syntax rw_waitForInventory handle n_sec Description This function works after an rmshell_session_init and an rw_getlnventoryXMLAsync It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and the number of seconds to wait If it is 1 this function blocks until the remote server is finished executing the command Otherwise it waits the number of seconds specified If the remote server has not yet finished executing the data coverage request when the number of seconds elapsed or if an error occurs it returns a non zero value otherwise it returns 0 and the text attribute holds the output inventory XML string Example 232 Internal Functions REACT MSHELL User s Manual 11 12 2007 opening a Remote MSHELL session Ssrvr rmshell_session_init 212 48 10 150 if S srvr print Error opening Remote MSHELL session return loading data coverage request template from file Scov readtext covTemplate txt nSecsToWai
205. nterfac However you will note that at any given time only one of these windows will be the Active Window i e the window with the highlighted top bar In Figure 1 the Command Shell Window is the active window ACT s Rapid Environmental Assessment Composition Tools REACT copyright 2004 2006 ACT Corp PROTOTYPE File View Execution Help Image Windows Help Siae ENE 028 Figure 1 Sample REACT MSHELL screen In addition Figure 1 provides examples of some of the different types of REACT Windows Command Line Image Script and Plot A description of each of the different windows follows Monitoring Panel The Monitoring Panel provides a simple way to send single commands to the interpreter and capture all text output it returns see right panel on the image below ACT REACT MSHELL User s Manual Table of Contentse 11 ka ACT s Rapid Environmental Assessment Composition Tools REACT copyright 2004 2006 ACT Corp PROTOTYPE File View Execution Help da e SSS use auto text v I display code V auto pop up Welcome to MSHELL An Image Signal Processing Interpreter 1988 2006 ACT Corp For a quick demostration select the tun all demos option from below hit ENTER START OF BLOCK OF CODE TO EXECUTE ada eqohare chr char view x te END OF BLOCK TO EXECUTE RESULTS DONE READY Enter Comman
206. nternal functions pdsfindobj and pdswdstr Example Reading a file in PDS format 212e Internal Functions REACT MSHELL User s Manual 11 12 2007 reads image object x reada lual472h 202 clemen_pds_image_uncorr reads browse image object x reada lual472h 202 clemen_pds_browse_uncorr reads histogram object x reada lual472h 202 clemen_pds_hist_uncorr See Also readtext readtext_and_status readf writea openf closef writecolor ProVIEW User s Guide Appendix B Internal Functions 213 readf Formatted File Read Syntax readf unit format arrayname or readf unit format stringname Description This function is used to perform a formatted read of a scalar or a string from a file unit which has already been opened using the openf command Only one value or string can be read at atime The format string follows a similar form to the C language formatting options where s is used for strings and f g e are used for floating point numbers The first command above is used for reading a value into an already existing array After executing the readf the array will have dimensions of 1x1 i e a scalar The second command above is used for reading a string into an already existing string variable If the readf is successful it will return a value of 0 On end of file eof a value of 1 is returned See Also openf anM_ Example Assuming that unit 1 has been alr
207. num keywords fits_get_num keywords handle ready keyvalue fits_read_keyn_value handle keynum keynum lt 738 ready keyvalue from previous example num_keywords is 738 unf_level_l_safing_flg for keynum 647 114e Internal Functions REACT MSHELL User s Manual 11 12 2007 fits_read_keyn_comment Returns keyword comment Syntax keycomment fits_read_keyn_comment handle keynum Description Returns keyword comment keycomment for the key number keynum Note that keynum can not exceed the number of existing keywords Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT ee fits ready num_keywords fits_get_num_keywords handle ready Skeycomment fits_read_keyn_comment handle keynum keynum lt 738 ready Skeycomment from previous example num_keywords is 738 label for field 173 for keynum 647 fits_read_ keyword_value Returns Key value Syntax keyvalue fits_read_keyword_value handle keyname Description Returns a string keyvalue for an existing name keyname Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT ws Ti ts ready Skeyname fits_read_keyn_name handle keynum keynum 647 ready Skeyvalue fits_read_keyword_value x keyname ready Skeyvalue unf_level_1l_safing_flg fits_read_keyword_comment Returns Keyword comment Syntax keycommente fits_read_key
208. o subject to the following conditions The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE NAME proj forward cartographic projection filter invproj inverse cartographic projection filter SYNOPSIS proj bceEfillmorsStTvVwW args args file s invproj bceEfillmorsStTwW args args file s DESCRIPTION Proj and invproj perform respective forward and inverse transformation of cartographic data to or from cartesian data with a wide range of selectable projection functions The following control parameters can appear in any order b Special option for binary coordinate data input and output through standard input and standard output Data is assumed to be in system type double floating point words This option is to be used when proj is a son process and allows bypassing formatting operations i Selects binary input only see b option I ProVIEW User s Guide Appendix D C
209. o not provide SQL query capability Example ProVIEW User s Guide Appendix B Internal Functions 89 Sdbffile react_data global place_find country dbf hdbf dbfopen dbffile get handle fldent dbfgetfieldcnt hdbf get number of fields record and name of the fields print number of records int2str fldcnt print nThe field names are n print fldcnt text names of the fields print n nrec dbfgetrecordent hdbf get number of records print number of records are 2 int2str nrec n Srec dbfgetrecords hdbf 1 1 read all the records print showing the content of the 1st 3 records n Srec 0 2 status dbfclose hdbf close the handle dbfclose This function closes the dbfile Syntax dbfclose hdbf Description this function closes the dbffile It makes the handle available for a subsequent call to dbfopen Example see example in dbfopen dbfgetfieldcnt returns the of fields in the dbf file Syntax dbfgetfieldcnt hdbf Description this function returns the number of fields present in the dbf file It also returns the names of the fields in the text attribute of the returned array variable Example see example in dbfopen dbfgetrecordcnt returns the of records in the file Syntax dbfgetrecordcnt hdbf Description This function returns the number of records in the dbf file 90e Internal Functions REACT MSHELL User s Manual 11 12 2007
210. oesssecssocesooseoosess 15 LANGUAGE SYNTAX nisciuna ana a E E AT E E E TREE 15 Introductionis ene a a a hh id a a a a E dan nana ies weal E 15 Variable Names and TV DGS aeii nenosiri aalaatiavetssnlanSttedgues Sects cabsassaucdinienctaatausedtentaalagesiecsbecous 15 Statements imene nenie e ia e a aa eaaa ea a raa E eaea Lr eaaet 24 Calling Syntax for Numeric Functions otsxciieciss ssidesagas csanlastesiveviae Ganesan nian geie eke 24 Comments Delimit rs 2 t ae a siuaeatseiaidesiahcaeduacs Auto a a a a N aa a a N aana ia 25 Operator Type and Precedence nnnonnnnneennnneeeesseseessssessssseressseresssereessoseessssersssseressseeeesseseesssseesss 25 Region of Interest Manipulation ssosssssnoeennseeeeossesoessssesssssesssssereessereesssseesssseesssseresssereessoseesssseess 26 Program Flow Control and Relational Operators ccccccccccssssssceseensscecesuuscecesuusseeesusaaeeecsessnseceennaes 27 Book Up Table Manip lati on che ac aah cee hate E accep ids aa ce Ba ch ty as ele E R RE 31 MSHELL SCRIPT EFTES GGMSE MSH VSH jinnin nana a N E N A EA I 32 Function Files mS ererii a E Wi elation A E a a a a a as 32 Meud e PLES GIST a e a MINE ORE OE aE 35 Virtual Include Files CVS a E a a OORE 35 IMPORTING AND EXPORTING DATA coc slot coptatiatss et heed te lacnbaidatpeacutd deel este caesacelgbeveurtsadstelheiits Palace 36 Imp rting DOIG mirerien a tag eceatia shins bebe el dah aces eed hee 36 POGUE TOT tite tiaas rtetatn Pace e A da taaubaa
211. offset gdal_get_raster_offset hdl bandnum Fetch the raster value offset This value in combination with the gdal_get_raster_scale value is used to transform raw pixel values into the units returned by gdal_get_raster_unit_type Units value raw value scale offset For file formats that don t know this intrinsically a value of zero is returned ctable gdal_get_raster_data_type hdl bandnum Returns the pixel data type for this band See gdal_create for a description of the data types ctable gdal_get_raster_scale hdl bandnum Fetch the raster value scale 316 Internal Functions REACT MSHELL User s Manual 11 12 2007 This value in combination with the gdal_get_raster_offset value is used to transform raw pixel values into the units returned by gdal_get_raster_unit_type Units value raw value scale offset For file formats that don t know this intrinsically a value of zero is returned unit gdal_get_raster_unit_type hdl bandnum Returns a string with the unit type for this raster band gdal_rasterio hdl wf xoff yoff xsize ysize my_array band_map npix_spc nline_spc nband_spc hdl wf xoff yoff xsize ysize my_array band_map npix_spc nline_spc nband_spce handle for an open dataset write flag 1 for write O for read raster x offset raster y offset pixel width to read write pixel height to read write array to read or write vector array o
212. om numbers generated 200 Internal Functions REACT MSHELL User s Manual 11 12 2007 The uniform random number generator itself is an adaptation of the RAN1 generator presented in Numerical Recipes in C see page 3 References and Further Readings This is a portable generator given the same seed number it will generate the same random sequence on all machines which utilizes three linear congruential generators in producing output Example The following MSHELL expressions will add uniform noise with intensities between 0 and 10 to the array a and save the result in c ready randinit 20 initialize random number generator ready c a 10 randu nrows a ncols a rcoeff Correlation Coefficient Syntax rcoeff a b Description Estimates the correlation coefficient between two arrays a and b with the same dimensions The correlation coefficient is a scalar Although the correlation coefficient is an internal function it could also be computed in terms of other MSHELL instructions as rcoeff a b mean a b a mean b mean sqrt a var b var ProVIEW User s Guide Appendix B Internal Functions 201 react_get_carto_info Retrieve Cartographic Viewer information Syntax react_get_carto_info info_type Description Retrieve Cartographic Viewer information depending on the specified information type string info_type If the function call is succes
213. ons REACT MSHELL User s Manual 11 12 2007 makes a backup copy s sys_copy results txt results_copy txt if s print An error occurred s text return copies file dat to destdir file dat s sys_move file dat destdir if s print An error occurred s text return ProVIEW User s Guide Appendix B Internal Functions 273 sys_del Deletes files or empty directories Syntax sys_del filename Description This function attempts to remove filename filename can be either a file or an empty directory If successful it returns 0 otherwise it returns a non zero value and the text attribute is set with a brief description of the error see the table below Return value text attribute Meaning 0 Not set Success 1 Set filename does not exists 2 Set File access denied 3 Set Directory not empty 4 Set Directory access denied 5 Set Cannot delete the object Example Deleting files and empty directories file s sys_del data txt directory s sys_del mydir if s print An error occurred s text return 274e Internal Functions REACT MSHELL User s Manual 11 12 2007 sys_deltree Deletes an entire directory tree Syntax sys_deltree dirname Description This function attempts to recursively remove the directory dirname along with all
214. or a sumcm Description For each row in the input array compute the cumulative sum of values along the row The output will have the same dimensions as the input Example With example for sumr sumr Sum Row Vectors in an Array Syntax sumr a or a sumr Description For each column in the input array sum the values along the column The output is a row vector Example The following generates an array and then calculates sum sumc Ssumcum and sumr of that array 260 Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide Syntax Description ready x of random randu 3 3 10 generate a 3 x 3 array ready x nint x to 10 row integers in the range of 1 example of sum x example of sumc x sumcum x example of sumcum x 8 00 18 00 10 00 15 00 ready sumr x example of sumr x row 0 8 00 16 00 17 00 svd Singular Value Decomposition svd A U D V Computes the singular value decomposition of an input matrix The routine used for this computation is derived from Numerical Recipes in C see page 3 References and Further Readings This routine takes the input matrix A and returns U D and V which contain the singular value decomposition of A The following equalities will hold u u 1 viev l A U D V Note that all the input variables must exist before calling this function Example
215. otherwise it will be created Array Interval Delimiter Syntax x n Description Used to denote an interval of rows or columns Example The following illustrates the use of the array interval delimiter To extract column number 3 of an array x type ready x 3 To extract row number 2 in x and assign it to y type 62e Internal Functions REACT MSHELL User s Manual 11 12 2007 ready y x 2 To extract the sub array in x defined by rows 3 to 5 and columns 2 to 10 and copy to y type ready y x 3 5 2 10 To insert the array y into the array x starting at row 8 and column 0 type ready x 8 0 y To extract an image block starting at row 9 and column 20 type ready x 9 20 string String Access Control Syntax string rs re cs ce or string cs ce or Description The notation for accessing the content of a string variable is discussed in page 22 the string variable section Logical Relational Operators lt Less Than Operator gt Greater Than Operator lt Less Than or Equal To Operator gt Greater Than or Equal To Operator zz Equivalent To Operator l Inequivalent To Operator amp amp Logical AND Operator Logical OR Operator Syntax expression OPERATOR expression2 Description These operators are used to perform logical checks on certain desired expressions Example Notice the use of separating parenthes
216. owing the REACT objects hierarchy as an XML string If an empty string is specified it retrieves the entire collection of all properties values of all REACT objects as an XML string ProVIEW User s Guide Appendix B Internal Functions 205 A status value zero successful non zero failure is returned Its text attribute will contain the command output upon successful or a brief description of the error upon failure Example result react_get_properties react ncda if result error result result text else Sxml result text The output XML string looks like this lt Object name react gt lt Object name ncda gt lt Property name activeTab gt layers lt Property gt lt Object gt lt Object gt react_set_property Set the value of a REACT property Syntax result react_set_property prop_name prop_value Description This function changes the property value of the specified object following the REACT objects hierarchy to the specified value A status value zero successful non zero failure is returned Its text attribute will contain the command output upon successful or a brief description of the error upon failure Example 206 Internal Functions REACT MSHELL User s Manual 11 12 2007 result react_set_property react mdev monitoringPanelDocked 51 if result error result result text else
217. previously opened SQLite database The output of the query if any is automatically retrieved The fields are delimited by the character The output is assigned to a string variable If successful it returns 0 and the text attribute holds the query result string If an error occurs it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example ProVIEW User s Guide Appendix B Internal Functions 253 status sqlite_connect test sqlite Squery select site_name latl lonl query Squery from RobinsonTargets Sresult sqlite_transact query Sresult status sqlite_close sqrt Square Root Syntax sqrt a or a sqrt Description Computes the square root of each array element in a If any of the entries in the input array are negative the output of the square root will be complex i e sqrt 1 0 1i where i implies that the number is imaginary Taking the square root of a complex array is a valid operation stats Computes Array Basic Statistics Syntax stats a or a stats Description Returns a row vector whose first element is the minimum value in a its second element is the maximum value in a its third element is the mean value of the elements of a and its last element is the standard deviation of the elements of a statxs Computes Statistics with exclusion vlaues Syntax statsx a exclude Description Retur
218. r that determines if the polygon will be drawn or not The values of fill must be zero or one fil val Example The following MSHELL expression illustrates the use of the polyfill function ones 3 1 1 ue 255 128 64 image zeros 256 256 lylist complex 0 100 150 0 0 0 100 100 lylistm polylist polylist 1 5 polylist 2 lylistm rmirror polylistm control complex value fill polylistm 190 Internal Functions polyfill image control image REACT MSHELL User s Manual 11 12 2007 polygonorient Computes the orientation of a polygon Syntax result polygonorient poly Description This function computes the orientation of a polygon given the coordinates of its vertices The coordinates are specified as a complex row vector Only closed polygons are supported so the last vertex should be the same as the first one see the example below Return values 0 The given polygon is degenerate 1 Means Clock Wise orientation CW 1 Means Counter Clock Wise orientation CCW Example clock wise polygon a complex 0 0 complex 0 10 complex 10 10 complex 10 0 complex 0 0 s polygonorient a s s 1 preg_match Reqular Expression Matching Syntax preg_match str_to_search regular_expression_pattern Description Given a regular expression pattern this function finds the first match in the input string General documentat
219. rate test sensor projection image truth zoom2fit truth 300 300 imageO truth view truth xy0 cgrid 0 image0 ncols 1 0 image0 nrows 1 1 1 x0 xy0 real y0 xy0 imag k 5 xsp spiral x0 k 10 3 ysp spiral y0 k 10 3 isp spiral image0 k 10 3 view xsp view ysp view isp wtile now apply image2surface while changing xy sampling image0 isp 7 sqrt 1 xy xsp tj ysp Zz zeros image0 nrows image0 ncols 0 non_valid_pixel 0 groi eqindex isp non_valid_pixel backg 0 i 75 while i gt 1 xlev 0 x0 max 1 i ylev 0 y0 max 1 i backg 0 grid DispContours xy0 xlev ylev backg dummy image0 groi2 index grid dummy groi2 128 dummy groi non_valid_pixel image dummy view image ns i print ns int2str ns n outrows grid nrows outcols grid ncols entll ns outrows outcols non_valid_pixel backg entl3 0 entl2 0 Sts M time image wdef nint xsp nrows 2 i i nint xsp ncols 2 i i i i 255 outg image2surface image xy z cntll1 cnt12 cnt13 outo image2surface image0 xy z cnt1l1 cnt12 cnt13 Ste M_time Sts te view outg view out0 wtile i i 3 EXAMPLE 2 reading read lunar topography from Clementine data luntopo reada luntopo flt float B luntopo scale255 set texture image to topography view B luntopo scale255 luntopo view luntopo entll ns outrows outcols non_valid_pixel backg ent1l2 0 cn
220. ray into a file The second command above is used for doing a formatted string write into an already open file The format string follows a similar form to the C language formatting options where s is used for strings and f g e are used for floating point numbers Example Given that unit 1 has been already open with an openf statement and that x is an array variable and name is a string variable then the following MSHELL statements are legal writef statements status writef 1 Hello my name is s n name status writef 1 The temperature is f degrees x status writef 1 The value is n 4 2f x status writef 1 g x status writef 1 e x ProVIEW User s Guide Appendix B Internal Functions 297 wsize Size of a Region of Interest Syntax wsize roi or roi wsize Description Given a valid rectangular region of interest this function will return the dimensions of the rectangular window defining the ROI wtile Tiles all Screen Windows Syntax wtile Description Tiles all the windows presently opened in the MSHELL environment 298 Internal Functions REACT MSHELL User s Manual 11 12 2007 X xcorr Cross Correlation Syntax xcorr a b Description Perform the cross correlation between two input arrays There are no specific restrictions on the two input arrays they can be either real or complex and one or two dimensional If a has dimensions N x M
221. ready b a multiply row vector b by Var matrix a 10 0 X row 0 3 00 3 00 3 00 ready a b an invalid multiplication gt gt gt error 4 incompatible dimensions ready b 4 multiply each element of b by 4 row 0 4 00 x Array Element Multiplication Syntax a b Description The operator symbol is used to perform the multiplication of corresponding elements between two arrays The multiplication is implemented as C 4 5 forallj i ProVIEW User s Guide Appendix B Internal Functions 57 where j and i are row and column indices respectively An error message will be generated if a and b do not have the same dimensions Example The following MSHELL statement will multiply corresponding elements in array a and b and store the result in c creates a row vector print array malt corresponding elements print results Continuation Line delimiter Description The symbol tells the MSHELL interpreter that the present statement will be continued on the next physical line Continuation lines can only be used within MSHELL script files msf or msh Example The following 2 lines of code illustrate the use of the continuation line delimiter within a script function The result of the expression is 21 x 4 5 1 Single Line Comment Delimiter Description The symbol is used to specify that a single li
222. red path and array names to use separated by spaces To save all of the ARRAY variables use save savefile all To save all the string variables use save savefile allstr To save all local ARRAY variable use save savefile all_local See Also load scale255 Scale to 8 bit Range Syntax scale255 a or a scale255 Description Scale the input array values to fall in the range 0 255 This function is particularly useful for scaling an array prior to copying it to an 8 bit image frame buffer Note that the input to scale255 must be real Example Given that a is a valid array f scale255 a will scale a and copy it into image f ProVIEW User s Guide Appendix B Internal Functions 235 setcwd Sets the current working directory Syntax setcwd string status setcwd string Description This is used to set the current working directory from the command line or within a script The advantage of using this function over the typical M_cwd command is that this captures the state of the change If status is lt 0 gt then the cwd request was successful if equal to lt 1 gt then it was unsuccessful This could be because the directory specified does not exist or simply that access permissions have not been met Example The following sets the current working directory to C Temp Since status 0 we know that the request was successful ready status setcwd C Temp ready status 0 re
223. region of interest wolut Windows Output Look Up Table Syntax woluit Description This is used to apply one of the output look up tables to a particular image The wolut system variables are used with the select command or m_viewlut intrinsic to choose a lookup table to use For example select wcolut0 will select the grayscale lookup table To read or modify the lookup tables RGB values use the wcolut system variables O gray 1 inverse gray 2 pseudocolor 3 inverse pseudocolor 294e Internal Functions REACT MSHELL User s Manual 11 12 2007 4 user defined Note starting in MSHELL version 3 the scheme for tracking lookup tables associated with array variables was changed See array attribute x LUT for details That is a color palette can be assigned to each individual array writea Write Array to Disk Syntax writea fname a mode Description Write an array a to file fname on the disk in the indicated mode using any of the supported formats For a discussion on the modes see description provided in the reada function Note for the char float ascii and double formats this function will save x text attribute if it was intitialized in the array to write to disk See Also reada Vopen fits_ nc_ pds_ writef writecolor Writes a Color Image Syntax writecolor path filename ext r g b image type Description N
224. ription This function returns a list of names of available WIPE Servers Example ready S WipeServers rs_availWipeServers rs1 ready rs_availDataSets Returns list of available data sets Syntax rs_AvailDataSets rs1 ACTTest Description This function returns a list of available data sets in a particular WIPE Server Example ready DataSets rs_AvailDataSets rsl1 ACTTest ready rs_extractData extract data from the Wipe Server Syntax rs_extractData rs1 Description This function is used to extract data from the WIPE Server The input arguments are the remote server handle the WIPE Server name the data item id you wish to extract data from the layer number the ROI subregion the output image dimensions the format to save the data in and the filename to save the data into If the ROI has all the values set to 9999 0 it means we want the whole region the data item occupies If this function succeds the return value is 1 otherwise is 0 Example 224e Internal Functions REACT MSHELL User s Manual 11 12 2007 ready SRecId TEDS_3Dtemp nwlan_1999071200_tfin ready bbox ones 1 4 9999 0 ready dim 41 181 ready layer 0 ready Sformat netCDF ready Sfname d temp temp nc ready ret rs_extractData rsl ACTTest RecId layer bbox di m format fname rs_getMetaData Extract the metadata request Syntax rs_getMeta
225. rld contours 97 plot Plot a Vector 187 plot3d 3 D Plot or Mesh Plot 189 polyfill Fills an Image with Polygons 190 rowplot Plots a Row from Array 223 view4d project planar image into an xyz grid 289 Region Ops aoi Active Region of Interest 69 bresen Compute Line Segment Points 72 Groi_Logical regionand ROI intersection 216 Index Pixels eqindex Equality Index 106 finite_index Index of Non infinite Elements 112 geindex Greater than or Equal Index 127 gtindex Greater than Index 136 index Index of Non Zero Elements 150 leindex Lower or Equal Index 154 Itindex Lower Index 158 159 nan_index Index of all NaN Elements 179 neqindex non equal index test 183 rindex Range Index 217 rindexc Range Index Complement 218 Interactive Selection inputfocus Array Variable with Current Focus 151 setroi Interactively sets an ROI 236 varname Returns the Variable Name 286 ladd2groi local add of constant to selected pixels 153 maskofEQ mask of elemens where a b 167 maskofGE mask of bit plane 167 maskofGE mask of elemens where a gt b 168 maskofGT mask of elemens where a gt b 170 maskofLE mask of elemens where a lt b 170 maskofLT mask of elemens where a lt b 170 Overlapping Regions cmplxoverlap 2 D range index 76 pixval Displays Pixel Status of Mouse 186 rfill Fills a subregion 216 wdef Define a Regio
226. rn value text Meaning attribute 0 Not set Success 1 Set First argument does not exist 2 Set Permission denied 3 Set Second argument already exists 4 Set First argument is neither file nor directory Example Renaming files and or directories rename files or directories s sys_ren filel txt better_name txt s sys_ren dirl newdir to catch errors if s print An error occurred s text return ProVIEW User s Guide Appendix B Internal Functions 271 SyS_copy Copies files Syntax sys_copy source dest Description If the dest parameter is a directory this function copies the file source in it Otherwise the file source is copied to a new file named dest in the current directory If successful it returns 0 otherwise it returns a non zero value and the text attribute is set with a brief description of the error see the table below Note that dest is meant to be relative to the current working directory see the sys_pwd function Absolute paths should not be used in dest Return value text Meaning attribute 0 Not set Success 1 Set Source file does not exists 2 Set First argument is not a file 3 Set Permission denied cannot create dest 4 Set Permission denied cannot create dest source 5 Set Last argument exists but it is not a directory Example Copying files 272 Internal Functi
227. roi 2 read a band view green_extracted now let us look at a complex variable myComplexImage complex xp Z myComplexImage text has real an imaginary part gt red real green imaginary view myComplexImage display complex variable the following is another way to construct and access a cube nbands 3 layers2 zeros nbands xp nrows xp ncols layers2 xp layers2 yp layers2 zp green2 layers2 2 print done 68e Internal Functions REACT MSHELL User s Manual 11 12 2007 and Bitwise AND operator Syntax and x y Description Perform bitwise AND operator treating input arguments as unsigned 64 bits integers Input arguments can be also real ARRAYs in this case the bitwise AND operator is performed on corresponding elements Example aoi Active Region of Interest Syntax image aoi Description This command lists the pixel values within a previously selected region of interest Note The region of interest must be of conservative size considering the requirements to list all values within the region asin Inverse Sine Syntax asin a or a asin Description Compute the inverse sine of each array element The output is in radians The actual mathematical expression computed is given by Cui asin a for all j i where j andi are row and column indices respectively Example The following MSHELL statement will compute the inverse sine of a
228. row dbrsgetrowsfloat srow erow fname dbrsgetrowsfloat colnames srow erow dbrsgetrowsfloat colnames srow erow finame REACT MSHELL User s Manual loj x 11 12 2007 srow start row number erow end row number fname output file name string colnames list of requested field names Description This function works after a dbconnect and dbsqlexec After a query this function when invoked will return the result set data as an array The first inout argument column_name is a comma separated list of column names to be retrieved This function may be called multiple times on the same result set If your are retrieving a large number of numeric related records this function executes significantly faster than dorsgetrows Example see dbrsgetrows example dbsqlexec Sends a query to the database Syntax dbsqlexec query Description This function executes a query on the connected server it is used after a dbconnect Returns a value of zero if it is successful Example see dbrsgetrows example dbfopen Returns a handle to the opened dbf file Syntax dbfopen dbffile Description this function returns a handle to the opened dbf file if it succeeds otherwise it returns 1 You can open up to 5 dbf files at a time Note In MS Windows a dbf file can also be accessed using the Visual FoxPro ODBC driver All the functions of the type dbf ___ are for giving access to the dbf file These functions d
229. rs_connect erie actgate com 12000 ready rs_release closes connection with a WIPE Object Syntax rs_release rs1 Description This function is used to close the connection with a remote WIPE Object Example ready rs_release rs1 ready rs_exec Executes command in the remote server Syntax rs_exec rs1 cmd Description This function is used to execute an MSHELL command string in the remote WIPE Object server It returns 0 if the command executed properly on the remote machine otherwise it returns the MTOOL error code generated during execution Example ready Scmd x scale255 hammiw 128 128 n ready retval rs_exec rs1 cmd rs_exec_async Same as rs_exec does not block Syntax rs_exec_async rs1 cmd Description This function is similar to rs_exec excepts that it does not block The local thread of execution is free to process other commands while the command passed in rs_exec_async executes in the remote server If succesfull it returns 0 Example 226 Internal Functions REACT MSHELL User s Manual 11 12 2007 ready cmd include bigloop n ready retval rs_exec_async rs1 cmd rs_getString Retrieves the content of a string variable Syntax rs_getString rs1 varname Description This function is used to retrieve the contents of a string variable in the remote WIPE Object server If the string variable does not exists the function re
230. rsgetrowsfloat Returns the result set as an array 88 dbrsrowcount returns result set 86 dbsqlexec Sends a query to the database 89 dbsqltr Transacts with an external database 93 dbf_functions dbfclose This function closes the dbfile 90 dbfgetfieldcnt returns the of fields in the dbf file 90 dbfgetrecordcnt returns the of records in the file 90 dbfgetrecords read the records from the dbf file 91 sqlite_functions sqlite_close Closes access to an SQLite database 248 sqlite_connect Connects to an SQLite database 248 sqlite_create Creates an empty SQLite database 248 sqlite_exec Sends a query to the SQLite database 249 sqlite_getcolnames Returns column names in a result set 249 sqlite_getrows Returns the result set as a string data 249 sqlite_getrowsfloat Returns the result set as an array 252 sqlite_rowcount Returns the result set count 253 sqlite_transact Transacts with an SQLite database 253 Date Operators dt2mjd returns modified Julian Date 95 gmtimenow returns time y m h m s 135 localtimenow returns local time 156 M_time see M_ system variables 163 mjd2dt convert modified Julian Date 176 tdiff computes elapse time 281 Filtering Frequency Operations B 50 Appendix B Internal Functions DCT dct8x8 Discrete Cosine Transform 8x8 94 idct8x8 Inverse Discrete Cosine Transform 141 FFT fft One dimensional
231. ry Standard Industry Standard Planetary Data System Support basic format used in planetary missions N A N A Yes Yes Yes Yes see also writecolor function Yes Yes simple format float MSHELL simple format with a 9 byte header 4 bytes pixel Yes Yes double MSHELL simple format with a 9 byte header 8 bytes pixel bmp Industry standard format N A Yes Yes Jpeg Industry standard format N A Yes Yes asciiflex MSHELL flexible text loader into numeric array Yes N A clemen_pds Clementine Mission Specific DCT type compression Yes N A Note that only the charflex and asciiflex formats requires the additional argument cntvec please see examples 208 Internal Functions REACT MSHELL User s Manual 11 12 2007 Note for the char float ascii and double formats reada will attempt to load the x text attribute if it was intitialized in the input file The char internal format is good to store and retrieve 1 byte data The char format stores images by using 1 byte pixel prefixed by MSHELL s 9 byte header i e 4 bytes specifying the number of rows 4 bytes specifying the number of columns and 1 byte specifying if array elements real or complex This format can be used both for both the reading and writing of data Example Read eqohare chr image using chr
232. s Note that sinc 0 is evaluated as 1 sinh Hyperbolic Sine Syntax sinh a or a sinh Description Computes the hyperbolic sine of each array element The hyperbolic sine of x is evaluated as X x e e sinh x 2 skeleton Binary Conversion Filter Syntax skeleton array Description Computes the skeleton on an input image Example Untitled y hammiw 256 256 255 y ltclipto y 100 0 y gtclipto y 200 0 x skeleton y view x view y 246e Internal Functions REACT MSHELL User s Manual 11 12 2007 smodify String Replace Syntax smodify string from to Description This replaces all occurrences of from with to in the string string The output of this function can be set to a resultant string also Example This replaces the F in Fun with a G to form Gun sortr Row Wise Sorting Syntax sortr a or a sortr Description Returns a sorted version on a row basis of the input array The sorting algorithm utilized is Heapsort The sorting is performed from small number to large number Example Create an array and then perform a row wise sort of the array ready a randu 2 7 create random 2x7 matrix ready a row 0 0 41 row 1 0 79 0 17 0 01 x 0 42 0 10 0 28 ready sortr a example of sort row 0 0 39 0 41 0 50 row 1 0 01 0 10 Goi spatf Spatial Filter Syntax spatf a n m
233. s All system variables are prefixed by M_ String system variables do not require the they are a special case For example to initialize the x axis label to the string Time use M_xlabel Time Virtual Variable V MSHELL has a special variable V called the virtual variable With this variable the user can manipulate an image file which can be as large as 2 64 pixels It supports many formats 1bytes pixel floating point double precision unsigned inteter If the user has a huge image in a file or is going to be working with an image that can not be easily held in memory then he or she can still manipulate pieces of the large image using MSHELL s virtual variable Only one image file can be associated at any given time with the virtual variable V The basic virtual related functions in MSHELL are Vopen Vclose and Vnew Vopen Links V to an image file Vclose Stops link between V and a disk file Vnew Creates a new virtual file See Appendix B for detailed usage of the above virtual variable manipulatory functions Once a link is established between a file in disk and the virtual variable V then the user can access rectangular regions of interest in the disk file for read or write operations the user must always provide a rectangular region of interest when writing or reading from V ACT REACT MSHELL User s Manual Table of Contentse 23 Statements A statement is in general an e
234. s 147 In the first case above the extension msh was not included in the argument In that case MSHELL will try to open the file test if that fails it will try again after adding the extension msh The system variable M_path establishes which directories in addition to the present directory are to be searched The following are some useful script files which were not coded as script functions Script File Description file2ods msh This script file is used to convert an existing image file to a PDS image file whereby the new image file now contains a PDS keyed header imgedit msh This script file is used for the editing of image files It is the same script which is called when one uses the Image Edit Image Attributes menu This is used to define the horizontal positional value of the upper left pixel for a user defined rectangular coordinate system img2pds msh This script file is used to convert open images to PDS images whereby the new image now contains a keyed header mpeg msh outdated This script file is used for the creation of MPEG movies from a group of existing similar image files This script prompts the user for any needed information and gives the capability of advanced functions or beginner use pdsmap msh This script file is used to map several or just one PDS formatted image onto a lat long annotated grid sysedit msh Al
235. s an RGB volume 67 Image Text Overlay text2image Converts Text to an Image 280 textoverlay Annotates an Image with Text 279 textremove Removes Text annoation 280 Image Array Matrix Vector Algebra Matrix Transpose 60 Array Subtraction 56 Column Augmentation 62 a b s n Generate a 1 D or 2 D ramp 55 Matrix Multiplication 57 Array Element Multiplication 57 Array Division by Scalar 58 Element Array Division 59 Array Interval Delimiter 62 Concatenate Arrays or Strings 61 Raise Array Elements to a Power 59 Array Addition 56 Assignment 62 abs Absolute Value 65 allocate_array Allocate an array and set its values 66 ceil Find the Ceiling of an Array 75 centroid centroid of an image 75 complex Creates a Complex Array 77 conj Array Conjugate 77 convtoi Convert Row Vector to Image 80 convtov Convert Image to Row Vector 80 exp Inverse Natural Logarithm 109 floor Floor of Input Array 120 fmod Floating Point Modulus 120 ProVIEW User s Guide free Free Variable from Memory 121 geo Geometric Series 127 ident Generate an Identity Array 142 imag Imaginary Part 143 int Integer part 151 int Inverse of an Array 152 log Natural Logarithm 157 logl0 Base 10 Logarithm 157 m_ Array attributes 167 makecmplx converts a real array to complex
236. scription Use this command to connect to an SQLite database The string passed is the file name of an existing SQLite database If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see sqlite_getrows example sqlite_close Closes access to an SQLite database Syntax sqlite_close Description Use this command to close the already opened SQLite database If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see sqlite_getrows example 2486 Internal Functions REACT MSHELL User s Manual 11 12 2007 sqlite_exec Sends a query to the SQLite database Syntax sqlite_exec query Description This function executes a query on the opened SQLite database and it is used after an sqlite_connect If successful it returns 0 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see sqlite_getrows example sqlite_getcolnames Returns column names in a result set Syntax sqlite _getcolnames Description Returns a comma separated list of the column names in a result set To be called after a SELECT query call to sqlite_exec Any expressions in the SELECT statement may be returned as an empty column name unless the AS operator is used The column name should m
237. sful it returns an ARRAY containing the requested information both as ARRAY elements and text attribute In case of an error it returns a NULL ARRAY and the text attribute contains the error description The following info_type strings are allowed e basic the returned ARRAY is a row vector ARRAY containing carto_UL complex value representing the upper left corner in cartographic coordinates of the current view in the Cartographic Viewer carto_dxy complex value representing the x and y meters per pixel values of the current view in the Cartographic Viewer carto_Nxy complex value representing the current view width and height in the Cartographic Viewer the text attribute is set to the map projection string of the current view in the Cartographic Viewer e Empty string same as basic react_set_carto_map_info Set Cartographic Viewer Map Info Syntax react_set_carto_map_info map_info Description Set the Cartographic Viewer Map Info to the specified string It returns 0 upon successful 1 otherwise text attribute will contain the error description react_load_mlt Loads an MLT file into REACT Syntax result react_load_mlt file_mlt mode Description Loads the specified Map Layers Tree file mlt into the REACT s Layers Manager The mode argument controls how the mlt has to be added mode 0 replace current tree mode 1 append to current tree mode 2 prepend to current tre
238. ssion_init and can be used to perform a WIPE server data coverage request by using the remote MSHELL interpreter It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and the coverage XML string This function will block until the WIPE server response is ready If successful it returns 0 and the text attribute holds the output inventory XML string If an error occurs it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example 228e Internal Functions REACT MSHELL User s Manual 11 12 2007 opening a Remote MSHELL session Ssrvr rmshell_session_init 212 48 10 150 if S srvr print Error opening Remote MSHELL session return loading data coverage request template from file Scov readtext covTemplate txt performing request and checking for errors status rw_getInventory S srvr cov if status status text return if request has been performed successfully s text contains the XML inventory string Sinventory s text Sinventory if xmlparse Sinventory print nErrors in XML inventory string n return SinventoryImageRelPath xmltextvalue CoverageImage the __WROOT__ macro contains the WIPE Server root directory string where the output image file is located fn __ SinventoryImageRelPath images inventory retrieving output image file
239. status rmshell_getfile S srvr fn inventoryImage reada images inventory jpg all view inventoryImage closing the Remote MSHELL session status rmshell_session_close S srvr rw_getInventoryAsync_ Retrieve Inventory XML String does not block Syntax rw_getinventoryAsync handle request Description This function works after an rmshell_session_init and behaves essentially like the rw_getlnventoryXML function but it returns immediately It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and the coverage XML string If successful it returns 0 ProVIEW User s Guide Appendix B Internal Functions 229 otherwise it returns a non zero value and the text attribute can be used to retrieve a brief description of the error Example see rw_waitForlnventory example rw_getMosaic Retrieve MOSAIC XML String Syntax rw_getMosaic handle request Description This function works after an rmshell_session_init and can be used to perform a WIPE server data extraction request by using the remote MSHELL interpreter It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and the MOSAIC request XML string This function will block until the WIPE server response is ready If successful it returns 0 and the text attribute holds the output MOSAIC XML string If an error occurs it returns a non zero value and the text attribute can
240. str x Sformat 8 1f print nUsing float2str with Sformat n float2str x format Sformat 2 1f print nUsing float2str with Sformat n float2str x format Sformat 8 2 print nUsing float2str n float2str x format with Sformat Sformat 14 2g print nUsing float2str with format n float2str x format Sformat 14 2e print nUsing float2str with format n float2str x format y complex x x Sformat 8 2f print nUsing float2str with format n float2str y format y complex x x Sformat 8 0f print nUsing float2str with Sformat n float2str y format controlling format controlling controlling format controlling format controlling on complex array on complex array Appendix B Internal Functions 119 Pro IEW 2003 p File Edit Search Image Plot Data Functions Operators Window Help aleae Slede Ee randu 2 3 0 5 1000 ready print array values n x print Using float2str with free format n float2str x format 8 1f print nUsing float2str float2str x format format 2 1 print nUsing float2str float2str x format format 8 2f print nUsing float2str float2str x format format 14 2g print nUsing float2str float2str x format format 14 2e print nUsing float2str float2str
241. subtraction 7 multiplication and division elemental A a b a to the power of b unary minus e g X transpose operator e g x f an internal function e g cos ACT REACT MSHELL User s Manual Table of Contentse 25 Proper use of parenthesis can result in a significantly faster execution Hence in the expression c atb x the multiplication is performed prior to the addition The user can use parenthesis to force grouping of terms and override the operator precedence The use of parenthesis for grouping can result in faster code execution For example consider the following two expressions x a b c x a c b if a and b are scalars and c is a large 2 dimensional or 1dimensional array the grouping a b c executes significantly faster since it involves fewer operations In the implementation of array assignments MSHELL uses the concept of copy on write sometimes referred to as COW Copy on write is a memory optimization strategy The fundamental idea is that multiple assignments say x y q y are pointing to the same location of memory used by y This pointing scheme is maintained until an operation tries to modify any element in an array say x 0 0 9 that it is being shared At this point a private copy of the memory pointed by x is first created then modify to prevent the changes affecting the other arrays All of this happens transparently to the user The primary
242. sult text react_open_url Opens an URL in a browser window Syntax s react_open_url my_url Description This function opens the specified URL in a web browser window The functionality is available only in GUI mode i e within REACT Example 204e Internal Functions REACT MSHELL User s Manual 11 12 2007 url http www actgate com s react_view_url url react_get_property Get the value of a REACT property Syntax result react_get_property prop_name Description This function returns the value of the specified REACT property REACT has a hierarchical set of objects and those objects have properties In order to access those properties a dot notation is used For example obj1 obj2 0bj3 propname retrieves the propname property value of the specified object obj3 following the REACT objects hierarchy obj1 obj2 obj3 A status value zero successful non zero failure is returned Its text attribute will contain the command output upon successful or a brief description of the error upon failure Example result react_get_property react mdev monitoringPanelDocked if result error result result text else Svalue result text react_get_properties Get the values for a set of REACT properties Syntax result react_get_properties react_object Description This function returns all the property values of the specified object foll
243. t ready colinfo 1 116e Internal Functions REACT MSHELL User s Manual 11 12 2007 fits_get_coltype Returns the column type Syntax coltype fits_get_coltype handle colnum Description Returns the column type number repeat count vector columns Returns 1x3 vector Coltype 0 0 column type number Coltype 0 1 repeat count Coltype 0 2 width Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT me Tits ready coltype fits_get_coltype handle 1 first column ready coltype 41 0 fits_read_col_values Reads column values Syntax coldata fits_read_col_values handle col firstrow firselem melem or coldata fits_read_col_values handle col firstrow num_rows or coldata fits_read_col_values handle col Description Reads the column values starting with firstrow firstelem and continuing for nelem crossing into new rows if needed The coldata output will always be a 1xN vector using this form Even if the column is a vector Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT wy Fr ts ready coldata fits_read_col_values handle col firstrow firs elem melem fits_read_col_str Reads column strings Syntax coldstr fits_read_col_str handle col firstrow firselem melem or ProVIEW User s Guide Appendix B Internal Functions 117 coldstr fits_read_col_str handle col firstrow num_rows or coldstr fits_read_col_ str hand
244. t 5 performing request asynchronously and checking for errors status rw_getInventoryAsync Ssrvr Scov if status status text return now waiting for the response to be ready print waiting int2str nSecsToWait seconds isBusy rw_waitForInventory srvr nSecsToWait while isBusy print server is still busy n print waiting int2str nSecsToWait seconds isBusy rw_waitForInventory srvr nSecsToWait print server is ready if request has been performed successfully isBusy text contains the XML inventory string Sinventory isBusy text Sinventory closing the Remote MSHELL session status rmshell_session_close S srvr rw_waitForMosaic Wait the number of specified seconds Syntax rw_waitForMosaic handle n_sec Description This function works after an rmshell_session_init and an rw_getMosaicXMLAsync It takes two arguments a valid string handle to a previously opened remote MSHELL interpreter and the number of seconds to wait If it is 1 this function blocks until the remote server is finished executing the command Otherwise it waits the number of seconds specified If the remote server has not yet finished executing the data extraction request when the number of seconds elapsed or if an error occurs it returns a non zero value otherwise it returns 0 and the text attribute holds the output MOSAIC XML string Example ProVIEW User s
245. t SQLITE Test 5 extraction of records s int2str srow through int2str erow as an ARRAY variable n s5 status sqlite_close sqlite_getrowsfloat Returns the result set as an array sqlite_getrows srow erow sqlite_getrows srow erow fname sqlite_getrows colnames srow erow sqlite_getrows colnames srow erow fname srow start row number erow end row number REACT MSHELL User s Manual 11 12 2007 fname output file name string colnames list of requested field names Description This function works after a sqlite_connect and sqlite_exec After a query this function when invoked will return the result set data as an array The first inout argument column_name is acomma separated list of column names to be retrieved This function may be called multiple times on the same result set If an error occurs it returns a NULL array and the text attribute can be used to retrieve a brief description of the error Example see sqlite_getrows example sqlite_rowcount Returns the result set count Syntax sqlite_rowcount Description This function works after an sqlite_connect and sqlite_exec After a query this function when invoked will return the number of rows in the result set Example see sqlite_getrows example sqlite_transact Transacts with an SQLite database Syntax sqlite_transact query Description Use this command to post the passed string as the next query for the
246. t response of the photoreceptors of the human eye model resulting in a perceived more uniform distribution of intensity values The actual intensity mapping utilized has the following mathematical representation K Vad hyplut k i j 0 min Pa hist255 a a nrows a ncols ProVIEW User s Guide Appendix B Internal Functions 139 iboxlist Input Box List Syntax iboxlist title nitems ilist Description This function is used to create an input box on the screen based on an input list ilist of options It allows one to modify various options in a form that is display on the screen Example the following illustrates how this function can be used 140 Internal Functions REACT MSHELL User s Manual 11 12 2007 title Silist item Sitemdesc Sitemval list Silist Sitem Sitemdesc Sitemval list Silist Slist iboxlist t My title My title initialize input x0 x0 is one add2list Silist item itemdesc itemval list text yo y0 is related to two add2list ilist item itemdesc itemval list text itle nlines ilist 5 ilist list idct8x8 Syntax idct8x8 b Description Inverse Discrete Cosine Transform Used to perform the inverse discrete cosine transform on an array b which is the DCT of a previous function The resultant will be identical to the original array previous to the creation of b
247. t in an array The coordinates row1 col1 and row2 col2 are respectively the start and end points of the line segment Note that xline a row1 col1 row2 col2 is equivalent to the following MSHELL instruction based on the bresen and complex unctions bresen complex col1 col2 row1 row2 See Also bresen Example For the given an array the following will calculate both the xline and the a besen complex 0 3 0 3 transformations of the array A hammiw 4 4 generate a 4 x 4 array a 10 0 X row 0 0 0064 0 0432 k 0 0432 row 1 0 0432 0 2916 s 0 2916 row 2 0 0800 0 5400 d 0 5400 row 3 0 0432 0 2916 7 0 2916 xline a 0 0 3 3 example of xline 10 0 X row 0 0 0064 0 2916 1 0000 0 2916 0 0432 a bresen complex 0 3 0 3 0 0064 0 2916 1 0000 0 2916 xlinec Extracts Coordinates of Line Syntax xlinec image 300 Internal Functions REACT MSHELL User s Manual 11 12 2007 Description Used to list the coordinates along a linear region of interest Once the command has been issued in the command window then one is prompted to click the endpoints of the desired linear region within the image of interest xlinev Extracts Vertices of Line Syntax xlinev image Description Used to list the vertices or end point of a linear region of interest Once the command has been issued in the command window then one is prompted to click the endpoints of the desired linear region w
248. t it generates independent identically distributed i i d Gaussian random numbers with zero mean and unit variance where n and m refer to the number of rows and columns in the array of Gaussian random numbers to be generated Example Say a is an already existing array to which it is desired to add Gaussian distributed random numbers with zero mean and standard deviation of 10 The following MSHELL expression will add the Gaussian noise to a and will save the result in c ready randinit 30 initialize random number generator ready a 10 100 1 ready c a 10 randg a nrows a ncols ready plot a c randinit Random Number Seed Initializer Syntax randinit n Description As this function is used to initialize the MSHELL random number generators it does not return any value To initialize a random sequence call randinit using a scalar value greater than 1 Example The initialization and subsequent use of a random generator ready randinit 10 initialize random number generators ready x randg 1 100 call gaussian rand num gnrtr randu Uniform Random Number Generator Syntax randu n m Description This generator produces independent identically distributed i i d random numbers between 0 and 1 It returns a pointer to an n x m dimensioned array structure where n and m are respectively the number of rows and columns of uniformly distributed rand
249. t the user is interested in generating its output as a cartographic map outcntl same as above definition See Also wdbmap msf MI_geo2cart msf Geo2Cart Map_Image msf Map_Images msf 98e Internal Functions REACT MSHELL User s Manual 11 12 2007 Example M_wdb C ACT Proview wdb coasts dat use coast line weqe dworld 90 90 180 180 180 360 weqc 255 weqc negate the image to force white background view255 weqc 2 0e6 range S Sri E EA range text proj ortho nellps WGS84 nlat_0 45 nlon_0 12 nno_defs range text smodify range text remove spaces wview dworld range 300 300 wview 255 wview view255 wview ProVIEW User s Guide Appendix B Internal Functions 99 The following example shows sample output from all the input files that can be accessed via the M_wdb variable The input data use here comes from the CIA vector shoreline publicly available 100 Internal Functions REACT MSHELL User s Manual 11 12 2007 ProVIEW User s Guide Appendix B Internal Functions 101 102 Internal Functions C ACT Proview wdb world dat view of the whole world centered at longitude 0 n 127 x 2 e6 rv Scarier rien rv text proj ortho nellps WGS84 nlat_0 65 nlon_0 155 nno_defs center on Alaska world_dat dworld rv 300 300 45 view255 world_dat M_wdb c act proview wdb bounds dat bounds_dat dworld rv 300 3
250. t13 30 40 0 1 moonTopo image2surface B 0 luntopo 2 cnt11 cnt12 cnt13 view255 moonTopo E oor n p Ot Om a Gann Bree oe 2j lee aizia Intonation Layers Control amp worhovs Dulder Wie View S A Anye Morau Downloade Netet ID Shom Caropactic Viewer layers anages j Q mo treme te ELE BAFI Figure 6 Example 2 output 146e Internal Functions REACT MSHELL User s Manual 11 12 2007 img2contour Create a contour image Syntax img2contour image levels graylevel Description Generates an output contour from the input image The levels are a row vector describing the contour steps desired and the graylevel is a row vector describing the value to use when drawing the contour line See Also arg Image Plot Data Functions Operators Window Help weee Slede Sleds Al x 255 hammiw 256 256 al iS img2contour x 100 150 200 ready y hammiw 32 32 255 ready view y ready _ su include Invoke an MSHELL Script File Syntax include fname Description A file with a sequence of MSHELL commands can be invoked at any time through the use of the include command where fname is the name of the script file to be executed Example Given an MSHELL script file named test msh the MSHELL instructions contained in the file can be executed by simply typing include test or include test msh ProVIEW User s Guide Appendix B Internal Function
251. tAinsondsd chelate tana a E E a A RE a A AR 37 INTERNAL FUNCTIONS are E ona alee a Mele RA E ame 38 MATH ERROR HANDLING AND INDEXING ssessseesessesesesresstseresresstsstestessetstsstresseestestessteseesetestesseserssreset 38 Systemlev l acC ENS eie a ced A RE A E aE E A n dla aaa oa a aa 4 Dynamic Data Exchang allot eis niei N Tad el OR tin eB eis iS hash GN EE as 4 Dyan Link Libraries DLL Srii an a baal tea dirteta al a bina boca taadacaasan aa a aiani 43 APPENDIX A MSHELL SCRIPTS EXTERNAL FUNCTIONS TREE cccssscsssseees 47 TNTRODUCTION E EE E E E E E E T 48 APPENDIX B INTERNAL FUNCTIONS wesisscecccvesicccesscuacecdess calovecesvetesccdecsovdsiscsesctdscdecenivaceveens 49 ACT REACT MSHELL User s Manual Table of Contentse v INTERNAL FUNCTIONS ALPHABETICAL LIST cccsesscccccccceceessnsececesececsesenssaececescesesessssaeceseesesenensaaeas 55 IS MINIIOUS E T ae laeians ata re hia esata vs T 55 T EE EE AAE A Saad tami EREE EA EEREN NAA AA ATE AE E 65 a o EA LIE EEEE INSE EIE EA IAEE gS SEES S A ES 71 BO E E E EE E E E E E E E ETT 75 A D E E E dolar E E E E TE E A E E 106 A E EE EA EE EE E EE delet catia A A E A E A ES 110 E EE AEE EAEE E EA EE N EAE A ETE A A A RT EEEE A AE 126 S a E EEA E A EA AEE AE E AE A E 137 E E E EE E E E E E E E E EA E E EES 140 SU E AE TE E E E E E EE E A E chee E A E E E 153 BOE e e a e a dts as 160 BIEL te as ge E E E E EA 179 sO a a na e a a a a a a a ea n a a a n 185 SOP I a
252. tfile Upload a file from the remote MSHELL 222 rmshell_putvar Put an ARRAY variable to the remote MSHELL 222 rmshell_putvarS Put a string variable to the remote MSHELL 222 rmshell_session_close Close connection to a remote MSHELL interpreter 222 rmshell_session_init Connect to a remote MSHELL interpreter 223 rmshell_wait Wait the number of specified seconds 219 Remote Access to WIPE CORBA Based rs_availDataSets Returns list of available data sets 224 rs_availWipeServers Returns available Server 224 rs_connect connect to a remote WIPE Object 225 rs_exec Executes command in the remote server 226 rs_exec_async Same as rs_exec 226 rs_extractData extract data from the Wipe Server 224 rs_getArray Retrieves the content of an Array 227 rs_getMetaData Extract the metadata request 225 rs_getString Retrieves the content of a string 227 rs_init loads msh32rs dll 225 rs_release closesconnection with a WIPE Object 226 rs_wait Waits the number of specified seconds 227 Remote Access to WIPE SOAP Based rw_getInventoryXML Retrieve Inventory XML String 228 rw_getInventoryXMLAsync Retrieve Inventory XML String does not block 229 rw_getMosaicXML Retrieve MOSAIC XML String 230 rw_getMosaicKMLAsync Retrieve MOSAIC XML String does not block 231 rw_waitForInventoryXML Wait the number of specified seconds 232 rw_waitForMosaicXM
253. the second column contains the value to use to fill in the corresponding 240 Internal Functions REACT MSHELL User s Manual 11 12 2007 polygons if it is a Nx1 array the column vector contains the shapefile ids to extract from the shapefile and if it is 0 then all the shapefile records are extracted The value used to fill in the polygons in the second and third case is determined by the content of the system variable M_plotcolor The returned image is a combination of the input image and the filled in polygons Example The following example illustrates the function Z ones 180 360 100 shp2image d temp admin98 shp z 180 90 180 90 070 view c Mode 1 Polygon Fill using Shapefile Record Id In this mode the record id is used to fill in the polygons If recn is a Nx1 array the column vector contains the record ids to extract from the shapefile if recn is 0 then all the records are extracted Note that if recn is a Nx2 array the second column is ignored Example The following example illustrates the function Zz ones 256 256 100 is shp2image d temp sed shp z 78 015 33 001 74 992 36 009 0 1 view c show c en Taso ee data type is real number of rows 256 number of columns 256 maximum value 598 minimum value 0 in this case 598 records were extracted Mode 2 Polygon Fill with Region Add This mode is useful when trying to determine overl
254. then plot3d10 x will plot x on plot screen number 10 If you want to free that screen later on you can type free plot10 See Also M_ for a complete list of system variables which affect the plot functions Example The following MSHELL instructions generate a 32 x 32 Hamming function and displays the function as a 3d plot row 0 15 1 col 0 19 1 50 ready ready z hammiw 16 20 ready ready M_xlabel row index ready M_ylabel column index ready plot3d z row col lala File Edit Search Image Plot Data Functions Operators Window Help AEA him e 4 row 0 15 1 col 0 19 1 50 z hammiw 16 20 M_xlabel row index M_ylabel column index plot3d z row col ProVIEW User s Guide Appendix B Internal Functions 189 Syntax list Description polyfill Fills an Image with Polygons polyfill image complex value fill polylist Fills and Image with Contained Polygons This routine allows for the fast drawing of polygons on image polylist is a complex array where each row correspond to a polygon Each element in polylist is a complex number with row and column position The column number is encoded as the real part and the row number as the imaginary part Image value is a column vector containing the real amplitude values to assign to the polygon to be drawn fill is a flag vecto
255. this function returns a clipped version of the input array That is every element in the input array less than the real threshold value is set to zero and every element greater or equal than the threshold value is set to 1 Example The following illustrates the use of bthresh ProVIEW User s Guide Appendix B Internal Functions 73 00 00 00 2 00 bthresh z 3 74e Internal Functions REACT MSHELL User s Manual 11 12 2007 C callDLL Calls a DLL for execution Syntax callIDLL dllname function returned_paramters Description This function is used to call a DLL for execution It must have been previously loaded with loadDLL The DLL must not return any more than 5 values The syntax is DLL filename function name returns comma delimited See section Dynamic Link Libraries DLL for details Example The following line calls the delaunay dll for execution after having been loaded with loadDLL There is only a z variable being returned by this dll therefore one must return zeros for all unused placeholders ready callDLL delaunay d11 delaunay z 0 0 0 0 ceil Find the Ceiling of an Array Syntax ceil array Description This function is used to find the ceiling of an array The output has the same dimensions as the original array The output contains the ceiling for each element Example ready x ceil 1 2 3 4 row 0 2 0 4 00 3 0 centroid computes centroid
256. tion This function mimics Qt s QString section function Given an input string a and a user defined string delimiter delimiter it allows the user to treact the input string as sections and extract all sections from start to end This function is quite usefull to break apart commad space value CSV type of input strings From left to right section are identified as 0 1 From right to left section are identified as 1 2 Example Sa my life as a dog strStartsWith a my returns 1 strStartsWith a mi returns strEndsWith Sa as a dog returns 1 strEndsWith S a as a cat returns strContains a a returns 2 strContains a lice returns my life asa strSection a 1 1 strup2low Converts uppercase to lowercase Syntax strlow2up uppercase Description The output is a string whereby all uppercase characters have been changed to lowercase ProVIEW User s Guide Appendix B Internal Functions 259 sum Sum All Elements Syntax sum a or a sum Description Sum all the elements in the input array The output of this operation is a scalar i e a1x1 array Example With example for sumr sumc Sum Column Vectors in an Array Syntax sumc a or a sumc Description For each row in the input array sum the values along the row The output is a column vector Example With example for sumr sumcum Row Wise Cumulative Sum Syntax sumcun a
257. tput of the query if any is automatically retrieved The records are extracted and string formatted The fields are delimited by the character The output is assigned to a string variable if the optional filename parameter is not specified otherwise the output is saved to the named file Example status dbconnect default_wipe Squery select DataSet ZpanScript query Squery from Data_Control result dbsqltr query result Sresultl dbsqltr Squery c temp o txt Sresultl status dbclose inixi File Edit Search Image Plot Data Functions Operators Window Help alee sede SIRI eE Sel Sl C Temp testme msf 3 and Shell a status dbconnect default_wipe MGs_MOLA zpan_def msh query select DataSet ZpanScript ms Her ie etal me query S query from Data_Control H ne zpan_def ns NGS_TES_albedo zpan_def msh MGS_TES_ Query zpan_MGS_TES Query msh result dbsqltr query NGS_TES_TI zpan_def msh Sresult SDNC NA TOPO zpan_def msh Viking zpan_def msh Sresultil dbsqltr query c temp o txt Zselect NA Sresultl LandWaterMask zpan_landwatermask status dbclose MGS_MOC_red zpan_def msh HGS_MOLA zpan_def msh MGS_MOLA_CPW zpan_def msh MGS _MOLA_DTED zpan_def msh MGS_TES_albedo zpan_def msh MGS_TES_Query zpan_NGS_TES Query msh NGS_TES_TI zpan_def msh SDNC NA TOPO zpan_def msh Viking zpan_def msh Zselect NA ready _ Hda
258. trows is the number of rows in the desired output image outcols is the number of columns in the desired output image non_valid_pixel amplitude value used to specify a pixel with no data in image Such pixels will not be used in the projection background_level initialize output image to this value before starting the projection process entl2 Cntl2 0 gt compute range of min and max values internally Cntl2 xmin xmax ymin ymax zmin zmax force the use of the provided range of min and max values cntl3 Cntl3 0 gt to map input image into a planar grid with not additional rotation or tilt transormations or cntl3 rot tilt show_base_image show_borders for orthographic projections where rot is rotation of the input image in degrees tilt is a rotation of the input image away from the normal show_base_image and show_borders must be set to zero If this option of cntl3 is used then cntl2 is set to 0 automatically 144e Internal Functions REACT MSHELL User s Manual 11 12 2007 See also Map_Image Map_Images Ml_geo2cart these are external functions that supports intensity mapping from geographic to cartographic Example ProVIEW User s Guide Appendix B Internal Functions 145 The following example illustrates the function Examplel illustrate image2surface with different sampling parameters truth reada eqohare chr char gene
259. turns a NULL value Example cmd Sname Hello World n retval rs_exec rsl1 cmd Svarname Sname Stemp rs_getArray rsl1 varname rs_getArray Retrieves the content of an Array variable Syntax rs_getArray rs1 varname Description This function is used to retrieve the content of an array variable in the remote WIPE Object server If the array variable does not exists the function returns a NULL array Example cmd x scale255 hammiw 128 128 n retval rs_exec rsl1 cmd Svarname x x rs_getArray rsl1 varname rs_wait Waits the number of specified seconds Syntax rs_wait rs1 of seconds Description This function is used after a call to rs_exec_async The number of seconds to wait is passed in to the function If it is 1 this function blocks until the remote server is finished executing the command Otherwise it waits the number of seconds specified If the remote server has not finished executing the command when the number of seconds elapsed it returns 1 otherwise it returns 0 Example ProVIEW User s Guide Appendix B Internal Functions 227 ready wait for 5 seconds loop until server is finished executing command ready while rs_wait rs1 5 server is not finished yet n rw_getInventory Retrieve Inventory XML String Syntax rw_getinventory handle request Description This function works after an rmshell_se
260. used to specify image font type text2image Currently times is the only option M_ptsize Controls the font size to be used when overlaying text to images using the text2image commands the available point sizes are 9 10 12 14 18 and 24 Time Related Variables M_time Returns the system time this variable is read only no value is needed or assigned ready M_time Tue Apr 25 12 04 35 1995 ProVIEW User s Guide Appendix B Internal Functions 163 164e Internal Functions System Related Variables M_cwd M_path M_wdb M_windir M_echo M_prompt M_windir M_proviewdir M_errorscript M_errorstring M_version M_nprint M_xpix M_ypix M_logmode Sets the current working directory For example to set c mydir as the current working directory type M_cwd c mydir The path string assigned to this variable will be searched when trying to open an input file For example to set M_path to the directorys c mshell bin amp c mshell msf type M_path c mshell bin c mshell msf Contains word data base file to use when drawing coast lines using the dworld function This is the windows root directory This toggles the display of executed commands within a script file M_echo 10 causes all commands to be displayed as they are performed M_echo 5 is nominal output M_echo 0 will prohibit all printing including explicit print statements Sets the command prompt text MSHELL
261. valid for real input arrays Example The following demonstrates the process randu 2 2 22 38 randu 2 2 maxr Row Maximum Syntax maxr a Description Computes the maximum for each row of array a and strores these values as a column vector 172e Internal Functions REACT MSHELL User s Manual 11 12 2007 mbox Text Box Syntax mbox string Description Prints to string to a dialog box on the screen mean Mean of Array Elements Syntax mean a or a mean Description This module computes the mean of all the elements in the input array The formula used to compute the mean is 1 S 1 1 a forallj i TS heer eae I J Coo I I where j and i are row and column indices respectively Example The following demonstrates the application ready a randu 2 100 create a matrix of ran num ready mean a 0 503304 median Compute Median Value Syntax median a Description Compute the median value of all the elements in the input array The output is a scalar i e a 1x1 array Example The following demonstrates the process ready a randu 2 100 ready median a 0 502454 medianr Row Wise Median Syntax medianr a or a medianr ProVIEW User s Guide Appendix B Internal Functions 173 Description Compute the median value along each row of the input array The output is a column vector with the number of elements equa
262. value Example The following illustrates the operation ready x 0 3 1 x row0 0 00 1 00 2 00 3 00 ready y gtclipto x 2 999 0 00 1 00 2 00 999 00 gtindex Greater than Index Syntax gtindex a b Description Similar to eqindex but it returns an index to all elements in a greater than b Example The following illustrates the operation ready a geo 2 8 ready a 1 00 2 00 4 00 8 00 16 00 32 00 64 00 128 00 ready gtindex a 8 4 Oi 6 Oi 136e Internal Functions REACT MSHELL User s Manual 11 12 2007 H hammiw Hamming Window Syntax hammiw n m Description Generates a 1 D or 2 D Hamming Window where the nth element in the Hamming Window is defined as 2m w 0 54 PADCE T n n 0 1 2 N 1 This window has side lobes in the frequency domain of 43dB Note the Hamming Window is a special case of the Blackman Harris Window The syntax for generation of a row vector containing the 1 D n element Hamming Window is hammiw n and the syntax for generating the 2 D n x m element Hamming Window is hammiw n m This 2 D array is equivalent to the MSHELL construction hammiw n hammiw m Example Let a be an array with dimensions that are a power of two The following MSHELL command will multiply the array a with a 2 D Hamming Window followed by the 2 D FFT f t2 hammiw nrows a ncols a a help Invokes the Help Utility S
263. varname ufun For example if x is an array variable the following two lines are equivalent 24 e Table of Contents REACT MSHELL User s Manual 11 12 2007 y cos mean x same as y cos x mean The notation in the second line allows us to look at the mean value as an attribute of x If the same computation is needed multiple times and it is over a large array then it is better to same the result in an intermediate variable For example y Itclipto x x max x max 2 can be more efficiently written as xtheshold x max 2 y Itclipto x xthreshold xthreshold Comments Delimiters Statements enclosed between and are ignored by the interpreter This is used to place comments in a script file or to prevent the execution of the line or lines between the comment delimiters For example a valid group of statements that make use of comment delimiters is Compute the magnitude of the FFT on image x x abs fft2 x The delimiter can be used to create single line comments in a script file e g x fft2 x note compute the 2D FFT of x Operator Type and Precedence The following operator symbols are defined within MSHELL Most of them are used in algebraic operations The precedence of operators increases as we move down the list with operators within the same line having the same precedence assignment operator row augmentation or string concatenation column augmentation array addition and
264. w in the class A or B or C or D or E b preg_match a pattern print INPUT STRING n Sa n Appendix B Internal Functions 193 SEARCH PATTERN is pattern n nOUTPUT of preg_match i e b text n b text n nOUTPUT of preg_match i e float2str b S 0 n Note repeating sequences are specified by the regular expression quantifiers n i e n print 2 specifies 0 or 1 n print ii specifies 0 or more n print specifies 1 or more n print n specifies exactly n times n print n m specifies at least n no more than m times print n specifies at least n times n pattern LAR AB b preg_match a pattern print INPUT STRING n Sa n print SEARCH PATTERN is pattern n print nOUTPUT of preg_match i e b text n b text print nOUTPUT of preg_match i e b n float2str b S 0 n pattern T E 3 MP b preg_match a pattern print INPUT STRING n Sa n print SEARCH PATTERN is S pattern n print nOUTPUT of preg_match i e b text n b text n print nOUTPUT of preg_match i e biner float2Zstri by S0f INNA pattern IMG_ the above pattern is looking for IMG_ followed by one or more non commas characters and then a comma b preg_match a pattern print INPUT STRING n Sa n print SEARCH PATTERN is pattern n print nOUTPUT of preg_match i e b text n b text n print nOU
265. wer or Equal Index Syntax leindex a b Description Similar to eqindex but returns an index to all elements in a lower than or equal to b Example Using the array a previously defined in leclipto ready a randu 1 7 ready leindex a 5 row 0 0 00 0 00i 1 00 0 00i 3 00 0 00 linterp Linear Interpolation Syntax linterp f x Description Linearly interpolates between data points located on a one dimensional grid The function argument f is a 1 dimensional row vector with an assumed interpixel distance of 1 along the axis i e the element values of f can be considered the ordinate values for some function over a set of increasing or decreasing abscissa values The argument x is a real 1 Dimensional row vector 154e Internal Functions REACT MSHELL User s Manual 11 12 2007 containing values of the abscissa for which ordinate values are to be linearly interpolated For every point that extrapolation is attempted the result is set to zero Example The following two examples illustrate the function ready f hammiw 1 4 ready f 10 0 X row 0 assumed abscissa values of Oj Lp 525 ready ready 0 50 0 00 0 50 1 00 1 50 2 00 2 50 3350 ready linterp f x 0 00 0 01 0 02 0 04 0 00 ready 0 2 ready linterp f y 0 01376 load Loads saved arrays or strings from a file Syntax load savefile Description Loads arrays or strings
266. word_comment handle keyname Description Returns keyword comment string for keyname Example The following MSHELL statement will compute the ProVIEW User s Guide Appendix B Internal Functions 115 ready handle fits_open_file C NXEROS_0001 XRS00053 FIT Le WETS ready Skeyname fits_read_keyword_name handle keynum keynum 647 ready Skeycomment fits_read_keyword_comment handle keyname ready Skeycomment label for field 173 fits_get_size Returns the of rows and columns Syntax size fits_get_size handle Description Returns the number of rows and columns in the current FITS file Size 0 0 number if rows and Size 0 1 number of columns Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT mM Mets ready size fits_get_size handle ready size 124 0 195 0 fits_get_colnum Returns the column of a fits file Syntax colinfo fits_get_colnum handle template_ name Description Returns a vector of columns and a string list in colinfo text of colnames newline separated if more than one column match the pattern template_name is the exact name of the column to be searched for or it may contain a wild card character or or it may contain the integer number of the desired column with the first column 1 Example ready handle fits_open_file C NXEROS_0001 XRS00053 FIT Ta fits ready colinfo fits_get_colnum x me
267. x corresponds to the abscissa values and the second argument y corresponds to the ordinate values i e a plot of y versus x will result Hence for the case that y is complex plot y is equivalent to plot real y imag y See Also M_ for a complete list of system variables which affect the plot function Example The following MSHELL instructions generate two ramp vectors in memory x and y and plot sin y as a function of cos x see Figure below and code following ProVIEW User s Guide Appendix B Internal Functions 187 Figure 5 1886 Internal Functions ready ready ready ready ready x 0 3 14159 5 0 1 oe SS M_ylabel sin y M_xlabel cos x plot sin y cos x REACT MSHELL User s Manual 11 12 2007 plot3d 3 D Plot or Mesh Plot Syntax plot3d z Description This function generates a hidden line surface plot using the values of an input array z The plot3d function requires as arguments a real array z with two or more rows and two or more columns You can also provide a row and column axis vector for annotation The parameter in the plot function is an optional integer 0 to 255 that selects the plot screen where the plot will be placed If an integer number from 0 to 255 is provided in this field the generated plot can be indexed from then on by that number For example if x is an array
268. x B Internal Functions 239 Pom Bet Gite Aydos mtos Maie thet te ia aaay oia gt ii Ure 10 Ca 18 shp2image Shapefile to Image Syntax shp2image filename image bbox recn mode Description This function is useful when performing polygon fill of shapefile records of type 5 polygons Note the function shp2fillimage ends up calling this function filename is a string containing the name of the shapefile file image is an array variable used as input to the polygon fill routine it serves as a background image bbox is a 1x4 array containing the bounding box of the region of interest Xmin Ymin Xmax Ymax bbox text optional input containing the proj4 string that describes the coordinate system of the vector features Note This option will be executed as long as there is a valid prj file associated with the shape file The prj file can contain a WKT well known text representation of the coordiate system recn can be a Nx2 array a Nx1 array or 0 and mode is a value that determines the type of output generated 0 fill polygon 1 fill polygon using shapefile record id as the fill value and 2 region add The following examples show the different modes in action Mode 0 Polygon Fill This mode works exactly as shp2fillimage If recn is a Nx2 array for each row the first column contains the shapefile record id and
269. xample The following demonstrates the process non ready ncvarattval temp nc Temperature dtgymd 19981012 newrite NetCDF Write Variable Syntax newrite fname varname img ncstart ncedges 182e Internal Functions REACT MSHELL User s Manual 11 12 2007 Description Writes array img to an existing variable varname in NetCDF file fname The parameters ncstart and ncedges determine what position to start writing in the variable and how much to write in each dimension For an N dimensional NetCDF variable ncstart and ncedges must be 1xN Example The following demonstrates the process The values 1 2 3 are written to the beginning of the first row in the 2 D variable myvariable in NetCDF file temp nc newriteatt NetCDF Write Attribute Syntax newriteatt fname varname attname value or newriteatt iname varname atiname strvalue Description Creates or modifies the value of attribute attname associated with variable varname If varname is empty string the attribute is added to the global attributes of the NetCDF file A floating point value value or a string strvalue can be written Example The following will demonstrates the process ready ncwriteatt newfile nc myvariable version 3 0 ready non newriteatt newfile nc myvariable Units degrees C neqindex Non Equality Index Syntax neqindex a b
270. xis value M_znice Similar to M_xnice but for z axis M_ztic Similar to M_xtic but for z axis M_xorigin x offset for the left of the plot output M_yorigin y offset for the top of the plot output M_xlen length of x axis units M_ylen length of y axis units M_zlen length of z axis units M_sym point symbols used when M_linetype is zero 1 squares with a top center tickmark 2 circles with a a top center tickmark 3 triangles with a top center tickmark 4 Y shaped marks 5 X shaped marks 6 diamonds with a top center tickmark 7 little umbrella looking symbols 8 little hourglass looking symbols 9 Z shaped marks 10 squares corner ticks and upper right to center tick 11 asterisks 12 plus symbols 13 diamonds M_height Font height of plot axis annotations M_panel For plot3d draw vertical lines on the front panels M_plotcolor graylevel 0 255 of plotting output REACT MSHELL User s Manual 11 12 2007 M_ndigits reserved M_xdigits reserved M_ydigits reserved M_zdigits reserved M_scalef reserved M_deltac reserved M_deltar reserved M_digits reserved M_contour_view reserved M_edit reserved Text Output M_format Controls the number of digits used when printing values to the Command Line Window screen For example M_format 00 000 specifies that the largest value that can be represented excluding the exponent is 99 999 Anything larger than this is printed as 4 M_ifont
271. xpression involving variables internal functions and calls to script functions Multiple statements can be typed in the same physical line if they are separated by a semicolon For example ready x 4 y x 4 z cos y is a legal statement A statement may expand over more than one physical line if a delimiter is used to indicate a continuation line e g x cos x y sin x y Tabs spaces and linefeeds are ignored by the interpreter An intuitive mathematical syntax is followed by the interpreter allowing you to input the expressions in a form similar to the their actual mathematical representation In general expressions which do not involve an assignment will print the result to the screen e g ready 3 4 5 A broad representation of numbers consistent with most computer languages is allowed The following are valid number representations 4 0 1 44 044 34 89F4 34 89e10 Calling Syntax for Numeric Functions The output of most of the numeric functions can be used as direct inputs to other numeric function e g X abs log 10 fft2 x Notice that you do not have to worry about the implicit dimensions of x and if it is either real or complex If a function can not handle a complex input it will return an error message Unary Numeric Function Syntax In general when using a function with only one input argument a MSHELL unary function the following two statements are equivalent ufun varname
272. y DDElnit and cmd is a string you want the server to execute DDEExec will return 0 if the server accepted the command 1 otherwise DDEPoke this command is used to request the server application to accept an unsolicited data item value Syntax DDEPoke chan item val chan is the channel number returned by DDE Init item is a string that identifies the data item you wish to send a value for and val is a string containing the value DDEpoke will return 0 if the server accepted the data item value 1 otherwise DDERegS this command is used to request the server application to provide the value of a data item Syntax var DDERegS chan item var is a MSHELL string variable chan is the channel number returned by DDEInit and item is a string that identifies the data item you are requesting the value of Table of Contentse 41 DDERedqV this command is used to request the server application to provide the value of a data item Syntax var DDEReqV chan item var is a MSHELL array variable chan is the channel number returned by DDEInit and item is a string that identifies the data item you are requesting the value of Example Using MSHELL scripting language path M NEWINDEX BYACCESS Sdatabase CL_0001 Open Database xf chanl DDEInit MSAccess System Scommand OpenDatabase path database MDB Scommand DDEExec c DDETerm chan1 hanl command Query Database
273. y then contour3 z 0 5 0 75 will plot a contour plot of array z on plot screen number 3 using for contour levels 0 5 and 0 75 The second way of calling contour allows to specify the values to use in for the x axis and y axis If later on you want to free that screen type free plot3 See Also M_ for a complete list of system variables which affect the plot related functions Example The following MSHELL instructions generate a 32 x 32 hamming function which is then stored in x and then used to generate a contour plot of x ready M_xlabel row index M_ylabel column index ready x hammiw 32 32 ready contourl0 x x min x max x min 0 1 0 3 ready contour x 0 31 1 10 0 31 1 0 1 0 5 convol Discrete Convolution Syntax convol k a Description This function performs the discrete convolution of a given array a with a kernel array k The implementations used in convol and convolt are computationally efficient for small kernel sizes However for large kernels an FFT implementation of the convolution should be considered Given an image and the right kernel this function can be used to change the spatial resolution in the image Given that array a has dimensions N x M 4 0 Qo Aom aio aia o Aima a gt gt x Anao Oynai 4y 1 m 1 it is assumed that a is zero for any index outside of the implicit range specified above
274. ylindrical nic chamb ChamberlinTrimetric kav5 KavraiskyV collg Collignon kav7 Kavraisky VII crast CrasterParabolic PutninsP4 labrd Laborde denoy DenoyerSemi Elliptical laea LambertAzimuthalEqualArea eck1 EckertI lagrng Lagrange eck2 EckertII larr Larrivee eck3 EckertIII lask Laskowski eck4 EckertIV latlong Lat long Geodetic eck5 EckertV longlat Lat long Geodetic eck6 EckertVI Icc LambertConformalConic eqc EquidistantCylindrical PlateCaree leac LambertEqualAreaConic eqdc EquidistantConic lee_os LeeOblatedStereographic euler Euler loxim Loximuthal fahey Fahey Isat SpaceobliqueforLANDSAT REACT MSHELL User s Manual 11 12 2007 mbt_s McBryde ThomasFlat PolarSine No 1 robin Robinson mbt_fps McBryde ThomasFlat PoleSine No 2 rpoly RectangularPolyconic mbtfpp McBride ThomasFlat PolarParabolic sinu Sinusoidal Sanson Flamsteed mbtfpq McBryde ThomasFlat PolarQuartic somerc Swiss Obl Mercator mbtfps McBryde ThomasFlat PolarSinusoidal stere Stereographic merc Mercator tec TransverseCentralCylindrical mil_os MillerOblatedStereographic tcea TransverseCylindricalEqualArea mill MillerCylindrical tissot Tissot mpoly ModifiedPolyconic tmerc TransverseMercator moll Mollweide tpeqd TwoPointEquidistant murd MurdochI tpers Tiltedperspective murd2 MurdochlII ups UniversalPolarStereographic murd3 MurdochliI urmS UrmaevV nell Nell urmfps UrmaevFlat PolarSinusoidal nell_h Nell Hammer utm
275. yntax help topic Description You can invoke the help utility directly from the command line An optional topic argument can be provided to search for help on that topic Example For help on the cos function type from the command line help cos heqlut Histogram Equalization LUT Syntax heqlut a or a heqlut Description Computes the 256 entry 8 bit look up table or intensity transformation which when applied to the input image a will result in a more uniform distribution of intensity value Example An image x can be subjected to the heqlut intensity transformation prior to display using the following MSHELL instructions ProVIEW User s Guide Appendix B Internal Functions 137 weolut3 ones 1 3 heqlut X select wcolut3 Note that selecting wcolut3 does not change the content of the actual image in memory only the way that it is displayed hist Histogram Generator Syntax hist a amin amax n Description This is a general purpose histogram generation subroutine It performs a histogram value of the element in the source input array The elements on the input array are first transformed by a linear equation which determines the range of the data to histogram and the number of bins on that range where a is the input array amin and amax are the extreme values and n is the number of levels over which the input will be grouped This function is particularly useful with floating point
276. ype xmin ymin xmax ymax If the shape file has an associated prj file then info text will contain any coordinate system information e g the Well Known Text or WKT string Example shpwriteroi Copy a subset of a shapefile Syntax shpwriteroi shpfile dstshpfile bbox Description Copies the specified bounding box from shpfile to a newly created shape file dstshpfile Where bbox xmin ymin xmax ymax shiftt Shift an Array or Image Syntax shiftt a row col Description This function is used to shift or translate an input array or image by a specified number of columns and rows The shift is non cyclic i e border pixels will not wrap around Note that the values of row and col must be non negative Example The example on the next page generates an array and then applies the shifte and shiftt functions ProVIEW User s Guide Appendix B Internal Functions 243 Syntax Description ready x int randu 3 3 10 of random ready x and 10 10 0 X row 0 3 00 00 2 00 row 1 9 00 00 1 00 row 2 2 00 5 00 8 00 ready shiftc x 1 0 down 10 0 X row 0 2 00 row 1 3 00 row 2 9 00 3 00 1 00 ready shiftt x 0 1 column right 10 0 X row 0 0 00 row 1 0 00 row 2 0 00 show generate a 3 x 3 array integers between 1 cyclic shift one row translation one Display Variables Information show variable or list of var
277. zero value and the text attribute can be used to retrieve a brief description of the error Example see rw_getInventory example ProVIEW User s Guide Appendix B Internal Functions 219 rmshell_getvar Get an ARRAY variable from the remote MSHELL Syntax rmshell_getvar handle varname Description This function works after an rmshell_session_init and can be used to retrieve the content of an ARRAY variable defined in the remote MSHELL interpreter It takes tow arguments a valid string handle to a previously opened remote MSHELL interpreter and the name of the ARRAY variable we want to retrieve the content If the specified variable does not exist or if an error occurs it returns a NULL array and the text attribute can be used to retrieve a brief description of the error Example The following example shows most of the remote MSHELL functions being utilized on a simple test case 220e Internal Functions REACT MSHELL User s Manual 11 12 2007 opening Remote MSHELL session Ssrvr rmshell_session_init 212 48 10 150 if srvr print Error opening Remote MSHELL session return hammiw 256 256 Ss I like pineapples whenever status is a non zero value its text attribute can be used to retrive a brief description of the error status rmshell_putvar Ssrvr x if status status text return status rmshell_putvarS Ssrvr Ss performing operations

Download Pdf Manuals

image

Related Search

Related Contents

ZyXEL ZyWALL USG 1000    User Manual - Rohrback Cosasco Systems  BEDIENUNGSANLEITUNG  1013-129 Retractable-AZM02_Amazon  RAR501 - Oregon Scientific UK  Frame It All 300001211 Instructions / Assembly  Euro-Pro KP170E User's Manual  Black & Decker 90512417 Instruction Manual  

Copyright © All rights reserved.
Failed to retrieve file