#AstroWheel
All kinds of snippets and wheels for astronomers
- edit the _posts.md file instead of the README.md, the README.md is generated by compile.py.
- Each post need to have a brief title start with level 2 title "## some question"
- we can make a discription and add some meta data for this posts, like tags. Format of tags should be "* tags: tag1, tag2..." just follow the title in the next line
- Then submitter start a level 4 title with his or her name "#### someone" (to make the text smaller..)
- And the last is your content.
- the compile.py will auto generate the tags.md and the table of contents below, so make sure that you abide by this rules to make it work properly.
- you should run compile.py every time you add or delete a new post. If you do not have python, your can just leave this compiling work for others.
Here is an example post.
[//]: # (This is a comment(not show in the home page) [//]: # (you should not change the title "## some problems title", because the compile.py need it to be this)
- tags: python, blabla, wheel
by someone
blablabla blalbalba here is the code
## some problems about python
* tags: python, blabla, wheel
#### by [someone](https://github.com/someone)
blablabla
blalbalba
here is the code
- tags: shell, rm
how to prevent neglectful rm -rf?
by Fmajor
- description: mv the things to ~/.trash/<date-time>
- disadvantages: you should clean your .trash using rmSure from time to time
code:
alias rmSure=/bin/rm
alias rm=trash
trash()
{
tempDir=~/.trash/`date +%Y-%m-%d-%H-%M-%S`
mkdir -p $tempDir
mv -f $@ $tempDir
}
- tags: git, github, version control
how to manage git branches efficiently?
by Fmajor
see
- tags: ds9, bash
by Fmajor
- auto load regions that has the same name (and .reg extension) as the fits file
- start with multiframe mode
mv your ds9 to ds9.bin and ds9.zip to ds9.bin.zip
save the code to ds9 in the same folder as ds9.bin and chmod +x
#!/bin/bash
export XPA_METHOD=local
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ -f `echo ${@%.fits}.reg` ]]; then
./ds9 -multiframe -lock frame image -zscale -linear -cmap gray -region shape projection $@ -region load all ${@%.fits}.reg&
else
./ds9 -multiframe -lock frame image -zscale -linear -cmap gray -region shape projection $@&
fi