From ac5da2059b5235a24788600a0a21cfec65abd1e3 Mon Sep 17 00:00:00 2001 From: vditomasso Date: Wed, 22 Mar 2017 11:19:51 -0400 Subject: [PATCH 1/6] making a change --- shifty.ipynb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shifty.ipynb b/shifty.ipynb index 8f8f82e..23cfb15 100644 --- a/shifty.ipynb +++ b/shifty.ipynb @@ -1,5 +1,16 @@ { "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# Making a change (3/22)" + ] + }, { "cell_type": "code", "execution_count": 1, From 55fb0aca173725f26722d44302be47ace0ee3eed Mon Sep 17 00:00:00 2001 From: vditomasso Date: Wed, 22 Mar 2017 11:20:47 -0400 Subject: [PATCH 2/6] deleted .txt dataframe files --- 0045+1634_61testing_mc.txt | 73 -------------------------------------- 0241-0326_61testing_mc.txt | 73 -------------------------------------- 2 files changed, 146 deletions(-) delete mode 100644 0045+1634_61testing_mc.txt delete mode 100644 0241-0326_61testing_mc.txt diff --git a/0045+1634_61testing_mc.txt b/0045+1634_61testing_mc.txt deleted file mode 100644 index d2a1953..0000000 --- a/0045+1634_61testing_mc.txt +++ /dev/null @@ -1,73 +0,0 @@ - Unnamed: 0 ir_gravity ir_spec_type opt_gravity opt_spec_type order rv shortname source_id spec_id RMS n=100 RMS n=200 RMS n=500 RMS n=1000 -0 0 12.0 61 -37.35 0015+3516 844 1682 0.11821430696653877 0.11857395363491874 0.11839305744633592 0.11850434872682865 -1 1 12.0 61 -37.35 0015+3516 844 1683 0.22273010550690714 0.22374580613899447 0.22335370136260396 0.22320230193973417 -2 2 12.0 61 -37.35 0015+3516 844 1684 0.1681872726595044 0.1681670134847788 0.1688325008422335 0.16851959859366644 -3 4 14.0 13.5 61 19.02 0036+1821 86 1705 0.13691407013003196 0.13686315433033439 0.1364913619325036 0.1365788071939815 -4 5 14.0 13.5 61 19.02 0036+1821 86 1706 0.14191208465910615 0.14249106835752876 0.1424936784248513 0.14240808725927764 -5 6 14.0 13.5 61 19.02 0036+1821 86 1707 0.1337280522185839 0.13447463180782637 0.13432467602510717 0.13411502877279738 -6 7 14.0 13.5 61 19.02 0036+1821 86 1708 0.12261957015327765 0.12235866703674 0.12193329747882156 0.12224752026420338 -7 8 61 9.0 0140+2701 217 1731 0.08440215669808175 0.08386480237736901 0.08412777685910683 0.08398643057380573 -8 10 11.0 61 20.0 0208+2542 307 1754 0.6723903838998573 0.671931169806961 0.6731429719094014 0.672219310842101 -9 11 11.0 10.0 61 6.0 0345+2540 825 1773 0.09600739575563948 0.09600024941136975 0.09649739007270287 0.09650044523626246 -10 12 11.0 10.5 61 52.37 0746+2000 119 1820 0.0804850125848681 0.08084672391677743 0.08100819567806064 0.080865869908021 -11 13 11.0 10.5 61 52.37 0746+2000 119 1821 0.06086519453847205 0.06106766281008375 0.061026755164104426 0.0611213086219695 -12 14 13.0 61 -0.68 1506+1321 778 1891 0.1364589721120711 0.1360966480906039 0.13625218773042477 0.13620077298895708 -13 15 13.0 61 -0.68 1506+1321 778 1894 0.11845109857185618 0.11846646169607947 0.1185462547100243 0.1185243980402672 -14 16 15.5 15.0 61 -39.85 1507-1627 775 1920 0.09921914835058467 0.09942527397533624 0.09918850127596172 0.09923000348262886 -15 17 11.0 61 -25.6 1658+7026 631 1939 0.12063943859566101 0.12041785418224257 0.1202247239181327 0.12034401291826134 -16 18 11.5 11.5 61 -24.68 2057-0252 697 1973 0.10561597541369777 0.10574332286421587 0.1054544408082486 0.1055328868008128 -17 19 13.0 61 -21.09 2104-1037 698 1995 0.10314284885770324 0.10397711210376415 0.10350474223640281 0.10384183141321765 -18 20 13.5 14.5 61 -37.55 2224-0158 441 2029 0.29733637358412973 0.2961550403358836 0.2970273617700294 0.2961136644044604 -19 21 13.5 14.5 61 -37.55 2224-0158 441 2030 0.1122626753320002 0.11206857951222549 0.11228297837378279 0.112578229307215 -20 22 6.0 61 -10.0 2234+4041 172 2057 0.45169103996697907 0.45034273760130694 0.4524983085182519 0.4522054450175129 -21 23 6.0 61 -10.0 2234+4041 172 2058 0.27316226042157776 0.27207282044719 0.27201966420416307 0.27216850162536105 -22 24 15.5 17.0 61 7.0 0205-1159 509 2107 0.34684748455613973 0.3460490958241235 0.34607239864128014 0.34490131495381615 -23 25 16.0 15.0 61 2.0 1228-1547 269 2114 0.12491134460633768 0.12452671706166435 0.12350824252882911 0.12377254623327984 -24 26 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 2142 0.3998016968214776 0.39908069002535385 0.39923853085128513 0.39974572364255423 -25 27 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 2143 0.2335949430788383 0.23219180961465974 0.23243934094908755 0.23193148555316395 -26 28 13.0 14.0 61 -29.0 1424+0917 220 2178 1.3871560140448274 1.3994855490274938 1.4006496205967582 1.394358302652128 -27 29 6.0 6.0 61 19.0 1056+0700 205 2190 0.08118049884825496 0.08124636261448845 0.08145197482998913 0.08134563842455429 -28 30 10.5 12.0 61 6.37 1305-2541 798 2254 0.11790813405428219 0.11806443970612115 0.11817081703310549 0.11796296311488633 -29 31 14.0 13.5 61 19.02 0036+1821 86 3012 0.14958438645545177 0.14952183504464248 0.1501719801106239 0.14970448425722516 -30 32 14.0 13.5 61 19.02 0036+1821 86 3016 0.12596003660897467 0.12641360426460552 0.12603747412095884 0.12634122068075576 -31 33 14.0 13.5 61 19.02 0036+1821 86 3021 0.14180568090496776 0.14126308512733052 0.14138873246894923 0.14134383288968896 -32 34 14.0 13.5 61 19.02 0036+1821 86 3036 0.1404025430878334 0.14071705838806822 0.14041012227432761 0.14090046442765755 -33 35 INT-G 10.0 β 9.5 61 8.112 0027+0503 17 3059 1.3556065138386415 1.3455322829222398 1.3449633416765605 1.341845070876202 -34 36 6.0 61 -10.0 2234+4041 172 3239 0.2736979688643415 0.27369869508571304 0.27352381212957316 0.27341631517750914 -35 37 6.0 61 -10.0 2234+4041 172 3242 0.4729949696692145 0.47112198817017303 0.4707922098169878 0.4710660420456775 -36 38 6.0 6.0 61 19.0 1056+0700 205 3321 0.08132061556263329 0.081271247957518 0.08143851864195047 0.08136639947628248 -37 43 61 9.0 0140+2701 217 3373 0.08500761440458202 0.08517551807351573 0.08481932603908303 0.08499636528366457 -38 44 13.0 14.0 61 -29.0 1424+0917 220 3397 1.8039125969681147 1.8105966448860267 1.8054434697168102 1.8119378557601005 -39 47 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 3464 0.30170752112656773 0.3003312359147055 0.3004311368949798 0.299920321975388 -40 48 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 3465 0.6035088698999984 0.5973167876379049 0.5957681085741205 0.5950666936778377 -41 50 16.0 15.0 61 2.0 1228-1547 269 3555 0.18210817344151584 0.18323470776894674 0.18375937465181863 0.18271670335947118 -42 52 11.0 61 20.0 0208+2542 307 3619 1.1870488639808612 1.1660632411436522 1.1491947970710044 1.1497082724128462 -43 53 11.0 61 20.0 0208+2542 307 3623 0.1009486692410013 0.10081429337602749 0.10101224011366873 0.10073432896892216 -44 54 22.0 22.0 61 4.0 1254-0122 439 3933 0.671404907631873 0.6788224613605229 0.6814958960740276 0.6801110586872542 -45 55 13.5 14.5 61 -37.55 2224-0158 441 3966 0.15108985913049303 0.15192619083145448 0.15217272067550397 0.1521341343148219 -46 56 13.5 14.5 61 -37.55 2224-0158 441 3976 0.422108078583099 0.4223998199984244 0.42268111018327914 0.4224407765006498 -47 57 VL-G 12.0 β 12.0 61 3.6489999999999996 0045+1634 334 4121 0.025117323241631268 0.02512624352596821 0.025313424293513298 0.025222822983866876 -48 58 15.5 17.0 61 7.0 0205-1159 509 4147 0.4543453594244331 0.4569833680925713 0.45686326279362466 0.45866345378073686 -49 59 15.5 17.0 61 7.0 0205-1159 509 4155 0.6376122164803053 0.6347718714324309 0.6365146308389907 0.6380917476825516 -50 61 INT-G 11.0 β 11.0 61 1.6340000000000001 0117-3403 317 4179 0.4859221054824222 0.4827599041161453 0.48365226218726765 0.483816079378632 -51 62 VL-G 11.0 γ 10.0 61 7.564 0241-0326 98 4255 0.7124939027733419 0.71883063077968 0.7227926160048341 0.7189595827531794 -52 64 γ 8.0 61 27.016 0534-0631 601 4355 1.6928602632495504 1.6897626594460846 1.6899903620077212 1.6877655844988257 -53 67 24.5 25.0 61 -9.0 0559-1404 595 4391 0.26396243584227574 0.26429088524367045 0.2643269422401345 0.2638737183775621 -54 69 γ 9.0 61 -6.978 1935-2846 105 4406 0.14704727242703017 0.14573454507824404 0.1463541831146127 0.1466607503094172 -55 70 β 14.0 61 -20.721 2154-1055 313 4417 1.4894771450253503 1.473202004747189 1.4804066248114929 1.4776405454291817 -56 72 25.0 61 19.0 2356-1553 611 4487 2.0250779091155158 2.021547803560476 2.039050966795043 2.0302174459349867 -57 76 26.0 27.0 61 -5.0 0937+2931 648 4596 0.35493632015034876 0.3536937462759518 0.3544900294596091 0.3537345333226295 -58 81 11.5 11.5 61 -24.68 2057-0252 697 4700 0.1126633380036763 0.11276745422039848 0.11255903706226043 0.11274664945018614 -59 83 24.0 61 14.0 2254+3123 767 4884 0.36985850962458855 0.3741732032870185 0.37228531419658045 0.3723484662334395 -60 86 20.0 17.5 61 28.0 0423-0414 794 5005 0.24580760083987452 0.2440000436570824 0.2458675284537353 0.24512197020075047 -61 87 11.0 10.0 61 6.0 0345+2540 825 5120 0.11925181563470791 0.11824816872625572 0.11879589973056591 0.1189893062363652 -62 90 12.0 61 -37.35 0015+3516 844 5206 0.11393562471955665 0.11391064443734095 0.11288236943069758 0.11321481034879298 -63 91 12.0 61 -37.35 0015+3516 844 5208 0.3111266635814308 0.3099239501131783 0.31212186185161395 0.31202496435830507 -64 92 12.0 61 -37.35 0015+3516 844 5219 0.21870878660098886 0.22105542678831397 0.2199229459598852 0.2206045114081051 -65 93 11.0 10.5 61 52.37 0746+2000 119 5826 0.06294472504699447 0.06295955714144981 0.0627411538797876 0.0628381387858802 -66 94 11.0 10.5 61 52.37 0746+2000 119 5836 0.08352361874046793 0.08338090569746825 0.08331782884977489 0.08316954136518485 -67 95 11.0 61 -25.6 1658+7026 631 7200 0.15189096987191048 0.1532086137324543 0.15180386554731345 0.15230007561782258 -68 98 13.0 61 -21.09 2104-1037 698 7402 0.11607156429504889 0.1160304850665383 0.11664982638955493 0.11627472718554956 -69 100 15.5 15.0 61 -39.85 1507-1627 775 7579 0.10142043458660072 0.10185002238497005 0.1016702922774296 0.10159950717387 -70 103 13.0 61 -0.68 1506+1321 778 7613 0.14924578221262527 0.1502386229831659 0.15012029262689922 0.1498246542184598 -71 105 13.0 61 -0.68 1506+1321 778 7617 0.12973826977646166 0.13065203841853507 0.12993471008222474 0.13015839580888552 diff --git a/0241-0326_61testing_mc.txt b/0241-0326_61testing_mc.txt deleted file mode 100644 index 1396c2b..0000000 --- a/0241-0326_61testing_mc.txt +++ /dev/null @@ -1,73 +0,0 @@ - Unnamed: 0 ir_gravity ir_spec_type opt_gravity opt_spec_type order rv shortname source_id spec_id RMS n=100 RMS n=200 RMS n=500 RMS n=1000 -0 0 12.0 61 -37.35 0015+3516 844 1682 0.7973113309588626 0.8019503420364269 0.8024419206903233 0.800986115101584 -1 1 12.0 61 -37.35 0015+3516 844 1683 0.8659590671484668 0.8707575255143865 0.8665467760354645 0.8669349372385263 -2 2 12.0 61 -37.35 0015+3516 844 1684 0.8570027804700945 0.8572406162513008 0.8584433780252073 0.8566708483750815 -3 4 14.0 13.5 61 19.02 0036+1821 86 1705 0.8022008298336829 0.8054575256304642 0.8045193348662995 0.8056407262218417 -4 5 14.0 13.5 61 19.02 0036+1821 86 1706 0.825679536596344 0.8281670391794421 0.8290271176753288 0.8277931185534875 -5 6 14.0 13.5 61 19.02 0036+1821 86 1707 0.8035948547727517 0.8032659134238963 0.7999904502723032 0.8032691570495792 -6 7 14.0 13.5 61 19.02 0036+1821 86 1708 0.7871268641862358 0.7869556053712142 0.7860853234091794 0.7845754167123251 -7 8 61 9.0 0140+2701 217 1731 0.7377725575507884 0.739411153153265 0.7400244267626965 0.7404548644845719 -8 10 11.0 61 20.0 0208+2542 307 1754 1.142519346953825 1.1415319319920696 1.1362947700863677 1.13798797524189 -9 11 11.0 10.0 61 6.0 0345+2540 825 1773 0.7504011940768005 0.7452894709551282 0.7429927402269259 0.7426139942663886 -10 12 11.0 10.5 61 52.37 0746+2000 119 1820 0.7440374420014134 0.7382283178473066 0.7423767804609742 0.7412497325230526 -11 13 11.0 10.5 61 52.37 0746+2000 119 1821 0.723034270708033 0.718715324031771 0.7180100701693586 0.7182571686071694 -12 14 13.0 61 -0.68 1506+1321 778 1891 0.8171718297276702 0.8188889188416365 0.8157747363575368 0.8170106383905741 -13 15 13.0 61 -0.68 1506+1321 778 1894 0.8100767760229302 0.7976219011156367 0.8047109707900792 0.8033624230184364 -14 16 15.5 15.0 61 -39.85 1507-1627 775 1920 0.7649433773995341 0.7615212546975573 0.7629845747980133 0.7620873236231019 -15 17 11.0 61 -25.6 1658+7026 631 1939 0.8010626654114897 0.8035715867625892 0.7999885630003829 0.8002151493331193 -16 18 11.5 11.5 61 -24.68 2057-0252 697 1973 0.723868472884449 0.7231254368654474 0.7270883345323012 0.7245467697776103 -17 19 13.0 61 -21.09 2104-1037 698 1995 0.7815769130386525 0.7834437065101062 0.7829052205441714 0.7847140475624679 -18 20 13.5 14.5 61 -37.55 2224-0158 441 2029 0.9213605659101941 0.9215513293139819 0.923989408482394 0.9215355548260606 -19 21 13.5 14.5 61 -37.55 2224-0158 441 2030 0.7471147101175448 0.7532514938255058 0.7529517341183661 0.7530627567871914 -20 22 6.0 61 -10.0 2234+4041 172 2057 0.9680665295220043 0.9687266573526679 0.9639750001482068 0.9687605241938696 -21 23 6.0 61 -10.0 2234+4041 172 2058 0.8036116542982255 0.8034447772572884 0.8035467066253978 0.8020769023263586 -22 24 15.5 17.0 61 7.0 0205-1159 509 2107 0.9327301425226312 0.9299490459958406 0.9317368968798626 0.9282844706784903 -23 25 16.0 15.0 61 2.0 1228-1547 269 2114 0.781080048343874 0.7825492699377028 0.7839163888878689 0.7853257593591892 -24 26 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 2142 1.0713318733739703 1.0763156775042635 1.0760090221003094 1.076011566634848 -25 27 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 2143 0.9206485138073297 0.9198130818219132 0.9244488213897712 0.924986282905393 -26 28 13.0 14.0 61 -29.0 1424+0917 220 2178 1.9658109984683179 1.9662191946419807 1.9539611686063896 1.9532512370616109 -27 29 6.0 6.0 61 19.0 1056+0700 205 2190 0.7011463640280808 0.7003822208896038 0.6995296256893269 0.6988764635982513 -28 30 10.5 12.0 61 6.37 1305-2541 798 2254 0.7290148337030457 0.7264703904510047 0.7276366688655658 0.7293168268265626 -29 31 14.0 13.5 61 19.02 0036+1821 86 3012 0.8293185048895684 0.8364331526172404 0.8306685130578908 0.8313470260316916 -30 32 14.0 13.5 61 19.02 0036+1821 86 3016 0.7860650277045913 0.7912359932999283 0.793588625634378 0.7903538597134009 -31 33 14.0 13.5 61 19.02 0036+1821 86 3021 0.8038691665708086 0.8117842165323009 0.8083439856548673 0.8092924855787975 -32 34 14.0 13.5 61 19.02 0036+1821 86 3036 0.8046010942617525 0.8081164895190562 0.8066399083463026 0.8085471298635648 -33 35 INT-G 10.0 β 9.5 61 8.112 0027+0503 17 3059 1.9600178089907567 1.966051311715886 1.9561247003773266 1.9653330516350676 -34 36 6.0 61 -10.0 2234+4041 172 3239 0.8020086474007485 0.8048855944186798 0.8043274646645243 0.8017553736178656 -35 37 6.0 61 -10.0 2234+4041 172 3242 0.988784267090693 0.9866189312236077 0.9845880764272872 0.9869297816912065 -36 38 6.0 6.0 61 19.0 1056+0700 205 3321 0.699771353004855 0.6960359953685589 0.698128011256065 0.696406756514217 -37 43 61 9.0 0140+2701 217 3373 0.7408121189845387 0.7450784179888515 0.7450087649594211 0.7427756853938728 -38 44 13.0 14.0 61 -29.0 1424+0917 220 3397 2.510874474752481 2.497262506116702 2.4762291175158015 2.4749826689527255 -39 47 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 3464 0.9941643125655157 0.9940205353745161 0.9956746812540828 0.9982313954401234 -40 48 VL-G 13.0 β 13.0 61 -2.0 1004+5022 241 3465 1.2717423325954385 1.26812408582495 1.274124861994147 1.2714370597337916 -41 50 16.0 15.0 61 2.0 1228-1547 269 3555 0.8456885302661098 0.8459277987664481 0.8439425292791171 0.8429112601003871 -42 52 11.0 61 20.0 0208+2542 307 3619 1.5729956173945976 1.5955318524272974 1.6262358434082467 1.6102836383106411 -43 53 11.0 61 20.0 0208+2542 307 3623 0.805178056826133 0.8041028868369524 0.8082616054392424 0.8047453307664546 -44 54 22.0 22.0 61 4.0 1254-0122 439 3933 1.2764764590363287 1.2844278393162671 1.2761743487219075 1.2778245261982695 -45 55 13.5 14.5 61 -37.55 2224-0158 441 3966 0.7856006219409626 0.7923401088035433 0.7929834169560077 0.7943585099909506 -46 56 13.5 14.5 61 -37.55 2224-0158 441 3976 1.0401513916339649 1.0557079633479667 1.0494911765746615 1.0540790289917608 -47 57 VL-G 12.0 β 12.0 61 3.6489999999999996 0045+1634 334 4121 0.7080899789338827 0.7133516674398122 0.7099855695108686 0.7096627353417232 -48 58 15.5 17.0 61 7.0 0205-1159 509 4147 1.0372188514368847 1.0519999255796064 1.0399234358715288 1.044801309081008 -49 59 15.5 17.0 61 7.0 0205-1159 509 4155 1.2302991377541723 1.2276877660531686 1.2282286294449711 1.2275627534972333 -50 61 INT-G 11.0 β 11.0 61 1.6340000000000001 0117-3403 317 4179 1.0957837532224324 1.098615145078748 1.0944022239394238 1.099628626458158 -51 62 VL-G 11.0 γ 10.0 61 7.564 0241-0326 98 4255 0.9617123059593814 0.9561339551231808 0.9588971638542791 0.9579757167310438 -52 64 γ 8.0 61 27.016 0534-0631 601 4355 1.8186319667199091 1.8152238577192799 1.8211890187764221 1.8201133153360909 -53 67 24.5 25.0 61 -9.0 0559-1404 595 4391 0.8535228690416149 0.8560294050956017 0.8505869502336568 0.8564581681210465 -54 69 γ 9.0 61 -6.978 1935-2846 105 4406 0.7503452281482295 0.7515219415675573 0.7488653431059272 0.7465645616030737 -55 70 β 14.0 61 -20.721 2154-1055 313 4417 2.0438992925990096 2.04381573087766 2.0294611123062816 2.030966391758253 -56 72 25.0 61 19.0 2356-1553 611 4487 2.654167848848875 2.6403828020411937 2.637943406149207 2.6466346329624377 -57 76 26.0 27.0 61 -5.0 0937+2931 648 4596 0.88984732394931 0.9016104922158426 0.9000494094393947 0.9024096024981356 -58 81 11.5 11.5 61 -24.68 2057-0252 697 4700 0.7389724133241253 0.7379476491354785 0.7335207051788323 0.7333098738743185 -59 83 24.0 61 14.0 2254+3123 767 4884 0.9429664527939291 0.95689072625194 0.9573977630333822 0.9536597544598128 -60 86 20.0 17.5 61 28.0 0423-0414 794 5005 0.8210938080449419 0.8216500697619934 0.8210580511459367 0.8199906265631058 -61 87 11.0 10.0 61 6.0 0345+2540 825 5120 0.7740605226132928 0.7687299092558607 0.7670817398932911 0.7674284841901774 -62 90 12.0 61 -37.35 0015+3516 844 5206 0.8126623920461793 0.8097676023588504 0.8085723279035345 0.8071176917662178 -63 91 12.0 61 -37.35 0015+3516 844 5208 0.9504486575877428 0.9565153704046147 0.9552368151324903 0.955070028764287 -64 92 12.0 61 -37.35 0015+3516 844 5219 0.9092843232877282 0.9106607156109794 0.9126402366564448 0.9128569750885906 -65 93 11.0 10.5 61 52.37 0746+2000 119 5826 0.7170136476027079 0.7215751559458998 0.7218815794220822 0.7211349016922666 -66 94 11.0 10.5 61 52.37 0746+2000 119 5836 0.7464503885012629 0.7427173962610092 0.7449467461633517 0.7460780932060902 -67 95 11.0 61 -25.6 1658+7026 631 7200 0.837596387656236 0.833820998431116 0.8319290889612805 0.8393011404529015 -68 98 13.0 61 -21.09 2104-1037 698 7402 0.794323484522829 0.7960113346632792 0.7953200830725906 0.7975445933059648 -69 100 15.5 15.0 61 -39.85 1507-1627 775 7579 0.7686283464267777 0.7668464878009174 0.7641597611979734 0.7658383299886384 -70 103 13.0 61 -0.68 1506+1321 778 7613 0.8283892200692591 0.8285039664302122 0.8313715722016706 0.8316912001319015 -71 105 13.0 61 -0.68 1506+1321 778 7617 0.8172651097561832 0.8158718561630321 0.815684697153064 0.8149185764301335 From b9e06787f5ba3d3c05d9d1f1f8e3c677576b81ce Mon Sep 17 00:00:00 2001 From: vditomasso Date: Wed, 29 Mar 2017 10:56:16 -0400 Subject: [PATCH 3/6] Put shifty.ipynb functions into shifty.py --- shifty.py | 311 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 311 insertions(+) create mode 100644 shifty.py diff --git a/shifty.py b/shifty.py new file mode 100644 index 0000000..3cb02d9 --- /dev/null +++ b/shifty.py @@ -0,0 +1,311 @@ +# Function that does n iterations of RMS calculation + +import matplotlib.pyplot as plt +import numpy as np +from scipy import interpolate +from scipy.interpolate import interp1d +import matplotlib.mlab as mlab +from scipy.stats import norm +# import BDdb +import astrodb +import pandas as pd + +db = astrodb.Database('/Users/victoriaditomasso/Desktop/BDNYCdeprecated.db') + + +def mc_rms(y_array1, y_array2, unc1, unc2, n): + """Does n iterations of RMS calculation. + + Arguments: y_array1, y_array2, unc1, unc2, n + Outputs: avg, error, RMS""" + + plt.clf() + + RMS = [] + + for w in range(n): + y_array1_rand = y_array1 + (np.random.randn(len(y_array1)) * unc1) + y_array2_rand = y_array2 + (np.random.randn(len(y_array2)) * unc2) + diff = y_array1_rand - y_array2_rand + rms = (np.sum(diff ** 2)) / (len(diff)) ** (0.5) + RMS.append(rms) + + avg = np.mean(RMS) + error = np.std(RMS) + # print('RMS = ',avg, '+/-', error) + # print(avg) + return avg, error, RMS + + RMS.sort() + # plt.hist(RMS, bins=50) + # plt.ylabel('Frequency') + # plt.xlabel('RMS') + # plt.show() + + # label = '/Users/victoriaditomasso/phys767/MCSpectra/hist_'+str(plot_title)+'.png' + + # plt.savefig(label) + + # print(RMS) + + +def snr_to_unc(unc_array): + """Checks if an array is SNR or unc, converts an SNR array into an uncertainty array. + + Arguments: unc_array + Outputs: unc""" + + unc = np.asarray(unc_array) + avg_unc = np.sum(unc) / len(unc) + if avg_unc > 4.0: + unc = 1.0 / unc + + return unc + + +def get_tar_data(tar_source_id, spec_order): + """Queries database for wavelength, flux, uncertainty and RV for a given source_id & spectral order + + Arguments: tar_source_id, spec_order + Outputs: w_tar,f_tar,rv_tar,unc_tar""" + + data_tar = db.query( + "select sources.id, sources.shortname, spectra.wavelength, spectra.flux, spectra.unc, radial_velocities.radial_velocity from sources join spectra on sources.id=spectra.source_id join radial_velocities on spectra.source_id=radial_velocities.source_id where spectra.source_id={} and spectra.wavelength_order={}".format( + tar_source_id, spec_order)) + + w_tar = np.asarray(data_tar[0][2]) + + f_tar = np.asarray(data_tar[0][3]) + + rv_tar = data_tar[0][5] + + unc_tar = data_tar[0][4] + + unc_tar = snr_to_unc(unc_tar) + + return w_tar, f_tar, rv_tar, unc_tar + + +def get_comp_data(spec_id): + """Queries database for wavelength, flux, uncertainty and RV for a given spectrum ID + + Arguments: spec_id + Outputs: w_comp,f_comp,rv_comp,unc_comp""" + + data_comp = db.query( + "select spectra.wavelength, spectra.flux, spectra.unc from spectra where spectra.id={}".format(row['spec_id'])) + + w_comp = np.asarray(data_comp[0][0]) + + f_comp = np.asarray(data_comp[0][1]) + + rv_comp = row['rv'] + + unc_comp = data_comp[0][2] + + unc_comp = snr_to_unc(unc_comp) + + return w_comp, f_comp, rv_comp, unc_comp + + +# I'm leaving this as a function even though it's only one line anyway +def rv_shift(wavelength, rv): + """Shifts a spectrum based on its radial velocity + + Arguments: wavelength array, rv + Outputs: shifted_wavelength""" + + shifted_wavelength = (wavelength) * (1. - (rv / 2.99792458e5)) + + return shifted_wavelength + + +def normalize_spectra(f1, unc1, f2, unc2): + """Normalized one spectrum to another + + Arguments: f1,unc1,f2,unc2 + Outputs: f2_norm""" + + # Finds a normalization coefficient + norm_coeff = sum((f1 * f2) / ((unc1) ** 2 + (unc2) ** 2)) / sum((f2 * f2) / ((unc1) ** 2 + (unc2) ** 2)) + + # Creates an array of normalized flux for the comparison object + f2_norm = f2 * norm_coeff + + return f2_norm + + +import numpy as np +import matplotlib.mlab as mlab + + +def mc_output_hist(MC_calculations, bins=25): + plt.hist(MC_calculations, bins, normed=True) + + mean = np.mean(MC_calculations) + variance = np.var(MC_calculations) + sigma = np.sqrt(variance) + x_hist = np.linspace(min(MC_calculations), max(MC_calculations)) + plt.plot(x, mlab.normpdf(x, mean, sigma)) + + avg = np.mean(MC_calculations) + error = np.std(MC_calculations) + y_gauss = mlab.normpdf(25, avg, error) + x_gauss = np.linspace(min(MC_calculations), max(MC_calculations), num=len(y_gauss)) + fig = plt.plot(x_gauss, y_gauss) + + print('mean = ', mean, 'sigma = ', sigma) + return fig + + +# yfcq_auto + +# The inputs are the target source id, the spec order being compared and the path to the text file with the comparison sample (has to be tab delimited) +def yfcq(tar_source_id, spec_order, path_to_comp_sample_dataframe): + # This clears the figure, useful when saving the plots + plt.clf() + + # Queries the database for target data + data_tar = db.query( + "select sources.id, sources.shortname, spectra.wavelength, spectra.flux, spectra.unc, radial_velocities.radial_velocity from sources join spectra on sources.id=spectra.source_id join radial_velocities on spectra.source_id=radial_velocities.source_id where spectra.source_id={} and spectra.wavelength_order={}".format( + tar_source_id, spec_order)) + + # Separates the target data into separate variables (wavelength, flux, RV, uncertainty) + w_tar = np.asarray(data_tar[0][2]) + f_tar = np.asarray(data_tar[0][3]) + rv_tar = data_tar[0][5] + unc_tar = data_tar[0][4] + + # Adjusting wavelength array of the target according to its RV + w_tar = w_tar * (1. - (rv_tar / 2.99792458e5)) + + # Reads in the dataframe + df = pd.read_csv(path_to_comp_sample_dataframe, sep='\t') + + # Empty lists to be populated in the forloop + RMSs = [] + sigmas = [] + + # Sets the first and last flux point that will be used in quantification calculation/will be plotted + f = 50 + l = 1000 + + # Iterates through all of the comparison objects in the dataframe + for i, row in df.iterrows(): + plt.clf() + + # Queries the database for comparison object data + data_comp = db.query( + "select spectra.wavelength, spectra.flux, spectra.unc from spectra where spectra.id={}".format( + row['spec_id'])) + + # Separates the comparison data into separate variables (wavelength, flux, RV, uncertainty) + w_comp = np.asarray(data_comp[0][0]) + f_comp = np.asarray(data_comp[0][1]) + rv_comp = row['rv'] + unc_comp = data_comp[0][2] + + # Will convert an SNR array to an uncertainty array + unc_comp = snr_to_unc(unc_comp) + + # Shifts spectra based on their RVs + w_comp = w_comp * (1. - (rv_comp / 2.99792458e5)) + + # Interpolates comparison spectrum and comparison unc + # Remember: once you interpolate, you need to plot the w_tar vs the interpolated flux NOT w_comp vs interpolated flux + f_comp = np.interp(w_tar, w_comp, f_comp) + unc_comp = np.interp(w_tar, w_comp, unc_comp) + + # Normalizes the comparison spectrum to the target spectrum + f_comp = normalize_spectra(f_tar, unc_tar, f_comp, unc_comp) + + # MC RMS calculation + y_array1 = f_tar[f:l] + y_array2 = f_comp[f:l] + unc1 = unc_tar[f:l] + unc2 = unc_comp[f:l] + + iterations = 1000 + avg, error, RMS = mc_rms(y_array1, y_array2, unc1, unc2, iterations) + + # Appends the average RMS and the error for each comp spectrum to master lists (RMSs and sigmas) + RMSs.append(avg) + sigmas.append(error) + + # Plots the spectra -> want to think about how to make this separate from the calculation + plot_title = str(row['shortname']) + '-' + str(row['spec_id']) + '_' + str(data_tar[0][1]) + plt.plot(w_tar[f:l], f_tar[f:l], color='black') + plt.plot(w_tar[f:l], f_comp[f:l], color='r') + # plt.fill_between(shifted_w_tar[f:l],f_tar[f:l]+unc_tar[f:l], f_tar[f:l]-unc_tar[f:l], color='black', alpha=0.3) + # plt.fill_between(shifted_w_comp[f:l], f_comp_norm_dk_interp[f:l]+unc_comp_interp[f:l], f_comp_norm_dk_interp[f:l]-unc_comp_interp[f:l], color='r', alpha=0.3) + plt.ylabel('wavelength') + plt.xlabel('flux') + plt.savefig('/Users/victoriaditomasso/phys767/MCSpectra/RMS_' + str(plot_title) + '.png') + plt.show() + plt.close() + + df['RMS'] = RMSs + df['sigma'] = sigmas + + df.to_csv(str(data_tar[0][1]) + '_RMS_bad_removed.txt', sep='\t') + + + + +def vis_rms_results(tar_source_id, spec_order, path_to_sorted_dataframe): + # Get target data + w_tar, f_tar, rv_tar, unc_tar = get_tar_data(tar_source_id, spec_order) + + # Shift target wavelength according to its RV + w_tar = (w_tar) * (1. - (rv_tar / 2.99792458e5)) + + # Read in the dataframe + df = pd.read_csv(path_to_sorted_dataframe, sep='\t') + + # Sets the first and last flux point that will be used in quantification calculation/will be plotted + f = 50 + l = 1000 + + fig = plt.gcf() + plt.figure(figsize=(7, 75)) + + # Iterates through all of the comparison objects in the dataframe + for i, row in df.iterrows(): + # Queries the database for comparison object data + data_comp = db.query( + "select spectra.wavelength, spectra.flux, spectra.unc from spectra where spectra.id={}".format( + row['spec_id'])) + + # Separates the comparison data into separate variables (wavelength, flux, RV, uncertainty) + w_comp = np.asarray(data_comp[0][0]) + f_comp = np.asarray(data_comp[0][1]) + rv_comp = row['rv'] + unc_comp = data_comp[0][2] + + # Will convert an SNR array to an uncertainty array + unc_comp = snr_to_unc(unc_comp) + + # Shifts spectra based on their RVs + w_comp = w_comp * (1. - (rv_comp / 2.99792458e5)) + + # Interpolates comparison spectrum and comparison unc + # Remember: once you interpolate, you need to plot the w_tar vs the interpolated flux NOT w_comp vs interpolated flux + f_comp = np.interp(w_tar, w_comp, f_comp) + unc_comp = np.interp(w_tar, w_comp, unc_comp) + + # Normalizes the comparison spectrum to the target spectrum + f_comp = normalize_spectra(f_tar, unc_tar, f_comp, unc_comp) + + f_tar_plot = f_tar[f:l] + i + f_comp_plot = f_comp[f:l] + i + w_tar_plot = w_tar[f:l] + w_comp_plot = w_comp[f:l] + unc_tar_plot = unc_tar[f:l] + unc_tar_plot = unc_comp[f:l] + + plt.plot(w_tar_plot, f_tar_plot, color='black') + plt.plot(w_tar_plot, f_comp_plot, color='red') + + plt.show() + + From 55f5af0d34e5d81c3df06d319a5f10d213d474a2 Mon Sep 17 00:00:00 2001 From: vditomasso Date: Wed, 29 Mar 2017 11:15:14 -0400 Subject: [PATCH 4/6] Minor syntax changes --- shifty.ipynb | 18 +++++++++--------- shifty.py | 18 +++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/shifty.ipynb b/shifty.ipynb index 23cfb15..6e5f6a6 100644 --- a/shifty.ipynb +++ b/shifty.ipynb @@ -254,7 +254,6 @@ }, "outputs": [], "source": [ - "\n", "import numpy as np\n", "import matplotlib.mlab as mlab\n", "\n", @@ -276,7 +275,7 @@ " fig = plt.plot(x_gauss,y_gauss)\n", " \n", " print('mean = ', mean, 'sigma = ', sigma)\n", - " return fig\n" + " return fig" ] }, { @@ -396,7 +395,7 @@ " df['RMS'] = RMSs\n", " df['sigma'] = sigmas\n", "\n", - " df.to_csv(str(data_tar[0][1])+'_RMS_bad_removed.txt',sep='\\t')\n" + " df.to_csv(str(data_tar[0][1])+'_RMS_bad_removed.txt',sep='\\t')" ] }, { @@ -861,8 +860,7 @@ " plt.plot(w_tar_plot,f_tar_plot,color='black')\n", " plt.plot(w_tar_plot,f_comp_plot,color='red')\n", " \n", - " plt.show()\n", - " " + " plt.show()" ] }, { @@ -904,7 +902,9 @@ "collapsed": true }, "outputs": [], - "source": [] + "source": [ + "" + ] } ], "metadata": { @@ -916,7 +916,7 @@ "language_info": { "codemirror_mode": { "name": "ipython", - "version": 3 + "version": 3.0 }, "file_extension": ".py", "mimetype": "text/x-python", @@ -927,5 +927,5 @@ } }, "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/shifty.py b/shifty.py index 3cb02d9..27c8607 100644 --- a/shifty.py +++ b/shifty.py @@ -7,7 +7,7 @@ import matplotlib.mlab as mlab from scipy.stats import norm # import BDdb -import astrodb +from astrodbkit import astrodb import pandas as pd db = astrodb.Database('/Users/victoriaditomasso/Desktop/BDNYCdeprecated.db') @@ -27,7 +27,7 @@ def mc_rms(y_array1, y_array2, unc1, unc2, n): y_array1_rand = y_array1 + (np.random.randn(len(y_array1)) * unc1) y_array2_rand = y_array2 + (np.random.randn(len(y_array2)) * unc2) diff = y_array1_rand - y_array2_rand - rms = (np.sum(diff ** 2)) / (len(diff)) ** (0.5) + rms = np.sum(diff ** 2) / len(diff) ** 0.5 RMS.append(rms) avg = np.mean(RMS) @@ -92,8 +92,7 @@ def get_comp_data(spec_id): Arguments: spec_id Outputs: w_comp,f_comp,rv_comp,unc_comp""" - data_comp = db.query( - "select spectra.wavelength, spectra.flux, spectra.unc from spectra where spectra.id={}".format(row['spec_id'])) + data_comp = db.query("select spectra.wavelength, spectra.flux, spectra.unc from spectra where spectra.id={}").format(spec_id) w_comp = np.asarray(data_comp[0][0]) @@ -115,7 +114,7 @@ def rv_shift(wavelength, rv): Arguments: wavelength array, rv Outputs: shifted_wavelength""" - shifted_wavelength = (wavelength) * (1. - (rv / 2.99792458e5)) + shifted_wavelength = wavelength * (1. - (rv / 2.99792458e5)) return shifted_wavelength @@ -135,9 +134,6 @@ def normalize_spectra(f1, unc1, f2, unc2): return f2_norm -import numpy as np -import matplotlib.mlab as mlab - def mc_output_hist(MC_calculations, bins=25): plt.hist(MC_calculations, bins, normed=True) @@ -177,7 +173,7 @@ def yfcq(tar_source_id, spec_order, path_to_comp_sample_dataframe): unc_tar = data_tar[0][4] # Adjusting wavelength array of the target according to its RV - w_tar = w_tar * (1. - (rv_tar / 2.99792458e5)) + w_tar *= 1. - (rv_tar / 2.99792458e5) # Reads in the dataframe df = pd.read_csv(path_to_comp_sample_dataframe, sep='\t') @@ -209,7 +205,7 @@ def yfcq(tar_source_id, spec_order, path_to_comp_sample_dataframe): unc_comp = snr_to_unc(unc_comp) # Shifts spectra based on their RVs - w_comp = w_comp * (1. - (rv_comp / 2.99792458e5)) + w_comp *= 1. - (rv_comp / 2.99792458e5) # Interpolates comparison spectrum and comparison unc # Remember: once you interpolate, you need to plot the w_tar vs the interpolated flux NOT w_comp vs interpolated flux @@ -257,7 +253,7 @@ def vis_rms_results(tar_source_id, spec_order, path_to_sorted_dataframe): w_tar, f_tar, rv_tar, unc_tar = get_tar_data(tar_source_id, spec_order) # Shift target wavelength according to its RV - w_tar = (w_tar) * (1. - (rv_tar / 2.99792458e5)) + w_tar = w_tar * (1. - (rv_tar / 2.99792458e5)) # Read in the dataframe df = pd.read_csv(path_to_sorted_dataframe, sep='\t') From eceef1e8ee4e377984db0af65fc2ce5795d7feeb Mon Sep 17 00:00:00 2001 From: vditomasso Date: Wed, 29 Mar 2017 11:21:32 -0400 Subject: [PATCH 5/6] Added .travis.yml file --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..521c928 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: python + +python: +- 3.6.0 + +script: +- pytest \ No newline at end of file From 52205f11441b82a6de76542a01c15f54a92f0ec1 Mon Sep 17 00:00:00 2001 From: vditomasso Date: Wed, 29 Mar 2017 11:24:49 -0400 Subject: [PATCH 6/6] Added shifty_test.py file --- shifty_test.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 shifty_test.py diff --git a/shifty_test.py b/shifty_test.py new file mode 100644 index 0000000..ec39d59 --- /dev/null +++ b/shifty_test.py @@ -0,0 +1,6 @@ +from shifty import mc_rms +import pytest + +# This test is going fail +def test_mc_rms_1(): + assert mc_rms(1,1,1,1,1) == 1 \ No newline at end of file