Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Added function to load a Surfer ascii grid#33

Merged
leouieda merged 14 commits into
fatiando:masterfrom
hbueno:grid
Jul 23, 2013
Merged

Added function to load a Surfer ascii grid#33
leouieda merged 14 commits into
fatiando:masterfrom
hbueno:grid

Conversation

@hbueno

@hbueno hbueno commented Jul 17, 2013

Copy link
Copy Markdown
Member

I until need to write some conditional test.
A cookbook example will be easy and fast to write.
For now, I'd like to learn the best way to load a file using Python.

@leouieda

Copy link
Copy Markdown
Member

@hbueno Boa! Agora faça a receita do jeito que a gente tinha falado e coloque no cookbook

@leouieda

Copy link
Copy Markdown
Member

@hbueno Use the data in this Gist to test the script: https://gist.github.com/leouieda/6023922

You can use urllib to download the data automatically so that we don't have to include it in the source:

import urllib
url = 'https://gist.github.com/leouieda/6023922/raw/948b0acbadb18e6ad49efe2092d9d9518b247780/bouguer_alps_egm08.grd'
urllib.urlretrieve(url, 'bouguer_alps_egm08.grd')
y, x, bouguer, shape = io.load_surfer('bouguer_alps_egm08.grd', fmt='ascii')

@leouieda

Copy link
Copy Markdown
Member

@hbueno Bonus points if you make another function in fatiando.io called fetch_bouguer_alps_egm() that uses urllib to download the data (as shown in the comment above)

@leouieda

Copy link
Copy Markdown
Member

@hbueno testei aqui e tá funcionando!

@leouieda

Copy link
Copy Markdown
Member

@hbueno Nas docstrings, tire as linhas vazias entre as descrições de parâmetros e returns.

@leouieda

Copy link
Copy Markdown
Member

Agora coloque uma breve descrição das suas funções na docstring do módulo (topo do arquivo). Inspire-se nas que já estão la

@leouieda

Copy link
Copy Markdown
Member

Henricão, só mais essas coisas pequenas e já tá pronto! Parabéns cara

@hbueno

hbueno commented Jul 19, 2013

Copy link
Copy Markdown
Member Author

@leouieda acho que não esqueci de nada. Por favor, veja a descrição da docstring.
A referencia deve ficar logo abaixo da função que a menciona ou no final de tudo?
Espaços, indentação está ok?

@leouieda

Copy link
Copy Markdown
Member

@hbueno Só mais umas coisas triviais. Ficou excelente! (i.e., malandruxo!)

leouieda added a commit that referenced this pull request Jul 23, 2013
Added function to load a Surfer ascii grid
@leouieda leouieda merged commit 1b67c5f into fatiando:master Jul 23, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants