Changeset 4663 for palm/trunk
- Timestamp:
- Sep 2, 2020 2:54:09 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_cvd
r4400 r4663 21 21 # Current revisions: 22 22 # ----------------- 23 # 24 # 23 # 24 # 25 25 # Former revisions: 26 26 # ----------------- 27 27 # $Id$ 28 # bugfix in non_measurable_vars; ignore station_h if featureType is trajectory 29 # 30 # 4400 2020-02-10 20:32:41Z suehring 28 31 # Initial revision 29 #30 #31 # $32 32 # 33 33 # Description: … … 60 60 61 61 # Definition of global configuration parameters 62 global global_acronym 63 global global_author 64 global global_campaign 65 global global_comment 66 global global_contact 62 global global_acronym 63 global global_author 64 global global_campaign 65 global global_comment 66 global global_contact 67 67 global global_data_content 68 68 global global_dependencies 69 global global_institution 70 global global_keywords 71 global global_location 72 global global_references 73 global global_site 74 global global_source 69 global global_institution 70 global global_keywords 71 global global_location 72 global global_references 73 global global_site 74 global global_source 75 75 global global_palm_version 76 global data_path 77 global output_path 78 global output_filename 76 global data_path 77 global output_path 78 global output_filename 79 79 global number_positions 80 80 global input_from_observations … … 108 108 # Check if configuration files exists and quit otherwise 109 109 input_config = ".cvd.config.default" 110 for i in range(1,len(sys.argv)): 110 for i in range(1,len(sys.argv)): 111 111 input_config = str(sys.argv[i]) 112 112 … … 120 120 121 121 config.read(input_config) 122 122 123 123 for section in range( 0, len( config.sections() ) ): 124 124 … … 155 155 output_filename = config.get( current_section, 'output_filename' ) 156 156 157 # Read customized coordinates where virtual measurements shall be taken, 157 # Read customized coordinates where virtual measurements shall be taken, 158 158 # as well as the variables that should be sampled. 159 159 elif ( current_section == 'custom_positions' ): … … 209 209 'vrs', 'x', 'y', 'z', 'lon', 'lat', 'ntime', 'station', 'traj', \ 210 210 'E_UTM', 'N_UTM', 'height_above_origin', 'station_h', \ 211 'traj_name', 'height', 'band_pm_size', 'bands_pm', 'bands_pm_size_bounds' \211 'traj_name', 'height', 'band_pm_size', 'bands_pm', 'bands_pm_size_bounds', \ 212 212 'bands_pm_size', 'ancillary_detected_layer' ] 213 213 … … 216 216 dims_out = [ name_eutm, name_nutm, name_hao, name_z, name_station_h ] 217 217 218 # Define list of attributes which need to be of type float. In the data set this is not 218 # Define list of attributes which need to be of type float. In the data set this is not 219 219 # necessarily guranteed. 220 220 atts_float = [ 'origin_x', 'origin_y', 'origin_z', 'origin_lon', 'origin_lat', 'rotation_angle' ] … … 256 256 257 257 258 # Check if observational data is available. This case, 259 # obtain an alphabetically sorted list of input data. List is sorted 258 # Check if observational data is available. This case, 259 # obtain an alphabetically sorted list of input data. List is sorted 260 260 # just for the sake of clarity in the resulting setup file. 261 261 if ( input_from_observations == True ): … … 369 369 for var in ncfile_in.variables.keys(): 370 370 if ( var in dims_out ): 371 # Create a variable and write it to file after it is read. In order to 372 # avoid fill values in the dimensions, these are converted to zero 371 # Create a variable and write it to file after it is read. In order to 372 # avoid fill values in the dimensions, these are converted to zero 373 373 # before written to file. Depending on the featureType of the measurement, 374 # the array shape is different. For more informations, please see 374 # the array shape is different. For more informations, please see 375 375 # [UC]2 data standard. 376 376 # Timeseries 377 if ( feature == name_ts ): 377 if ( feature == name_ts ): 378 378 temp_ts = ncfile_out.createVariable( var + str(num_vmeas), float, \ 379 379 name_station + str(num_vmeas)) … … 382 382 # Trajectories 383 383 elif ( feature == name_traj ): 384 temp_traj = ncfile_out.createVariable( var + str(num_vmeas), float, \ 385 ( name_traj_dim + str(num_vmeas), \ 386 name_ntime + str(num_vmeas) ) ) 387 temp_traj[:,:] = np.nan_to_num( ncfile_in.variables[var][:,:] ) 384 # @note: If there are files where station_h is present although featureType is 385 # trajectory, station_h must not be read. 386 if var != name_station_h: 387 temp_traj = ncfile_out.createVariable( var + str(num_vmeas), float, \ 388 ( name_traj_dim + str(num_vmeas), \ 389 name_ntime + str(num_vmeas) ) ) 390 temp_traj[:,:] = np.nan_to_num( ncfile_in.variables[var][:,:] ) 388 391 389 392 # TimeseriesProfiles … … 411 414 ncfile_in.close() 412 415 413 # Set flag to indicate that for this specific site dimensions have been 416 # Set flag to indicate that for this specific site dimensions have been 414 417 # already created and attributes are already set. 415 418 if ( create_metadata_for_site[sites.index( site )] != "Done" ): … … 507 510 measured_variables.append(var) 508 511 509 # Check if given variables are already in the default variables. 512 # Check if given variables are already in the default variables. 510 513 # If not, extend. 511 514 for var in custom_vars: … … 549 552 550 553 quit() 551
Note: See TracChangeset
for help on using the changeset viewer.