<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%matplotlib notebook\n",
    "\n",
    "import sys, os \n",
    "print(os.path.abspath('.'))\n",
    "sys.path.append(os.path.join('..','..')) \n",
    "\n",
    "import pylab\n",
    "pylab.rcParams['figure.figsize'] = (8.0, 8.0)\n",
    "pylab.rcParams['image.cmap'] = 'rainbow'\n",
    "\n",
    "import numpy\n",
    "import scipy\n",
    "import scipy.special\n",
    "\n",
    "from matplotlib import pylab\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "from crocodile.synthesis import *\n",
    "from crocodile.simulate import *\n",
    "from crocodile.msclean import *\n",
    "\n",
    "def aaf_ns(a, m, c):\n",
    "    \"\"\"\n",
    "\n",
    "    \"\"\"\n",
    "    r=numpy.hypot(*ucs(a))\n",
    "    return scipy.special.pro_ang1(m,m,c,r)\n",
    "\n",
    "def stackshow(stack):\n",
    "    plt.clf()\n",
    "    nscales=stack.shape[2]\n",
    "    for iscale in range(nscales):\n",
    "        ny=int(numpy.sqrt(nscales))\n",
    "        nx=ny\n",
    "        plt.subplot(nx,ny,iscale+1)\n",
    "        plt.imshow(stack[:,:,iscale],origin='lower',cmap='Greys')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "vlas=numpy.genfromtxt(\"../../data/models/VLA_A_hor_xyz.txt\", delimiter=\",\")\n",
    "vobs=xyz_to_baselines(vlas, numpy.arange(0,numpy.pi,0.1) ,  numpy.pi/4)\n",
    "yy=simulate_point(vobs/5, 0.01, 0.01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "ps, vs = sortw(vobs/5, yy)\n",
    "wstep=2500\n",
    "dirty,psf=doimg(2*0.025, 2*15000, ps, vs, lambda *x: wslicimg(*x, wstep=wstep, Qpx=1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "scales=[1,3,10]\n",
    "ps, vs, cc, rres=majorcycle(2*0.025, 2*15000, vobs/5, yy, 0.1, 1, 100, wstep, scales)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "plt.clf()\n",
    "plt.subplot(1, 2, 1)\n",
    "plt.imshow(numpy.sqrt(numpy.fabs(cc)), origin='lower')\n",
    "plt.colorbar()\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "plt.imshow(rres, origin='lower')\n",
    "plt.colorbar()\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "nv=11232\n",
    "wstep=2500\n",
    "ii=range( 0, nv, wstep)\n",
    "print(ii)\n",
    "print(ii[:-1], ii[1:])\n",
    "print(zip(ii[:-1], ii[1:]))\n",
    "\n",
    "\n",
    "print(zip(range(ii[-1], nv)))\n",
    "\n",
    "import see\n",
    "dir(zip(ii[:-1], ii[1:]))\n",
    "\n",
    "print(zip(ii[:-1], ii[1:]))\n",
    "print(zip(ii[:-1], ii[1:]).append(zip(range(ii[-1], nv))) )\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {<commit_msg>Keep msclean in my area until it is done<commit_after>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%matplotlib notebook\n",
    "\n",
    "import sys, os \n",
    "print(os.path.abspath('.'))\n",
    "sys.path.append(os.path.join('..','..')) \n",
    "\n",
    "import pylab\n",
    "pylab.rcParams['figure.figsize'] = (8.0, 8.0)\n",
    "pylab.rcParams['image.cmap'] = 'rainbow'\n",
    "\n",
    "import numpy\n",
    "import scipy\n",
    "import scipy.special\n",
    "\n",
    "from matplotlib import pylab\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "from crocodile.synthesis import *\n",
    "from crocodile.simulate import *\n",
    "from msclean import *\n",
    "\n",
    "def aaf_ns(a, m, c):\n",
    "    \"\"\"\n",
    "\n",
    "    \"\"\"\n",
    "    r=numpy.hypot(*ucs(a))\n",
    "    return scipy.special.pro_ang1(m,m,c,r)\n",
    "\n",
    "def stackshow(stack):\n",
    "    plt.clf()\n",
    "    nscales=stack.shape[2]\n",
    "    for iscale in range(nscales):\n",
    "        ny=int(numpy.sqrt(nscales))\n",
    "        nx=ny\n",
    "        plt.subplot(nx,ny,iscale+1)\n",
    "        plt.imshow(stack[:,:,iscale],origin='lower',cmap='Greys')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "vlas=numpy.genfromtxt(\"../../data/models/VLA_A_hor_xyz.txt\", delimiter=\",\")\n",
    "vobs=xyz_to_baselines(vlas, numpy.arange(0,numpy.pi,0.1) ,  numpy.pi/4)\n",
    "yy=simulate_point(vobs/5, 0.01, 0.01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "ps, vs = sortw(vobs/5, yy)\n",
    "wstep=2500\n",
    "dirty,psf=doimg(2*0.025, 2*15000, ps, vs, lambda *x: wslicimg(*x, wstep=wstep, Qpx=1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "scales=[1,3,10]\n",
    "ps, vs, cc, rres=majorcycle(2*0.025, 2*15000, vobs/5, yy, 0.1, 2, 100, wstep, scales)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "plt.clf()\n",
    "plt.subplot(1, 2, 1)\n",
    "plt.imshow(numpy.sqrt(numpy.fabs(cc)), origin='lower')\n",
    "plt.colorbar()\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "plt.imshow(rres, origin='lower')\n",
    "plt.colorbar()\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
{'fraction_non_alphanumeric': 0.25162992859360445, 'fraction_numerical': 0.023595156783607574, 'mean_word_length': 2.484586262844781, 'pattern_counts': {'":': 94, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1431197', 'n_tokens_mistral': 2913, 'n_tokens_neox': 2780, 'n_words': 428}