comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Why is my code truncating my image dimensions?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Why is my code truncating my image dimensions? [message #81147 is a reply to message #81056] Tue, 14 August 2012 04:29 Go to previous messageGo to previous message
adhdunn is currently offline  adhdunn
Messages: 11
Registered: July 2012
Junior Member
Yes I can see how formatting can work very well in your case.

Hopefully I can crack this darn set of programs today and try to move forward. Of course I will most likely be moving on to another code and another set of problems ;)

I am also surrounded by a lot of people with a wealth of knowledge, unfortunately that knowledge is just not IDL based.

Best of luck to you and thanks again for your help! You will probably see my name on this site a bit more in the future.

Cheers!
Allisyn



On Monday, August 13, 2012 11:33:51 AM UTC-4, adh...@gmail.com wrote:
> Hi!
>
>
>
> I am trying to read in two datasets (Landsat and NLDAS) using a .ctl file but my code seems to be truncating the last digit of the Landsat image. I have run through various trials to see why this is happening, with not luck. If someone could take a look below and see if a glaring error pops out I would greatly appreciate it!
>
>
>
> NOTE*** The Landsat image has dimensions 7931 x 7001. The NLDAS file has dimensions of 224 x 464. The NLDAS data dimensions read in correctly, but the Landsat image prints 793 and 700. In the code below 'nmx' and 'nmy' represent the Landsat input while 'nx' and 'ny' represent the NDLAS input. My original thought was that the data type was set wrong, but I no longer think this to be the case after several test. Also, the truncation occurs when it is first read in not after the FIX operation (if that matters).
>
>
>
> Any suggestions would be appreciated! Thank you!!
>
>
>
> Here is the code:
>
>
>
> OPENR, 1,fname_ctl
>
>
>
> nmx = 0L & nmy = 0L & nx = 0L & ny = 0L & rad_fname = '' & $
>
> fname0 = '' & fname1 = '' & fname2 = '' & fname3= '' & fname4= '' & fname5= '' & $ fname6= '' & fname7= '' & fname8= '' & fname9= '' & fname10= '' & $
>
> fname11= '' & fname12= '' & fname13= '' & fname14= '' & fname15= '' & $
>
> fname16= '' & fname17= '' & fname18= '' & fname19= '' & fname20= '' & $
>
> fname21= '' & fname22= '' & fname23='' & fname50= ''
>
>
>
> ; Read in each line
>
>
>
> WHILE (~ EOF(1)) DO BEGIN
>
>
>
> READF,1,$
>
> FORMAT = '(I3,3(/,I3),25(/,A100),/,A100)',nmx,nmy,nx,ny,rad_fname, fname0, $
>
> fname1,fname2,fname3,fname4,fname5,fname6,fname7,fname8,fnam e9,fname10,$
>
> fname11,fname12,fname13,fname14,fname15,fname16,fname17,fnam e18,fname19,fname20,$ fname21,fname22,fname23,fname50
>
>
>
> PRINT,$
>
> FORMAT = '(I3,3(/,I3),25(/,A100),/,A100)',nmx,nmy,nx,ny,rad_fname, fname0, $
>
> fname1,fname2,fname3,fname4,fname5,fname6,fname7,fname8,fnam e9,fname10,$
>
> fname11,fname12,fname13,fname14,fname15,fname16,fname17,fnam e18,fname19,fname20,$ fname21,fname22,fname23,fname50
>
>
>
>
>
> ENDWHILE
>
>
>
> ; Convert the read in values to proper type
>
>
>
> nx = FIX(nx, TYPE = 3) ; nx and ny are the dimensions of the NLDAS data.
>
> ny = FIX(ny, TYPE = 3)
>
>
>
> nmx = FIX(nmx, TYPE = 3) ; nmx and nmy are the dimensions of the LANDSAT
>
> nmy = FIX(nmy, TYPE = 3) ; image taken from the header information.
>
>
>
> ****THIS IS WHAT PRINTS OUT-
>
> 793
>
> 700
>
> 224
>
> 464
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Why is my code truncating my image dimensions?
Next Topic: Memory Allocation Problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 11:33:14 PDT 2025

Total time taken to generate the page: 0.32004 seconds