tcl-nap-users Mailing List for Tcl NAP (Page 2)
Brought to you by:
dav480,
peter_turner
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
(3) |
Mar
(22) |
Apr
|
May
(7) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <Har...@cs...> - 2006-05-05 00:16:19
|
-----Original Message----- From: Davies, Harvey (CMAR, Aspendale)=20 Sent: Thursday, 4 May 2006 10:33 To: 'salah jubeh' Subject: RE: [Tcl-nap-users] index =20 -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Wednesday, 3 May 2006 17:47 To: NAP Subject: [Tcl-nap-users] index =20 Hi all =20 i would like to ask how can i use indeces to calculate statistical function for the whole image like mean , percentile , mode ... =20 For example I tried to calulate the max value for an aray extarcted from an hdf file i do that on two steps =20 nap "result=3D [nap_get hdf $img_src [nap_get hdf -list $img_src {^[^:]*$}]]"; =20 nap "min1 =3D [nap "min(min(result))"]" nap "max1 =3D [nap "max(max(result))"]" =20 [>>>] The simplest and most general method is to reshape the array to a vector as in the following: [>>>] nap "vector =3D reshape(result)" [>>>] [nap "min(vector)"] [>>>] [nap "max(vector)"] [>>>]=20 [>>>] For simple reduction functions (e.g. max()) you can avoid creating another array by looping as follows: [>>>] nap "max1 =3D result" [>>>] while {[$max1 rank] > 0} { [>>>] nap "max1 =3D max(max1)" [>>>] } |
From: salah j. <s_...@ya...> - 2006-05-03 07:46:42
|
Hi all i would like to ask how can i use indeces to calculate statistical function for the whole image like mean , percentile , mode ... For example I tried to calulate the max value for an aray extarcted from an hdf file i do that on two steps nap "result= [nap_get hdf $img_src [nap_get hdf -list $img_src {^[^:]*$}]]"; nap "min1 = [nap "min(min(result))"]" nap "max1 = [nap "max(max(result))"]" --------------------------------- Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates. |
From: salah j. <s_...@ya...> - 2006-03-24 16:13:05
|
Hi I have an application that have many users, suppose that one guy is processing a large volume of data that's mean the second user have to wait until the Job is finished for the first request. in NAP how can i solve this i thought of using threads ,but i don't know if this library is a thread safe or if it is Multi threaded library. how can i solve this issue. Thanks in advance --------------------------------- Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates. |
From: salah j. <s_...@ya...> - 2006-03-22 19:45:19
|
I have developed an application using NAP for image processing, i want to enhance the performance of this application, i have many users using this application i want to know if nap is a multithreded package. Best Regard Eng. Salah Al Jubeh MCP,MCAD,MCSD Mobile:00306947192421 --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: <Pet...@cs...> - 2006-03-19 23:04:32
|
Hi Salah, =20 This can be a bit tricky the bottom line is to make the last thing in the procedure the result and do not assign it to anything. If you are using the procedure as a nap function then you can use return to return the result. =20 proc st {} { nap "{1 2 3 4}" } =20 nap img =3D [st] =20 will work =20 nap img =3D st() =20 will not work because the function must have at least 1 argument =20 proc st1 {a} { =20 nap "{1 2 3 4}" } =20 =20 nap img =3D st1(3) =20 or=20 =20 nap img =3D [st1 3] =20 will work. =20 When using procedures as nap functions the function parameters are separated by , and must be NAOs. The result should also be a nao. Procedures can return a NAO, however, you need to do something like the first example to return a result. If the result was in a NAO called say "a" then put "nap a" as the last statement in the procedure. =20 =20 Cheers =20 Peter T =20 =20 =20 =20 -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Saturday, 18 March 2006 7:57 AM To: NAP Subject: [Tcl-nap-users] return NAO object =20 Hi again=20 is there is a way to return a NAO out of function =20 proc set_data { img} { nap "$img =3D {1 2 3 4 _}" } set_data data $data =20 _____ =20 Yahoo! Mail Bring photos to life! New PhotoMail <http://pa.yahoo.com/*http:/us.rd.yahoo.com/evt=3D39174/*http:/photomail.= m ail.yahoo.com> makes sharing a breeze.=20 |
From: salah j. <s_...@ya...> - 2006-03-17 20:56:49
|
Hi again is there is a way to return a NAO out of function proc set_data { img} { nap "$img = {1 2 3 4 _}" } set_data data $data --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: salah j. <s_...@ya...> - 2006-03-15 21:02:31
|
Hi peter The problem was the data type , i am working with U16 so when i use NDVI the range suppose to be from -1 to 1. what was happinning is that when i subtract two numbers like thes 250 -256 i get the missing value which is 64k after that this value is used again to calculate the NDVI I.E 250 - 254 / 250+254 --------> 65536/504 Pet...@cs... wrote: RE: [Tcl-nap-users] Missing values Hi Sala, nap ndvi = 0.0/0.0 $ndvi _ This sets x to NaN (not a number) 1.0/0.0 generates Inf. The default missing value for float is NaN. You could use nap ndvi = isnan(ndvi) ? maxval : ndvi to fix the problem Cheers Peter T -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Monday, 13 March 2006 8:32 PM To: NAP Subject: [Tcl-nap-users] Missing values Hi all While doing some image analysis i did NDVI "near-red/near+red" , some pixel values of both images has zero value thats mean (0-0)/(0-0) afetr thai i trid to get the max but i get a strange result. how can i get the max value in that case. Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. |
From: <Pet...@cs...> - 2006-03-15 00:06:40
|
Hi Salah, I apologise, in my last email I missed the h in your name. In relation to this problem I do not understand how the gdalinfo relates to the HDF file structure. Suggest using hdp, or use the HDF GUI in Nap to compare the structure of the HDF files. I think you have lost the coordinate variables associated with green (scale variables). You can also check green by: puts "[$green header]" this will show if coordinate variables attached to green. However, once you do this the NAO associated with green will be lost because you "set green [nap_get ...]" instead of " nap green =3D [nap_get ...]" Cheers Peter T -----Original Message----- From: salah jubeh [mailto:s_...@ya...]=20 Sent: Friday, 10 March 2006 8:48 PM To: Turner, Peter (CMAR, Hobart); tcl...@li... Subject: RE: [Tcl-nap-users] writing HDF files Hi Peter=20 =20 Thanks for advice it was a simple test and also i am anew tcl Programmer. i think you have seen my second post which is again has a title write hdf. =20 Today i test the result of this code with gdalinfo tool =20 set green [nap_get hdf green.hdf "3-dimensional Scientific Dataset"] set TM [nap_get hdf green.hdf :TransformationMatrix] set PR [nap_get hdf green.hdf :Projection] set AP [nap_get hdf green.hdf :AREA_OR_POINT] set TIFFS [nap_get hdf green.hdf :TIFFTAG_SOFTWARE] set TIFFX [nap_get hdf green.hdf :TIFFTAG_XRESOLUTION] set TIFFY [nap_get hdf green.hdf :TIFFTAG_YRESOLUTION] set TIFFU [nap_get hdf green.hdf :TIFFTAG_RESOLUTIONUNIT] $green hdf test.hdf "3-dimensional Scientific Dataset" $TM hdf test.hdf ":TransformationMatrix" $PR hdf test.hdf ":Projection" $AP hdf test.hdf ":AREA_OR_POINT" $TIFFS hdf test.hdf ":TIFFTAG_SOFTWARE" $TIFFX hdf test.hdf ":TIFFTAG_XRESOLUTION" $TIFFY hdf test.hdf ":TIFFTAG_YRESOLUTION" $TIFFU hdf test.hdf ":TIFFTAG_RESOLUTIONUNIT" =20 The too images suppose to be identical but the result was not as i expected. =20 The origenal image information " green.hdf" C:\projects\gdal-1.3h\apps>gdalinfo.exe c:\tclhttpd\htdocs\raster\data\green.hdf Driver: HDF4Image/HDF4 Dataset Size is 615, 529 Coordinate System is: PROJCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Projection Name =3D Transverse Mercator Uni", GEOGCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Unable to match Ellipsoid (Datum) to a Ge", DATUM["unknown", =09 SPHEROID["unnamed",6378137,298.2572220960423]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433]], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin",0], PARAMETER["central_meridian",24], PARAMETER["scale_factor",0.9996], PARAMETER["false_easting",500000], PARAMETER["false_northing",0], UNIT["metre",1, AUTHORITY["EPSG","9001"]]] Origin =3D (477701.230832,3928005.705781) Pixel Size =3D (0.63939200,-0.63939200) Metadata: Signature=3DCreated with GDAL (http://www.remotesensing.org/gdal/) TransformationMatrix=3D477701.230832, 0.639392, 0.000000, 3928005.705781, 0.0000 00, -0.639392 Projection=3DPROJCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Projection Name =3D Transverse Mercator Uni",GEOGCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Unable to match Ellipsoid (Datum) to a Ge",DATUM["unknown",SPHEROID["unnamed",63 =09 78137,298.2572220960423]],PRIMEM["Greenwich",0],UNIT["degree",0.01745329 25199433 =09 ]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],P ARAMETER =09 ["central_meridian",24],PARAMETER["scale_factor",0.9996],PARAMETER["fals e_eastin =09 g",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG" ,"9001"] ]] AREA_OR_POINT=3DArea TIFFTAG_SOFTWARE=3DIMAGINE TIFF Support Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: etif.c $ $Revision: 1.10.1.9 $ $Date: 2003/11/13 19:25:49EST $ TIFFTAG_XRESOLUTION=3D1 TIFFTAG_YRESOLUTION=3D1 TIFFTAG_RESOLUTIONUNIT=3D1 (unitless) Corner Coordinates: Upper Left ( 477701.231, 3928005.706) Lower Left ( 477701.231, 3927667.467) Upper Right ( 478094.457, 3928005.706) Lower Right ( 478094.457, 3927667.467) Center ( 477897.844, 3927836.587) Band 1 Block=3D615x1 Type=3DUInt16, ColorInterp=3DGray=20 The result image information " test.hdf" =20 C:\projects\gdal-1.3h\apps>gdalinfo.exe c:\tclhttpd\htdocs\raster\data\test.hdf Driver: HDF4Image/HDF4 Dataset Size is 615, 529 Coordinate System is `' Metadata: TransformationMatrix=3D477701.230832, 0.639392, 0.000000, 3928005.705781, 0.0000 00, -0.639392 Projection=3DPROJCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Projection Name =3D Transverse Mercator Uni",GEOGCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Unable to match Ellipsoid (Datum) to a Ge",DATUM["unknown",SPHEROID["unnamed",63 =09 78137,298.2572220960423]],PRIMEM["Greenwich",0],UNIT["degree",0.01745329 25199433 =09 ]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],P ARAMETER =09 ["central_meridian",24],PARAMETER["scale_factor",0.9996],PARAMETER["fals e_eastin =09 g",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG" ,"9001"] ]] AREA_OR_POINT=3DArea TIFFTAG_XRESOLUTION=3D1 TIFFTAG_YRESOLUTION=3D1 TIFFTAG_RESOLUTIONUNIT=3D1 (unitless) _FillValue=3D65535 Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0, 529.0) Upper Right ( 615.0, 0.0) Lower Right ( 615.0, 529.0) Center ( 307.5, 264.5) Band 1 Block=3D615x1 Type=3DUInt16, ColorInterp=3DGray This is the reason that i can not see my image. because i define the extent in my bviewer and the new image has extent 0,0,615,520 insted of 477701.230832036580,3927667.467451686000,478094.456867, 3928005.70578=20 =20 I want to ask why this happen, how can i create anew image have the same meta data but diffrent cell values. =20 =20 Pet...@cs... wrote: Hi salah, =20 You seem to have sorted out how to write multiple SDSs and attributes.=20 I am not sure if you are aware but you need to be careful mixing NAOs and tcl commands. Your example below is a bit dangerous if you want to use x for anything else. NAOs have a reference count which counts the number of tcl variables pointing at them. If the NAO reference count goes to 0 then the NAO kills itself. In order to create a relationship between the NAO and a tcl variable the nap command needs to be used: nap x =3D [nap_get hdf .......] In the above case the NAO will have a reference count of 1 and be attached to x so that if x gets unset the reference count on the NAO will be decremented and if the reference count is zero it will disappear. In your example, although x points to the NAO the reference count on the NAO will be 0. In this case the NAO is a bit smart an says, hey, you just created me, even though I have a zero reference count I must be needed for something so I will hang around until something happens. In your case you wrote straight back to an HDF file. However, once that event happened the NAO will disappear so trying to do anything further with x/NAO will not work. It is important to understand this, because if you do not you can get into lots of trouble. You cannot get rid of the fillvalue at present using nap. I doubt that this is causing a problem. I would just check the contents of the output file with hdp, I would then use the NAP HDF display utility to have a look at the contents of each file and make sure there is nothing else wrong. Cheers Peter -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Wednesday, 8 March 2006 11:03 PM To: NAP Subject: [Tcl-nap-users] writing HDF files Hi guys =20 I tried to genarate HDF files out of NAOs. =20 set x [nap_get hdf c:/sampels/p14/gdal/p14_4.hdf "3-dimensional Scientific Dataset"] $x hdf sa.hdf sa nap_get hdf -list sa.hdf ------- sa sa:_FillValue I want to ask how i can add SDS to the file like transformation matrix and projection.=20 =20 Regards =20 Yahoo! Mail Use Photomail <http://us.rd.yahoo.com/mail_us/taglines/pmall2/*http://photomail.mail.y ahoo.com> to share photos without annoying attachments. Yahoo! Mail Bring photos to life! New PhotoMail <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=3D39174/*http://photomai= l .mail.yahoo.com> makes sharing a breeze.=20 |
From: <Pet...@cs...> - 2006-03-14 23:58:28
|
Hi Sala, nap ndvi =3D 0.0/0.0=20 $ndvi _ This sets x to NaN (not a number) 1.0/0.0 generates Inf. The default missing value for float is NaN.=20 You could use nap ndvi =3D isnan(ndvi) ? maxval : ndvi to fix the problem Cheers Peter T -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Monday, 13 March 2006 8:32 PM To: NAP Subject: [Tcl-nap-users] Missing values Hi all =20 While doing some image analysis i did NDVI "near-red/near+red" , some pixel values of both images has zero value thats mean (0-0)/(0-0) afetr thai i trid to get the max but i get a strange result. =20 how can i get the max value in that case. =20 =20 =20 =20 Yahoo! Mail Bring photos to life! New PhotoMail <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=3D39174/*http://photomai= l .mail.yahoo.com> makes sharing a breeze.=20 |
From: salah j. <s_...@ya...> - 2006-03-13 09:37:41
|
I needed to do linear fuzzy logic membership so i wrote this function proc i_linear {data low high} { nap "m = 1f /(high-low)" nap "b = -1f * low * m" nap "data <= low ? 0.0 : data >= high ? 1.0 :m*data + b" } proc d_linear {data low high} { nap "m = 1f /(high-low)" nap "b = -1f * low * m" nap "data <= low ? 1.0 : data >= high ? 0.0 :m*data + b" } proc linear {data a b c d} { #slope and intercept for 1st equation nap "m1 = 1f /(b-a)" nap "b1 = -1f * a * m1" #slope and intercept for 2st equation nap "m1 = 1f /(c-d)" nap "b1 = -1f * d * m2" nap "data <= a && data >=d ? 0.0 : data >= b && data <= c ? 1.0 : data >= a && data <= b ? m1 * data + b1 : m2 * data + b2 } I did not test very carfully so ... --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: salah j. <s_...@ya...> - 2006-03-13 09:31:57
|
Hi all While doing some image analysis i did NDVI "near-red/near+red" , some pixel values of both images has zero value thats mean (0-0)/(0-0) afetr thai i trid to get the max but i get a strange result. how can i get the max value in that case. --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: salah j. <s_...@ya...> - 2006-03-10 09:47:48
|
Hi Peter Thanks for advice it was a simple test and also i am anew tcl Programmer. i think you have seen my second post which is again has a title write hdf. Today i test the result of this code with gdalinfo tool set green [nap_get hdf green.hdf "3-dimensional Scientific Dataset"] set TM [nap_get hdf green.hdf :TransformationMatrix] set PR [nap_get hdf green.hdf :Projection] set AP [nap_get hdf green.hdf :AREA_OR_POINT] set TIFFS [nap_get hdf green.hdf :TIFFTAG_SOFTWARE] set TIFFX [nap_get hdf green.hdf :TIFFTAG_XRESOLUTION] set TIFFY [nap_get hdf green.hdf :TIFFTAG_YRESOLUTION] set TIFFU [nap_get hdf green.hdf :TIFFTAG_RESOLUTIONUNIT] $green hdf test.hdf "3-dimensional Scientific Dataset" $TM hdf test.hdf ":TransformationMatrix" $PR hdf test.hdf ":Projection" $AP hdf test.hdf ":AREA_OR_POINT" $TIFFS hdf test.hdf ":TIFFTAG_SOFTWARE" $TIFFX hdf test.hdf ":TIFFTAG_XRESOLUTION" $TIFFY hdf test.hdf ":TIFFTAG_YRESOLUTION" $TIFFU hdf test.hdf ":TIFFTAG_RESOLUTIONUNIT" The too images suppose to be identical but the result was not as i expected. The origenal image information " green.hdf" C:\projects\gdal-1.3h\apps>gdalinfo.exe c:\tclhttpd\htdocs\raster\data\green.hdf Driver: HDF4Image/HDF4 Dataset Size is 615, 529 Coordinate System is: PROJCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Projection Name = Transverse Mercator Uni", GEOGCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Unable to match Ellipsoid (Datum) to a Ge", DATUM["unknown", SPHEROID["unnamed",6378137,298.2572220960423]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433]], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin",0], PARAMETER["central_meridian",24], PARAMETER["scale_factor",0.9996], PARAMETER["false_easting",500000], PARAMETER["false_northing",0], UNIT["metre",1, AUTHORITY["EPSG","9001"]]] Origin = (477701.230832,3928005.705781) Pixel Size = (0.63939200,-0.63939200) Metadata: Signature=Created with GDAL (http://www.remotesensing.org/gdal/) TransformationMatrix=477701.230832, 0.639392, 0.000000, 3928005.705781, 0.0000 00, -0.639392 Projection=PROJCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Projection Name = Transverse Mercator Uni",GEOGCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Unable to match Ellipsoid (Datum) to a Ge",DATUM["unknown",SPHEROID["unnamed",63 78137,298.2572220960423]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433 ]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER ["central_meridian",24],PARAMETER["scale_factor",0.9996],PARAMETER["false_eastin g",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"] ]] AREA_OR_POINT=Area TIFFTAG_SOFTWARE=IMAGINE TIFF Support Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: etif.c $ $Revision: 1.10.1.9 $ $Date: 2003/11/13 19:25:49EST $ TIFFTAG_XRESOLUTION=1 TIFFTAG_YRESOLUTION=1 TIFFTAG_RESOLUTIONUNIT=1 (unitless) Corner Coordinates: Upper Left ( 477701.231, 3928005.706) Lower Left ( 477701.231, 3927667.467) Upper Right ( 478094.457, 3928005.706) Lower Right ( 478094.457, 3927667.467) Center ( 477897.844, 3927836.587) Band 1 Block=615x1 Type=UInt16, ColorInterp=Gray The result image information " test.hdf" C:\projects\gdal-1.3h\apps>gdalinfo.exe c:\tclhttpd\htdocs\raster\data\test.hdf Driver: HDF4Image/HDF4 Dataset Size is 615, 529 Coordinate System is `' Metadata: TransformationMatrix=477701.230832, 0.639392, 0.000000, 3928005.705781, 0.0000 00, -0.639392 Projection=PROJCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Projection Name = Transverse Mercator Uni",GEOGCS["IMAGINE GeoTIFF Support Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved @(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $ Unable to match Ellipsoid (Datum) to a Ge",DATUM["unknown",SPHEROID["unnamed",63 78137,298.2572220960423]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433 ]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER ["central_meridian",24],PARAMETER["scale_factor",0.9996],PARAMETER["false_eastin g",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"] ]] AREA_OR_POINT=Area TIFFTAG_XRESOLUTION=1 TIFFTAG_YRESOLUTION=1 TIFFTAG_RESOLUTIONUNIT=1 (unitless) _FillValue=65535 Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0, 529.0) Upper Right ( 615.0, 0.0) Lower Right ( 615.0, 529.0) Center ( 307.5, 264.5) Band 1 Block=615x1 Type=UInt16, ColorInterp=Gray This is the reason that i can not see my image. because i define the extent in my bviewer and the new image has extent 0,0,615,520 insted of 477701.230832036580,3927667.467451686000,478094.456867, 3928005.70578 I want to ask why this happen, how can i create anew image have the same meta data but diffrent cell values. Pet...@cs... wrote: Hi salah, You seem to have sorted out how to write multiple SDSs and attributes. I am not sure if you are aware but you need to be careful mixing NAOs and tcl commands. Your example below is a bit dangerous if you want to use x for anything else. NAOs have a reference count which counts the number of tcl variables pointing at them. If the NAO reference count goes to 0 then the NAO kills itself. In order to create a relationship between the NAO and a tcl variable the nap command needs to be used: nap x = [nap_get hdf .] In the above case the NAO will have a reference count of 1 and be attached to x so that if x gets unset the reference count on the NAO will be decremented and if the reference count is zero it will disappear. In your example, although x points to the NAO the reference count on the NAO will be 0. In this case the NAO is a bit smart an says, hey, you just created me, even though I have a zero reference count I must be needed for something so I will hang around until something happens. In your case you wrote straight back to an HDF file. However, once that event happened the NAO will disappear so trying to do anything further with x/NAO will not work. It is important to understand this, because if you do not you can get into lots of trouble. You cannot get rid of the fillvalue at present using nap. I doubt that this is causing a problem. I would just check the contents of the output file with hdp, I would then use the NAP HDF display utility to have a look at the contents of each file and make sure there is nothing else wrong. Cheers Peter -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Wednesday, 8 March 2006 11:03 PM To: NAP Subject: [Tcl-nap-users] writing HDF files Hi guys I tried to genarate HDF files out of NAOs. set x [nap_get hdf c:/sampels/p14/gdal/p14_4.hdf "3-dimensional Scientific Dataset"] $x hdf sa.hdf sa nap_get hdf -list sa.hdf ------- sa sa:_FillValue I want to ask how i can add SDS to the file like transformation matrix and projection. Regards Yahoo! Mail Use Photomail to share photos without annoying attachments. --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: <Har...@cs...> - 2006-03-10 06:06:12
|
Hi Guobin, =20 Welcome to the wonderful world of Nap. I am ccing this reply to (tcl...@li...), which I assume you meant to send your message to. I gather you tried the tcl command "exec hdp ..." and it failed. This is probably because you have not installed HDF, which includes the dump utility "hdp". You can get HDF from http://hdf.ncsa.uiuc.edu/ =20 Have fun napping, Harvey Harvey Davies, CSIRO Marine and Atmospheric Research, Private Bag No. 1, Aspendale 3195 E-mail: har...@cs... Office: 03 9239 4556 Mobile: 04 2241 7563=20 -----Original Message----- From: Fu, Guobin (CLW, Floreat)=20 Sent: Friday, 10 March 2006 16:29 To: da...@us... Subject: help =20 Dear Everyone, =20 I am new to NAP and reading the menu "NAP User's Guide Version 5.0" by Harvey Davis published in July 2005. I met a problem at Page 133 with command "exec". I could save the hdf file, but couldn't exec it as shown by Line 2 on Page 133 and Line 7 from bottom on Page 134. On page 138, there is another "exec", and I failed again. Does anybody know what's happening? Thank you so much! =20 Cheers, Guobin =20 =20 <><><><><><><><><><> Guobin Fu, PhD CSIRO Land and Water Private Bag No 5 Wembley, WA 6913 AUSTRALIA Phone: 61-8-9333 6342 Fax: 61-8-9333 6499 Email: Guo...@cs... <><><><><><><><><><>=20 =20 |
From: <Pet...@cs...> - 2006-03-10 04:23:44
|
Hi salah, =20 You seem to have sorted out how to write multiple SDSs and attributes.=20 I am not sure if you are aware but you need to be careful mixing NAOs and tcl commands. Your example below is a bit dangerous if you want to use x for anything else. NAOs have a reference count which counts the number of tcl variables pointing at them. If the NAO reference count goes to 0 then the NAO kills itself. In order to create a relationship between the NAO and a tcl variable the nap command needs to be used: nap x =3D [nap_get hdf .......] In the above case the NAO will have a reference count of 1 and be attached to x so that if x gets unset the reference count on the NAO will be decremented and if the reference count is zero it will disappear. In your example, although x points to the NAO the reference count on the NAO will be 0. In this case the NAO is a bit smart an says, hey, you just created me, even though I have a zero reference count I must be needed for something so I will hang around until something happens. In your case you wrote straight back to an HDF file. However, once that event happened the NAO will disappear so trying to do anything further with x/NAO will not work. It is important to understand this, because if you do not you can get into lots of trouble. You cannot get rid of the fillvalue at present using nap. I doubt that this is causing a problem. I would just check the contents of the output file with hdp, I would then use the NAP HDF display utility to have a look at the contents of each file and make sure there is nothing else wrong. Cheers Peter -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Wednesday, 8 March 2006 11:03 PM To: NAP Subject: [Tcl-nap-users] writing HDF files Hi guys =20 I tried to genarate HDF files out of NAOs. =20 set x [nap_get hdf c:/sampels/p14/gdal/p14_4.hdf "3-dimensional Scientific Dataset"] $x hdf sa.hdf sa nap_get hdf -list sa.hdf ------- sa sa:_FillValue I want to ask how i can add SDS to the file like transformation matrix and projection.=20 =20 Regards =20 Yahoo! Mail Use Photomail <http://us.rd.yahoo.com/mail_us/taglines/pmall2/*http://photomail.mail.y ahoo.com> to share photos without annoying attachments. |
From: salah j. <s_...@ya...> - 2006-03-09 19:01:31
|
Hi guys I have posted a message with the same subject and i want to explain exactly what i am doing. I did the test below which reads the data from one HDF image file and write it to another HDF image file. a new image is generated just only one difference the 3-dimensional Scientific Dataset have a general attribute which is Fillvalue. i am using another library which is gdal also i am using mapserver to display the images using the web. the gdal library compiled to support HDF files, the library that i used to do that is HDF41r5. i was able to see the origenal image which is "green band" at the same time i was not able to display the test images. as i said in the previous post that the fillvalue is the reason, so i need to away to deal with this issue . is HDF41r5 is the reason ..., or can i omit this tag or not even write it at the first place. set green [nap_get hdf green.hdf "3-dimensional Scientific Dataset"] set TM [nap_get hdf green.hdf :TransformationMatrix] set PR [nap_get hdf green.hdf :Projection] set AP [nap_get hdf green.hdf :AREA_OR_POINT] set TIFFS [nap_get hdf green.hdf :TIFFTAG_SOFTWARE] set TIFFX [nap_get hdf green.hdf :TIFFTAG_XRESOLUTION] set TIFFY [nap_get hdf green.hdf :TIFFTAG_YRESOLUTION] set TIFFU [nap_get hdf green.hdf :TIFFTAG_RESOLUTIONUNIT] $green hdf test.hdf "3-dimensional Scientific Dataset" $TM hdf test.hdf ":TransformationMatrix" $PR hdf test.hdf ":Projection" $AP hdf test.hdf ":AREA_OR_POINT" $TIFFS hdf test.hdf ":TIFFTAG_SOFTWARE" $TIFFX hdf test.hdf ":TIFFTAG_XRESOLUTION" $TIFFY hdf test.hdf ":TIFFTAG_YRESOLUTION" $TIFFU hdf test.hdf ":TIFFTAG_RESOLUTIONUNIT" --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: salah j. <s_...@ya...> - 2006-03-09 18:30:11
|
Hi again. when i write to NAO to hdf file i get sa:Fillvalue like the example below. i passed this image to gdal but it is giving me a white image. i think that gdal did not recognise this tag. my question is how to omit this tag from the hdf file , or how to write just only the data to the hdf file. salah jubeh <s_...@ya...> wrote: Hi guys I tried to genarate HDF files out of NAOs. set x [nap_get hdf c:/sampels/p14/gdal/p14_4.hdf "3-dimensional Scientific Dataset"] $x hdf sa.hdf sa nap_get hdf -list sa.hdf ------- sa sa:_FillValue I want to ask how i can add SDS to the file like transformation matrix and projection. Regards --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. |
From: salah j. <s_...@ya...> - 2006-03-08 12:03:19
|
Hi guys I tried to genarate HDF files out of NAOs. set x [nap_get hdf c:/sampels/p14/gdal/p14_4.hdf "3-dimensional Scientific Dataset"] $x hdf sa.hdf sa nap_get hdf -list sa.hdf ------- sa sa:_FillValue I want to ask how i can add SDS to the file like transformation matrix and projection. Regards --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. |
From: <Har...@cs...> - 2006-03-07 05:30:20
|
-----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Monday, 6 March 2006 22:53 To: NAP Subject: [Tcl-nap-users] Two issues : gdal +binary data =20 Hi Guys =20 Since NAP is an array processor, and i think it is originally designed to support images is there is any way to support GDAL format. =20 I GDAL my images and convert them to ASCII or HDF image file and after that make my manipulation, and this is an extra process. =20 I was not aware of GDAL. I found web page: http://www.remotesensing.org/gdal/index.html This was most interesting. GDAL looks very useful for converting from one grid/raster file type to another. There was a description of the GDAL data model. I gather this is an internal (memory) format (like Nap's NAOs) rather than a file format. Is this correct? If so, I do not understand what you mean by "support GDAL format". If it is a file format (binary I assume) then two possibilities are: 1. Read using command "nap_get binary" 2. Implement a new Tcl image type. This involves writing C code. =20 second issue: =20 I create NAOs objects out of quick bird image and i did a comparison between the time needed to create NAO out of ASCII and out of HDF =20 i create 8 images 4 in ASCII and 4 in HDF "each band in an image" and i got this result. Image Name N_cols Nrows Data type origen Size ascii Size HDF Time ASCII Time HDF Diff B_1 4698 2235 U16 Quick 34.624 20.531 17.078 244.11 227.032 B_2 4698 2235 U16 Quick 34.760 20.531 17.141 245.58 228.439 B_3 4698 2235 U16 Quick 31.29 20.531 17.203 248.39 231.187 B_3 4698 2235 U16 Quick 34.833 20.531 18.125 255.00 236.857 =20 is my result is ok...?, now i am wondering why creating NAO out of HDF files is more expensive than creating it out of ASCII. =20 This makes no sense to me. ASCII should take much longer than HDF.=20 Your HDF file sizes look sensible, but not the ASCII sizes (unless some form of compression is being used). Using your smallest ASCII size of 31.29 MB, this means there are only 31.29*(1024*1024.0)/(4698*2235*2) = =3D 1.6 bytes per element. The smallest space an ASCII value can occupy is two bytes (e.g. "9,"). Would you like to send me sample HDF & ASCII files? |
From: salah j. <s_...@ya...> - 2006-03-06 11:52:50
|
Hi Guys Since NAP is an array processor, and i think it is originally designed to support images is there is any way to support GDAL format. I GDAL my images and convert them to ASCII or HDF image file and after that make my manipulation, and this is an extra process. second issue: I create NAOs objects out of quick bird image and i did a comparison between the time needed to create NAO out of ASCII and out of HDF i create 8 images 4 in ASCII and 4 in HDF "each band in an image" and i got this result. Image Name N_cols Nrows Data type origen Size ascii Size HDF Time ASCII Time HDF Diff B_1 4698 2235 U16 Quick 34.624 20.531 17.078 244.11 227.032 B_2 4698 2235 U16 Quick 34.760 20.531 17.141 245.58 228.439 B_3 4698 2235 U16 Quick 31.29 20.531 17.203 248.39 231.187 B_3 4698 2235 U16 Quick 34.833 20.531 18.125 255.00 236.857 is my result is ok...?, now i am wondering why creating NAO out of HDF files is more expensive than creating it out of ASCII. --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: <Pau...@cs...> - 2006-03-04 02:12:13
|
Salah, I think your problem is linked to the instance of wish.exe still = persisting in memory. Memory is allocated to a process, and only after = the process is terminated is this memory allocation freed back to the = system. So in the instance you are describing below, NAP is = appropriately dealing with the memory within its operation (as a wish = process), however wish.exe keeps a handle to this memory until it is = termination - it's just one of the memory quirks within computing. A way around this kind of memory bloat is to call instances of wish (or = tclsh) within a shell script (or alternate), these instances then are = allocated memory and freed within a looping structure, and your memory = bloat is minimised. I hope this helps... Paul -----Original Message----- From: tcl...@li... on behalf of salah jubeh Sent: Fri 3/03/2006 8:38 PM To: NAP Cc:=09 Subject: RE: [Tcl-nap-users] Nap Memory Problem I have just did the test on a third machine with fresh TCL = installation from http://www.activestate.com/Products/ActiveTcl/ and = with nap 5.0.5 the result again was negative. salah jubeh <s_...@ya...> wrote: Thank You very much for your = concern. =20 I hav did the same test=20 =20 8 % nap_info bytes 1348 1323435 9 % nap "result=3D get_gridascii('c:/red.asc')" ::NAP::6474-6474 10 % nap_info bytes 1312472 1323435 11 % unset result 12 % nap_info bytes 1348 1323435 13 %=20 In this test the nap looks like it works perfectly. but again i = checked wich84.exe proceess memory usage . the first reading was 12,000 = k and after the second time i used the code a bove it was about 30,000 k = and after 4 times it was a bout 85,000 k, also i checked memory page = file i get almost the same result. =20 Today i did also some test by allocating NAO objects and after several = times the tclsh crashes. =20 i will try to do the same test on other machines and i will see the = result.=20 =20 Har...@cs... wrote: Hi Salah, =20 The following is a log (using the unreleased version 6.0.0) of = creating & freeing a 100 MB array. The task manager showed that wish.exe started at 9 MB, went up to 112 = MB when the array was allocated & then decreased to 10 MB after the = freeing. The 1st number produced by =93nap_info bytes=94 shows the number of = byt es used by NAOs returned to 2696 after the freeing. =20 % nap_info bytes 2696 2696 40092 40146 % nap "a =3D reshape(9, {25 1024 1024})"; # create 100 MB array ::NAP::18-18 % nap_info bytes 104860544 104861500 72228 72884 % unset a % nap_info bytes 2696 104861500 72220 72884 =20 Hope this helps, Harvey Harvey Davies, CSIRO Marine and Atmospheric Research, Private Bag No. 1, Aspendale 3195 E-mail: har...@cs... Office: 03 9239 4556 Mobile: 04 2241 7563=20 -----Original Message----- From: tcl...@li... = [mailto:tcl...@li...] On Behalf Of salah = jubeh Sent: Friday, 3 March 2006 12:14 To: tcl...@li... Subject: [Tcl-nap-users] Nap Memory Problem =20 Hi Guys =20 I am working with NAP to do some image processing. i am using a nap = function "get_gridascii" to read arc grid ASCII files. the size of = images ranges from 2 MB to 100 MB and the platform that i am using is = WINXP. =20 I faced a problem such that the TCL shell give me message can not = allocate memory. after calling "get_gridascii" several times. =20 I used windows task manager utility to trace the process memory = usage I find that a little a mount is freed after destroying a NAO = object, I did the same test on two PCs and i get the same result on two = versions of TCL. =20 This is how i am using get_gridascii =20 nap "get_gridascii('red.ASC')"; ::NAP::16-16 =20 i used ::NAP::16-16 in order to free the memory but the memory did = not freed. =20 also i did another test like that=20 =20 nap "red=3Dget_gridascii('red.ASC')"; =20 and i used set red "" also i used unset red to free memory but the = memory did not freed. =20 I checked this with another versions like 5.0.3 and 5.0.2 and i get = the same result. =20 finally i made this test with 4.0.1 i get a good result doing the = same test ,The memory was freed BUT I tried to open an image a bout 80 = MB. the TCL shell stop responding. this image i was able to create ANO = Object out of it with NAP 5.0.5 but i could not do the same with NAP = 4.0.1. i did this test a gain twice an i faild to creat NAO object. =20 What is the cause of this problem , is it a bug . and how can i free = the memory. =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 < /DIV> =20 =20 =20 =20 =20 =20 =20 =20 =20 Best Regard =20 Eng. Salah Al Jubeh MCP,MCAD,MCSD=20 Mobile:00306947192421 =20 =20 =20 --------------------------------- =20 Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze.=20 =20 --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. =20 --------------------------------- Brings words and photos together (easily) with PhotoMail - it's free and works with Yahoo! Mail. =09 --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. |
From: salah j. <s_...@ya...> - 2006-03-03 09:38:47
|
I have just did the test on a third machine with fresh TCL installation from http://www.activestate.com/Products/ActiveTcl/ and with nap 5.0.5 the result again was negative. salah jubeh <s_...@ya...> wrote: Thank You very much for your concern. I hav did the same test 8 % nap_info bytes 1348 1323435 9 % nap "result= get_gridascii('c:/red.asc')" ::NAP::6474-6474 10 % nap_info bytes 1312472 1323435 11 % unset result 12 % nap_info bytes 1348 1323435 13 % In this test the nap looks like it works perfectly. but again i checked wich84.exe proceess memory usage . the first reading was 12,000 k and after the second time i used the code a bove it was about 30,000 k and after 4 times it was a bout 85,000 k, also i checked memory page file i get almost the same result. Today i did also some test by allocating NAO objects and after several times the tclsh crashes. i will try to do the same test on other machines and i will see the result. Har...@cs... wrote: Hi Salah, The following is a log (using the unreleased version 6.0.0) of creating & freeing a 100 MB array. The task manager showed that wish.exe started at 9 MB, went up to 112 MB when the array was allocated & then decreased to 10 MB after the freeing. The 1st number produced by nap_info bytes shows the number of byt es used by NAOs returned to 2696 after the freeing. % nap_info bytes 2696 2696 40092 40146 % nap "a = reshape(9, {25 1024 1024})"; # create 100 MB array ::NAP::18-18 % nap_info bytes 104860544 104861500 72228 72884 % unset a % nap_info bytes 2696 104861500 72220 72884 Hope this helps, Harvey Harvey Davies, CSIRO Marine and Atmospheric Research, Private Bag No. 1, Aspendale 3195 E-mail: har...@cs... Office: 03 9239 4556 Mobile: 04 2241 7563 -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Friday, 3 March 2006 12:14 To: tcl...@li... Subject: [Tcl-nap-users] Nap Memory Problem Hi Guys I am working with NAP to do some image processing. i am using a nap function "get_gridascii" to read arc grid ASCII files. the size of images ranges from 2 MB to 100 MB and the platform that i am using is WINXP. I faced a problem such that the TCL shell give me message can not allocate memory. after calling "get_gridascii" several times. I used windows task manager utility to trace the process memory usage I find that a little a mount is freed after destroying a NAO object, I did the same test on two PCs and i get the same result on two versions of TCL. This is how i am using get_gridascii nap "get_gridascii('red.ASC')"; ::NAP::16-16 i used ::NAP::16-16 in order to free the memory but the memory did not freed. also i did another test like that nap "red=get_gridascii('red.ASC')"; and i used set red "" also i used unset red to free memory but the memory did not freed. I checked this with another versions like 5.0.3 and 5.0.2 and i get the same result. finally i made this test with 4.0.1 i get a good result doing the same test ,The memory was freed BUT I tried to open an image a bout 80 MB. the TCL shell stop responding. this image i was able to create ANO Object out of it with NAP 5.0.5 but i could not do the same with NAP 4.0.1. i did this test a gain twice an i faild to creat NAO object. What is the cause of this problem , is it a bug . and how can i free the memory. < /DIV> Best Regard Eng. Salah Al Jubeh MCP,MCAD,MCSD Mobile:00306947192421 --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. --------------------------------- Brings words and photos together (easily) with PhotoMail - it's free and works with Yahoo! Mail. --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. |
From: salah j. <s_...@ya...> - 2006-03-03 08:17:35
|
Thank You very much for your concern. I hav did the same test 8 % nap_info bytes 1348 1323435 9 % nap "result= get_gridascii('c:/red.asc')" ::NAP::6474-6474 10 % nap_info bytes 1312472 1323435 11 % unset result 12 % nap_info bytes 1348 1323435 13 % In this test the nap looks like it works perfectly. but again i checked wich84.exe proceess memory usage . the first reading was 12,000 k and after the second time i used the code a bove it was about 30,000 k and after 4 times it was a bout 85,000 k, also i checked memory page file i get almost the same result. Today i did also some test by allocating NAO objects and after several times the tclsh crashes. i will try to do the same test on other machines and i will see the result. Har...@cs... wrote: Hi Salah, The following is a log (using the unreleased version 6.0.0) of creating & freeing a 100 MB array. The task manager showed that wish.exe started at 9 MB, went up to 112 MB when the array was allocated & then decreased to 10 MB after the freeing. The 1st number produced by nap_info bytes shows the number of bytes used by NAOs returned to 2696 after the freeing. % nap_info bytes 2696 2696 40092 40146 % nap "a = reshape(9, {25 1024 1024})"; # create 100 MB array ::NAP::18-18 % nap_info bytes 104860544 104861500 72228 72884 % unset a % nap_info bytes 2696 104861500 72220 72884 Hope this helps, Harvey Harvey Davies, CSIRO Marine and Atmospheric Research, Private Bag No. 1, Aspendale 3195 E-mail: har...@cs... Office: 03 9239 4556 Mobile: 04 2241 7563 -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Friday, 3 March 2006 12:14 To: tcl...@li... Subject: [Tcl-nap-users] Nap Memory Problem Hi Guys I am working with NAP to do some image processing. i am using a nap function "get_gridascii" to read arc grid ASCII files. the size of images ranges from 2 MB to 100 MB and the platform that i am using is WINXP. I faced a problem such that the TCL shell give me message can not allocate memory. after calling "get_gridascii" several times. I used windows task manager utility to trace the process memory usage I find that a little a mount is freed after destroying a NAO object, I did the same test on two PCs and i get the same result on two versions of TCL. This is how i am using get_gridascii nap "get_gridascii('red.ASC')"; ::NAP::16-16 i used ::NAP::16-16 in order to free the memory but the memory did not freed. also i did another test like that nap "red=get_gridascii('red.ASC')"; and i used set red "" also i used unset red to free memory but the memory did not freed. I checked this with another versions like 5.0.3 and 5.0.2 and i get the same result. finally i made this test with 4.0.1 i get a good result doing the same test ,The memory was freed BUT I tried to open an image a bout 80 MB. the TCL shell stop responding. this image i was able to create ANO Object out of it with NAP 5.0.5 but i could not do the same with NAP 4.0.1. i did this test a gain twice an i faild to creat NAO object. What is the cause of this problem , is it a bug . and how can i free the memory. Best Regard Eng. Salah Al Jubeh MCP,MCAD,MCSD Mobile:00306947192421 --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. --------------------------------- Brings words and photos together (easily) with PhotoMail - it's free and works with Yahoo! Mail. |
From: <Har...@cs...> - 2006-03-03 07:19:32
|
Hi Salah, =20 The following is a log (using the unreleased version 6.0.0) of creating & freeing a 100 MB array. The task manager showed that wish.exe started at 9 MB, went up to 112 MB when the array was allocated & then decreased to 10 MB after the freeing. The 1st number produced by "nap_info bytes" shows the number of bytes used by NAOs returned to 2696 after the freeing. =20 % nap_info bytes 2696 2696 40092 40146 % nap "a =3D reshape(9, {25 1024 1024})"; # create 100 MB array ::NAP::18-18 % nap_info bytes 104860544 104861500 72228 72884 % unset a % nap_info bytes 2696 104861500 72220 72884 =20 Hope this helps, Harvey Harvey Davies, CSIRO Marine and Atmospheric Research, Private Bag No. 1, Aspendale 3195 E-mail: har...@cs... Office: 03 9239 4556 Mobile: 04 2241 7563=20 -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Friday, 3 March 2006 12:14 To: tcl...@li... Subject: [Tcl-nap-users] Nap Memory Problem =20 Hi Guys =20 I am working with NAP to do some image processing. i am using a nap function "get_gridascii" to read arc grid ASCII files. the size of images ranges from 2 MB to 100 MB and the platform that i am using is WINXP. =20 I faced a problem such that the TCL shell give me message can not allocate memory. after calling "get_gridascii" several times. =20 I used windows task manager utility to trace the process memory usage I find that a little a mount is freed after destroying a NAO object, I did the same test on two PCs and i get the same result on two versions of TCL. =20 This is how i am using get_gridascii =20 nap "get_gridascii('red.ASC')"; ::NAP::16-16 =20 i used ::NAP::16-16 in order to free the memory but the memory did not freed. =20 also i did another test like that=20 =20 nap "red=3Dget_gridascii('red.ASC')"; =20 and i used set red "" also i used unset red to free memory but the memory did not freed. =20 I checked this with another versions like 5.0.3 and 5.0.2 and i get the same result. =20 finally i made this test with 4.0.1 i get a good result doing the same test ,The memory was freed BUT I tried to open an image a bout 80 MB. the TCL shell stop responding. this image i was able to create ANO Object out of it with NAP 5.0.5 but i could not do the same with NAP 4.0.1. i did this test a gain twice an i faild to creat NAO object. =20 What is the cause of this problem , is it a bug . and how can i free the memory. =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 Best Regard =20 Eng. Salah Al Jubeh MCP,MCAD,MCSD=20 <http://saalaah.jeeran.com/salahjubeh.png>=20 Mobile:00306947192421 =20 _____ =20 Yahoo! Mail Bring photos to life! New <http://pa.yahoo.com/*http:/us.rd.yahoo.com/evt=3D39174/*http:/photomail.= m ail.yahoo.com> PhotoMail makes sharing a breeze.=20 |
From: salah j. <s_...@ya...> - 2006-03-03 01:13:46
|
Hi Guys I am working with NAP to do some image processing. i am using a nap function "get_gridascii" to read arc grid ASCII files. the size of images ranges from 2 MB to 100 MB and the platform that i am using is WINXP. I faced a problem such that the TCL shell give me message can not allocate memory. after calling "get_gridascii" several times. I used windows task manager utility to trace the process memory usage I find that a little a mount is freed after destroying a NAO object, I did the same test on two PCs and i get the same result on two versions of TCL. This is how i am using get_gridascii nap "get_gridascii('red.ASC')"; ::NAP::16-16 i used ::NAP::16-16 in order to free the memory but the memory did not freed. also i did another test like that nap "red=get_gridascii('red.ASC')"; and i used set red "" also i used unset red to free memory but the memory did not freed. I checked this with another versions like 5.0.3 and 5.0.2 and i get the same result. finally i made this test with 4.0.1 i get a good result doing the same test ,The memory was freed BUT I tried to open an image a bout 80 MB. the TCL shell stop responding. this image i was able to create ANO Object out of it with NAP 5.0.5 but i could not do the same with NAP 4.0.1. i did this test a gain twice an i faild to creat NAO object. What is the cause of this problem , is it a bug . and how can i free the memory. Best Regard Eng. Salah Al Jubeh MCP,MCAD,MCSD Mobile:00306947192421 --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. |
From: <Har...@cs...> - 2006-02-13 06:49:09
|
> -----Original Message----- > From: tcl...@li... [mailto:tcl-nap-users- > ad...@li...] On Behalf Of ni...@ma... > Sent: Sunday, 12 February 2006 21:13 > To: tcl...@li... > Subject: [Tcl-nap-users] Re: Welcome to the 'Tcl-nap-users' mailing list >=20 > Greetings, >=20 > ####Below we open ARC info ascii grids using nap > ####the grids were created using gdal_translate > ####iirc, WE NEED TO ADD "NODATA_value -9999" line to the grid files as > gdal doe > ####not seem to do this automatically... >=20 > nap "red =3D get_gridascii('red.ASC')"; > nap "near =3D get_gridascii('near.ASC')"; > nap [result =3D (near-red)/(near+red)] > nap "result =3D (near-red)/(near+red)" > $result > plot_nao result -print 0 -filename result.jpeg >=20 > ####The resulting plot is correct.... >=20 > ####Trying the same, but with using hdf files, >=20 >=20 > nap "red =3D [nap_get hdf red.hdf "3-dimensional Scientific = Dataset"]" > nap "near =3D [nap_get hdf near.hdf "3-dimensional Scientific Dataset"]" [>>>] I gather the SDS name is "3-dimensional Scientific Dataset". I think the spaces should be OK, but I could be wrong. It is unusual to have such an SDS name. =20 > nap "result =3D (near-red)/(near+red)" >=20 > plot_nao result -print 0 -filename result1.jpeg >=20 > ####The resulting plot is only the first row of the hdf SDS... [>>>] This is strange. > ####Do we need to loop in tcl and read all the rows? [>>>] No. If you do not specify an index then the whole SDS is read. > #### or is there an "append nao" type of method? >=20 > regards, >=20 > nikos >=20 > thanx, [>>>]=20 Can you send me your HDF files and your script? Harvey |