def multinetcdfresult(request): #print 'URLREQ: ',request.matched_route.name sessionid = request.matchdict[ 'session'] #request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); #sessiontask=tasks[sessionid] #session=sessiontask['session'] #scan session folder for images session = picnicsession.loadsession(sessionid) if 'starttime' in session: session['starttime'] = datetime.strptime(session['starttime'], picnicsession.json_dateformat) if 'endtime' in session: session['endtime'] = datetime.strptime(session['endtime'], picnicsession.json_dateformat) return { 'plainurls': sessionUrls(request, sessionid, ('.json', '.cdl')), 'session': session, 'datetime': datetime, 'timedelta': timedelta, 'printNumber': picnicsession.printNumber, 'sessionActive': picnicsession.sessionActive(session) }
def netcdfresult(request): #print 'URLREQ: ',request.matched_route.name sessionid = request.matchdict[ 'session'] #request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); #sessiontask=tasks[sessionid] #session=sessiontask['session'] #scan session folder for images session = picnicsession.loadsession(sessionid) if 'starttime' in session: session['starttime'] = datetime.strptime(session['starttime'], picnicsession.json_dateformat) if 'endtime' in session: session['endtime'] = datetime.strptime(session['endtime'], picnicsession.json_dateformat) fullfilename = picnicsession.sessionfile( sessionid, session['filename']) #safejoin(folder,session['filename']) try: from netCDF4 import Dataset nc = Dataset(fullfilename, 'r') inf = picnicsession.infoOfFile(fullfilename) e = None except Exception, err: nc = None inf = [None, None, 0, None] e = err
def netcdfreimage(request): #print 'URLREQ: ',request.matched_route.name sessionid = request.matchdict[ 'session'] #request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); session = picnicsession.loadsession(sessionid) return picnicsession.newSessionProcess("readnetcdf", request, session)
def imageresult(request): #print 'URLREQ: ',request.matched_route.name sessionid=request.matchdict['session']#request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); #sessiontask=tasks[sessionid] #session=sessiontask['session'] #scan session folder for images session=picnicsession.loadsession(sessionid) if 'starttime' in session: session['starttime']=datetime.strptime(session['starttime'],picnicsession.json_dateformat) if 'endtime' in session: session['endtime']=datetime.strptime(session['endtime'],picnicsession.json_dateformat) #send to template return { 'imageurls':sessionUrls(request,sessionid,('.png','.jpg')) , 'plainurls':sessionUrls(request,sessionid,('.json','.cdl')), 'session':session, 'timedelta':timedelta }
def multinetcdfresult(request): #print 'URLREQ: ',request.matched_route.name sessionid=request.matchdict['session']#request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); #sessiontask=tasks[sessionid] #session=sessiontask['session'] #scan session folder for images session=picnicsession.loadsession(sessionid) if 'starttime' in session: session['starttime']=datetime.strptime(session['starttime'],picnicsession.json_dateformat) if 'endtime' in session: session['endtime']=datetime.strptime(session['endtime'],picnicsession.json_dateformat) return { 'plainurls':sessionUrls(request,sessionid,('.json','.cdl')), 'session':session, 'datetime':datetime, 'timedelta':timedelta, 'printNumber':picnicsession.printNumber, 'sessionActive':picnicsession.sessionActive(session)}
def reimagerequest(request): #print 'URLREQ: ',request.matched_route.name sessionid=request.matchdict['session']#request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); session=picnicsession.loadsession(sessionid) if True: oldsessionid=sessionid pysession=request.session sessionid=pysession.new_csrf_token() session['sessionid']=sessionid session['finalpage']=request.route_path('imageresult',session=sessionid); for f in ('display_parameters.json','process_parameters.json'): j=picnicsession.loadjson(oldsessionid,f,failvalue=None) if j!=None: picnicsession.storejson(sessionid,j,f) return picnicsession.newSessionProcess("createimages",request,session)
def main(): import sys import os import picnicsession picnicsession.addDispatchers(getDispatchers()) loc = sys.argv[1] sess = '' while len(sess) == 0: sess = os.path.basename(loc) loc = os.path.dirname(loc) sessions = loc print sess print sessions os.environ['SESSIONFOLDER'] = sessions os.putenv('SESSIONFOLDER', sessions) session = picnicsession.loadsession(sess) picnicsession.taskdispatch('createimages', None, session)
def main(): import sys import os import picnicsession picnicsession.addDispatchers(getDispatchers()) loc=sys.argv[1] sess='' while len(sess)==0: sess=os.path.basename(loc) loc=os.path.dirname(loc) sessions=loc print sess print sessions os.environ['SESSIONFOLDER']=sessions os.putenv('SESSIONFOLDER',sessions) session=picnicsession.loadsession(sess) picnicsession.taskdispatch('createimages',None,session)
def reimagerequest(request): #print 'URLREQ: ',request.matched_route.name sessionid = request.matchdict[ 'session'] #request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); session = picnicsession.loadsession(sessionid) if True: oldsessionid = sessionid pysession = request.session sessionid = pysession.new_csrf_token() session['sessionid'] = sessionid session['finalpage'] = request.route_path('imageresult', session=sessionid) for f in ('display_parameters.json', 'process_parameters.json'): j = picnicsession.loadjson(oldsessionid, f, failvalue=None) if j != None: picnicsession.storejson(sessionid, j, f) return picnicsession.newSessionProcess("createimages", request, session)
def imageresult(request): #print 'URLREQ: ',request.matched_route.name sessionid = request.matchdict[ 'session'] #request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); #sessiontask=tasks[sessionid] #session=sessiontask['session'] #scan session folder for images session = picnicsession.loadsession(sessionid) if 'starttime' in session: session['starttime'] = datetime.strptime(session['starttime'], picnicsession.json_dateformat) if 'endtime' in session: session['endtime'] = datetime.strptime(session['endtime'], picnicsession.json_dateformat) #send to template return { 'imageurls': sessionUrls(request, sessionid, ('.png', '.jpg')), 'plainurls': sessionUrls(request, sessionid, ('.json', '.cdl')), 'session': session, 'timedelta': timedelta }
def netcdfresult(request): #print 'URLREQ: ',request.matched_route.name sessionid=request.matchdict['session']#request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); #sessiontask=tasks[sessionid] #session=sessiontask['session'] #scan session folder for images session=picnicsession.loadsession(sessionid) if 'starttime' in session: session['starttime']=datetime.strptime(session['starttime'],picnicsession.json_dateformat) if 'endtime' in session: session['endtime']=datetime.strptime(session['endtime'],picnicsession.json_dateformat) fullfilename=picnicsession.sessionfile(sessionid,session['filename'])#safejoin(folder,session['filename']) try: from netCDF4 import Dataset nc=Dataset(fullfilename,'r') inf=picnicsession.infoOfFile(fullfilename) e=None except Exception, err: nc=None inf=[None,None,0,None] e=err
def netcdfreimage(request): #print 'URLREQ: ',request.matched_route.name sessionid=request.matchdict['session']#request.session.get_csrf_token();#params.getone('csrf_token') #folder=picnicsession.sessionfolder(sessionid); session=picnicsession.loadsession(sessionid) return picnicsession.newSessionProcess("readnetcdf",request,session)