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

Home » Public Forums » archive » stacking the images according to julian date
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
stacking the images according to julian date [message #85594] Tue, 20 August 2013 13:10 Go to next message
ansul is currently offline  ansul
Messages: 1
Registered: August 2013
Junior Member
Hello all,

I am a newbie in IDL and thought I might get some information here.

I need to do a time series analysis with landsat images (almost 500 images). I need to stack the image according to the julian dates. So I have 500 images in a folder which are named lndsr.LT50140331989278XXX01. In this naming format the Julian date starts from the 20th position to 22nd position. And I need to use this information to stack the image.

All your help will be much appreciated.

Thanks
Re: stacking the images according to julian date [message #85595 is a reply to message #85594] Tue, 20 August 2013 13:27 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ansul writes:

> I am a newbie in IDL and thought I might get some information here.
>
> I need to do a time series analysis with landsat images (almost 500 images). I need to stack the image according to the julian dates. So I have 500 images in a folder which are named lndsr.LT50140331989278XXX01. In this naming format the Julian date starts from the 20th position to 22nd position. And I need to use this information to stack the image.
>
> All your help will be much appreciated.

filenames = File_Search("lndsr.*", COUNT=count)
juldates = DblArr(count)

; Parse the filename for the Julian date.
FOR j=0,count-1 DO BEGIN
thisFile = filenames[j]
year = Fix(StrMid(thisFile, 15, 4))
doy = Fix(StrMid(thisFile, 19, 3))
juldates[j] = JulDay(1, doy, year)
ENDFOR

; Sort the Julian dates.
sorted = Sort(juldates)

; Sort the filenames in the right order for stacking.
filenames = filenames[sorted]

I don't think you REALLY want to stack these images, but now you have
them in the right order, in case you want to process them in the right
order.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: stacking the images according to julian date [message #85596 is a reply to message #85595] Tue, 20 August 2013 14:02 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
And to be an annoying kibbutzer-- I believe this can also be done without loops:

filenames = File_Search("lndsr.*", COUNT=count)
year = Fix(StrMid(filenames,15,4))
doy = Fix(StrMid(filenames,19,3))
juldates = JulDay(1,doy, year)

; Sort the Julian dates.
sorted = Sort(juldates)

; Sort the filenames in the right order for stacking.

filenames = filenames[sorted]



On Tuesday, August 20, 2013 4:27:24 PM UTC-4, David Fanning wrote:

>>
>
>> All your help will be much appreciated.
>
>
>
> filenames = File_Search("lndsr.*", COUNT=count)
>
> juldates = DblArr(count)
>
>
>
> ; Parse the filename for the Julian date.
>
> FOR j=0,count-1 DO BEGIN
>
> thisFile = filenames[j]
>
> year = Fix(StrMid(thisFile, 15, 4))
>
> doy = Fix(StrMid(thisFile, 19, 3))
>
> juldates[j] = JulDay(1, doy, year)
>
> ENDFOR
>
>
>
> ; Sort the Julian dates.
>
> sorted = Sort(juldates)
>
>
>
> ; Sort the filenames in the right order for stacking.
>
> filenames = filenames[sorted]
>
>
>
> I don't think you REALLY want to stack these images, but now you have
>
> them in the right order, in case you want to process them in the right
>
> order.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: stacking the images according to julian date [message #85597 is a reply to message #85596] Tue, 20 August 2013 14:17 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wayne Landsman writes:

> And to be an annoying kibbutzer-- I believe this can also be done without loops:
>
> filenames = File_Search("lndsr.*", COUNT=count)
> year = Fix(StrMid(filenames,15,4))
> doy = Fix(StrMid(filenames,19,3))
> juldates = JulDay(1,doy, year)
>
> ; Sort the Julian dates.
> sorted = Sort(juldates)
>
> ; Sort the filenames in the right order for stacking.
>
> filenames = filenames[sorted]

Even better, if harder for a newby to understand! ;-)

Cheers,

David

P.S. It's even hard for old guys to understand. I almost always have to
read your article on STRMID to understand how it works on arrays.

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Maximum number of keywords?
Next Topic: Non-intuitive result with !Null in Where()

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

Current Time: Wed Oct 08 13:33:44 PDT 2025

Total time taken to generate the page: 0.00420 seconds