Ignore:
Timestamp:
Mar 1, 2019 8:56:57 AM (3 years ago)
Author:
maronga
Message:

added output of theta_2m_av and minor revisions in palm_csd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palm_csd

    r3726 r3773  
    2525# -----------------
    2626# $Id$
     27# Unspecificed changes
     28#
     29# 3726 2019-02-07 18:22:49Z maronga
    2730# Removed some more bugs
    2831#
     
    521524      tmp_x1 = int( domain_x1[i] * domain_px[i] / domain_px[parent_id] ) + 1
    522525      tmp_y1 = int( domain_y1[i] * domain_px[i] / domain_px[parent_id] ) + 1
    523       print(tmp_x0)
    524       print(tmp_x1)     
    525       print(tmp_y0)
    526       print(tmp_y1) 
    527526
    528527      tmp_x = nc_read_from_file_1d(input_file_x[ii_parent[i]], "x", tmp_x0, tmp_x1)
     
    539538     
    540539#     Shift the child terrain height according to the parent mean terrain height
     540      print("shifting: -" + str(np.mean(zt)) + " +" + str(np.mean(zt_ip)))
     541      #zt = zt - np.min(zt) + np.min(zt_ip)
    541542      zt = zt - np.mean(zt) + np.mean(zt_ip)
    542543 
     
    544545#     Blend over the parent and child terrain height within a radius of 50 px 
    545546      zt = blend_array_2d(zt,zt_ip,50)
     547     # zt = zt_ip
    546548   
    547549#  Final step: add zt array to the global array   
     
    714716
    715717   building_type = nc_read_from_file_2d_all(filename[i], 'building_type')
    716     
     718   
    717719   vegetation_type = nc_read_from_file_2d(input_file_vegetation_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
    718720   vegetation_type[vegetation_type == 255] = fillvalues["vegetation_type"]
     
    745747   pavement_type = np.where((pavement_type != fillvalues["pavement_type"]) & (building_type != fillvalues["building_type"]),fillvalues["pavement_type"],pavement_type) 
    746748
    747 #  #5 Remove pavement for pixels with water
    748    pavement_type = np.where((pavement_type != fillvalues["pavement_type"]) & (water_type != fillvalues["water_type"]),fillvalues["pavement_type"],pavement_type)  
    749 
     749#  #5 Remove pavement for pixels with water.
     750   pavement_type = np.where((pavement_type != fillvalues["pavement_type"]) & (water_type != fillvalues["water_type"]),fillvalues["pavement_type"],pavement_type)
     751   
    750752#  #6 Remove water for pixels with buildings
    751753   water_type = np.where((water_type != fillvalues["water_type"]) & (building_type != fillvalues["building_type"]),fillvalues["water_type"],water_type)
    752  
    753    
     754
    754755#  Correct vegetation_type when a vegetation height is available and is indicative of low vegeetation
    755756   vegetation_height = nc_read_from_file_2d(input_file_vegetation_height[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
     
    843844   street_type[street_type == 255] = fillvalues["street_type"]
    844845   street_type = np.where((street_type < 1) & (street_type != fillvalues["street_type"]),defaultvalues["street_type"],street_type)
    845    
     846
     847   pavement_type = nc_read_from_file_2d_all(filename[i], 'pavement_type')
     848   street_type = np.where((pavement_type == fillvalues["pavement_type"]),fillvalues["street_type"],street_type)
     849
    846850   nc_write_to_file_2d(filename[i], 'street_type', street_type, datatypes["street_type"],'y','x',fillvalues["street_type"])
    847851   nc_write_attribute(filename[i], 'street_type', 'long_name', 'street type')
Note: See TracChangeset for help on using the changeset viewer.