Re: Output PNGs in different sizes

From: Jonas Kaufmann <jonas.kaufmann_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 19 2012 - 01:22:29 MDT

Hello,

thank you for your answers! The reason I wanted to to this via
setvalues is that I hope to get some more performance instead of
creating new workstations for every single PNG size. When trying to
set wkHeight or wkWidth with setvalues, I don't get any error or
warning message - however I think that a warning message would be good
in these cases.

Although it is documented that this is not settable, I think it would
be a great addition to make these computations faster. Already looking
forward to this feature :)

Jonas

On Mon, Jun 18, 2012 at 10:16 PM, Mary Haley <haley@ucar.edu> wrote:
> Dave,
>
> So "setvalues" doesn't give you an error or warning message if you try to set a non-settable resource in a setvalues block?
>
> If not, do you think this is something that should be considered?
>
> --Mary
>
> On Jun 18, 2012, at 2:04 PM, David Brown wrote:
>
>> wkWidth and wkHeight have always been documented as RCG in the HLU documents (meaning settable from a resource file, or during creation, and gettable) but the S is missing, which means that the documented behavior is that these resources cannot be changed after the workstation is open. Whether this is actually necessary with the new Cairo-based workstation, I don't know. We can certainly look into this and it may be possible to remove the restriction.
>> -dave
>>
>> On Jun 18, 2012, at 12:52 PM, Mary Haley wrote:
>>
>>> Hi Jonas,
>>>
>>> I'm not sure if this is a bug or the correct behavior, but you can't change the size of the PNG output after you've already created it with gsn_open_wks.
>>>
>>> In other words, using "setvalues" to change the size will never work.
>>>
>>> I'll file a ticket on this just in case.
>>>
>>> Meanwhile, if you want to get different sizes, you will need to open up a new PNG file with a new call to gsn_open_wks and a different file name.
>>>
>>> I've attached a small example.
>>>
>>> --Mary
>>> <png_example.ncl>
>>> On Jun 18, 2012, at 10:17 AM, Jonas Kaufmann wrote:
>>>
>>>> Hello,
>>>>
>>>> I am trying to generate PNGs in different sizes from GRIB weather
>>>> data. The map should always show the same area, but the output PNG
>>>> files should have different sizes. I know that I can call the output
>>>> function (like gsn_csm_vector_scalar_map) in a loop, but I am looking
>>>> to get a better performance than this approach.
>>>>
>>>> In the "Animation" examples, I see that I can set some variables
>>>> afterwards and then simply call draw and frame for the next animation
>>>> step. However it seems that these options are not available for
>>>> wkWidth and wkHeight.
>>>>
>>>> Here are some snippets of my script:
>>>>
>>>> wks_type = "png"
>>>> wks_type@wkWidth = 256
>>>> wks_type@wkHeight = 256
>>>> wks = gsn_open_wks(wks_type,outfile)
>>>> [...]
>>>> ;;; first image: 256x256px
>>>> plot = gsn_csm_vector_scalar_map(wks, wind_u, wind_v, wind_speed, res1)
>>>> draw(plot)
>>>> frame(wks)
>>>>
>>>> ;;; second image: 512x512px
>>>> setvalues wks
>>>>      "wkHeight" : 512
>>>>      "wkWidth"  : 512
>>>> end setvalues
>>>> draw(plot)
>>>> frame(wks)
>>>>
>>>>
>>>> I get images in my outfile name with "000001", "000002" etc. appended,
>>>> but they are always the same size, the one that I originally set. Is
>>>> there a way to change the PNG output size with setvalues? Or is there
>>>> another way to achieve a better performance for my task than simply
>>>> calling the gsn_csm_vector_scalar_map method in a loop?
>>>>
>>>>
>>>> Thank you for your help!
>>>>
>>>> Best regards
>>>>
>>>> Jonas
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 19 01:23:04 2012

This archive was generated by hypermail 2.1.8 : Mon Jun 25 2012 - 09:57:23 MDT