Return a dictionary of attrs when given an Iris object
(obj)
| 119 | |
| 120 | |
| 121 | def _iris_obj_to_attrs(obj): |
| 122 | """Return a dictionary of attrs when given an Iris object""" |
| 123 | attrs = {"standard_name": obj.standard_name, "long_name": obj.long_name} |
| 124 | if obj.units.calendar: |
| 125 | attrs["calendar"] = obj.units.calendar |
| 126 | if obj.units.origin != "1" and not obj.units.is_unknown(): |
| 127 | attrs["units"] = obj.units.origin |
| 128 | attrs.update(obj.attributes) |
| 129 | return {k: v for k, v in attrs.items() if v is not None} |
| 130 | |
| 131 | |
| 132 | def _iris_cell_methods_to_str(cell_methods_obj): |