Inverse distance weighted interpolation

Assignment Help Chemistry
Reference no: EM13874362

It is well known that IDW(Inverse Distance Weighted Interpolation) will not yield exactly the same value if we use the known locations as the input. Write a Python program to test
this property.

The following is a Python implementation of IDW. This function takes two input variables. Z is a list of lists where each element list contains four values: X, Y, Value, and Distance to target point. Z can also be a NumPy 2-D array. Variable b is the power of distance. It returns the estimated value at the target location. Note that we don't need to specify the target location per se. Instead in Z we have the distance from each known location to the target point.

def IDW(Z, b):
zw = 0.0 # sum of weighted z
sw = 0.0 # sum of weights
N = len(Z) # number of points in the data
for i in range(N):
  d = Z[i][3]
  if d == 0:
      return Z[i][2]
 w = 1.0/d**b
 sw += w
 zw += w*Z[i][2]
return zw/sw

Reference no: EM13874362

Questions Cloud

Describe what you feel to a good performance appraisal : Describe what you feel would be a good performance appraisal system -OR- do you feel that most performance appraisal systems serve little to no benefit to organizations and are a waste of time? Please support your rationale.
What are universal wastes? : What are universal wastes?
Company has calculated its pretax income : At the beginning of 2010, the retained earnings of the Cameron Company were $212,000. For 2010, the company has calculated its pretax income from continuing operations to be $120,000. During 2010, the following events also occurred:
How would presence of second technology that had higher cost : How would the presence of a second technology that had higher operating costs but lower capacity costs affect peak-load pricing and investment in the capital-intensive technology?
Inverse distance weighted interpolation : The following is a Python implementation of IDW. This function takes two input variables. Z is a list of lists where each element list contains four values: X, Y, Value, and Distance to target point. Z can also be a NumPy 2-D array. Variable b is the..
Find the largest number of these intervals so : Compatible intervals Given n open intervals (a1, b1), (a2, b2), . . . , (an, bn) on the real line, each representing start and end times of some activity requiring the same resource, the task is to find the largest number of these intervals so that n..
Explain why it is possible to interpret a two-part tariff : Explain why it is possible to interpret a two-part tariff as a two-block-rate tariff. Explain the circumstances under which this equivalency might not hold. Why might a consumer choose to have access and still consume zero units?
Practice of public health or community health nursing : Identify a new law or regulation that affects the practice of public health or community health nursing.
Show the number of students whose zip is 07070 : Show the number of students whose zip is 07070. List all students (display student_id, first name, last name, and employer) who live in Columbus, OH. Show the zip, state and city that have > 5 students as residents.

Reviews

Write a Review

Chemistry Questions & Answers

  What is the value for w for this reaction

A chemical reaction takes place in a container of cross-sectional area 100 cm2 As a result of . the reaction, a piston is pushed out through 11 cm against an external pressure of 689 torr. What is the value for w for this reaction?

  Explain what mass of hydrogen gas will be produce

The following reaction takes place when some drain cleaners are added to water. What mass of hydrogen gas will be produce from 4.76 g of aluminum and 3.23 g of NaOH- 2Al(s) + 2NaOH(s) + 6H2O(l) -> 2NaAl(OH)(aq) + 3H2(g)

  Explain the dilution of the buffer should not change the ph

The dilution of the buffer should not change the pH of the buffer by very much. Explain why not.

  Explain increase the rate at which water evaporates

Which factor of the following would increase the rate at which water evaporates from an open container

  Explain how organizations should respond to security

Explain how organizations should respond to security incidents. Provide an example to support your answer

  State what is the value of the equilibrium constant

What is the value of the equilibrium constant at this temperature for the reaction of SO2 with N2O to form SO3 and N2 (balanced with lowest whole-number coefficients)?

  Calculate the wavelength of the x rays in nm

The distance between layers in a crystal is 321 pm. X rays are diffracted from these layers at an angle of 45.6°. Assuming that n = 4, calculate the wavelength of the X rays in nm.

  Explain the three ph cases for phenylalanine

Include drawings of each of the three ph cases for phenylalanine, and be certain to include the appropriate locations of charge on your molecular structure.

  What volume of sodium hydroxide solution is required

What volume (in mL) of a 1.420M NaOH solution is required to titrate 25.0mL of 4.50M HCl solution.

  Calculate the molecule weight of the liquidnbsp if 231grams

calculate the molecule weight of the liquidnbsp if 2.31grams of the vapor of a volatile liquid is able to fill a 498-ml

  Explain the binding energy is larger in the crystal

The internuclear distance in NaCl(g) is 2.3606 angstrom, whereas in NaCl(s) the shortest Na-Cl distance is 2.814 angstrom. Explain why this should be so when the binding energy is larger in the crystal.

  Explain what are the new concentrations of weak acid

Explain what is the pH of a 1.00 L solution which primarily has 0.051 mol acetic acid and 0.029 mol sodium acetate once 0.006mols of NaOH has been added. Ka for acetic acid is 1.8x10-5. Explain what are the new concentrations of weak acid and weak..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd