atlas.prepare_cutout_metadata(cutoutname=cutoutname,username=cutoutuser)
    else:
         atlas.prepare_cutout_metadata(cutoutname=cutoutname)

    server_filename = "meta_"+cutoutname+".npz";
    atlas.download_file_and_rename(remote_file=server_filename,local_file=f);
    atlas.delete_file(filename=server_filename);
    f.seek(0);
    shape = numpy.load(f)["latitudes"].shape;

    if (output != "JSON"):
        print("Opening and formatting layouts...");

    layout_files = [];
    for layout in capacitylayouts:
         layout_files.append(open_layout.open_layout_as_npy(layout,shape))


    if (conversion_name == None):
         conversion_name = atlas._get_unique_npy_file();
         
    else:
         #conversion_name += ".npy";
         name1 = "wind_"+username+"_"+cutoutname+"_"+conversion_name+".npy";
         conversion_name = name1;
         

    conversion_name_base = conversion_name[:-4];
    
    if (output != "JSON"): 
        print("Uploading layout(s)...");
Пример #2
0
    # layout_name = atlas._get_unique_npy_file();
    layout_name = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")+".npy"
    layout_name_base = layout_name[:-4];
    name = "layout_"+username+"_"+cutoutname+"_" +layout_name_base +"_"+ str(i).rjust(4,"0") + ".npy";
else:
     layout_name += ".npy"
     name = layout_name;

if (output != "JSON"):
    print("Opening and formatting layouts...");

if (output != "JSON"):
    print("Uploading layout...");

numpy.save(cwd+"/data/"+username+"/"+name,layoutTmp);
layout_file=open_layout.open_layout_as_npy(cwd+"/data/"+username+"/"+name,shape)
atlas.upload_from_file_and_rename(local_file=layout_file,remote_file=name);
     
if (output == "JSON"):
        outArr={}
        outArr['type']="Success"
        outArr['text']="Layout uploaded"
        outArr['desc']="Layout for user:"******" LayoutName:"+name
        outArr['traceback']= ''
        outArr['data'] = ''
        print (json.dumps(outArr));
else:
    print("");
    print("+--- Uploaded layout. --------------------+")
    print("| Result name: " + str(name).ljust(24) + "|");
    print("+------------- cut here ------------------+");