Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

OOPS (Re: missing points break up surface)

There is an error in my code for reconstructing an irregular
topology using the non-missing points.  A more accurate version
is:
 
  float[][] set_samples = domainSet.getSamples();
  // count non-missing samples
  int len = 0;
  for (int i=0; i<LengthX*LengthY; i++) {
    if (samples[0][i] == samples[0][i]) len++; // not missing
  }
  FlatField new_ff = null;
  if (len > 0) {
    float[][] new_set_samples = new float[2][len];
    double[][] new_samples = new double[2][len];
    len = 0;
    for (int i=0; i<LengthX*LengthY; i++) {
      if (samples[0][i] == samples[0][i]) {
        new_set_samples[0][len] = set_samples[0][i];
        new_set_samples[1][len] = set_samples[1][i];
        new_samples[0][len] = samples[0][i];
        new_samples[1][len] = samples[1][i];
        len++;
      }
    }
    Set new_domainSet = new Irregular2DSet( Domain, new_set_samples );
    new_ff = new FlatField( overfunc, new_domainSet );
    new_ff.setSamples(new_samples);
  }
  // now new_ff can be used in place of ff
  // if all points are missing, new_ff == null
 
> Since I don't have your data or ArcGridReader I was not able to test
> my code examples, so there may be a few bugs.
 
I was right.
 
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
whibbard@xxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html
 

  • 1999 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: