<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://sunpy.org/</id>
  <title>Blog - Posts tagged Code</title>
  <updated>2026-04-16T16:25:23.419720+00:00</updated>
  <link href="https://sunpy.org/"/>
  <link href="https://sunpy.org/blog/tag/code/atom.xml" rel="self"/>
  <generator uri="https://ablog.readthedocs.io/" version="0.11.13">ABlog</generator>
  <entry>
    <id>https://sunpy.org/posts/2017/2017-08-29-IRISPy-andNDCube/</id>
    <title>IRISPy and NDCube</title>
    <updated>2017-08-29T00:00:00+00:00</updated>
    <author>
      <name>Ankit Baruah</name>
    </author>
    <content type="html">&lt;section id="irispy-and-ndcube"&gt;

&lt;p&gt;GSoC has come to an end, it was one of the best summer experience I had.  In
this summer I had to create a new affiliated package IRISPy but during this
project making a base package for multi-dimensional contiguous and
non-contiguous spatially aware arrays (from readme.md of NDCube) was a natural
step so ended up developing another repository NDCube.  This was initially
a part of sunpycube but after breaking and burning everything we ended up with
ndcube :P.&lt;/p&gt;
&lt;section id="ndcube"&gt;
&lt;h2&gt;NDCube&lt;/h2&gt;
&lt;aside class="system-message"&gt;
&lt;p class="system-message-title"&gt;System Message: INFO/1 (&lt;span class="docutils literal"&gt;/home/docs/checkouts/readthedocs.org/user_builds/sunpyorg/checkouts/489/posts/2017/2017-08-29-IRISPy-andNDCube.rst&lt;/span&gt;, line 2); &lt;em&gt;&lt;a href="#id1"&gt;backlink&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Duplicate implicit target name: “ndcube”.&lt;/p&gt;
&lt;/aside&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/sunpy/ndcube"&gt;NDCube&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/abit2/cube/pull/10"&gt;PR10&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The NDCube has two container objects:&lt;/p&gt;
&lt;p&gt;1. NDCube which can handle n-dimensional data containing WCS objects and metadata.
This has different methods such as:&lt;/p&gt;
&lt;p&gt;The basic slicing i.e &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;__getitem__&lt;/span&gt;&lt;/code&gt; of N-dimensional objects like numpy.array
and this also handle the slicing of WCS objects.  Suppose we are dropping
a axis, this is handled by setting the WCS value to one for that axis.&lt;/p&gt;
&lt;div class="highlight-default notranslate"&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;cube2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dimensions&lt;/span&gt;
&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;DimensionPair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Quantity&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;2.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;pix&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;axis_types&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;HPLN-TAN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;HPLT-TAN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;WAVE&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;cube2&lt;/span&gt;
&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;span class="n"&gt;Sunpy&lt;/span&gt; &lt;span class="n"&gt;NDCube&lt;/span&gt;
&lt;span class="o"&gt;---------------------&lt;/span&gt;
&lt;span class="n"&gt;WCS&lt;/span&gt; &lt;span class="n"&gt;Keywords&lt;/span&gt;
&lt;span class="n"&gt;Number&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;WCS&lt;/span&gt; &lt;span class="n"&gt;axes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="n"&gt;CTYPE&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;WAVE&amp;#39;&lt;/span&gt;  &lt;span class="s1"&gt;&amp;#39;HPLT-TAN&amp;#39;&lt;/span&gt;  &lt;span class="s1"&gt;&amp;#39;HPLN-TAN&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;CRVAL&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.0000000000000001e-09&lt;/span&gt;  &lt;span class="mf"&gt;0.5&lt;/span&gt;  &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;span class="n"&gt;CRPIX&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;2.0&lt;/span&gt;  &lt;span class="mf"&gt;2.0&lt;/span&gt;
&lt;span class="n"&gt;PC1_1&lt;/span&gt; &lt;span class="n"&gt;PC1_2&lt;/span&gt; &lt;span class="n"&gt;PC1_3&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;span class="n"&gt;PC2_1&lt;/span&gt; &lt;span class="n"&gt;PC2_2&lt;/span&gt; &lt;span class="n"&gt;PC2_3&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;1.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;span class="n"&gt;PC3_1&lt;/span&gt; &lt;span class="n"&gt;PC3_2&lt;/span&gt; &lt;span class="n"&gt;PC3_3&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;span class="n"&gt;CDELT&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2.0000000000000002e-11&lt;/span&gt;  &lt;span class="mf"&gt;0.5&lt;/span&gt;  &lt;span class="mf"&gt;0.40000000000000002&lt;/span&gt;
&lt;span class="n"&gt;NAXIS&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;  &lt;span class="mi"&gt;3&lt;/span&gt;  &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="o"&gt;---------------------&lt;/span&gt;
&lt;span class="n"&gt;Length&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;NDCube&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;2.&lt;/span&gt;  &lt;span class="mf"&gt;3.&lt;/span&gt;  &lt;span class="mf"&gt;4.&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;pix&lt;/span&gt;
&lt;span class="n"&gt;Axis&lt;/span&gt; &lt;span class="n"&gt;Types&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;NDCube&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;HPLN-TAN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;HPLT-TAN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;WAVE&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;cube2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:,&lt;/span&gt; &lt;span class="p"&gt;:]&lt;/span&gt;
&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;span class="n"&gt;Sunpy&lt;/span&gt; &lt;span class="n"&gt;NDCube&lt;/span&gt;
&lt;span class="o"&gt;---------------------&lt;/span&gt;
&lt;span class="n"&gt;WCS&lt;/span&gt; &lt;span class="n"&gt;Keywords&lt;/span&gt;
&lt;span class="n"&gt;Number&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;WCS&lt;/span&gt; &lt;span class="n"&gt;axes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="n"&gt;CTYPE&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;WAVE&amp;#39;&lt;/span&gt;  &lt;span class="s1"&gt;&amp;#39;HPLT-TAN&amp;#39;&lt;/span&gt;  &lt;span class="s1"&gt;&amp;#39;HPLN-TAN&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;CRVAL&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.0000000000000001e-09&lt;/span&gt;  &lt;span class="mf"&gt;0.5&lt;/span&gt;  &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;span class="n"&gt;CRPIX&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;2.0&lt;/span&gt;  &lt;span class="mf"&gt;2.0&lt;/span&gt;
&lt;span class="n"&gt;PC1_1&lt;/span&gt; &lt;span class="n"&gt;PC1_2&lt;/span&gt; &lt;span class="n"&gt;PC1_3&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;span class="n"&gt;PC2_1&lt;/span&gt; &lt;span class="n"&gt;PC2_2&lt;/span&gt; &lt;span class="n"&gt;PC2_3&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;1.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;span class="n"&gt;PC3_1&lt;/span&gt; &lt;span class="n"&gt;PC3_2&lt;/span&gt; &lt;span class="n"&gt;PC3_3&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;0.0&lt;/span&gt;  &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;span class="n"&gt;CDELT&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2.0000000000000002e-11&lt;/span&gt;  &lt;span class="mf"&gt;0.5&lt;/span&gt;  &lt;span class="mf"&gt;0.40000000000000002&lt;/span&gt;
&lt;span class="n"&gt;NAXIS&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;  &lt;span class="mi"&gt;3&lt;/span&gt;  &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="o"&gt;---------------------&lt;/span&gt;
&lt;span class="n"&gt;Length&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;NDCube&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;3.&lt;/span&gt;  &lt;span class="mf"&gt;4.&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;pix&lt;/span&gt;
&lt;span class="n"&gt;Axis&lt;/span&gt; &lt;span class="n"&gt;Types&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;NDCube&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;HPLT-TAN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;WAVE&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;In&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;cube2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:,&lt;/span&gt; &lt;span class="p"&gt;:]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dimensions&lt;/span&gt;
&lt;span class="n"&gt;Out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;DimensionPair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Quantity&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;3.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;pix&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;axis_types&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;HPLT-TAN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;WAVE&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;plot()&lt;/span&gt;&lt;/code&gt; method that animates if dimension is greater than 2, else if dimension less than equal to 2 than plots images, this animations uses the WCS data for the axis.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;world_to_pixel()&lt;/span&gt;&lt;/code&gt; method converts world coordinates to pixel coordinates, this method is unit aware.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;pixel_to_world()&lt;/span&gt;&lt;/code&gt; method converts pixel coordinates to world coordinates, this method is unit aware.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;to_sunpy()&lt;/span&gt;&lt;/code&gt; this method automates the conversion of present NDCube instance to sunpy instance is it satisfies all the necessary requirements. Presently it supports Map and work is going on in TimeSeries.&lt;/p&gt;
&lt;p&gt;2. &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;NDCubeSequence&lt;/span&gt;&lt;/code&gt; which handles a list of NDCube object, this also handles extra coordinate axis which is parallel to one of the data axis.
This has methods such as:&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;plot()&lt;/span&gt;&lt;/code&gt; method that creates a animation using the data of the WCS for the axis.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;__getitem__&lt;/span&gt;&lt;/code&gt; method that slices the sequence like a list containing NDCubes which also handles slicing of WCS objects.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;index_as_cube()&lt;/span&gt;&lt;/code&gt; this method handles the slicing of sequence as a single N-dimensional object.
Example: if the dimension of NDCube objects inside the list of NDCubeSequence is 3 then this method will treat slicing of sequence as single 3 dimensional object by concatenating all the cubes.
So this makes the dimensions as &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;(len(list_inside_cubesequence)*NDCube[1st&lt;/span&gt; &lt;span class="pre"&gt;dimension],&lt;/span&gt; &lt;span class="pre"&gt;NDCube[2nd&lt;/span&gt; &lt;span class="pre"&gt;dimension],&lt;/span&gt; &lt;span class="pre"&gt;NDCube[3rd&lt;/span&gt; &lt;span class="pre"&gt;dimension])&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;explode_along_axis()&lt;/span&gt;&lt;/code&gt; method that slices NDCube object along that axis.
This is useful to reduce the dimension of NDCube’s inside the sequence list.
This will create a new sequence as this break the cube along one axis.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;to_sunpy()&lt;/span&gt;&lt;/code&gt; method it creates a new Sunpy instance if it satisfies the requirements.
Presently only mapcube is implemented.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="irispy"&gt;
&lt;h2&gt;IRISPy&lt;/h2&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/abit2/irispy/pull/3"&gt;PR3&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;IRISPy class was a easy implementation after the useful and challenging NDCube repository was alive.
This made creating a new class such as IRISSpectrograph a rather simple task.
This was done in a clean and neat way.&lt;/p&gt;
&lt;p&gt;So this class object has all the inherent methods and properties of NDCubeSequence as it uses this as it’s base class.&lt;/p&gt;
&lt;p&gt;Future work includes making changes to &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;IRISSpectrograph&lt;/span&gt;&lt;/code&gt; to include the recently added changes such as
SpectrographSequence, so this is a new sequence which is using the &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;NDCubeSequence&lt;/span&gt;&lt;/code&gt; as it’s parent class. Making the
iris tools working properly with the new IRISSpectrograph. Developing NDCube’s and NDCubeSequence’s &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;to_sunpy&lt;/span&gt;&lt;/code&gt; method
to handle all the sunpy objects.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
</content>
    <link href="https://sunpy.org/posts/2017/2017-08-29-IRISPy-andNDCube/"/>
    <summary>GSoC has come to an end, it was one of the best summer experience I had.  In
this summer I had to create a new affiliated package IRISPy but during this
project making a base package for multi-dimensional contiguous and
non-contiguous spatially aware arrays (from readme.md of NDCube) was a natural
step so ended up developing another repository NDCube.  This was initially
a part of sunpycube but after breaking and burning everything we ended up with
ndcube :P.</summary>
    <category term="Code" label="Code"/>
    <category term="Fun" label="Fun"/>
    <category term="GSoC" label="GSoC"/>
    <published>2017-08-29T00:00:00+00:00</published>
  </entry>
  <entry>
    <id>https://sunpy.org/posts/2017/2017-08-16-sunpy-website-improvements/</id>
    <title>Sunpy Website Improvements</title>
    <updated>2017-08-16T00:00:00+00:00</updated>
    <author>
      <name>Duygu KESKEK</name>
    </author>
    <content type="html">&lt;section id="sunpy-website-improvements"&gt;

&lt;p&gt;Believe or not, there is only one week left to the end of GSoC!
The whole GSoC period became an unforgettable experience for me.
I still remember the first time I read the documentation of Sphinx and say “What the hell am I supposed to do now?”&lt;/p&gt;
&lt;p&gt;The old SunPy website was a Ruby based Jekyll static website and it wasn’t consistent with the documentation theme.
The main aspect of the project is to remove the inconsistency between the website and the docs while improving UI/UX.
There are also 4 extensions of the project&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;&lt;p&gt;Implementing a registry of SunPy Affiliated packages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Move away from Jekyll to a Python based static site generator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write a sphinx extension that maintains an up to date list on the main website of the instruments and data products supported by the SunPy library&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Improve the content of the SunPy website&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In my proposal, I mentioned that I’ll implement all the extensions and at the end of the GSoC, I can say that I’m done with all except the Sphinx extension.
Mentors also didn’t force me to do that since there was more important and never-ending issues on the list.&lt;/p&gt;
&lt;section id="first-month"&gt;
&lt;h2&gt;First Month&lt;/h2&gt;
&lt;p&gt;At the first month of the project, I spent almost 1 week to understand Sphinx and read its documentation.
This was the first time I heard about Sphinx and it was quite exciting to learn something new.
The challenge of my project was to create both the website and the docs using Sphinx.
This was discussed on Matrix channel, and even seemed impossible for some since there is always a risk that the website and the docs may break each other.
Also, using Sphinx for a website theme was so RARE ! I was sometimes like “Come on! It’s a docs generator ?!”&lt;/p&gt;
&lt;p&gt;I used &lt;a class="reference external" href="https://github.com/ryan-roemer/sphinx-bootstrap-theme"&gt;sphinx-bootstrap-theme&lt;/a&gt; as a basis of my project.
I started implementing the navbar sections and put all the content in the new website.
Sphinx uses restructuredText as its markup language and I used RST for the entire website.
I added a scrolling sidebar for navigation between headlines.
At the end of the first month, the structure of the website was nicely prepared for revisions and improvements.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="second-month"&gt;
&lt;h2&gt;Second Month&lt;/h2&gt;
&lt;p&gt;The second month, I started to work on the blog section and used &lt;a class="reference external" href="https://github.com/abakan/ablog"&gt;Ablog&lt;/a&gt; .
However, the struggle was real, Ablog was full of bugs and it was the only option for blogging with Sphinx.
Then, my mentors fixed the Ablog and did the magic.
After that, I implemented the blogging system and made it possible for someone to write their own blog posts easily.
Additionally, I integrated &lt;a class="reference external" href="https://disqus.com/"&gt;DISQUS&lt;/a&gt; to the blog and enabled commenting on the posts.
At the end of the 2nd month, I made a lot of meetings with my mentors and started to work on the documentation theme.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="final-month"&gt;
&lt;h2&gt;Final Month&lt;/h2&gt;
&lt;p&gt;The final month of GSoC was the most painful one for me :P
At the beginning, mentors helped me to build the current SunPy documentation theme (It took 3 days to achieve that ^^) and use our new &lt;a class="reference external" href="https://github.com/sunpy/sunpy-sphinx-theme"&gt;SunPy Sphinx theme&lt;/a&gt; for the docs.
After that, they opened issues on the theme repo (Have a look at this never-ending &lt;a class="reference external" href="https://github.com/sunpy/sunpy-sphinx-theme/issues"&gt;issue list&lt;/a&gt; 😅) and I fixed them one by one.
The worst part of working on the docs is the build time!
It takes averagely 10 min to build after a simple change 😠
By time, I got used to this also ^^ I redesigned every component of the docs and made them consistent.
There was a huge color mismatch and also lots of bugs, and I’m done with all and my mentors appreciate the work.
I’m also really happy with the docs theme. Now, there are just some minor issues and the renovated website will be replaced with the good old Jekyll one before the SunPy 0.8 release ^^
I’m really exciting for the day that everyone will see the new website with the release and get some feedbacks on it :)
In the near end of the GSoC, I can comfortably say that it makes me feel really happy to work on an open source project.
I want to contribute to the website after the GSoC ends and see how it will improve even better by time.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
</content>
    <link href="https://sunpy.org/posts/2017/2017-08-16-sunpy-website-improvements/"/>
    <summary>Believe or not, there is only one week left to the end of GSoC!
The whole GSoC period became an unforgettable experience for me.
I still remember the first time I read the documentation of Sphinx and say “What the hell am I supposed to do now?”</summary>
    <category term="Code" label="Code"/>
    <category term="Fun" label="Fun"/>
    <category term="GSoC" label="GSoC"/>
    <published>2017-08-16T00:00:00+00:00</published>
  </entry>
</feed>
