Skip to content
Snippets Groups Projects
Select Git revision
  • 09f7e2d228b9e541009981c01ba8636c9b6c4677
  • master default protected
  • enxhi_issue460_remove_TOAR-I_access
  • michael_issue459_preprocess_german_stations
  • sh_pollutants
  • develop protected
  • release_v2.4.0
  • michael_issue450_feat_load-ifs-data
  • lukas_issue457_feat_set-config-paths-as-parameter
  • lukas_issue454_feat_use-toar-statistics-api-v2
  • lukas_issue453_refac_advanced-retry-strategy
  • lukas_issue452_bug_update-proj-version
  • lukas_issue449_refac_load-era5-data-from-toar-db
  • lukas_issue451_feat_robust-apriori-estimate-for-short-timeseries
  • lukas_issue448_feat_load-model-from-path
  • lukas_issue447_feat_store-and-load-local-clim-apriori-data
  • lukas_issue445_feat_data-insight-plot-monthly-distribution
  • lukas_issue442_feat_bias-free-evaluation
  • lukas_issue444_feat_choose-interp-method-cams
  • 414-include-crps-analysis-and-other-ens-verif-methods-or-plots
  • lukas_issue384_feat_aqw-data-handler
  • v2.4.0 protected
  • v2.3.0 protected
  • v2.2.0 protected
  • v2.1.0 protected
  • Kleinert_etal_2022_initial_submission
  • v2.0.0 protected
  • v1.5.0 protected
  • v1.4.0 protected
  • v1.3.0 protected
  • v1.2.1 protected
  • v1.2.0 protected
  • v1.1.0 protected
  • IntelliO3-ts-v1.0_R1-submit
  • v1.0.0 protected
  • v0.12.2 protected
  • v0.12.1 protected
  • v0.12.0 protected
  • v0.11.0 protected
  • v0.10.0 protected
  • IntelliO3-ts-v1.0_initial-submit
41 results

test_data_generator.py

Blame
  • vtk_export.c 971 B
    
    #include <stdlib.h>
    #include <stdio.h>
    
    #define Q(i, j, k) Q[((k) + (n) * ((j) + (m) * (i)))]
    
    
    
    void save_vtk(double *Q, double *x, double *y, int m, int n) {
      
      int i, j;
      FILE *fp = fopen("result.vtk", "w");
      
      /* Write vtk Datafile header */
      fprintf(fp, "# vtk DataFile Version 2.0\n");
      fprintf(fp, "VTK\nASCII\nDATASET POLYDATA\n");
    
      /* Store water height as polydata */
      fprintf(fp, "\nPOINTS %d double\n", m*n);
      
      for (j = 0; j < n; j++) 
        for (i = 0; i < m; i++)
          fprintf(fp, "%e %e %e\n", x[i], y[j], Q(0, i, j));
    
      fprintf(fp,"\nVERTICES %d %d\n", n, n *(m+1));
      for (j = 0; j < n; j++)  {
        fprintf(fp, "%d ", m);
        for (i = 0; i < m; i++) 
          fprintf(fp, "%d ", i+j*m);
        fprintf(fp,"\n");
      }
    
      /* Store lookup table */
      fprintf(fp,
    	  "POINT_DATA %d\nSCALARS height double 1\nLOOKUP_TABLE default\n",m*n);
      for (j = 0; j < n; j++)
        for (i = 0; i < m; i++)
          fprintf(fp, "%e\n", Q(0, i, j));
      fclose(fp);     
    }