Skip to content

Commit

Permalink
Merge pull request #1446 from bsipocz/docs_fixing_typos
Browse files Browse the repository at this point in the history
Fixing typos
  • Loading branch information
Cadair committed Jun 16, 2015
2 parents 8f86c22 + 75ce12a commit 88c186b
Show file tree
Hide file tree
Showing 70 changed files with 513 additions and 519 deletions.
42 changes: 21 additions & 21 deletions doc/source/code_ref/map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ SunPy map

Overview
--------
One of core classes in SunPy is a Map. A SunPy Map object is simply a
One of core classes in SunPy is a Map. A SunPy Map object is simply a
spatially-aware data array, often an image. In order to make it easy to work
with image data in SunPy, the Map object provides a number of methods for
commonly performed operations.

2D map objects are subclasses of sunpy.map.MapBase and all Map objects are
2D map objects are subclasses of sunpy.map.MapBase and all Map objects are
created using the Map factory sunpy.map.Map.

.. Todo:
1. Map factory and registration
2. MapBase and Generic Map
3. MapMeta and the seperation from the file io
3. MapMeta and the separation from the file io
Creating Map Objects
--------------------
SunPy Map objects are constructed using the special factory
SunPy Map objects are constructed using the special factory
class `~sunpy.map.Map`: ::

>>> x = sunpy.map.Map('file.fits')

The result of a call to `~sunpy.map.Map` will be either a `~sunpy.map.mapbase.GenericMap` object,
or a subclass of `~sunpy.map.mapbase.GenericMap` which either deals with a specific type of data,
The result of a call to `~sunpy.map.Map` will be either a `~sunpy.map.mapbase.GenericMap` object,
or a subclass of `~sunpy.map.mapbase.GenericMap` which either deals with a specific type of data,
e.g. `~sunpy.map.sources.sdo.AIAMap` or `~sunpy.map.sources.soho.LASCOMap`, or if no
instrument matches, a 2D map `~sunpy.map.mapbase.GenericMap`.

Expand All @@ -48,23 +48,23 @@ Using Map Objects
-----------------

Once a map object has been created using `~sunpy.map.Map` it will be a instance
or a subclass of the `~sunpy.map.mapbase.GenericMap` class. Irrespective of
the instrument the map is constructed for, all maps behave the same and are
or a subclass of the `~sunpy.map.mapbase.GenericMap` class. Irrespective of
the instrument the map is constructed for, all maps behave the same and are
interchangeable with one another. It is possible to manipulate the map or access
meta data about the map from the methods and proprties of the map class.
The following documentation of `~sunpy.map.mapbase.GenericMap` lists the
attributes and methods that are availible on all Map objects.
meta data about the map from the methods and properties of the map class.
The following documentation of `~sunpy.map.mapbase.GenericMap` lists the
attributes and methods that are available on all Map objects.

.. autoclass:: sunpy.map.mapbase.GenericMap
:members:


Map Classes
-----------
There are a series of base map classes which are specalised for each
There are a series of base map classes which are specialised for each
instrument. These subclass GenericMap and then register with
the Map factory class, which will direct instatiation of an instrument class if the correct
parameters are met.
the Map factory class, which will be direct instantiation of an instrument class if the correct
parameters are met.

.. automodapi:: sunpy.map
:no-main-docstr:
Expand All @@ -78,27 +78,27 @@ officially part of SunPy. This is good for prototyping new instruments. For
example, to add a Map type for a future instrument, consider the code skeleton ::

import sunpy

class FutureMap(sunpy.GenericMap):

def __init__(self, data, header, **kwargs):

GenericMap.__init__(self, data, header, **kwargs)

# Any Future Instrument specific keyword manipulation

# Specify a classmethod that determines if the data-header pair matches
# the new instrument
@classmethod
def is_datasource_for(cls, data, header, **kwargs):
"""Determines if header corresponds to an AIA image"""
return header.get('instrume', '').startswith('FUTURESCOPE')

Then, to be able to instantiate a FutureMap using the Map() factory, one must
register the FutureMap type with the factory ::

sunpy.map.Map.register(FutureMap, FutureMap.is_datasource_for)

If this line is placed correctly, for example in your subpackages __init__.py,
it can be guaranteed that the FutureMap is always accessible when your package
is imported.

0 comments on commit 88c186b

Please sign in to comment.