{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "from jinja2 import Environment, FileSystemLoader, select_autoescape\n", "from get_paperinfo_fromurls import get_paperinfo_fromurls" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "\n", "class CARDS_TEMPLATE(object):\n", " def __init__(self, path_to_template, template_filename):\n", " self.path_to_template = path_to_template\n", " self.template_filename = template_filename\n", " self.template = self._get_template()\n", " self.rendered_html = None\n", "\n", " def _get_template(self):\n", " env = Environment(\n", " autoescape=select_autoescape(\n", " enabled_extensions=('html'),\n", " default_for_string=True,\n", " ),\n", " loader=FileSystemLoader(self.path_to_template)\n", " )\n", " return env.get_template(self.template_filename)\n", "\n", " def render(self, paper_details_iterator):\n", " self.rendered_html = self.template.render(paper_details=paper_details_iterator)\n", "\n", " def save_html(self, output_dir=None, output_htmlfile=None):\n", " with open(os.path.join(output_dir, output_htmlfile), \"w\") as f:\n", " f.write(self.rendered_html)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "template_file = \"htmlcard.html\"\n", "template_path = \"\"\n", "card_template = CARDS_TEMPLATE(\n", " path_to_template = template_path,\n", " template_filename = template_file,\n", " )\n", "\n", "def create_html_card(arxiv_link):\n", " paper_details = get_paperinfo_fromurls(arxiv_link)\n", " card_template.render(paper_details_iterator=paper_details)\n", " return card_template.rendered_html" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "paper_details = get_paperinfo_fromurls(\"https://arxiv.org/abs/2208.13511\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'https://arxiv.org/abs/2208.13511': ArxivPaper(title='Galaxies with Fuzzy Dark Matter', authors=[{'name': 'Jae-Weon Lee'}], abstract='This is a brief review on some properties of galaxies in the fuzzy dark\\nmatter model, where dark matter is an ultra-light scalar particle with mass $m\\n= O(10^{-22})eV$. From quantum pressure, dark matter has a halo length scale\\nwhich can solve the small scale issues of the cold dark matter model, such as\\nthe core-cusp problem, and explain many other observed mysteries of galaxies.', linktopdf='http://arxiv.org/pdf/2208.13511v1', linktoabs='http://arxiv.org/abs/2208.13511v1', arxiv_id='2208.13511')}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "paper_details" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "card_template.render(paper_details_iterator=paper_details)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "card_template.save_html(output_dir = template_path, output_htmlfile = \"a.html\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'
\\n \\n \\n\\n \\n\\n \\n \\nThis is a brief review on some properties of galaxies in the fuzzy dark\\nmatter model, where dark matter is an ultra-light scalar particle with mass $m\\n= O(10^{-22})eV$. From quantum pressure, dark matter has a halo length scale\\nwhich can solve the small scale issues of the cold dark matter model, such as\\nthe core-cusp problem, and explain many other observed mysteries of galaxies.
\\n\\n \\nThis is a brief review on some properties of galaxies in the fuzzy dark\n", "matter model, where dark matter is an ultra-light scalar particle with mass $m\n", "= O(10^{-22})eV$. From quantum pressure, dark matter has a halo length scale\n", "which can solve the small scale issues of the cold dark matter model, such as\n", "the core-cusp problem, and explain many other observed mysteries of galaxies.
\n", "\n", " \n", "We analyse the observational signatures of galactic magnetic fields that are\n", "self-consistently generated in magnetohydrodynamic simulations of the\n", "interstellar medium through turbulence driven by supernova (SN) explosions and\n", "differential rotation. In particular, we study the time evolution of the\n", "Faraday rotation measure (RM), synchrotron radiation, and Stokes parameters by\n", "characterising the typical structures formed in the plane of observation. We do\n", "this by defining two distinct models for both thermal and cosmic ray (CR)\n", "electron distributions. Our results indicate that the maps of RM have\n", "structures which are sheared and rendered anisotropically by differential\n", "rotation and that they depend on the choice of thermal electrons model as well\n", "as the SN rate. Synchrotron maps are qualitatively similar to the maps of the\n", "mean magnetic field along the line of sight and structures are only marginally\n", "affected by the CR model. Stokes parameters and related quantities, such as the\n", "degree of linear polarisation, are highly dependent on both frequency and\n", "resolution of the observation.
\n", "\n", " \n", "