{"id":107830,"date":"2025-12-11T06:42:26","date_gmt":"2025-12-11T06:42:26","guid":{"rendered":"https:\/\/ahay.org\/blog\/?p=107830"},"modified":"2025-12-11T21:29:32","modified_gmt":"2025-12-11T21:29:32","slug":"xarray-interface","status":"publish","type":"post","link":"https:\/\/ahay.org\/blog\/2025\/12\/11\/xarray-interface\/","title":{"rendered":"Xarray interface"},"content":{"rendered":"\n<p><a href=\"https:\/\/docs.xarray.dev\/en\/stable\/\" data-type=\"link\" data-id=\"https:\/\/docs.xarray.dev\/en\/stable\/\">Xarray<\/a> interface for Madagascar has been added. All the Madagascar programs can now be directly applied to an <code>xarray.DataArray<\/code> object, similar to Madagascar&#8217;s existing <a href=\"https:\/\/ahay.org\/blog\/2021\/04\/09\/enhancements-to-python-interface\/\" data-type=\"link\" data-id=\"https:\/\/ahay.org\/blog\/2021\/04\/09\/enhancements-to-python-interface\/\">NumPy<\/a> and <a href=\"https:\/\/ahay.org\/blog\/2013\/06\/13\/extending-matlab-interface\/\" data-type=\"link\" data-id=\"https:\/\/ahay.org\/blog\/2013\/06\/13\/extending-matlab-interface\/\">MATLAB<\/a> interface. <\/p>\n\n\n\n<p><strong>Why Xarray?<\/strong> While the NumPy interface is useful, Xarray offers a major advantage. It preserves metadata (coordinates, dimensions, and units) alongside the data. This allows the interface to automatically handle RSF header attributes. See <a href=\"https:\/\/github.com\/mssujith\/ipython\/blob\/master\/MXarray.ipynb\" data-type=\"link\" data-id=\"https:\/\/github.com\/mssujith\/ipython\/blob\/master\/MXarray.ipynb\">an example<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ahay.org\/blog\/wp-content\/uploads\/2025\/12\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1634\" height=\"1734\" src=\"https:\/\/ahay.org\/blog\/wp-content\/uploads\/2025\/12\/image-3.png\" alt=\"\" class=\"wp-image-107844 img-thumbnail img-responsive\" srcset=\"https:\/\/ahay.org\/blog\/wp-content\/uploads\/2025\/12\/image-3.png 1634w, https:\/\/ahay.org\/blog\/wp-content\/uploads\/2025\/12\/image-3-283x300.png 283w, https:\/\/ahay.org\/blog\/wp-content\/uploads\/2025\/12\/image-3-965x1024.png 965w, https:\/\/ahay.org\/blog\/wp-content\/uploads\/2025\/12\/image-3-768x815.png 768w, https:\/\/ahay.org\/blog\/wp-content\/uploads\/2025\/12\/image-3-1447x1536.png 1447w\" sizes=\"auto, (max-width: 1634px) 100vw, 1634px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Xarray interface for Madagascar has been added. All the Madagascar programs can now be directly applied to an xarray.DataArray object, similar to Madagascar&#8217;s existing NumPy and MATLAB interface. Why Xarray? While the NumPy interface is useful, Xarray offers a major advantage. It preserves metadata (coordinates, dimensions, and units) alongside the data. This allows the interface [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-107830","post","type-post","status-publish","format-standard","hentry","category-systems"],"_links":{"self":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/107830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/comments?post=107830"}],"version-history":[{"count":4,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/107830\/revisions"}],"predecessor-version":[{"id":107851,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/107830\/revisions\/107851"}],"wp:attachment":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/media?parent=107830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/categories?post=107830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/tags?post=107830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}