duncanwp / cis_plugins Goto Github PK
View Code? Open in Web Editor NEWMy CIS plugins
License: GNU Lesser General Public License v3.0
My CIS plugins
License: GNU Lesser General Public License v3.0
I am trying to collocate MODIS and AERONET daily AOD for each individual AERONET station.
AOD550_MODIS_collocated = latlon_MODIS_AOD_subset.collocated_onto(station, h_sep=10, t_sep='P1D')
AttributeError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
50 try:
---> 51 return getattr(obj, method)(*args, **kwds)
52
~/anaconda3/lib/python3.6/site-packages/pandas/core/generic.py in getattr(self, name)
5140 return self[name]
-> 5141 return object.getattribute(self, name)
5142
AttributeError: 'Series' object has no attribute 'nonzero'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
in
12
13 if latlon_MODIS_AOD_subset is not None:
---> 14 AOD550_MODIS_collocated = latlon_MODIS_AOD_subset.collocated_onto(station, h_sep=10, t_sep='P1D')#, h_sep=10)#,t_sep='P1D')
15 else:
16 AOD550_MODIS_collocated = [station.copy(np.ma.masked_all_like(station.data))]*3
~/anaconda3/lib/python3.6/site-packages/cis/data_io/common_data.py in collocated_onto(self, sample, how, kernel, missing_data_for_missing_sample, fill_value, var_name, var_long_name, var_units, **kwargs)
176 missing_data_for_missing_sample=missing_data_for_missing_sample,
177 fill_value=fill_value, var_name=var_name, var_long_name=var_long_name,
--> 178 var_units=var_units, **kwargs)
179
180 def plot(self, *args, **kwargs):
~/anaconda3/lib/python3.6/site-packages/cis/data_io/ungridded_data.py in sampled_from(self, data, how, kernel, missing_data_for_missing_sample, fill_value, var_name, var_long_name, var_units, **kwargs)
829 missing_data_for_missing_sample=missing_data_for_missing_sample,
830 fill_value=fill_value, var_name=var_name, var_long_name=var_long_name,
--> 831 var_units=var_units, **kwargs)
832
833 def _get_default_plot_type(self, lat_lon=False):
~/anaconda3/lib/python3.6/site-packages/cis/data_io/ungridded_data.py in _ungridded_sampled_from(sample, data, how, kernel, missing_data_for_missing_sample, fill_value, var_name, var_long_name, var_units, **kwargs)
1250 raise ValueError("Invalid argument, data must be either GriddedData or UngriddedData")
1251
-> 1252 return collocate(data, sample, col, con, kernel)
1253
1254
~/anaconda3/lib/python3.6/site-packages/cis/collocation/col.py in collocate(data, sample, collocator, constraint, kernel)
29 t1 = time()
30 try:
---> 31 new_data = collocator.collocate(sample, data, constraint, kernel)
32 except (TypeError, AttributeError) as e:
33 raise CoordinateNotFoundError('Collocator was unable to compare data points, check the dimensions of each '
~/anaconda3/lib/python3.6/site-packages/cis/collocation/col_implementations.py in collocate(self, points, data, constraint, kernel)
88 else:
89 for i, point, con_points in constraint.get_iterator(self.missing_data_for_missing_sample, None, None,
---> 90 data_points, None, sample_points, None):
91
92 try:
~/anaconda3/lib/python3.6/site-packages/cis/collocation/col_implementations.py in get_iterator(self, missing_data_for_missing_sample, coord_map, coords, data_points, shape, points, output_data)
357 d_points = data_points
358 for check in self.checks:
--> 359 d_points = d_points.iloc[check(d_points, p)]
360
361 yield i, p, d_points
~/anaconda3/lib/python3.6/site-packages/cis/collocation/col_implementations.py in time_constraint(self, points, ref_point)
296
297 def time_constraint(self, points, ref_point):
--> 298 return np.nonzero(np.abs(points.time - ref_point.time) < self.t_sep)[0]
299
300 def alt_constraint(self, points, ref_point):
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in nonzero(a)
1651
1652 """
-> 1653 return _wrapfunc(a, 'nonzero')
1654
1655
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
59 # a downstream library like 'pandas'.
60 except (AttributeError, TypeError):
---> 61 return _wrapit(obj, method, *args, **kwds)
62
63
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapit(obj, method, *args, **kwds)
43 if not isinstance(result, mu.ndarray):
44 result = asarray(result)
---> 45 result = wrap(result)
46 return result
47
~/anaconda3/lib/python3.6/site-packages/pandas/core/generic.py in array_wrap(self, result, context)
1788 return result
1789 d = self._construct_axes_dict(self._AXIS_ORDERS, copy=False)
-> 1790 return self._constructor(result, **d).finalize(
1791 self, method="array_wrap"
1792 )
~/anaconda3/lib/python3.6/site-packages/pandas/core/series.py in init(self, data, index, dtype, name, copy, fastpath)
312 if len(index) != len(data):
313 raise ValueError(
--> 314 f"Length of passed values is {len(data)}, "
315 f"index implies {len(index)}."
316 )
ValueError: Length of passed values is 1, index implies 48.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.