{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Testing the MESA data on the CADC" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "import mesa as ms\n", "import nugridse as mp\n", "%pylab nbagg" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "!ls" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [], "source": [ "### Seeker method " ] }, { "cell_type": "raw", "metadata": {}, "source": [ "nugrid_data_dir='/home/nugrid/CADC/NuGrid/data/set1'" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "### set1.2_m" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['M1.00Z2.0e-02', 'M1.65Z2.0e-02', 'M25.0Z2.0e-02', 'M5.00Z2.0e-02', 'M12.0Z2.0e-02', 'M2.00Z2.0e-02', 'M3.00Z2.0e-02', 'M6.00Z2.0e-02', 'M15.0Z2.0e-02', 'M20.0Z2.0e-02', 'M4.00Z2.0e-02', 'M7.00Z2.0e-02']\n" ] } ], "source": [ "set1p2_m_masses=['M1.00Z2.0e-02', 'M1.65Z2.0e-02','M25.0Z2.0e-02', 'M5.00Z2.0e-02'\n", " ,'M12.0Z2.0e-02', 'M2.00Z2.0e-02', 'M3.00Z2.0e-02', 'M6.00Z2.0e-02'\n", " ,'M15.0Z2.0e-02', 'M20.0Z2.0e-02' ,'M4.00Z2.0e-02', 'M7.00Z2.0e-02']\n", "set_dir='/set1.2_m/'\n", "print set1p2_m_masses" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "########### Test M1.00Z2.0e-02\n", "##MESA##\n" ] }, { "ename": "NameError", "evalue": "name 'nugrid_data_dir' is not defined", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m'########### Test '\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mset1p2_m_masses\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mk\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m'##MESA##'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0mhistorydata\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mms\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstar_log\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnugrid_data_dir\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mset_dir\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;34m'see_wind/'\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mset1p2_m_masses\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mk\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;34m'/LOGS'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m'##H5_surf##'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[0msefiles_surf\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mse\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnugrid_data_dir\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mset_dir\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;34m'ppd_wind/'\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mset1p2_m_masses\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mk\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;34m'/H5_surf'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mNameError\u001b[0m: name 'nugrid_data_dir' is not defined" ] } ], "source": [ "for k in range(len(set1p2_m_masses)):\n", " print '########### Test ',set1p2_m_masses[k]\n", " print '##MESA##'\n", " historydata=ms.star_log(nugrid_data_dir+set_dir+'see_wind/'+set1p2_m_masses[k]+'/LOGS')\n", " print '##H5_surf##'\n", " sefiles_surf=mp.se(nugrid_data_dir+set_dir+'ppd_wind/'+set1p2_m_masses[k]+'/H5_surf')\n", " print '#test all cycles'\n", " h1=sefiles_surf.get('H-1')\n", " print\n", " print '##H5_out##'\n", " sefiles_out=mp.se(nugrid_data_dir+set_dir+'ppd_wind/'+set1p2_m_masses[k]+'/H5_out')\n", " print '#test all cycles'\n", " h1=sefiles_out.get('H-1')\n", " print\n", " print '##H5_restart##'\n", " sefiles_restart=mp.se(nugrid_data_dir+set_dir+'ppd_wind/'+set1p2_m_masses[k]+'/H5_restart')\n", " print '#test all cycles'\n", " h1=sefiles_restart.get('H-1')\n", " print\n", " print '##last cycles##'\n", " print 'last cycles MESA/surf/out/rstart: ',int(historydata.get('model_number')[-1]),int(sefiles_surf.se.cycles[-1]), \\\n", " int(sefiles_out.se.cycles[-1]),int(sefiles_restart.se.cycles[-1])\n", " #plotting\n", " historydata.kippenhahn(set1p2_m_masses[k]+' MESA','model')\n", " #plt.title(set1p2_m_masses[k])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [Root]", "language": "python", "name": "Python [Root]" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.12" } }, "nbformat": 4, "nbformat_minor": 0 }