Re: NCL controlled by launchctl to schedule daily execution

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Aug 29 2013 - 12:33:35 MDT

Glad to hear it worked. To answer you other question, yes it is true that you can set any individual resource explicitly in a script. However each resource also belongs to a resources class. For instance, resources that specify a text font, "cnHighLabelFont", for example, all belong to the "Font" resource class. You can specify a class resource only in a resource file. It will then apply to all resources that belong to that class unless the resource is explicitly set to a different value. The other thing to note is there are different levels of resources files that are applied in a specific sequence. You can read the details at http://www.ncl.ucar.edu/Document/HLUs/User_Guide/hluimplmt/rescfiles.shtml.
 -dave

On Aug 28, 2013, at 9:17 PM, YU CHENG <mikadofasan@gmail.com> wrote:

> Hi Dave,
>
> Thank you, it works. Before you replied me, i was trying to change the mode of .hluresfile, but in vain. Thanks for telling a nice trick to set wsMaximumSize explicitly in ncl scripts. I suppose, the properties in the hluresfile can also be set in scripts explicitly? Thank you very much!
>
> Yu
> On Aug 28, 2013, at 8:38 PM, David Brown <dbrown@ucar.edu> wrote:
>
>> Hi Yu Cheng,
>> Does your .hluresfile set a larger value for wsMaximumSize than the value in the error message? If so, the problem is probably that launchctl runs using administrative user id (not as you). Therefore NCL would not
>> read the .hluresfile in your home directory. I would suggest setting wsMaximumSize explicitly in the script that needs to use it. You need to get the workspace object id in order to do this.
>>
>> Here is an example of setting the wsMaximumSize:
>>
>> setvalues NhlGetWorkspaceObjectId()
>> "wsMaximumSize" : 300000000
>> end setvalues
>>
>> Hope this helps.
>> -dave
>>
>>
>> On Aug 28, 2013, at 6:12 PM, YU CHENG <mikadofasan@gmail.com> wrote:
>>
>>> Hi everyone,
>>>
>>> I'm currently working on a project to plot out daily MODIS SST and Real Time Ocean forecast SST and SSH. Since i'm going to the sea, and don't have stable internet during that period, I wanted to schedule this job at the same time of every single day.
>>> I used python to control the process including downloading, plotting, tar and send to my dropbox/share directory. My system is Mac OS X 10.8.4, I use launchctl to control the scheduled job.
>>>
>>> However, I can execute the python script without any problem. But when it is called by launchctl, there is a problem.
>>>
>>> part of my scripts:
>>> os.system('/Users/yucheng/Documents/app/ncl/bin/ncl modis_sst.ncl') # Plot Daily MODIS SST
>>> os.system('/Users/yucheng/Documents/app/ncl/bin/ncl meteor_daily_final.ncl') # Plot GHRSST and RTOFS
>>>
>>> Nothing specific, just calling ncl using absolute path to execute my ncl files. But NCL just can't plot correctly, showing library not found, I tried to change the PATH of $load lines within the scripts, But the problem is still there. I further thought it is the problem of environmental var $NCARG_ROOT, cause it is first set when I log in to bash_shell. Therefore I tried to set it using launchctl. After this change, my ncl file works now, but just plot out a white background without shading showing this message:
>>>
>>>
>>> fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size 100000000
>>> fatal:ContourPlotDraw: draw error
>>> warning:WorkstationDeactivate: workstation not active or not opened
>>>
>>> I already changed the .hluresfile, but this is not the value I set either.
>>>
>>> Anybody has experience with ncl working well with launchctl? My python codes and ncl codes work perfectly, just not with the launchctl…
>>> It is probably not very relevant to NCL, but still. There must be somewhere within NCL calling $NCARG_ROOT but I haven't changed. But still, $NCARG_ROOT is now a universal variable….
>>>
>>> Thank you!
>>>
>>> Yu Cheng
>>>
>>>
>>> _______________________________________________
>>> 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 Thu Aug 29 12:33:47 2013

This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT