Changeset 3688
- Timestamp:
- Jan 22, 2019 10:44:20 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_csd
r3668 r3688 25 25 # ----------------- 26 26 # $Id$ 27 # Some unspecified bugfixes 28 # 29 # 3668 2019-01-14 12:49:24Z maronga 27 30 # Various improvements and bugfixes 28 31 # … … 43 46 # @todo Allow for ASCII input of terrain height and building height 44 47 # @todo Modularize reading config file 48 # @todo Convert to object-oriented treatment (buidings, trees) 49 # @todo Automatically shift child domains so that their origin lies intersects 50 # a edge note of the parent grid 45 51 #------------------------------------------------------------------------------# 46 52 … … 457 463 458 464 459 x_UTM = nc_read_from_file_2d(input_file_x[ii[i]], "Band1", domain_x0[i], domain_x0[i], domain_y0[i], domain_y0[i]) 460 y_UTM = nc_read_from_file_2d(input_file_y[ii[i]], "Band1", domain_x0[i], domain_x0[i], domain_y0[i], domain_y0[i]) 465 x_UTM = nc_read_from_file_2d(input_file_x[ii[i]], "Band1", domain_x0[i], domain_x0[i], domain_y0[i], domain_y0[i]) - 0.5 * domain_px[i] 466 y_UTM = nc_read_from_file_2d(input_file_y[ii[i]], "Band1", domain_x0[i], domain_x0[i], domain_y0[i], domain_y0[i]) - 0.5 * domain_px[i] 461 467 lat = nc_read_from_file_2d(input_file_lat[ii[i]], "Band1", domain_x0[i], domain_x0[i], domain_y0[i], domain_y0[i]) 462 468 lon = nc_read_from_file_2d(input_file_lon[ii[i]], "Band1", domain_x0[i], domain_x0[i], domain_y0[i], domain_y0[i]) … … 466 472 nc_write_global_attributes(filename[i],float(x_UTM[0,0]),float(y_UTM[0,0]),float(lat[0,0]),float(lon[0,0]),"",global_acronym,global_angle,global_author,global_campaign,global_comment,global_contact,global_data_content,global_dependencies,global_institution,global_keywords,global_location,global_palm_version,global_references,global_site,global_source,version_out) 467 473 474 del x_UTM, y_UTM, lat, lon 468 475 469 476 # Process terrain height … … 596 603 for i in range(0,ndomains): 597 604 buildings_2d = nc_read_from_file_2d(input_file_buildings_2d[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i]) 598 605 599 606 building_id = nc_read_from_file_2d(input_file_building_id[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i]) 600 607 … … 615 622 print("Data check #2 " + str(check_arrays_2(buildings_2d,building_type,fillvalues["buildings_2d"],fillvalues["building_type"]))) 616 623 617 624 618 625 nc_write_to_file_2d(filename[i], 'buildings_2d', buildings_2d, datatypes["buildings_2d"],'y','x',fillvalues["buildings_2d"]) 619 626 nc_write_attribute(filename[i], 'buildings_2d', 'long_name', 'buildings') … … 637 644 nc_write_attribute(filename[i], 'building_type', 'coordinates', 'E_UTM N_UTM lon lat') 638 645 nc_write_attribute(filename[i], 'building_type', 'grid_mapping', 'E_UTM N_UTM lon lat') 639 640 print("out_1: " + str(np.any(building_type == -2)))641 646 642 647 del buildings_2d … … 1013 1018 lai = vegetation_pars[1,:,:] 1014 1019 1015 1016 1020 # Determine all pixels that do not already have and LAD but which are high vegetation to a dummy value of 1.0 and remove all other pixels 1017 1021 lai_high = np.where( (lad[0,:,:] == fillvalues["tree_data"]) & ( ( (vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18) ) & ( (patch_height == fillvalues["tree_data"]) | (patch_height >= domain_dz[i])) ),1.0,fillvalues["tree_data"]) … … 1043 1047 1044 1048 # If desired, remove all high vegetation. TODO: check if this is still necessary 1045 if domain_high_vegetation[i]:1049 if not domain_high_vegetation[i]: 1046 1050 vegetation_type = np.where((vegetation_type != fillvalues["vegetation_type"]) & ( (vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18) ),3,vegetation_type) 1047 1051
Note: See TracChangeset
for help on using the changeset viewer.