Please create a php function that returns an array with the X% value for the lowest and the X% value from the highest value for each month and day.
The data is in the format: id,year,month,day,element,value.
Discard any value that is not numeric from your calculation, ex - -6T.
See attached csv file for data to test against (93051 lines).
Be willing to demonstrate results on your server before final payment by including a textarea field where I can drop data into (see format below and in the attached csv file). I will want to test against a small sample size, less than 100 rows of data.
function X_value ($data, $element, $percent)
{
// do something
}
$results = X_value($data, "TMIN", 90);
print_r($results);
[USC00101017] => Array
(
[01] => Array
(
[1] => Array
(
[TMIN] => Array
(
[90] => Array
(
[min] => -6
[max] => 72
)
)
)
[2] => Array
(
[TMIN] => Array
(
[90] => Array
(
[min] => // some number
[max] => // some number
)
)
)
...
)
[02] => Array
(
[1] => Array
(
[TMIN] => Array
(
[90] => Array
(
[min] => // some number
[max] => // some number
)
)
)
[2] => Array
(
[TMIN] => Array
(
[90] => Array
(
[min] => // some number
[max] => // some number
)
)
)
...
)
...
)
ex - 90% (min) for TMIN for May 1 is -22, 90% (max) for TMIN for May 1 is 72
USC00101017,2013,05,1,TMIN,-56
USC00101017,2008,05,1,TMIN,-33
USC00101017,2011,05,1,TMIN,-22 << 90% (min)
USC00101017,1997,05,1,TMIN,-6
USC00101017,2010,05,1,TMIN,-6
USC00101017,2009,05,1,TMIN,0
USC00101017,2001,05,1,TMIN,6
USC00101017,2012,05,1,TMIN,17
USC00101017,2003,05,1,TMIN,28
USC00101017,2006,05,1,TMIN,28
USC00101017,2015,05,1,TMIN,28
USC00101017,2016,05,1,TMIN,28
USC00101017,2002,05,1,TMIN,44
USC00101017,2005,05,1,TMIN,44
USC00101017,1999,05,1,TMIN,56
USC00101017,2004,05,1,TMIN,56
USC00101017,2014,05,1,TMIN,56
USC00101017,2000,05,1,TMIN,72 << 90% (max)
USC00101017,2007,05,1,TMIN,83
USC00101017,1998,05,1,TMIN,94
In your proposal here or through private message, let me know how you will handle calculating the 90% level when there are 5 values to work with, ex - 1,3,7,7,13 ... what value would you use for the 90% min and max?