McIDAS-V Support Forums

Support and discussion of the McIDAS-V software package
Forum HomeMcIDAS-V Home
It is currently 13 Jul 2020, 02:28

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: can't use captureImage
PostPosted: 08 Sep 2017, 18:44 
User avatar

Joined: 19 Jan 2009, 19:16
Posts: 1119
Attachment:
Screen Shot 2017-09-08 at 1.39.15 PM.png
Screen Shot 2017-09-08 at 1.39.15 PM.png [ 147.84 KiB | Viewed 220 times ]


I updated to Version 1.7beta1 2017-09-07, and there seems to be a problem with captureImage. This error message is a variation on a theme. When I load an image, I get a ValueError as well without the no time step warning.

Attachment:
Screen Shot 2017-09-08 at 1.57.03 PM.png
Screen Shot 2017-09-08 at 1.57.03 PM.png [ 60.95 KiB | Viewed 222 times ]


Thanks,
Joleen


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 08 Sep 2017, 18:59 
User avatar

Joined: 15 Nov 2010, 17:57
Posts: 910
Hi Joleen -

This is related to Inquiry 2176, which is in programmer iteration. The objective of this inquiry is to improve captureImage so it will capture the image that you are looking at, instead of just the first frame in a loop. The way that this will work is an index= keyword which will be added to captureImage. So, you could do something like index=5, which would capture an image of the 5th frame in the loop. This work has yet to be competed. However, for now, you can just tack "index=0" to your captureImage commands and things should work like they have in the past. So your captureImage command would be:

Code:
activeDisplay().captureImage('/Users/joleenf/test/test.png', index=0)

If this doesn't work, or if you have any questions, please let me know. I'll update you when there is progress on this inquiry.

Thanks -
Bob Carp


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 08 Sep 2017, 21:44 
User avatar

Joined: 09 Jan 2009, 20:44
Posts: 192
Location: Madison, WI
Hi Joleen,

Sorry about that. I believe the problem has been fixed with my latest commit, though Bob hasn't taken a crack at it yet!


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 11 Sep 2017, 16:27 
User avatar

Joined: 15 Nov 2010, 17:57
Posts: 910
Hi Joleen and Jon -

Just a heads up that there are still problems with captureImage(). I put the inquiry back in programmer iteration.

Thanks -
Bob


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 11 Sep 2017, 17:45 
User avatar

Joined: 19 Jan 2009, 19:16
Posts: 1119
Thanks for the heads-up. I have been using the captureImage fairly generically and have not run into any issues yet.

Joleen


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 11 Sep 2017, 18:04 
User avatar

Joined: 15 Nov 2010, 17:57
Posts: 910
Hi Joleen -

Just on the chance that we are doing something differently, here's what I'm doing to cause an issue:

  1. Through a script, create a loop of 10 GOES-16 CONUS images.
  2. Play through the loop in the display and things look fine.
  3. Run a captureImage command from the Jython Shell.
  4. The image is captured, but if I play through the loop in the Main Display, the images don't change but the layer labels do.

I almost missed this at first since I was checking the layer label times in my image captures and not looking at the actual images themselves.

- Bob


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 11 Sep 2017, 21:19 
User avatar

Joined: 19 Jan 2009, 19:16
Posts: 1119
Hi Bob,

At this point, I am displaying image by image (removing layers between times) and saving a single image at a time with index=0. However, the behavior you describe was similar to a problem I had when trying to use a nextStep() or takeStepForward(). I only have the remnants of the code around, I decided to use the single image, capture, clear the panel, display the next image approach. Here is the snippet I still have in my code. I have not used the following code since early January of this year.

Joleen

Code:
fname_template = '{}{}-{:04d}.jpg'

anim = panel[0].getAnimation()
times = anim.getTimes()
steps = anim.getNumSteps()

label='Full Disk ({} um)     CONUS ({} um)     Meso ({} um)'.format((fd[0]['satband-band-label'].split())[0],
           (conus[0]['satband-band-label'].split())[0],(meso1[0]['satband-band-label'].split())[0])

for x in range(steps):
    idx = anim.getCurrent()

    fname = fname_template.format(fdFileH,parms['day'],idx)
    timestep = str(times[x+1])

    formatStuff=[Matte(
                 background='black',
                 top=90,
                 ),
         TextOverlay(
                 text=label,
                 place="UM,0,30",
                 anchor="UM",
                 fontSize="24",
                 color="yellow",
                 ),
         TextOverlay(
                 text=str(timestep),
                 place="UM,0,60",
                 anchor="UM",
                 fontSize="24",
                 color="yellow",
                 ),
              ]


    #print 'idx=%s timestep=%s fname=%s' % (idx, timestep, fname)
    panel[0].captureImage(filename=fname, formatting=formatStuff)
    if (maxidx < idx):
       maxidx=idx
    anim.takeStepForward()




Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 12 Sep 2017, 06:19 
User avatar

Joined: 27 Nov 2010, 15:46
Posts: 486
Joleen and Bob -

Why aren't you using writeImageAtIndex(filename,index,...) instead of captureImage?

HP


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 12 Sep 2017, 10:09 
User avatar

Joined: 19 Jan 2009, 19:16
Posts: 1119
Hi HP,

At the time, I was struggling to get writeImageAtIndex to work consistently as well. I would have to check for the old versions in a repository so that I can rerun to remind myself what was happening.

Joleen


Top
 Profile  
 
 Post subject: Re: can't use captureImage
PostPosted: 12 Sep 2017, 11:34 
User avatar

Joined: 27 Nov 2010, 15:46
Posts: 486
Hi Joleen -

I have uploaded to the SSEC server (im Sequence_save.py) my method for saving image sequences that uses writeImageAtIndex(). Maybe you can make use of it. I never had problems with this code, although I do not know how it would behave in most recent nightlies. In these days, I have to run a nightly from early June, due to a different problem.

HP


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group