parser.add_argument("--output",nargs="?",type=str,help="output type (print/JSON) ");
parser.add_argument("--save_sum",action='store_true',help="If True, sum of potential output will be saved for all grid cells in outfile+_sum.npy. False by default. ");
parser.set_defaults(save_sum=False)

args = parser.parse_args();

server = args.server[0];
port = args.port
username = args.username;
password = args.password;
cutoutname = args.cutoutname[0];
cutoutuser = args.cutoutuser
conversion_name = args.name;
save_sum = args.save_sum

onshorecurve = reatlas_client.turbineconf_to_powercurve_object(args.onshorepowercurve[0]);
offshorecurve = reatlas_client.turbineconf_to_powercurve_object(args.offshorepowercurve[0]);
capacitylayouts = args.capacitylayout;
output = args.output

if (username == None):
     username = raw_input("username: "******"password: ");

try:
    if (port != None):
         atlas = reatlas_client.REatlas(server,port);
    else:
         atlas = reatlas_client.REatlas(server);
Beispiel #2
0
print("56.9,7.5 degrees has index " + str((i, j)) + ".")

# Prepare for wind conversion:

# Make a capacity layout with 0 everywhere but in (i,j)
layout = numpy.zeros(Denmark["latitudes"].shape)
layout[i, j] = 1.0

# Upload it

numpy.save("layout.npy", layout)
atlas.upload_file(filename="layout.npy")

# Load the power curve
Vestas90 = reatlas_client.turbineconf_to_powercurve_object("TurbineConfig/Vestas_V90_3MW.cfg")

# Start a wind conversion on Denmark:

atlas.select_cutout(cutoutname="Denmark", username="******")

wind_job = atlas.convert_and_aggregate_wind(
    result_name="myresult", onshorepowercurve=Vestas90, offshorepowercurve=Vestas90, capacitylayouts=["layout.npy"]
)

# Find the temporal index for January 13, 1992 at 05.00 UTC

idx = numpy.where(Denmark["dates"] == datetime.datetime(1992, 1, 13, 5, 0))[0][0]

print("January 13, 1992 at 05.00 UTC has index " + str(idx) + ".")