This hanger is like “hey dude, I’m pretty cool inside of me”
Monthly Archives: February 2015
Mathematica | A brief log of my recent work
“Calculation of energy flux in High energy Satellite” is my recently work on INTEGRAL catalog. My goal is to calibrate the emitting model and the interstellar absorption model in X-ray energy range. While the model is convincing, I can boldly utilize those models on HXMT catalog for estimation. The following notes are focused on Mathematica which I used to produce the data analysis.
- Data Import/Export
Mathematica can read many types of data file, like .txt .dat .fits (It’s ok for read, but normally the capacity of FITS file are about 10MB, so it’s not ok for program running with such a huge burden), especially for large group of data analysis, this proper of mathematica is very useful. When talked about the fits file, there is a little trick I want to note down that I can use the Export function in fv tool to export the specific rows and columns with .txt for data analysis, instead of running the whole FITS raw data. Here’s the code for Importing files:
Import["complete path of your file","Table"]
I import data as table like {{1,2},{44,63}}. What is important to notice is the path syntax. For example, my OS X system have to start with a slash”/” and end up with file name, NO slash in the end.
eg. Import[“/Users/tuoyouli/Desktop/data.txt”,”Table”]
What’s next is exporting file which is similar with Import syntax.
Export["complete write path",data,"Table"]
eg. Export["/Users/tuoyouli/Desktop/HXMT flux/HEcounts.dat",Table[{b[[i]][[2]], b[[i]][[3]], a[[i]]}, {i, 1, Length[a]}], "Table"]
- Data Regroup
The previous Export code include a data reorganize part:
Table[{b[[i]][[2]], b[[i]][[3]], a[[i]]}, {i, 1, Length[a]}]
while a,b are two-dimensional data group like {{1,2,1},{3,4,3},{5,6,5}}, the b[[i]][[2]] is a coordinate that can pick the specific element of the group b. And based on this, you can pick up the specific elements in different data group and then reorganize them by code Table in anyway you like. Huzzah! Another interesting normal usage about reorganization, is to combine two lists on plotting. When I want to plot how groupA depends on groupB, I can write down this code:
ListPlot[Transpose[{A,B}]]
of course, listA and listB must in same length.
- Numerical Calculation(!)
For this section is the key function for Mathematica. I was told the somebody believe the Calculation Physics is the third fundamental part of physics, the other two are theoretical and experimental physics. Wow, that’s huge! Anyway here’s the numerical calculation which can give out the numerical results instead of analytical results. So when talk about Numerical, two things occur to me. One, numerical integration. Two, fitting and interpolation values. For numerical integration in Mathematica, I can simply use the code NIntegrate[], this code contains different numerical integrate method like Monte Carlo. (for more detail read on NIntegrate Method) Another stuff is interpolate value for a experimental separated data to a curve or line.
eg. Interpolation[data,InterpolationOrder->3,Method->Spline]
This a 3-order spline to interpolate the data, also there are plenty of numerical method for interpolation. (Read More)
So, perhaps in the following career I don’t have much chance to use Mathematica, because Matlab takes the lead, you don’t really want to use the different syntax with people around you. But Mathematica is so elegant and so easy to use, this work was based on Mathematica which help me get through all the obstacles. And this work log may at least not be nonsense.
“苏格拉底”在喧嚣中死亡
2013-07-27(文)
确实我敲打文字的次数不是很多,以至于1个小时过去了,我不断纠结和反复着开头,而迟迟没有敲键。也或许真的是脑中的片段过于琐碎,没有这个功力将其合理地串联起来。于是,我索性胡乱地草草开头,哪怕只能写到这里,也就罢了。
一. 过于喧嚣的孤独
真是可笑,这草草的第一段竟然让我找到了一个有趣的开始行文的话题。上文有一个词很奇怪,至少是我读的东西里几乎没有出现过。虽然是我杜撰的,但我却觉得是一个普遍的状态——敲键。现在人类的生活状态,工作状态和心理状态都发生了巨大的改变,这种变化在我看来,刚才那个文字上的一点点字义的变化对我产生了一个不小的笑点,但宏观到我能观察到的微观的小世界,这种深刻而剧烈的变化给我更多的是不安的恐惧。
不知从什么时候开始,发现自己越来越难以独处,一件事的意义 总要被一个或大或小的集体的背景所框定和绑架,其定义和理解往往受到一个或大或小的舆论的限定。无数次漫无目的地翻出手机检查一下消息栏,即使长期只有寥寥的中国移动的客服短信。而且总是有一种强迫症似的冲动去浏览未读信息。可笑的是,强迫症在当下也被标榜成为一种时尚,我不清楚人们是受到舆论的牵引如此病态和机械的,还是被时代标记了一种脸谱化的习惯。
为此,我曾长期逃避社交网络,逃避一切有大众舆论和自我袒露的地方。对于逃避大众舆论,一部分处于对 被思想 的担忧,但更主要是对其受群体心理规律支配的强大的不可逆性和排他性的恐惧。万一失足,挑战大众不仅艰辛和徒劳,更会被社会教化天衣无缝的“诡计”折磨的捶胸顿足、无可奈何。对于社交网络的自我坦露,我曾有过愤慨的谴责,在笔墨间骂他们是精神的婊子,信息的便捷传输使信息沦为纯粹的信息,如同计算机代码一般在人与人之间交互,然而却没有了灵气以及分量。
我想过写一点愤青檄文之类来阐明其病态,但是却不经意落入了一个可笑的悖论。在社交网络的语境下阐述社交网络的病态,如同醉酒之人说自己没醉一样的滑稽。而且哪怕是有人附和,这其中的矛盾也令人哭笑不得。赞同,是什么程度上的赞同?是同样冲破了悖论枷锁的义无反顾,或者是因为同样醉酒之人心灵的一点点契合,或是一瞬间朦胧的“有感觉”。我总是以“患不知人也”鼓励和安慰自己,然正是如此,哪怕是越来越不会独处,却真正越来越孤独,这孤独过于喧嚣罢了。
看到一些朋友发表一些文字一些图片,我努力去揣摩他们的心理状态,哪怕我能很敏感地洞察,但是奇怪的是我很难把他们反射到自己的心灵,因此有时我还双关地调侃自己是20世纪的人。这种隔阂如果按照孔子“不患人之不己知”的逻辑推己及人的话,那是多么可怕的一幅图景,人们不过是自说自话地按照生命的节律演着一出出舞台剧。我不愿意这样推断,我宁愿相信只是自己修为不够。但实际上并不是我个人的臆断就能改变现实图景的走势,我能感觉到和很多朋友甚至是亲人走得越来越远了,如果我孤高到你我想象中的程度那我也就没有恐惧了,但实际上我就是废柴一枚。
在交往人群的分类中,有一些奇怪的划分,老乡、同学这些划分依据就如同将数字按照高矮分类一样无聊。或许三天一条短信才算做是常联系,可能电话中你言我语滔滔不绝才算是有感情,但我一般低于这个标准,但我也仅仅是低于一个标准。一个未加约定就已经俗成的标准将生命里的几乎所有人不加区别的疏离,而这又仅仅是前提,真正的疏离被决定于我产生了这样的想法。
很自然地,群体情愫的伦理关怀将这样的个体视为弱势给予关注(哈),而对这种定位的强烈反感和排斥便不可避免地将我拽入一个极端,或者说是这种极端的态度将我塑造到了一个极端,排斥和人交往。甚至是上一秒还和人热络着,这一秒可能突然愣住发一小会儿呆,脑子里闪过无数次演绎过的消极得令人叹息的支离破碎的东西。
但如果兜一个圈又回到孔子的假设,那一切还是能看到乐观的一面,既是 这些令我不安的谈论自我的言语完全不必,我并没有悲剧性的历程,只不过我不勤于演戏、欺骗上帝、欺骗自己。
二.苏格拉底已死
但是不欺骗上帝,仅仅这样我就能是问心无愧的吗?
前两天和一高中同学争论,争论的问题的本身对我来说是不证自明的,但是哪怕我的论证字字句句掷地有声,但是面对他的诡辩或者严格说是小学生吵架的言语方式,我可以不屑他完全没有哲学素养,我可以表达震惊和不可理喻,但是我唯一不能做到的就是说服他。
诸如:XXX的言论只代表XXX他自己,我们世界有多少人,他才占到几分之几,根本没有代表性,你没有辩证地表述这个问题,说明你的言论是有漏洞的……以一种M16全自动步枪的节奏堆砌辞藻不断打断对方不断提高音量。显然是吵架而不是争论。
我放弃了,我没有再试图说服他,我想当然的认为他的幼稚和他获得真理的权利并不对等。我再次选择了逃避,逃避大众因为群体的愚蠢和无意识,这次则是一种“机智”。这种机智虽然不同于“大学生”群体的老练和圆滑,但是这种机智却使我一天天缩小自己满以为值得和可能交流的对象。苏格拉底已死。
选择背后的基础是勇气和责任,对于大众的逃避起码是勇气的缺失,苏格拉底没有如此选择,他用生命践行了他的哲学和他声称的神明所赋予给他的开导大众的责任。这是自主性同样是人性,更是华丽丽赤裸裸地对人性尊严的体现。我的怯懦不能证明怯懦自身是站不住脚的,即我们不去褒贬苏格拉底的诘问。但是却可以质疑,对于我的论证,到底是听者心灵没有敞开,还是我貌似高贵的知识不够有力?
讽刺的是,现在已经过12点了,也就是说今天是我的生日,而今天我却宣布了我一直视为偶像和导师的苏格拉底之死。
但是巧合的是,苏格拉底之死浇灌出了其哲学以及其崇敬者的信仰。
