diff --git a/.coveragerc b/.coveragerc index ce2f455..4edd7b1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,2 @@ [run] -relative_files = True \ No newline at end of file +relative_files = True diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index 21d2219..d2369f9 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -16,4 +16,3 @@ jobs: needs: [python2_tests, python3_tests] uses: ./.github/workflows/publish.yml secrets: inherit - diff --git a/.github/workflows/test-python-2.yml b/.github/workflows/test-python-2.yml index d220611..bfa1e64 100644 --- a/.github/workflows/test-python-2.yml +++ b/.github/workflows/test-python-2.yml @@ -31,11 +31,11 @@ jobs: run: | ${{ matrix.python }} --version ${{ matrix.pip }} freeze - + - name: Run flake8 checks shell: bash run: flake8 inspire_json_merger tests - + - name: Run tests run: | ./run-tests.sh diff --git a/.github/workflows/test-python-3.yml b/.github/workflows/test-python-3.yml index 4e40217..d3c56a3 100644 --- a/.github/workflows/test-python-3.yml +++ b/.github/workflows/test-python-3.yml @@ -41,7 +41,7 @@ jobs: - name: Run flake8 checks shell: bash run: flake8 inspire_json_merger tests - + - name: Run tests run: | ./run-tests.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..2c56732 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - id: fix-byte-order-marker + - id: mixed-line-ending + - id: name-tests-test + args: [ --pytest-test-first ] + exclude: '^(?!factories/)' + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.5.6 + hooks: + - id: ruff + args: [ --fix ] diff --git a/inspire_json_merger/api.py b/inspire_json_merger/api.py index 1a93ec2..1cb1599 100644 --- a/inspire_json_merger/api.py +++ b/inspire_json_merger/api.py @@ -22,8 +22,8 @@ from __future__ import absolute_import, division, print_function -from inspire_utils.record import get_value from inspire_utils.helpers import force_list +from inspire_utils.record import get_value from json_merger.merger import MergeError, Merger from inspire_json_merger.config import ( @@ -35,7 +35,6 @@ PublisherOnPublisherOperations, ) from inspire_json_merger.postprocess import postprocess_results - from inspire_json_merger.utils import filter_conflicts, filter_records @@ -61,9 +60,13 @@ def merge(root, head, update, head_source=None, configuration=None): if not configuration: configuration = get_configuration(head, update, head_source) conflicts = [] - root, head, update = filter_records(root, head, update, filters=configuration.pre_filters) + root, head, update = filter_records( + root, head, update, filters=configuration.pre_filters + ) merger = Merger( - root=root, head=head, update=update, + root=root, + head=head, + update=update, default_dict_merge_op=configuration.default_dict_merge_op, default_list_merge_op=configuration.default_list_merge_op, list_dict_ops=configuration.list_dict_ops, @@ -95,7 +98,7 @@ def get_configuration(head, update, head_source=None): MergerConfigurationOperations: an object containing the rules needed to merge HEAD and UPDATE """ - head_source = (head_source or get_head_source(head)) + head_source = head_source or get_head_source(head) update_source = get_acquisition_source(update) if is_manual_merge(head, update): @@ -118,12 +121,15 @@ def get_configuration(head, update, head_source=None): def get_head_source(json_obj): def no_freetext_in_publication_info(obj): - return 'publication_info' in obj and \ - any('pubinfo_freetext' not in pubinfo for pubinfo in obj.get('publication_info')) + return 'publication_info' in obj and any( + 'pubinfo_freetext' not in pubinfo for pubinfo in obj.get('publication_info') + ) def no_arxiv_in_dois(obj): - return 'dois' in obj and \ - any(source.lower() != 'arxiv' for source in force_list(get_value(obj, 'dois.source'))) + return 'dois' in obj and any( + source.lower() != 'arxiv' + for source in force_list(get_value(obj, 'dois.source')) + ) if no_freetext_in_publication_info(json_obj) or no_arxiv_in_dois(json_obj): return 'publisher' @@ -141,15 +147,33 @@ def get_acquisition_source(json_obj): def is_manual_merge(head, update): - return ('control_number' in update and 'control_number' in head and update['control_number'] != head['control_number']) + return ( + 'control_number' in update + and 'control_number' in head + and update['control_number'] != head['control_number'] + ) def is_erratum(update): - erratum_keywords = {"erratum", "corrigendum", "publisher's note", "publisher correction"} + erratum_keywords = { + "erratum", + "corrigendum", + "publisher's note", + "publisher correction", + } journal_titles_list = get_value(update, "titles.title", []) journal_titles_string = " ".join(journal_titles_list).lower() - title_contains_erratum_keyword = any([keyword in journal_titles_string for keyword in erratum_keywords]) - title_starts_with_correction_to = any(journal_title.lower().startswith('correction to:') for journal_title in journal_titles_list) + title_contains_erratum_keyword = any( + [keyword in journal_titles_string for keyword in erratum_keywords] + ) + title_starts_with_correction_to = any( + journal_title.lower().startswith('correction to:') + for journal_title in journal_titles_list + ) erratum_in_dois_material = 'erratum' in get_value(update, "dois.material", []) - if title_contains_erratum_keyword or title_starts_with_correction_to or erratum_in_dois_material: + if ( + title_contains_erratum_keyword + or title_starts_with_correction_to + or erratum_in_dois_material + ): return True diff --git a/inspire_json_merger/comparators.py b/inspire_json_merger/comparators.py index 4f9423e..1376d98 100644 --- a/inspire_json_merger/comparators.py +++ b/inspire_json_merger/comparators.py @@ -29,8 +29,7 @@ NameInitial, NameToken, ) -from json_merger.contrib.inspirehep.comparators import \ - DistanceFunctionComparator +from json_merger.contrib.inspirehep.comparators import DistanceFunctionComparator from inspire_json_merger.utils import scan_author_string_for_phrases @@ -53,6 +52,7 @@ def author_tokenize(name): class IDNormalizer(object): """Callable that can be used to normalize by a given id for authors.""" + def __init__(self, id_type): self.id_type = id_type @@ -75,19 +75,25 @@ class AuthorComparator(DistanceFunctionComparator): AuthorNameNormalizer(author_tokenize, asciify=True), AuthorNameNormalizer(author_tokenize, first_names_number=1), AuthorNameNormalizer(author_tokenize, first_names_number=1, asciify=True), - AuthorNameNormalizer(author_tokenize, first_names_number=1, first_name_to_initial=True), - AuthorNameNormalizer(author_tokenize, first_names_number=1, first_name_to_initial=True, asciify=True), + AuthorNameNormalizer( + author_tokenize, first_names_number=1, first_name_to_initial=True + ), + AuthorNameNormalizer( + author_tokenize, + first_names_number=1, + first_name_to_initial=True, + asciify=True, + ), ] def get_pk_comparator(primary_key_fields, normalization_functions=None): class Ret(PrimaryKeyComparator): - __doc__ = ( - 'primary_key_fields:%s, normalization_functions:%s' % ( - primary_key_fields, - normalization_functions, - ) + __doc__ = 'primary_key_fields:%s, normalization_functions:%s' % ( + primary_key_fields, + normalization_functions, ) + Ret.primary_key_fields = primary_key_fields Ret.normalization_functions = normalization_functions or {} return Ret @@ -112,19 +118,19 @@ class Ret(PrimaryKeyComparator): SchemaValueComparator = get_pk_comparator([['schema', 'value']]) -PublicationInfoComparator = get_pk_comparator([ - ['journal_title', 'journal_volume', 'material', 'cnum'] -]) +PublicationInfoComparator = get_pk_comparator( + [['journal_title', 'journal_volume', 'material', 'cnum']] +) -FigureComparator = get_pk_comparator([ - ['key', 'material'] -]) +FigureComparator = get_pk_comparator([['key', 'material']]) -DocumentComparator = get_pk_comparator([ - ['source', 'description', 'material'], - ['source', 'fulltext', 'material'], - ['source', 'original_url', 'material'], -]) +DocumentComparator = get_pk_comparator( + [ + ['source', 'description', 'material'], + ['source', 'fulltext', 'material'], + ['source', 'original_url', 'material'], + ] +) PersistentIdentifierComparator = get_pk_comparator(['value', 'material']) diff --git a/inspire_json_merger/config.py b/inspire_json_merger/config.py index 6f81f2e..16e80af 100644 --- a/inspire_json_merger/config.py +++ b/inspire_json_merger/config.py @@ -22,20 +22,21 @@ from __future__ import absolute_import, division, print_function -from json_merger.config import DictMergerOps as D, UnifierOps as U +from json_merger.config import DictMergerOps as D +from json_merger.config import UnifierOps as U +from inspire_json_merger.comparators import COMPARATORS, GROBID_ON_ARXIV_COMPARATORS from inspire_json_merger.pre_filters import ( + clean_root_for_acquisition_source, + filter_curated_references, filter_documents_same_source, filter_figures_same_source, - filter_curated_references, filter_publisher_references, - update_authors_with_ordering_info, remove_references_from_update, - clean_root_for_acquisition_source, + remove_root, + update_authors_with_ordering_info, update_material, - remove_root ) -from .comparators import COMPARATORS, GROBID_ON_ARXIV_COMPARATORS """ This module provides different sets of rules that `inspire_json_merge` @@ -58,7 +59,7 @@ class ArxivOnArxivOperations(MergerConfigurationOperations): filter_documents_same_source, filter_figures_same_source, filter_curated_references, - update_authors_with_ordering_info + update_authors_with_ordering_info, ] conflict_filters = [ '_collections', @@ -104,7 +105,8 @@ class ArxivOnArxivOperations(MergerConfigurationOperations): 'persistent_identifiers': D.FALLBACK_KEEP_HEAD, 'preprint_date': D.FALLBACK_KEEP_HEAD, 'publication_info': D.FALLBACK_KEEP_HEAD, - # Fields bellow are merged and conflicts are ignored, so for those fields we stay with previous merge behaviour. + # Fields bellow are merged and conflicts are ignored, + # so for those fields we stay with previous merge behaviour. 'abstracts': D.FALLBACK_KEEP_UPDATE, 'acquisition_source': D.FALLBACK_KEEP_UPDATE, 'arxiv_eprints': D.FALLBACK_KEEP_UPDATE, @@ -115,7 +117,6 @@ class ArxivOnArxivOperations(MergerConfigurationOperations): 'license': D.FALLBACK_KEEP_UPDATE, 'number_of_pages': D.FALLBACK_KEEP_UPDATE, 'public_notes': D.FALLBACK_KEEP_UPDATE, - } @@ -126,7 +127,7 @@ class ArxivOnPublisherOperations(MergerConfigurationOperations): filter_figures_same_source, filter_publisher_references, update_authors_with_ordering_info, - clean_root_for_acquisition_source + clean_root_for_acquisition_source, ] default_list_merge_op = U.KEEP_ONLY_HEAD_ENTITIES conflict_filters = [ @@ -205,7 +206,7 @@ class PublisherOnArxivOperations(MergerConfigurationOperations): filter_figures_same_source, filter_curated_references, update_authors_with_ordering_info, - clean_root_for_acquisition_source + clean_root_for_acquisition_source, ] conflict_filters = [ '_collections', @@ -255,7 +256,7 @@ class PublisherOnPublisherOperations(MergerConfigurationOperations): filter_figures_same_source, filter_curated_references, update_authors_with_ordering_info, - clean_root_for_acquisition_source + clean_root_for_acquisition_source, ] conflict_filters = [ '_collections', @@ -294,7 +295,8 @@ class PublisherOnPublisherOperations(MergerConfigurationOperations): 'curated': D.FALLBACK_KEEP_HEAD, 'preprint_date': D.FALLBACK_KEEP_HEAD, 'report_numbers': D.FALLBACK_KEEP_HEAD, - # Fields bellow are merged and conflicts are ignored, so for those fields we stay with previous merge behaviour. + # Fields bellow are merged and conflicts are ignored, + # so for those fields we stay with previous merge behaviour. '_files': D.FALLBACK_KEEP_UPDATE, 'acquisition_source': D.FALLBACK_KEEP_UPDATE, 'authors.raw_affiliations': D.FALLBACK_KEEP_UPDATE, @@ -310,23 +312,15 @@ class PublisherOnPublisherOperations(MergerConfigurationOperations): class GrobidOnArxivAuthorsOperations(MergerConfigurationOperations): default_list_merge_op = U.KEEP_ONLY_HEAD_ENTITIES default_dict_merge_op = D.FALLBACK_KEEP_HEAD - list_dict_ops = { - 'authors.raw_affiliations': D.FALLBACK_KEEP_UPDATE - } - list_merge_ops = { - 'authors.raw_affiliations': U.KEEP_ONLY_UPDATE_ENTITIES - } + list_dict_ops = {'authors.raw_affiliations': D.FALLBACK_KEEP_UPDATE} + list_merge_ops = {'authors.raw_affiliations': U.KEEP_ONLY_UPDATE_ENTITIES} comparators = GROBID_ON_ARXIV_COMPARATORS conflict_filters = ["authors.full_name"] class ErratumOnPublisherOperations(MergerConfigurationOperations): comparators = COMPARATORS - pre_filters = [ - update_material, - update_authors_with_ordering_info, - remove_root - ] + pre_filters = [update_material, update_authors_with_ordering_info, remove_root] default_list_merge_op = U.KEEP_UPDATE_AND_HEAD_ENTITIES_HEAD_FIRST default_dict_merge_op = D.FALLBACK_KEEP_HEAD list_merge_ops = { diff --git a/inspire_json_merger/postprocess.py b/inspire_json_merger/postprocess.py index 79b1d68..a630e14 100644 --- a/inspire_json_merger/postprocess.py +++ b/inspire_json_merger/postprocess.py @@ -123,7 +123,8 @@ def postprocess_conflicts(conflicts, merged): def add_conflict(conflict, processed_conflicts, unprocessed_conflicts): - """Adds conflict which added something to `merged` dict so positions for other conflicts should be updated + """Adds conflict which added something to `merged` dict so positions + for other conflicts should be updated Args: conflict(Conflict): curently added conflict @@ -147,7 +148,12 @@ def update_conflicts_list(conflict, conflict_list): new_type, new_path, new_content = conflict for idx, processed_conflict in enumerate(conflict_list): path = processed_conflict[1] - if path[0] == new_path[0] and len(path) > 1 and len(new_path) > 1 and path[1] >= new_path[1]: + if ( + path[0] == new_path[0] + and len(path) > 1 + and len(new_path) > 1 + and path[1] >= new_path[1] + ): path = list(path) path[1] += 1 path = tuple(path) @@ -184,7 +190,8 @@ def _additem(item, object, path): Args: item: Item to add object: List or Dictionary to which item should be added - path(tuple): Path on which item should be added, every element of path is a separate element. + path(tuple): Path on which item should be added, every element of + path is a separate element. Path represents place after which item should be added. Returns(tuple): Tuple containing path and item merged with item under proper path. @@ -218,9 +225,11 @@ def _additem(item, object, path): def _is_conflict_duplicated(conflict, possible_duplicates): conflict_type, conflict_location, conflict_content = conflict - if conflict_type == "ADD_BACK_TO_HEAD" and conflict_location[0] == "authors" and conflict_content in possible_duplicates: - return True - return False + return bool( + conflict_type == "ADD_BACK_TO_HEAD" + and conflict_location[0] == "authors" + and conflict_content in possible_duplicates + ) def _process_author_manual_merge_conflict(conflict, merged): @@ -239,7 +248,8 @@ def _process_author_manual_merge_conflict(conflict, merged): def _insert_to_list(item, objects_list, position=None): - """Inserts value into list at proper position (as close to requested position as possible but not before it). + """Inserts value into list at proper position (as close to requested + position as possible but not before it). If no position provided element will be added at the end of the list. Args: diff --git a/inspire_json_merger/pre_filters.py b/inspire_json_merger/pre_filters.py index 6425149..7413da3 100644 --- a/inspire_json_merger/pre_filters.py +++ b/inspire_json_merger/pre_filters.py @@ -28,13 +28,19 @@ import pyrsistent from inspire_utils.record import get_value -from pyrsistent import freeze, thaw, ny, pmap +from pyrsistent import freeze, ny, pmap, thaw from six.moves import zip from inspire_json_merger.utils import ORDER_KEY FIELDS_WITH_MATERIAL_KEY = [ - 'dois', 'publication_info', 'copyright', 'documents', 'license', 'figures', 'persistent_identifiers' + 'dois', + 'publication_info', + 'copyright', + 'documents', + 'license', + 'figures', + 'persistent_identifiers', ] @@ -66,9 +72,13 @@ def keep_only_update_source_in_field(field, root, head, update): ``root`` and ``head``. """ update_thawed = thaw(update) - update_sources = {source.lower() for source in get_value(update_thawed, '.'.join([field, 'source']), [])} + update_sources = { + source.lower() + for source in get_value(update_thawed, '.'.join([field, 'source']), []) + } if not update_sources: - # If there is no field or source then fallback for source to `aquisition_source.source` + # If there is no field or source then fallback for source to + # `aquisition_source.source` source = get_value(update_thawed, "acquisition_source.source") if source: update_sources = {source.lower()} @@ -97,13 +107,15 @@ def filter_curated_references(root, head, update): update (pmap): the update record. Returns: - tuple: ``(root, head, update)`` with ``references`` removed from ``root`` and either - ``head`` or ``update``. + tuple: ``(root, head, update)`` with ``references`` removed from ``root`` + and either ``head`` or ``update``. """ if 'references' not in head or 'references' not in update: return root, head, update - references_curated = are_references_curated(root.get('references', []), head.get('references', [])) + references_curated = are_references_curated( + root.get('references', []), head.get('references', []) + ) if 'references' in root: root = root.remove('references') if references_curated: @@ -141,13 +153,17 @@ def update_authors_with_ordering_info(root, head, update): """ if 'authors' in head: - head = head.update({"authors": _update_authors_list_with_ordering_data(head["authors"])}) + head = head.update( + {"authors": _update_authors_list_with_ordering_data(head["authors"])} + ) return root, head, update def _update_authors_list_with_ordering_data(input_list): positions = iter(range(len(input_list))) - return input_list.transform([pyrsistent.ny], lambda element: element.set(ORDER_KEY, (next(positions)))) + return input_list.transform( + [pyrsistent.ny], lambda element: element.set(ORDER_KEY, (next(positions))) + ) def are_references_curated(root_refs, head_refs): @@ -157,10 +173,9 @@ def are_references_curated(root_refs, head_refs): if len(root_refs) != len(head_refs): return True - if all(ref_almost_equal(root, head) for (root, head) in zip(root_refs, head_refs)): - return False - - return True + return not all( + ref_almost_equal(root, head) for root, head in zip(root_refs, head_refs) + ) def ref_almost_equal(root_ref, head_ref): @@ -171,8 +186,12 @@ def _normalize_ref(ref): ref = _remove_if_present(ref, 'record') ref = _remove_if_falsy(ref, 'curated_relation') ref = _remove_if_present(ref, 'raw_refs') - ref = ref.transform(['reference'], lambda reference: _remove_if_present(reference, 'misc')) - ref = ref.transform(['reference'], lambda reference: _remove_if_present(reference, 'authors')) + ref = ref.transform( + ['reference'], lambda reference: _remove_if_present(reference, 'misc') + ) + ref = ref.transform( + ['reference'], lambda reference: _remove_if_present(reference, 'authors') + ) return ref @@ -212,7 +231,9 @@ def update_material(root, head, update): return root, head, update for field in FIELDS_WITH_MATERIAL_KEY: if field in update: - update = update.transform([field, ny], lambda element: element.set("material", "erratum")) + update = update.transform( + [field, ny], lambda element: element.set("material", "erratum") + ) return root, head, update diff --git a/inspire_json_merger/utils.py b/inspire_json_merger/utils.py index 2f86e8e..c38bb4c 100644 --- a/inspire_json_merger/utils.py +++ b/inspire_json_merger/utils.py @@ -25,6 +25,7 @@ from __future__ import absolute_import, division, print_function import re + import six from pyrsistent import freeze, thaw from six.moves import zip @@ -55,36 +56,31 @@ def scan_author_string_for_phrases(s): s = s.decode('utf-8') retval = { - 'TOKEN_TAG_LIST': [ - 'lastnames', - 'nonlastnames', - 'titles', - 'raw'], + 'TOKEN_TAG_LIST': ['lastnames', 'nonlastnames', 'titles', 'raw'], 'lastnames': [], 'nonlastnames': [], 'titles': [], - 'raw': s} + 'raw': s, + } l = s.split(',') # noqa: E741 if len(l) < 2: # No commas means a simple name new = s.strip() new = new.split(' ') if len(new) == 1: - retval['lastnames'] = new # rare single-name case + retval['lastnames'] = new # rare single-name case else: retval['lastnames'] = new[-1:] retval['nonlastnames'] = new[:-1] for tag in ['lastnames', 'nonlastnames']: retval[tag] = [x.strip() for x in retval[tag]] - retval[tag] = [re.split(split_on_re, x) - for x in retval[tag]] + retval[tag] = [re.split(split_on_re, x) for x in retval[tag]] # flatten sublists - retval[tag] = [item for sublist in retval[tag] - for item in sublist] + retval[tag] = [item for sublist in retval[tag] for item in sublist] retval[tag] = [x for x in retval[tag] if x != ''] else: # Handle lastname-first multiple-names case - retval['titles'] = l[2:] # no titles? no problem + retval['titles'] = l[2:] # no titles? no problem retval['nonlastnames'] = l[1] retval['lastnames'] = l[0] for tag in ['lastnames', 'nonlastnames']: diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..f6f5368 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,27 @@ +target-version = "py311" +[lint.flake8-tidy-imports] +ban-relative-imports = "all" + +[lint] +select = [ + # pycodestyle + "E", + # Pyflakes + "F", + # flake8-bugbear + "B", + # flake8-simplify + "SIM", + # isort + "I", + # flake8-tidy-imports + "TID", + # flake8-pytest-style + "PT", +] + +[lint.pycodestyle] +ignore-overlong-task-comments = true + +[lint.pydocstyle] +convention = "google" diff --git a/run-tests.sh b/run-tests.sh index 7960aa6..26ffc30 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -22,5 +22,4 @@ set -e -flake8 inspire_json_merger tests pytest tests/ diff --git a/setup.py b/setup.py index 1e51bc0..ddcfc9f 100644 --- a/setup.py +++ b/setup.py @@ -26,10 +26,10 @@ from setuptools import find_packages, setup - URL = 'https://github.com/inspirehep/inspire-json-merger' -readme = open('README.rst').read() +with open("README.rst") as f: + readme = f.read() setup_requires = [ 'autosemver~=0.0,>=0.5.2', @@ -55,9 +55,14 @@ 'pytest~=8.0,>=8.0.2;python_version >= "3.6"', ] +dev_require = [ + "pre-commit==3.5.0", +] + extras_require = { 'docs': docs_require, 'tests': tests_require, + 'dev': dev_require, } extras_require['all'] = [] diff --git a/tests/conftest.py b/tests/conftest.py index a9c9d59..14733ec 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,7 +20,7 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -from __future__ import absolute_import, print_function, division +from __future__ import absolute_import, division, print_function import os import sys diff --git a/tests/unit/test_api.py b/tests/unit/test_api.py index 7108a6e..c130730 100644 --- a/tests/unit/test_api.py +++ b/tests/unit/test_api.py @@ -28,8 +28,7 @@ from operator import itemgetter import pytest - -from utils import validate_subschema, assert_ordered_conflicts +from utils import assert_ordered_conflicts, validate_subschema from inspire_json_merger.api import ( get_acquisition_source, @@ -38,150 +37,130 @@ merge, ) from inspire_json_merger.config import ( - ErratumOnPublisherOperations, ArxivOnArxivOperations, ArxivOnPublisherOperations, + ErratumOnPublisherOperations, + GrobidOnArxivAuthorsOperations, + ManualMergeOperations, PublisherOnArxivOperations, PublisherOnPublisherOperations, - ManualMergeOperations, - GrobidOnArxivAuthorsOperations ) -def get_file(file_path): +def load_test_data(file_path): path = os.path.dirname(os.path.abspath(__file__)) - path = os.path.join(path, file_path) - return open(path, 'r') - + full_path = os.path.join(path, file_path) -def load_test_data(file_path): - return json.load(get_file(file_path)) + with open(full_path, 'r') as file: + return json.load(file) def test_get_acquisition_source_non_arxiv(): - rec = { - 'acquisition_source': { - 'source': 'foo' - } - } + rec = {'acquisition_source': {'source': 'foo'}} assert get_acquisition_source(rec) == 'foo' validate_subschema(rec) -@pytest.fixture +@pytest.fixture() def rec_dois(): - return \ - { - 'dois': [ - { - 'material': 'publication', - 'source': 'elsevier', - 'value': '10.3847/2041-8213/aa9110' - } - ], - 'arxiv_eprints': [ - { - 'categories': [ - 'gr-qc', - 'astro-ph.HE' - ], - 'value': '1710.05832' - } - ] - } - - -@pytest.fixture + return { + 'dois': [ + { + 'material': 'publication', + 'source': 'elsevier', + 'value': '10.3847/2041-8213/aa9110', + } + ], + 'arxiv_eprints': [ + {'categories': ['gr-qc', 'astro-ph.HE'], 'value': '1710.05832'} + ], + } + + +@pytest.fixture() def rec_publication_info(): - return \ - { - 'publication_info': [ - { - 'artid': '161101', - 'journal_record': { - '$ref': 'http://labs.inspirehep.net/api/journals/1214495' - }, - 'journal_title': 'Phys.Rev.Lett.', - 'journal_volume': '119', - 'pubinfo_freetext': 'Phys. Rev. Lett. 119 161101 (2017)', - 'year': 2017 - } - ], - 'arxiv_eprints': [ - { - 'categories': [ - 'gr-qc', - 'astro-ph.HE' - ], - 'value': '1710.05832' - } - ] - } - - -@pytest.fixture + return { + 'publication_info': [ + { + 'artid': '161101', + 'journal_record': { + '$ref': 'http://labs.inspirehep.net/api/journals/1214495' + }, + 'journal_title': 'Phys.Rev.Lett.', + 'journal_volume': '119', + 'pubinfo_freetext': 'Phys. Rev. Lett. 119 161101 (2017)', + 'year': 2017, + } + ], + 'arxiv_eprints': [ + {'categories': ['gr-qc', 'astro-ph.HE'], 'value': '1710.05832'} + ], + } + + +@pytest.fixture() def arxiv_record(): return { '_collections': ['literature'], 'document_type': ['article'], 'titles': {'title': 'Superconductivity'}, 'arxiv_eprints': [{'value': '1710.05832'}], - 'acquisition_source': {'source': 'arXiv'} + 'acquisition_source': {'source': 'arXiv'}, } -@pytest.fixture +@pytest.fixture() def publisher_record(): return { '_collections': ['literature'], 'document_type': ['article'], 'titles': {'title': 'Superconductivity'}, 'dois': [{'value': '10.1023/A:1026654312961'}], - 'acquisition_source': {'source': 'ejl'} + 'acquisition_source': {'source': 'ejl'}, } -@pytest.fixture +@pytest.fixture() def erratum_1(): return { '_collections': ['literature'], 'document_type': ['article'], 'titles': [{'title': 'Erratum: that was a wrong title'}], 'dois': [{'value': '10.1023/A:1026654312961'}], - 'acquisition_source': {'source': 'ejl'} + 'acquisition_source': {'source': 'ejl'}, } -@pytest.fixture +@pytest.fixture() def erratum_2(): return { '_collections': ['literature'], 'document_type': ['article'], 'titles': [{'title': 'Correction to: an article'}], 'dois': [{'value': '10.1023/A:1026654312961'}], - 'acquisition_source': {'source': 'ejl'} + 'acquisition_source': {'source': 'ejl'}, } -@pytest.fixture +@pytest.fixture() def erratum_3(): return { '_collections': ['literature'], 'document_type': ['article'], 'titles': [{'title': 'A title'}], 'dois': [{'value': '10.1023/A:1026654312961', 'material': 'erratum'}], - 'acquisition_source': {'source': 'ejl'} + 'acquisition_source': {'source': 'ejl'}, } -@pytest.fixture +@pytest.fixture() def erratum_4(): return { '_collections': ['literature'], 'document_type': ['article'], 'titles': [{'title': 'Publisher correction A title'}], 'dois': [{'value': '10.1023/A:1026654312961'}], - 'acquisition_source': {'source': 'ejl'} + 'acquisition_source': {'source': 'ejl'}, } @@ -256,7 +235,9 @@ def test_get_head_source_no_arxiv_dois_and_no_freetext(rec_dois, rec_publication assert get_head_source(rec_dois) == 'publisher' -def test_get_head_source_arxiv_dois_and_freetext_but_no_arxiv_eprint(rec_dois, rec_publication_info): +def test_get_head_source_arxiv_dois_and_freetext_but_no_arxiv_eprint( + rec_dois, rec_publication_info +): rec = rec_dois rec.get('dois')[0]['source'] = 'arXiv' rec['publication_info'] = rec_publication_info['publication_info'] @@ -265,15 +246,32 @@ def test_get_head_source_arxiv_dois_and_freetext_but_no_arxiv_eprint(rec_dois, r assert get_head_source(rec_dois) == 'publisher' -def test_get_configuration(arxiv_record, publisher_record, erratum_1, erratum_2, erratum_3, erratum_4): +def test_get_configuration( + arxiv_record, publisher_record, erratum_1, erratum_2, erratum_3, erratum_4 +): assert get_configuration(arxiv_record, arxiv_record) == ArxivOnArxivOperations - assert get_configuration(arxiv_record, publisher_record) == PublisherOnArxivOperations - assert get_configuration(publisher_record, arxiv_record) == ArxivOnPublisherOperations - assert get_configuration(publisher_record, publisher_record) == PublisherOnPublisherOperations - assert get_configuration(publisher_record, erratum_1) == ErratumOnPublisherOperations - assert get_configuration(publisher_record, erratum_2) == ErratumOnPublisherOperations - assert get_configuration(publisher_record, erratum_3) == ErratumOnPublisherOperations - assert get_configuration(publisher_record, erratum_4) == ErratumOnPublisherOperations + assert ( + get_configuration(arxiv_record, publisher_record) == PublisherOnArxivOperations + ) + assert ( + get_configuration(publisher_record, arxiv_record) == ArxivOnPublisherOperations + ) + assert ( + get_configuration(publisher_record, publisher_record) + == PublisherOnPublisherOperations + ) + assert ( + get_configuration(publisher_record, erratum_1) == ErratumOnPublisherOperations + ) + assert ( + get_configuration(publisher_record, erratum_2) == ErratumOnPublisherOperations + ) + assert ( + get_configuration(publisher_record, erratum_3) == ErratumOnPublisherOperations + ) + assert ( + get_configuration(publisher_record, erratum_4) == ErratumOnPublisherOperations + ) arxiv1 = arxiv_record arxiv1['control_number'] = 1 @@ -319,14 +317,8 @@ def test_get_configuration_without_acquisition_source(arxiv_record, publisher_re def test_merger_handles_list_deletions(): root = { 'book_series': [ - { - 'title': 'IEEE Nucl.Sci.Symp.Conf.Rec.', - 'volume': '1' - }, - { - 'title': 'CMS Web-Based Monitoring', - 'volume': '2' - }, + {'title': 'IEEE Nucl.Sci.Symp.Conf.Rec.', 'volume': '1'}, + {'title': 'CMS Web-Based Monitoring', 'volume': '2'}, { 'title': 'Lectures in Testing', 'volume': '3', @@ -345,45 +337,57 @@ def test_merger_handles_list_deletions(): expected_merged = head expected_conflict = [ - {'path': '/book_series/0/volume', 'op': 'replace', 'value': '3', '$type': 'SET_FIELD'}, - {'path': '/book_series/0/title', 'op': 'replace', 'value': 'Lectures in Testing', '$type': 'SET_FIELD'}, - {'path': '/book_series/2', 'op': 'remove', 'value': None, '$type': 'REMOVE_FIELD'}, - {'path': '/book_series/1', 'op': 'remove', 'value': None, '$type': 'REMOVE_FIELD'} + { + 'path': '/book_series/0/volume', + 'op': 'replace', + 'value': '3', + '$type': 'SET_FIELD', + }, + { + 'path': '/book_series/0/title', + 'op': 'replace', + 'value': 'Lectures in Testing', + '$type': 'SET_FIELD', + }, + { + 'path': '/book_series/2', + 'op': 'remove', + 'value': None, + '$type': 'REMOVE_FIELD', + }, + { + 'path': '/book_series/1', + 'op': 'remove', + 'value': None, + '$type': 'REMOVE_FIELD', + }, ] merged, conflict = merge(root, head, update, head_source='arxiv') assert merged == expected_merged - assert sorted(conflict, key=operator.itemgetter("path")) == sorted(expected_conflict, key=operator.itemgetter("path")) + assert sorted(conflict, key=operator.itemgetter("path")) == sorted( + expected_conflict, key=operator.itemgetter("path") + ) def test_merger_handles_authors_with_correct_ordering(): root = {} head = { "authors": [ - { - 'full_name': 'Janeway, Kathryn', - 'age': 44 - }, - { - 'full_name': 'Picard, Jean-Luc', - 'age': 55 - }, + {'full_name': 'Janeway, Kathryn', 'age': 44}, + {'full_name': 'Picard, Jean-Luc', 'age': 55}, { "full_name": "Archer, Jonathan", - } + }, ], } update = { "authors": [ - { - "full_name": "Kirk, James" - }, - { - 'full_name': 'Janeway Kathryn, Picard Jean-Luc', 'age': 66 - }, + {"full_name": "Kirk, James"}, + {'full_name': 'Janeway Kathryn, Picard Jean-Luc', 'age': 66}, { "full_name": "Archer, Jonathan", - } + }, ], } @@ -392,29 +396,36 @@ def test_merger_handles_authors_with_correct_ordering(): 'path': '/authors/1', 'op': 'replace', 'value': {'full_name': 'Janeway Kathryn, Picard Jean-Luc', 'age': 66}, - '$type': 'SET_FIELD' + '$type': 'SET_FIELD', }, { 'path': '/authors/2', 'op': 'replace', 'value': {'full_name': 'Janeway Kathryn, Picard Jean-Luc', 'age': 66}, - '$type': 'SET_FIELD' + '$type': 'SET_FIELD', }, ] - expected_merged = {'authors': [ - {"full_name": "Kirk, James"}, - {'age': 44, 'full_name': 'Janeway, Kathryn'}, - {'age': 55, 'full_name': 'Picard, Jean-Luc'}, - {"full_name": "Archer, Jonathan"} - ]} + expected_merged = { + 'authors': [ + {"full_name": "Kirk, James"}, + {'age': 44, 'full_name': 'Janeway, Kathryn'}, + {'age': 55, 'full_name': 'Picard, Jean-Luc'}, + {"full_name": "Archer, Jonathan"}, + ] + } merged, conflict = merge(root, head, update, head_source='arxiv') assert merged == expected_merged - assert conflict.sort(key=itemgetter('path')) == expected_conflict.sort(key=itemgetter('path')) + assert conflict.sort(key=itemgetter('path')) == expected_conflict.sort( + key=itemgetter('path') + ) @pytest.mark.xfail( - reason="On python3 it fails as it's getting UUIDs of duplicated authors in different order than in python 2." + reason=( + "On python3 it fails as it's getting UUIDs of duplicated authors in different" + " order than in python 2." + ) ) def test_ordering_conflicts(): # This test is actually for broken input. @@ -428,7 +439,9 @@ def test_ordering_conflicts(): expected_merged = load_test_data("test_data/merged.json") merged, conflicts = merge(root, head, update) - assert sorted(merged['authors'], key=itemgetter('uuid')) == sorted(expected_merged['authors'], key=itemgetter('uuid')) + assert sorted(merged['authors'], key=itemgetter('uuid')) == sorted( + expected_merged['authors'], key=itemgetter('uuid') + ) assert_ordered_conflicts(conflicts, expected_conflicts) @@ -438,12 +451,8 @@ def test_grobid_on_arxiv_operations_without_conflict(): "authors": [ { "full_name": "Sułkowski, Piotr", - "raw_affiliations": [{ - "value": "Warsaw U." - }], - "emails": [ - "sulkowski.p@fuw.edu.pl" - ], + "raw_affiliations": [{"value": "Warsaw U."}], + "emails": ["sulkowski.p@fuw.edu.pl"], } ] } @@ -452,12 +461,14 @@ def test_grobid_on_arxiv_operations_without_conflict(): "authors": [ { "full_name": "Sułkowski, Piotr", - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "sulkowski.piotr@fuw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], + "emails": ["sulkowski.piotr@fuw.edu.pl"], } ] } @@ -465,18 +476,25 @@ def test_grobid_on_arxiv_operations_without_conflict(): expected_merged = { "authors": [ { - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "sulkowski.p@fuw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], - "full_name": "Sułkowski, Piotr" + "emails": ["sulkowski.p@fuw.edu.pl"], + "full_name": "Sułkowski, Piotr", } ] } - merged, conflicts = merge(root, authors_arxiv, authors_grobid, configuration=GrobidOnArxivAuthorsOperations) + merged, conflicts = merge( + root, + authors_arxiv, + authors_grobid, + configuration=GrobidOnArxivAuthorsOperations, + ) assert not conflicts assert merged == expected_merged @@ -487,68 +505,75 @@ def test_grobid_on_arxiv_operations_doesnt_conflict_on_author_full_name(): "authors": [ { "full_name": "Kowal, Michal", - "raw_affiliations": [{ - "value": "Warsaw U." - }], - "emails": [ - "kowal.m@fuw.edu.pl" - ], + "raw_affiliations": [{"value": "Warsaw U."}], + "emails": ["kowal.m@fuw.edu.pl"], }, { "full_name": "Sułkowski, Piotr", - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics" - }], - } + "raw_affiliations": [{"value": "Warsaw U., Faculty of Physics"}], + }, ] } authors_grobid = { "authors": [ { "full_name": "Kowal, Michal", - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "kowal.m@uw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], + "emails": ["kowal.m@uw.edu.pl"], }, { "full_name": "Sułkowski, Piotr Andrzej", - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "sulkowski.p@fuw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], - } + "emails": ["sulkowski.p@fuw.edu.pl"], + }, ] } expected_merged = { "authors": [ { - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "kowal.m@fuw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], - "full_name": "Kowal, Michal" + "emails": ["kowal.m@fuw.edu.pl"], + "full_name": "Kowal, Michal", }, { - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "sulkowski.p@fuw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], - "full_name": "Sułkowski, Piotr" - } + "emails": ["sulkowski.p@fuw.edu.pl"], + "full_name": "Sułkowski, Piotr", + }, ] } - merged, conflicts = merge(root, authors_arxiv, authors_grobid, configuration=GrobidOnArxivAuthorsOperations) + merged, conflicts = merge( + root, + authors_arxiv, + authors_grobid, + configuration=GrobidOnArxivAuthorsOperations, + ) assert not conflicts assert merged == expected_merged @@ -559,12 +584,8 @@ def test_grobid_on_arxiv_operations_keeps_authors_from_head(): "authors": [ { "full_name": "Kowal, Michal", - "raw_affiliations": [{ - "value": "Warsaw U." - }], - "emails": [ - "kowal.m@fuw.edu.pl" - ], + "raw_affiliations": [{"value": "Warsaw U."}], + "emails": ["kowal.m@fuw.edu.pl"], } ] } @@ -572,39 +593,50 @@ def test_grobid_on_arxiv_operations_keeps_authors_from_head(): "authors": [ { "full_name": "Kowal, Michal", - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "kowal.m@uw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], + "emails": ["kowal.m@uw.edu.pl"], }, { "full_name": "Sułkowski, Piotr Andrzej", - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "sulkowski.p@fuw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], - } + "emails": ["sulkowski.p@fuw.edu.pl"], + }, ] } expected_merged = { "authors": [ { - "raw_affiliations": [{ - "value": "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" - }], - "emails": [ - "kowal.m@fuw.edu.pl" + "raw_affiliations": [ + { + "value": ( + "Warsaw U., Faculty of Physics, Pastuera 7, Warsaw, Poland" + ) + } ], - "full_name": "Kowal, Michal" + "emails": ["kowal.m@fuw.edu.pl"], + "full_name": "Kowal, Michal", } ] } - merged, conflicts = merge(root, authors_arxiv, authors_grobid, configuration=GrobidOnArxivAuthorsOperations) + merged, conflicts = merge( + root, + authors_arxiv, + authors_grobid, + configuration=GrobidOnArxivAuthorsOperations, + ) assert not conflicts assert merged == expected_merged diff --git a/tests/unit/test_comparators.py b/tests/unit/test_comparators.py index 0d77639..4d36142 100644 --- a/tests/unit/test_comparators.py +++ b/tests/unit/test_comparators.py @@ -23,27 +23,25 @@ from __future__ import absolute_import, division, print_function from inspire_schemas.api import load_schema, validate - from json_merger.config import UnifierOps +from utils import assert_ordered_conflicts -from inspire_json_merger.comparators import IDNormalizer from inspire_json_merger.api import merge +from inspire_json_merger.comparators import IDNormalizer from inspire_json_merger.config import ArxivOnArxivOperations -from utils import assert_ordered_conflicts - -ArxivOnArxivOperations.list_merge_ops['references'] = UnifierOps.KEEP_UPDATE_AND_HEAD_ENTITIES_HEAD_FIRST -ArxivOnArxivOperations.list_merge_ops['publication_info'] = UnifierOps.KEEP_UPDATE_AND_HEAD_ENTITIES_HEAD_FIRST +ArxivOnArxivOperations.list_merge_ops[ + 'references' +] = UnifierOps.KEEP_UPDATE_AND_HEAD_ENTITIES_HEAD_FIRST +ArxivOnArxivOperations.list_merge_ops[ + 'publication_info' +] = UnifierOps.KEEP_UPDATE_AND_HEAD_ENTITIES_HEAD_FIRST def add_arxiv_source(*json_obj): # This function add a source object to the given json file list for obj in json_obj: - source = { - 'acquisition_source': { - 'source': 'arxiv' - } - } + source = {'acquisition_source': {'source': 'arxiv'}} obj.update(source) return json_obj if len(json_obj) > 1 else json_obj[0] @@ -92,7 +90,9 @@ def test_comparing_authors_unicode_name(): expected_conflict = [] expected_merged = head - root, head, update, expected_merged = add_arxiv_source(root, head, update, expected_merged) + root, head, update, expected_merged = add_arxiv_source( + root, head, update, expected_merged + ) merged, conflict = merge(root, head, update, head_source='arxiv') merged = add_arxiv_source(merged) @@ -124,7 +124,9 @@ def test_comparing_publication_info(): expected_conflict = [] expected_merged = update - root, head, update, expected_merged = add_arxiv_source(root, head, update, expected_merged) + root, head, update, expected_merged = add_arxiv_source( + root, head, update, expected_merged + ) merged, conflict = merge(root, head, update, head_source='arxiv') merged = add_arxiv_source(merged) @@ -141,7 +143,7 @@ def test_comparing_publication_info_with_cnum(): "artid": "WEPAB127", "cnum": "C21-05-24.3", "conf_acronym": "IPAC2021", - "year": 2021 + "year": 2021, } ] } @@ -154,7 +156,7 @@ def test_comparing_publication_info_with_cnum(): "conference_record": { "$ref": "https://inspirehep.net/api/conferences/1853162" }, - "year": 2021 + "year": 2021, } ] } @@ -162,7 +164,9 @@ def test_comparing_publication_info_with_cnum(): expected_conflict = [] expected_merged = update - root, head, update, expected_merged = add_arxiv_source(root, head, update, expected_merged) + root, head, update, expected_merged = add_arxiv_source( + root, head, update, expected_merged + ) merged, conflict = merge(root, head, update, head_source='arxiv') merged = add_arxiv_source(merged) @@ -182,7 +186,7 @@ def test_comparing_keywords(): { 'value': 'test', 'schema': 'JACOW', - } + }, ] } update = { @@ -194,7 +198,7 @@ def test_comparing_keywords(): { 'value': 'shielding', 'schema': 'JACOW', - } + }, ] } diff --git a/tests/unit/test_data/head.json b/tests/unit/test_data/head.json index af78b68..f3b2ffa 100644 --- a/tests/unit/test_data/head.json +++ b/tests/unit/test_data/head.json @@ -1 +1 @@ -{"$schema": "https://inspirehep.net/schemas/records/hep.json", "_collections": ["Literature"], "abstracts": [{"source": "arXiv", "value": "The X-ray polarization of the reflection nebulae in the Galactic Center inform us about the direction of the illuminating source (through the polarization angle) and the cloud position along the line of sight (through the polarization degree). However, the detected polarization degree is expected to be lowered because of the mixing of the emission of the clouds with the unpolarized diffuse emission in the GC region. In addition, in a real observation, also the morphological smearing of the source due to the PSF and the unpolarized instrumental background contribute in diluting the polarization degree. So far, these effects have never been included in the estimation of the dilution. Here, we evaluate the detectability of the X-ray polarization predicted for the MC2, Bridge-B2, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2 and Sgr C3 molecular clouds with modern X-ray imaging polarimeters like the Imaging X-ray Polarimetry Explorer (IXPE) and the Enhanced X-ray Timing and Polarimetry mission (eXTP). We perform realistic simulations of X-ray polarimetric observations considering (with the aid of Chandra maps and spectra) the spatial, spectral and polarization properties of all the diffuse emission and background components in each region of interest. We find that in the 4.0$-$8.0 keV band, where the emission of the molecular clouds outshines the other components, the dilution of the polarization degree, including the contribution due to the morphological smearing of the source, ranges between $\\sim$19\\% and $\\sim$55\\%. We conclude that, for some values of distances reported in the literature, the diluted polarization degree of G0.11-0.11, Sgr B2, Bridge-B2, Bridge-E, Sgr C1 and Sgr C3, may be detectable in a 2 Ms long IXPE observations. The enhanced capabilities of eXTP may allow to detect the 4.0$-$8.0 keV of all the targets considered here."}], "acquisition_source": {"datetime": "2020-08-19T02:34:07.466667", "method": "hepcrawl", "source": "arXiv", "submission_number": "2451783"}, "arxiv_eprints": [{"categories": ["astro-ph.HE"], "value": "2008.07830"}], "authors": [{"full_name": "Di Gesu, L.", "ids": [{"schema": "INSPIRE BAI", "value": "L.Di.gesu.1"}], "signature_block": "GASl", "uuid": "dd1f671a-43a3-4870-bf77-28802f4c8f2b"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "b8beba24-0813-4856-9fc6-ba7cd32d83a7"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "70fcca2d-b11b-4c12-a867-01f9e21bcafb"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "3ad41f1b-9a97-49ee-b0c1-6b43d513a359"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "a2e1c16a-0b5a-4eaf-b6bb-2c6e62539a0a"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "9a4fde71-cced-4ad4-a58b-52f2d58d40d9"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "421bad05-b019-4c0c-8b99-841567e4a173"}, {"full_name": "Di Gesu, F. Marin", "ids": [{"schema": "INSPIRE BAI", "value": "F.M.Di.Gesu.1"}], "signature_block": "GASf", "uuid": "e415bf20-3dc2-461d-9e73-973584d80f52"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "e7458737-e1e2-4d12-b4c1-fa649c628f54"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "349db320-280e-4a38-9f26-8d9ea3d4f149"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "b274f7d6-8aff-4c4b-9d24-8518f072f4af"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "13549754-2aec-43c3-9bd0-92738e5011a9"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "7e879a49-a361-4583-9b71-2194649fde16"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "994008f1-1f79-4e25-9a07-3774098aee96"}, {"full_name": "Marin, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Marin.1"}], "signature_block": "MARANf", "uuid": "c8f63f03-5b1d-4bc3-80e8-57649ad47429"}], "citeable": true, "control_number": 1812138, "curated": false, "document_type": ["article"], "documents": [{"hidden": true, "key": "2008.07830.pdf", "source": "arxiv", "url": "http://inspire-afs-web2.cern.ch/var/data/files/g214/4283955/content.pdf%3B2"}], "figures": [{"caption": "Scattering geometry for a molecular cloud located in front or behind the Sgr A* plane. The two positions depicted result in the same effective scattering and polarization degree. In this scheme, $d_{\\rm proj}$ is the cloud-Sgr A* distance projected in the plane of the sky, $d_{\\rm los}$ is the line of sight displacement of the cloud with respect to the Sgr A* plane, c is the speed of light $t_{\\rm light}$ is light travel time between Sgr A* and the cloud, $\\theta$ and $\\pi-\\theta$ are the two possible scattering angles.", "filename": "geo.png", "key": "0025d41cb9a3c96d01b37a0e8cf96559", "source": "arxiv", "url": "https://inspirehep.net/files/0025d41cb9a3c96d01b37a0e8cf96559"}, {"caption": "From the left to the right: background and continuum subtracted Chandra maps of the cloud, the hard-plasma, and the soft-plasma component in the Sgr A region. Images are smoothed using a 3 pixel Gaussian kernel. The color bar displayed on the bottom has adimensional units because the images are normalized to the maximum value. The regions comprising the targets selected for IXPE simulations (i.e. MC2, Bridge-B2, Bridge-E, and G0.11-0.11) are shown. In the first panel, a circle having the size of the IXPE PSF is shown for comparison. The direction of Sgr A* is indicated with an arrow.", "filename": "allmaps.png", "key": "96eb5bd494e47dbe55739a374b063cb9", "source": "arxiv", "url": "https://inspirehep.net/files/96eb5bd494e47dbe55739a374b063cb9"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_mc2.png", "key": "a4a2d1122896604415e7f3a887e8ce5f", "source": "arxiv", "url": "https://inspirehep.net/files/a4a2d1122896604415e7f3a887e8ce5f"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_bridge_b2.png", "key": "b2f382a809b2558f8616a3c0770c7bce", "source": "arxiv", "url": "https://inspirehep.net/files/b2f382a809b2558f8616a3c0770c7bce"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_cbridge_e.png", "key": "8abb45156e696f6fe2b79b6b97bfb191", "source": "arxiv", "url": "https://inspirehep.net/files/8abb45156e696f6fe2b79b6b97bfb191"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_g011.png", "key": "cd61e9585bc3605b5d8088627432d248", "source": "arxiv", "url": "https://inspirehep.net/files/cd61e9585bc3605b5d8088627432d248"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_sgrb2.png", "key": "4a8840ea72fd5612ae96ea75c8925974", "source": "arxiv", "url": "https://inspirehep.net/files/4a8840ea72fd5612ae96ea75c8925974"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_c1.png", "key": "04152c80be804a31a73a361f783a4f7b", "source": "arxiv", "url": "https://inspirehep.net/files/04152c80be804a31a73a361f783a4f7b"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_c2.png", "key": "7832a072c7943f9138264f992dd96b10", "source": "arxiv", "url": "https://inspirehep.net/files/7832a072c7943f9138264f992dd96b10"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_c3.png", "key": "097c03b16853f30b02faa7a1aa325426", "source": "arxiv", "url": "https://inspirehep.net/files/097c03b16853f30b02faa7a1aa325426"}, {"caption": "Histograms showing the distribution of the polarization degree in the 4.0-8.0 keV band obtained simulating the cloud G0.11-0.11 for different instrumental resolution. Orange histogram: infinite spatial resolution case. Blue histogram: IXPE resolution case.", "filename": "histonew.png", "key": "4bb4fac1f1caa200d8ff491cf32c04f9", "source": "arxiv", "url": "https://inspirehep.net/files/4bb4fac1f1caa200d8ff491cf32c04f9"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "filename": "g011_map_arrow.png", "key": "87cb3c7bca1a822c5701e3c32e556a61", "source": "arxiv", "url": "https://inspirehep.net/files/87cb3c7bca1a822c5701e3c32e556a61"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "filename": "b2_arrows_pos.png", "key": "d3022a6c47dc14ce7a50bb7cabf749a3", "source": "arxiv", "url": "https://inspirehep.net/files/d3022a6c47dc14ce7a50bb7cabf749a3"}], "inspire_categories": [{"source": "arxiv", "term": "Astrophysics"}], "legacy_creation_date": "2020-08-19", "legacy_version": "20200820034323.0", "license": [{"license": "arXiv nonexclusive-distrib 1.0", "material": "preprint", "url": "http://arxiv.org/licenses/nonexclusive-distrib/1.0/"}], "preprint_date": "2020-08-18", "public_notes": [{"source": "arXiv", "value": "accepted for publication in Astronomy&Astrophysics"}], "references": [{"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Baganoff, F. K., Bautz, M. W., Brandt, W. N., et al. 2001, Nature, 413, 45"}], "record": {"$ref": "https://inspirehep.net/api/literature/576909"}, "reference": {"authors": [{"full_name": "Baganoff, F.K."}, {"full_name": "Bautz, M.W."}, {"full_name": "Brandt, W.N."}], "publication_info": {"artid": "45", "journal_title": "Nature", "journal_volume": "413", "page_start": "45", "year": 2001}}}, {"raw_refs": [{"schema": "text", "value": "Bunner, A. N. 1978, ApJ, 220, 261"}], "reference": {"authors": [{"full_name": "Bunner, A.N."}], "publication_info": {"artid": "261", "journal_title": "Astrophys.J.", "journal_volume": "220", "page_start": "261", "year": 1978}}}, {"raw_refs": [{"schema": "text", "value": "Capelli, R., Warwick, R. S., Porquet, D., Gillessen, S., & Predehl, P."}], "reference": {"authors": [{"full_name": "Capelli, R."}, {"full_name": "Warwick, R.S."}, {"full_name": "Porquet, D."}, {"full_name": "Gillessen, S."}, {"full_name": "Predehl, P."}]}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "2012, A&A, 545, A35"}], "record": {"$ref": "https://inspirehep.net/api/literature/1121491"}, "reference": {"publication_info": {"artid": "A35", "journal_title": "Astron.Astrophys.", "journal_volume": "545", "page_start": "A35", "year": 2012}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Chuard, D., Terrier, R., Goldwurm, A., et al. 2018, A&A, 610, A34"}], "record": {"$ref": "https://inspirehep.net/api/literature/1641736"}, "reference": {"authors": [{"full_name": "Chuard, D."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A34", "journal_title": "Astron.Astrophys.", "journal_volume": "610", "page_start": "A34", "year": 2018}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Churazov, E., Khabibullin, I., Ponti, G., & Sunyaev, R. 2017, MNRAS, 468, 165"}], "record": {"$ref": "https://inspirehep.net/api/literature/1501218"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Khabibullin, I."}, {"full_name": "Ponti, G."}, {"full_name": "Sunyaev, R."}], "publication_info": {"artid": "165", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "468", "page_start": "165", "year": 2017}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Churazov, E., Sunyaev, R., & Sazonov, S. 2002, MNRAS, 330, 817"}], "record": {"$ref": "https://inspirehep.net/api/literature/577763"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Sunyaev, R."}, {"full_name": "Sazonov, S."}], "publication_info": {"artid": "817", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "330", "page_start": "817", "year": 2002}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Clavel, M., Terrier, R., Goldwurm, A., et al. 2013, A&A, 558, A32"}], "record": {"$ref": "https://inspirehep.net/api/literature/1242619"}, "reference": {"authors": [{"full_name": "Clavel, M."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A32", "journal_title": "Astron.Astrophys.", "journal_volume": "558", "page_start": "A32", "year": 2013}}}], "self": {"$ref": "https://inspirehep.net/api/literature/1812138"}, "texkeys": ["DiGesu:2020pxk"], "titles": [{"source": "arXiv", "title": "Prospects for IXPE and eXTP polarimetric archaeology of the reflection nebulae in the Galactic Center"}]} \ No newline at end of file +{"$schema": "https://inspirehep.net/schemas/records/hep.json", "_collections": ["Literature"], "abstracts": [{"source": "arXiv", "value": "The X-ray polarization of the reflection nebulae in the Galactic Center inform us about the direction of the illuminating source (through the polarization angle) and the cloud position along the line of sight (through the polarization degree). However, the detected polarization degree is expected to be lowered because of the mixing of the emission of the clouds with the unpolarized diffuse emission in the GC region. In addition, in a real observation, also the morphological smearing of the source due to the PSF and the unpolarized instrumental background contribute in diluting the polarization degree. So far, these effects have never been included in the estimation of the dilution. Here, we evaluate the detectability of the X-ray polarization predicted for the MC2, Bridge-B2, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2 and Sgr C3 molecular clouds with modern X-ray imaging polarimeters like the Imaging X-ray Polarimetry Explorer (IXPE) and the Enhanced X-ray Timing and Polarimetry mission (eXTP). We perform realistic simulations of X-ray polarimetric observations considering (with the aid of Chandra maps and spectra) the spatial, spectral and polarization properties of all the diffuse emission and background components in each region of interest. We find that in the 4.0$-$8.0 keV band, where the emission of the molecular clouds outshines the other components, the dilution of the polarization degree, including the contribution due to the morphological smearing of the source, ranges between $\\sim$19\\% and $\\sim$55\\%. We conclude that, for some values of distances reported in the literature, the diluted polarization degree of G0.11-0.11, Sgr B2, Bridge-B2, Bridge-E, Sgr C1 and Sgr C3, may be detectable in a 2 Ms long IXPE observations. The enhanced capabilities of eXTP may allow to detect the 4.0$-$8.0 keV of all the targets considered here."}], "acquisition_source": {"datetime": "2020-08-19T02:34:07.466667", "method": "hepcrawl", "source": "arXiv", "submission_number": "2451783"}, "arxiv_eprints": [{"categories": ["astro-ph.HE"], "value": "2008.07830"}], "authors": [{"full_name": "Di Gesu, L.", "ids": [{"schema": "INSPIRE BAI", "value": "L.Di.gesu.1"}], "signature_block": "GASl", "uuid": "dd1f671a-43a3-4870-bf77-28802f4c8f2b"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "b8beba24-0813-4856-9fc6-ba7cd32d83a7"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "70fcca2d-b11b-4c12-a867-01f9e21bcafb"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "3ad41f1b-9a97-49ee-b0c1-6b43d513a359"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "a2e1c16a-0b5a-4eaf-b6bb-2c6e62539a0a"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "9a4fde71-cced-4ad4-a58b-52f2d58d40d9"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "421bad05-b019-4c0c-8b99-841567e4a173"}, {"full_name": "Di Gesu, F. Marin", "ids": [{"schema": "INSPIRE BAI", "value": "F.M.Di.Gesu.1"}], "signature_block": "GASf", "uuid": "e415bf20-3dc2-461d-9e73-973584d80f52"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "e7458737-e1e2-4d12-b4c1-fa649c628f54"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "349db320-280e-4a38-9f26-8d9ea3d4f149"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "b274f7d6-8aff-4c4b-9d24-8518f072f4af"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "13549754-2aec-43c3-9bd0-92738e5011a9"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "7e879a49-a361-4583-9b71-2194649fde16"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "994008f1-1f79-4e25-9a07-3774098aee96"}, {"full_name": "Marin, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Marin.1"}], "signature_block": "MARANf", "uuid": "c8f63f03-5b1d-4bc3-80e8-57649ad47429"}], "citeable": true, "control_number": 1812138, "curated": false, "document_type": ["article"], "documents": [{"hidden": true, "key": "2008.07830.pdf", "source": "arxiv", "url": "http://inspire-afs-web2.cern.ch/var/data/files/g214/4283955/content.pdf%3B2"}], "figures": [{"caption": "Scattering geometry for a molecular cloud located in front or behind the Sgr A* plane. The two positions depicted result in the same effective scattering and polarization degree. In this scheme, $d_{\\rm proj}$ is the cloud-Sgr A* distance projected in the plane of the sky, $d_{\\rm los}$ is the line of sight displacement of the cloud with respect to the Sgr A* plane, c is the speed of light $t_{\\rm light}$ is light travel time between Sgr A* and the cloud, $\\theta$ and $\\pi-\\theta$ are the two possible scattering angles.", "filename": "geo.png", "key": "0025d41cb9a3c96d01b37a0e8cf96559", "source": "arxiv", "url": "https://inspirehep.net/files/0025d41cb9a3c96d01b37a0e8cf96559"}, {"caption": "From the left to the right: background and continuum subtracted Chandra maps of the cloud, the hard-plasma, and the soft-plasma component in the Sgr A region. Images are smoothed using a 3 pixel Gaussian kernel. The color bar displayed on the bottom has adimensional units because the images are normalized to the maximum value. The regions comprising the targets selected for IXPE simulations (i.e. MC2, Bridge-B2, Bridge-E, and G0.11-0.11) are shown. In the first panel, a circle having the size of the IXPE PSF is shown for comparison. The direction of Sgr A* is indicated with an arrow.", "filename": "allmaps.png", "key": "96eb5bd494e47dbe55739a374b063cb9", "source": "arxiv", "url": "https://inspirehep.net/files/96eb5bd494e47dbe55739a374b063cb9"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_mc2.png", "key": "a4a2d1122896604415e7f3a887e8ce5f", "source": "arxiv", "url": "https://inspirehep.net/files/a4a2d1122896604415e7f3a887e8ce5f"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_bridge_b2.png", "key": "b2f382a809b2558f8616a3c0770c7bce", "source": "arxiv", "url": "https://inspirehep.net/files/b2f382a809b2558f8616a3c0770c7bce"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_cbridge_e.png", "key": "8abb45156e696f6fe2b79b6b97bfb191", "source": "arxiv", "url": "https://inspirehep.net/files/8abb45156e696f6fe2b79b6b97bfb191"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_g011.png", "key": "cd61e9585bc3605b5d8088627432d248", "source": "arxiv", "url": "https://inspirehep.net/files/cd61e9585bc3605b5d8088627432d248"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_sgrb2.png", "key": "4a8840ea72fd5612ae96ea75c8925974", "source": "arxiv", "url": "https://inspirehep.net/files/4a8840ea72fd5612ae96ea75c8925974"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_c1.png", "key": "04152c80be804a31a73a361f783a4f7b", "source": "arxiv", "url": "https://inspirehep.net/files/04152c80be804a31a73a361f783a4f7b"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_c2.png", "key": "7832a072c7943f9138264f992dd96b10", "source": "arxiv", "url": "https://inspirehep.net/files/7832a072c7943f9138264f992dd96b10"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "filename": "spec_c3.png", "key": "097c03b16853f30b02faa7a1aa325426", "source": "arxiv", "url": "https://inspirehep.net/files/097c03b16853f30b02faa7a1aa325426"}, {"caption": "Histograms showing the distribution of the polarization degree in the 4.0-8.0 keV band obtained simulating the cloud G0.11-0.11 for different instrumental resolution. Orange histogram: infinite spatial resolution case. Blue histogram: IXPE resolution case.", "filename": "histonew.png", "key": "4bb4fac1f1caa200d8ff491cf32c04f9", "source": "arxiv", "url": "https://inspirehep.net/files/4bb4fac1f1caa200d8ff491cf32c04f9"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "filename": "g011_map_arrow.png", "key": "87cb3c7bca1a822c5701e3c32e556a61", "source": "arxiv", "url": "https://inspirehep.net/files/87cb3c7bca1a822c5701e3c32e556a61"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "filename": "b2_arrows_pos.png", "key": "d3022a6c47dc14ce7a50bb7cabf749a3", "source": "arxiv", "url": "https://inspirehep.net/files/d3022a6c47dc14ce7a50bb7cabf749a3"}], "inspire_categories": [{"source": "arxiv", "term": "Astrophysics"}], "legacy_creation_date": "2020-08-19", "legacy_version": "20200820034323.0", "license": [{"license": "arXiv nonexclusive-distrib 1.0", "material": "preprint", "url": "http://arxiv.org/licenses/nonexclusive-distrib/1.0/"}], "preprint_date": "2020-08-18", "public_notes": [{"source": "arXiv", "value": "accepted for publication in Astronomy&Astrophysics"}], "references": [{"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Baganoff, F. K., Bautz, M. W., Brandt, W. N., et al. 2001, Nature, 413, 45"}], "record": {"$ref": "https://inspirehep.net/api/literature/576909"}, "reference": {"authors": [{"full_name": "Baganoff, F.K."}, {"full_name": "Bautz, M.W."}, {"full_name": "Brandt, W.N."}], "publication_info": {"artid": "45", "journal_title": "Nature", "journal_volume": "413", "page_start": "45", "year": 2001}}}, {"raw_refs": [{"schema": "text", "value": "Bunner, A. N. 1978, ApJ, 220, 261"}], "reference": {"authors": [{"full_name": "Bunner, A.N."}], "publication_info": {"artid": "261", "journal_title": "Astrophys.J.", "journal_volume": "220", "page_start": "261", "year": 1978}}}, {"raw_refs": [{"schema": "text", "value": "Capelli, R., Warwick, R. S., Porquet, D., Gillessen, S., & Predehl, P."}], "reference": {"authors": [{"full_name": "Capelli, R."}, {"full_name": "Warwick, R.S."}, {"full_name": "Porquet, D."}, {"full_name": "Gillessen, S."}, {"full_name": "Predehl, P."}]}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "2012, A&A, 545, A35"}], "record": {"$ref": "https://inspirehep.net/api/literature/1121491"}, "reference": {"publication_info": {"artid": "A35", "journal_title": "Astron.Astrophys.", "journal_volume": "545", "page_start": "A35", "year": 2012}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Chuard, D., Terrier, R., Goldwurm, A., et al. 2018, A&A, 610, A34"}], "record": {"$ref": "https://inspirehep.net/api/literature/1641736"}, "reference": {"authors": [{"full_name": "Chuard, D."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A34", "journal_title": "Astron.Astrophys.", "journal_volume": "610", "page_start": "A34", "year": 2018}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Churazov, E., Khabibullin, I., Ponti, G., & Sunyaev, R. 2017, MNRAS, 468, 165"}], "record": {"$ref": "https://inspirehep.net/api/literature/1501218"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Khabibullin, I."}, {"full_name": "Ponti, G."}, {"full_name": "Sunyaev, R."}], "publication_info": {"artid": "165", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "468", "page_start": "165", "year": 2017}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Churazov, E., Sunyaev, R., & Sazonov, S. 2002, MNRAS, 330, 817"}], "record": {"$ref": "https://inspirehep.net/api/literature/577763"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Sunyaev, R."}, {"full_name": "Sazonov, S."}], "publication_info": {"artid": "817", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "330", "page_start": "817", "year": 2002}}}, {"curated_relation": false, "raw_refs": [{"schema": "text", "value": "Clavel, M., Terrier, R., Goldwurm, A., et al. 2013, A&A, 558, A32"}], "record": {"$ref": "https://inspirehep.net/api/literature/1242619"}, "reference": {"authors": [{"full_name": "Clavel, M."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A32", "journal_title": "Astron.Astrophys.", "journal_volume": "558", "page_start": "A32", "year": 2013}}}], "self": {"$ref": "https://inspirehep.net/api/literature/1812138"}, "texkeys": ["DiGesu:2020pxk"], "titles": [{"source": "arXiv", "title": "Prospects for IXPE and eXTP polarimetric archaeology of the reflection nebulae in the Galactic Center"}]} diff --git a/tests/unit/test_data/root.json b/tests/unit/test_data/root.json index 8f8d210..e7e62fe 100644 --- a/tests/unit/test_data/root.json +++ b/tests/unit/test_data/root.json @@ -1 +1 @@ -{"$schema": "https://inspirehep.net/schemas/records/hep.json", "_collections": ["Literature"], "_files": [{"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:fe5bd305e5607bee4a542270521e2661", "file_id": "38962b15-4cdd-46f1-8ff3-bc451fbca6f4", "key": "2008.07830.tar.gz", "size": 3950796, "version_id": "b7f7b2a6-2169-4e38-9eb6-f62d60926e9b"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:0025d41cb9a3c96d01b37a0e8cf96559", "file_id": "346e3b99-a2e0-4a78-9f9d-e89de237d813", "key": "geo.png", "size": 48154, "version_id": "2b51b80d-6886-4066-aec0-734547c44678"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:96eb5bd494e47dbe55739a374b063cb9", "file_id": "5af5766f-a497-47f0-99fd-65c932b3f374", "key": "allmaps.png", "size": 2422309, "version_id": "6b05783e-b965-4ced-bc41-9b49a4217d26"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:a4a2d1122896604415e7f3a887e8ce5f", "file_id": "07c4cbb0-45c5-4e07-bf97-95aea26a3553", "key": "spec_mc2.png", "size": 338643, "version_id": "6026c157-a5f5-4e3c-b781-e8e9f438dcd7"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:b2f382a809b2558f8616a3c0770c7bce", "file_id": "161475cf-59c5-48bb-80df-44c8cb44fb54", "key": "spec_bridge_b2.png", "size": 337496, "version_id": "2b7d69dc-1e97-4b19-bd8d-56a4c2c29eb8"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:8abb45156e696f6fe2b79b6b97bfb191", "file_id": "f338b660-4195-42f6-8018-6a6f26d80bb5", "key": "spec_cbridge_e.png", "size": 402344, "version_id": "802ad814-c2bd-4dd7-a4a7-67c5a22c0c0d"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:cd61e9585bc3605b5d8088627432d248", "file_id": "81e9903d-99ea-46a6-9d97-a7a81eb0f5c4", "key": "spec_g011.png", "size": 452314, "version_id": "4e09659a-b23e-420e-bd0e-fa166e92cf4c"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:4a8840ea72fd5612ae96ea75c8925974", "file_id": "aba40414-3775-4654-b5a9-27853aec9417", "key": "spec_sgrb2.png", "size": 513544, "version_id": "e9ef9a9d-12a5-46d5-a169-dd019453f759"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:04152c80be804a31a73a361f783a4f7b", "file_id": "9ec1b8ea-363d-4c30-a0ca-4604555996f4", "key": "spec_c1.png", "size": 413628, "version_id": "5c95173f-09e6-4cec-872b-4b2e608d6652"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:7832a072c7943f9138264f992dd96b10", "file_id": "972e82a2-cbcf-4432-9027-13d6e39647cc", "key": "spec_c2.png", "size": 403377, "version_id": "48b1ed8b-cc58-487b-9f86-b49a6a8b7508"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:097c03b16853f30b02faa7a1aa325426", "file_id": "a6d3e785-4e09-494e-bdf5-311e9c5eec08", "key": "spec_c3.png", "size": 456951, "version_id": "62eb25ca-1d0a-4d7c-b13a-ba2cd4fda3e6"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:4bb4fac1f1caa200d8ff491cf32c04f9", "file_id": "ca4e4a90-8347-46c0-b447-fb8c454f7733", "key": "histonew.png", "size": 21982, "version_id": "9b6dfff6-8b89-4308-84e4-f014c447f3e2"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:87cb3c7bca1a822c5701e3c32e556a61", "file_id": "1cb245a2-54ce-4f24-97b7-4bfefd75b597", "key": "g011_map_arrow.png", "size": 122665, "version_id": "5fbdb255-b50f-41ba-b24a-bc8d3ddb674d"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:d3022a6c47dc14ce7a50bb7cabf749a3", "file_id": "2d4f8dcb-1977-40c6-9bff-6e8f4d5f4f87", "key": "b2_arrows_pos.png", "size": 274657, "version_id": "925496cf-5be4-43f7-a85c-10e9f9fad4dc"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:8bb9b265e790fad2255cdf9f0e526065", "file_id": "15886c5d-e715-47d3-81c7-cfcde03f72d0", "key": "2008.07830.pdf", "size": 3870607, "version_id": "063078eb-b4d4-446e-935a-e1ab09324cb1"}], "abstracts": [{"source": "arXiv", "value": "The X-ray polarization of the reflection nebulae in the Galactic Center inform us about the direction of the illuminating source (through the polarization angle) and the cloud position along the line of sight (through the polarization degree). However, the detected polarization degree is expected to be lowered because of the mixing of the emission of the clouds with the unpolarized diffuse emission in the GC region. In addition, in a real observation, also the morphological smearing of the source due to the PSF and the unpolarized instrumental background contribute in diluting the polarization degree. So far, these effects have never been included in the estimation of the dilution. Here, we evaluate the detectability of the X-ray polarization predicted for the MC2, Bridge-B2, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2 and Sgr C3 molecular clouds with modern X-ray imaging polarimeters like the Imaging X-ray Polarimetry Explorer (IXPE) and the Enhanced X-ray Timing and Polarimetry mission (eXTP). We perform realistic simulations of X-ray polarimetric observations considering (with the aid of Chandra maps and spectra) the spatial, spectral and polarization properties of all the diffuse emission and background components in each region of interest. We find that in the 4.0$-$8.0 keV band, where the emission of the molecular clouds outshines the other components, the dilution of the polarization degree, including the contribution due to the morphological smearing of the source, ranges between $\\sim$19\\% and $\\sim$55\\%. We conclude that, for some values of distances reported in the literature, the diluted polarization degree of G0.11-0.11, Sgr B2, Bridge-B2, Bridge-E, Sgr C1 and Sgr C3, may be detectable in a 2 Ms long IXPE observations. The enhanced capabilities of eXTP may allow to detect the 4.0$-$8.0 keV of all the targets considered here."}], "acquisition_source": {"datetime": "2020-08-19T02:34:07.466667", "method": "hepcrawl", "source": "arXiv", "submission_number": "e1311d70e1c311ea87370a580a640aa1"}, "arxiv_eprints": [{"categories": ["astro-ph.HE"], "value": "2008.07830"}], "authors": [{"full_name": "Di Gesu, L."}, {"full_name": "Ferrazzoli, R."}, {"full_name": "Donnarumma, I."}, {"full_name": "Soffitta, P."}, {"full_name": "Costa, E."}, {"full_name": "Muleri, F."}, {"full_name": "Pesce-Rollins, M."}, {"full_name": "Di Gesu, F. Marin"}, {"full_name": "Ferrazzoli, R."}, {"full_name": "Donnarumma, I."}, {"full_name": "Soffitta, P."}, {"full_name": "Costa, E."}, {"full_name": "Muleri, F."}, {"full_name": "Pesce-Rollins, M."}, {"full_name": "Marin, F."}], "citeable": true, "curated": false, "document_type": ["article"], "documents": [{"fulltext": true, "hidden": true, "key": "2008.07830.pdf", "material": "preprint", "original_url": "http://export.arxiv.org/pdf/2008.07830", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/2008.07830.pdf"}], "figures": [{"caption": "Scattering geometry for a molecular cloud located in front or behind the Sgr A* plane. The two positions depicted result in the same effective scattering and polarization degree. In this scheme, $d_{\\rm proj}$ is the cloud-Sgr A* distance projected in the plane of the sky, $d_{\\rm los}$ is the line of sight displacement of the cloud with respect to the Sgr A* plane, c is the speed of light $t_{\\rm light}$ is light travel time between Sgr A* and the cloud, $\\theta$ and $\\pi-\\theta$ are the two possible scattering angles.", "key": "geo.png", "label": "geo.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/geo.png"}, {"caption": "From the left to the right: background and continuum subtracted Chandra maps of the cloud, the hard-plasma, and the soft-plasma component in the Sgr A region. Images are smoothed using a 3 pixel Gaussian kernel. The color bar displayed on the bottom has adimensional units because the images are normalized to the maximum value. The regions comprising the targets selected for IXPE simulations (i.e. MC2, Bridge-B2, Bridge-E, and G0.11-0.11) are shown. In the first panel, a circle having the size of the IXPE PSF is shown for comparison. The direction of Sgr A* is indicated with an arrow.", "key": "allmaps.png", "label": "sga_maps.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/allmaps.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_mc2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_mc2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_bridge_b2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_bridge_b2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_cbridge_e.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_cbridge_e.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_g011.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_g011.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_sgrb2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_sgrb2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c1.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_c1.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_c2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c3.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_c3.png"}, {"caption": "Histograms showing the distribution of the polarization degree in the 4.0-8.0 keV band obtained simulating the cloud G0.11-0.11 for different instrumental resolution. Orange histogram: infinite spatial resolution case. Blue histogram: IXPE resolution case.", "key": "histonew.png", "label": "dilution.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/histonew.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "g011_map_arrow.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/g011_map_arrow.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "b2_arrows_pos.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/b2_arrows_pos.png"}], "inspire_categories": [{"source": "arxiv", "term": "Astrophysics"}], "license": [{"license": "arXiv nonexclusive-distrib 1.0", "material": "preprint", "url": "http://arxiv.org/licenses/nonexclusive-distrib/1.0/"}], "preprint_date": "2020-08-18", "public_notes": [{"source": "arXiv", "value": "accepted for publication in Astronomy&Astrophysics"}], "references": [{"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Baganoff, F. K., Bautz, M. W., Brandt, W. N., et al. 2001, Nature, 413, 45"}], "record": {"$ref": "https://inspirehep.net/api/literature/576909"}, "reference": {"authors": [{"full_name": "Baganoff, F.K."}, {"full_name": "Bautz, M.W."}, {"full_name": "Brandt, W.N."}], "publication_info": {"artid": "45", "journal_title": "Nature", "journal_volume": "413", "page_start": "45", "year": 2001}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Bunner, A. N. 1978, ApJ, 220, 261"}], "reference": {"authors": [{"full_name": "Bunner, A.N."}], "publication_info": {"artid": "261", "journal_title": "Astrophys.J.", "journal_volume": "220", "page_start": "261", "year": 1978}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Capelli, R., Warwick, R. S., Porquet, D., Gillessen, S., & Predehl, P."}], "reference": {"authors": [{"full_name": "Capelli, R."}, {"full_name": "Warwick, R.S."}, {"full_name": "Porquet, D."}, {"full_name": "Gillessen, S."}, {"full_name": "Predehl, P."}]}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "2012, A&A, 545, A35"}], "record": {"$ref": "https://inspirehep.net/api/literature/1121491"}, "reference": {"publication_info": {"artid": "A35", "journal_title": "Astron.Astrophys.", "journal_volume": "545", "page_start": "A35", "year": 2012}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Chuard, D., Terrier, R., Goldwurm, A., et al. 2018, A&A, 610, A34"}], "record": {"$ref": "https://inspirehep.net/api/literature/1641736"}, "reference": {"authors": [{"full_name": "Chuard, D."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A34", "journal_title": "Astron.Astrophys.", "journal_volume": "610", "page_start": "A34", "year": 2018}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Khabibullin, I., Ponti, G., & Sunyaev, R. 2017, MNRAS, 468, 165"}], "record": {"$ref": "https://inspirehep.net/api/literature/1501218"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Khabibullin, I."}, {"full_name": "Ponti, G."}, {"full_name": "Sunyaev, R."}], "publication_info": {"artid": "165", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "468", "page_start": "165", "year": 2017}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Sunyaev, R., & Sazonov, S. 2002, MNRAS, 330, 817"}], "record": {"$ref": "https://inspirehep.net/api/literature/577763"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Sunyaev, R."}, {"full_name": "Sazonov, S."}], "publication_info": {"artid": "817", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "330", "page_start": "817", "year": 2002}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Clavel, M., Terrier, R., Goldwurm, A., et al. 2013, A&A, 558, A32"}], "record": {"$ref": "https://inspirehep.net/api/literature/1242619"}, "reference": {"authors": [{"full_name": "Clavel, M."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A32", "journal_title": "Astron.Astrophys.", "journal_volume": "558", "page_start": "A32", "year": 2013}}}], "titles": [{"source": "arXiv", "title": "Prospects for IXPE and eXTP polarimetric archaeology of the reflection nebulae in the Galactic Center"}]} \ No newline at end of file +{"$schema": "https://inspirehep.net/schemas/records/hep.json", "_collections": ["Literature"], "_files": [{"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:fe5bd305e5607bee4a542270521e2661", "file_id": "38962b15-4cdd-46f1-8ff3-bc451fbca6f4", "key": "2008.07830.tar.gz", "size": 3950796, "version_id": "b7f7b2a6-2169-4e38-9eb6-f62d60926e9b"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:0025d41cb9a3c96d01b37a0e8cf96559", "file_id": "346e3b99-a2e0-4a78-9f9d-e89de237d813", "key": "geo.png", "size": 48154, "version_id": "2b51b80d-6886-4066-aec0-734547c44678"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:96eb5bd494e47dbe55739a374b063cb9", "file_id": "5af5766f-a497-47f0-99fd-65c932b3f374", "key": "allmaps.png", "size": 2422309, "version_id": "6b05783e-b965-4ced-bc41-9b49a4217d26"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:a4a2d1122896604415e7f3a887e8ce5f", "file_id": "07c4cbb0-45c5-4e07-bf97-95aea26a3553", "key": "spec_mc2.png", "size": 338643, "version_id": "6026c157-a5f5-4e3c-b781-e8e9f438dcd7"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:b2f382a809b2558f8616a3c0770c7bce", "file_id": "161475cf-59c5-48bb-80df-44c8cb44fb54", "key": "spec_bridge_b2.png", "size": 337496, "version_id": "2b7d69dc-1e97-4b19-bd8d-56a4c2c29eb8"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:8abb45156e696f6fe2b79b6b97bfb191", "file_id": "f338b660-4195-42f6-8018-6a6f26d80bb5", "key": "spec_cbridge_e.png", "size": 402344, "version_id": "802ad814-c2bd-4dd7-a4a7-67c5a22c0c0d"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:cd61e9585bc3605b5d8088627432d248", "file_id": "81e9903d-99ea-46a6-9d97-a7a81eb0f5c4", "key": "spec_g011.png", "size": 452314, "version_id": "4e09659a-b23e-420e-bd0e-fa166e92cf4c"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:4a8840ea72fd5612ae96ea75c8925974", "file_id": "aba40414-3775-4654-b5a9-27853aec9417", "key": "spec_sgrb2.png", "size": 513544, "version_id": "e9ef9a9d-12a5-46d5-a169-dd019453f759"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:04152c80be804a31a73a361f783a4f7b", "file_id": "9ec1b8ea-363d-4c30-a0ca-4604555996f4", "key": "spec_c1.png", "size": 413628, "version_id": "5c95173f-09e6-4cec-872b-4b2e608d6652"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:7832a072c7943f9138264f992dd96b10", "file_id": "972e82a2-cbcf-4432-9027-13d6e39647cc", "key": "spec_c2.png", "size": 403377, "version_id": "48b1ed8b-cc58-487b-9f86-b49a6a8b7508"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:097c03b16853f30b02faa7a1aa325426", "file_id": "a6d3e785-4e09-494e-bdf5-311e9c5eec08", "key": "spec_c3.png", "size": 456951, "version_id": "62eb25ca-1d0a-4d7c-b13a-ba2cd4fda3e6"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:4bb4fac1f1caa200d8ff491cf32c04f9", "file_id": "ca4e4a90-8347-46c0-b447-fb8c454f7733", "key": "histonew.png", "size": 21982, "version_id": "9b6dfff6-8b89-4308-84e4-f014c447f3e2"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:87cb3c7bca1a822c5701e3c32e556a61", "file_id": "1cb245a2-54ce-4f24-97b7-4bfefd75b597", "key": "g011_map_arrow.png", "size": 122665, "version_id": "5fbdb255-b50f-41ba-b24a-bc8d3ddb674d"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:d3022a6c47dc14ce7a50bb7cabf749a3", "file_id": "2d4f8dcb-1977-40c6-9bff-6e8f4d5f4f87", "key": "b2_arrows_pos.png", "size": 274657, "version_id": "925496cf-5be4-43f7-a85c-10e9f9fad4dc"}, {"bucket": "0ae14b92-770a-40dd-b23d-023929b1e5f5", "checksum": "md5:8bb9b265e790fad2255cdf9f0e526065", "file_id": "15886c5d-e715-47d3-81c7-cfcde03f72d0", "key": "2008.07830.pdf", "size": 3870607, "version_id": "063078eb-b4d4-446e-935a-e1ab09324cb1"}], "abstracts": [{"source": "arXiv", "value": "The X-ray polarization of the reflection nebulae in the Galactic Center inform us about the direction of the illuminating source (through the polarization angle) and the cloud position along the line of sight (through the polarization degree). However, the detected polarization degree is expected to be lowered because of the mixing of the emission of the clouds with the unpolarized diffuse emission in the GC region. In addition, in a real observation, also the morphological smearing of the source due to the PSF and the unpolarized instrumental background contribute in diluting the polarization degree. So far, these effects have never been included in the estimation of the dilution. Here, we evaluate the detectability of the X-ray polarization predicted for the MC2, Bridge-B2, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2 and Sgr C3 molecular clouds with modern X-ray imaging polarimeters like the Imaging X-ray Polarimetry Explorer (IXPE) and the Enhanced X-ray Timing and Polarimetry mission (eXTP). We perform realistic simulations of X-ray polarimetric observations considering (with the aid of Chandra maps and spectra) the spatial, spectral and polarization properties of all the diffuse emission and background components in each region of interest. We find that in the 4.0$-$8.0 keV band, where the emission of the molecular clouds outshines the other components, the dilution of the polarization degree, including the contribution due to the morphological smearing of the source, ranges between $\\sim$19\\% and $\\sim$55\\%. We conclude that, for some values of distances reported in the literature, the diluted polarization degree of G0.11-0.11, Sgr B2, Bridge-B2, Bridge-E, Sgr C1 and Sgr C3, may be detectable in a 2 Ms long IXPE observations. The enhanced capabilities of eXTP may allow to detect the 4.0$-$8.0 keV of all the targets considered here."}], "acquisition_source": {"datetime": "2020-08-19T02:34:07.466667", "method": "hepcrawl", "source": "arXiv", "submission_number": "e1311d70e1c311ea87370a580a640aa1"}, "arxiv_eprints": [{"categories": ["astro-ph.HE"], "value": "2008.07830"}], "authors": [{"full_name": "Di Gesu, L."}, {"full_name": "Ferrazzoli, R."}, {"full_name": "Donnarumma, I."}, {"full_name": "Soffitta, P."}, {"full_name": "Costa, E."}, {"full_name": "Muleri, F."}, {"full_name": "Pesce-Rollins, M."}, {"full_name": "Di Gesu, F. Marin"}, {"full_name": "Ferrazzoli, R."}, {"full_name": "Donnarumma, I."}, {"full_name": "Soffitta, P."}, {"full_name": "Costa, E."}, {"full_name": "Muleri, F."}, {"full_name": "Pesce-Rollins, M."}, {"full_name": "Marin, F."}], "citeable": true, "curated": false, "document_type": ["article"], "documents": [{"fulltext": true, "hidden": true, "key": "2008.07830.pdf", "material": "preprint", "original_url": "http://export.arxiv.org/pdf/2008.07830", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/2008.07830.pdf"}], "figures": [{"caption": "Scattering geometry for a molecular cloud located in front or behind the Sgr A* plane. The two positions depicted result in the same effective scattering and polarization degree. In this scheme, $d_{\\rm proj}$ is the cloud-Sgr A* distance projected in the plane of the sky, $d_{\\rm los}$ is the line of sight displacement of the cloud with respect to the Sgr A* plane, c is the speed of light $t_{\\rm light}$ is light travel time between Sgr A* and the cloud, $\\theta$ and $\\pi-\\theta$ are the two possible scattering angles.", "key": "geo.png", "label": "geo.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/geo.png"}, {"caption": "From the left to the right: background and continuum subtracted Chandra maps of the cloud, the hard-plasma, and the soft-plasma component in the Sgr A region. Images are smoothed using a 3 pixel Gaussian kernel. The color bar displayed on the bottom has adimensional units because the images are normalized to the maximum value. The regions comprising the targets selected for IXPE simulations (i.e. MC2, Bridge-B2, Bridge-E, and G0.11-0.11) are shown. In the first panel, a circle having the size of the IXPE PSF is shown for comparison. The direction of Sgr A* is indicated with an arrow.", "key": "allmaps.png", "label": "sga_maps.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/allmaps.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_mc2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_mc2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_bridge_b2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_bridge_b2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_cbridge_e.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_cbridge_e.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_g011.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_g011.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_sgrb2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_sgrb2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c1.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_c1.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_c2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c3.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/spec_c3.png"}, {"caption": "Histograms showing the distribution of the polarization degree in the 4.0-8.0 keV band obtained simulating the cloud G0.11-0.11 for different instrumental resolution. Orange histogram: infinite spatial resolution case. Blue histogram: IXPE resolution case.", "key": "histonew.png", "label": "dilution.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/histonew.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "g011_map_arrow.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/g011_map_arrow.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "b2_arrows_pos.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/0ae14b92-770a-40dd-b23d-023929b1e5f5/b2_arrows_pos.png"}], "inspire_categories": [{"source": "arxiv", "term": "Astrophysics"}], "license": [{"license": "arXiv nonexclusive-distrib 1.0", "material": "preprint", "url": "http://arxiv.org/licenses/nonexclusive-distrib/1.0/"}], "preprint_date": "2020-08-18", "public_notes": [{"source": "arXiv", "value": "accepted for publication in Astronomy&Astrophysics"}], "references": [{"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Baganoff, F. K., Bautz, M. W., Brandt, W. N., et al. 2001, Nature, 413, 45"}], "record": {"$ref": "https://inspirehep.net/api/literature/576909"}, "reference": {"authors": [{"full_name": "Baganoff, F.K."}, {"full_name": "Bautz, M.W."}, {"full_name": "Brandt, W.N."}], "publication_info": {"artid": "45", "journal_title": "Nature", "journal_volume": "413", "page_start": "45", "year": 2001}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Bunner, A. N. 1978, ApJ, 220, 261"}], "reference": {"authors": [{"full_name": "Bunner, A.N."}], "publication_info": {"artid": "261", "journal_title": "Astrophys.J.", "journal_volume": "220", "page_start": "261", "year": 1978}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Capelli, R., Warwick, R. S., Porquet, D., Gillessen, S., & Predehl, P."}], "reference": {"authors": [{"full_name": "Capelli, R."}, {"full_name": "Warwick, R.S."}, {"full_name": "Porquet, D."}, {"full_name": "Gillessen, S."}, {"full_name": "Predehl, P."}]}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "2012, A&A, 545, A35"}], "record": {"$ref": "https://inspirehep.net/api/literature/1121491"}, "reference": {"publication_info": {"artid": "A35", "journal_title": "Astron.Astrophys.", "journal_volume": "545", "page_start": "A35", "year": 2012}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Chuard, D., Terrier, R., Goldwurm, A., et al. 2018, A&A, 610, A34"}], "record": {"$ref": "https://inspirehep.net/api/literature/1641736"}, "reference": {"authors": [{"full_name": "Chuard, D."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A34", "journal_title": "Astron.Astrophys.", "journal_volume": "610", "page_start": "A34", "year": 2018}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Khabibullin, I., Ponti, G., & Sunyaev, R. 2017, MNRAS, 468, 165"}], "record": {"$ref": "https://inspirehep.net/api/literature/1501218"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Khabibullin, I."}, {"full_name": "Ponti, G."}, {"full_name": "Sunyaev, R."}], "publication_info": {"artid": "165", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "468", "page_start": "165", "year": 2017}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Sunyaev, R., & Sazonov, S. 2002, MNRAS, 330, 817"}], "record": {"$ref": "https://inspirehep.net/api/literature/577763"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Sunyaev, R."}, {"full_name": "Sazonov, S."}], "publication_info": {"artid": "817", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "330", "page_start": "817", "year": 2002}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Clavel, M., Terrier, R., Goldwurm, A., et al. 2013, A&A, 558, A32"}], "record": {"$ref": "https://inspirehep.net/api/literature/1242619"}, "reference": {"authors": [{"full_name": "Clavel, M."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A32", "journal_title": "Astron.Astrophys.", "journal_volume": "558", "page_start": "A32", "year": 2013}}}], "titles": [{"source": "arXiv", "title": "Prospects for IXPE and eXTP polarimetric archaeology of the reflection nebulae in the Galactic Center"}]} diff --git a/tests/unit/test_data/update.json b/tests/unit/test_data/update.json index 87e80de..65b8e17 100644 --- a/tests/unit/test_data/update.json +++ b/tests/unit/test_data/update.json @@ -1 +1 @@ -{"$schema": "https://inspirehep.net/schemas/records/hep.json", "_collections": ["Literature"], "abstracts": [{"source": "arXiv", "value": "The X-ray polarization of the reflection nebulae in the Galactic Center inform us about the direction of the illuminating source (through the polarization angle) and the cloud position along the line of sight (through the polarization degree). However, the detected polarization degree is expected to be lowered because of the mixing of the emission of the clouds with the unpolarized diffuse emission in the GC region. In addition, in a real observation, also the morphological smearing of the source due to the PSF and the unpolarized instrumental background contribute in diluting the polarization degree. So far, these effects have never been included in the estimation of the dilution. Here, we evaluate the detectability of the X-ray polarization predicted for the MC2, Bridge-B2, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2 and Sgr C3 molecular clouds with modern X-ray imaging polarimeters like the Imaging X-ray Polarimetry Explorer (IXPE) and the Enhanced X-ray Timing and Polarimetry mission (eXTP). We perform realistic simulations of X-ray polarimetric observations considering (with the aid of Chandra maps and spectra) the spatial, spectral and polarization properties of all the diffuse emission and background components in each region of interest. We find that in the 4.0$-$8.0 keV band, where the emission of the molecular clouds outshines the other components, the dilution of the polarization degree, including the contribution due to the morphological smearing of the source, ranges between $\\sim$19\\% and $\\sim$55\\%. We conclude that, for some values of distances reported in the literature, the diluted polarization degree of G0.11-0.11, Sgr B2, Bridge-B2, Bridge-E, Sgr C1 and Sgr C3, may be detectable in a 2 Ms long IXPE observations. The enhanced capabilities of eXTP may allow to detect the 4.0$-$8.0 keV of all the targets considered here."}], "acquisition_source": {"datetime": "2020-08-21T02:33:40.722742", "method": "hepcrawl", "source": "arXiv", "submission_number": "3606e706e35611ea87370a580a640aa1"}, "arxiv_eprints": [{"categories": ["astro-ph.HE"], "value": "2008.07830"}], "authors": [{"full_name": "Di Gesu, L.", "ids": [{"schema": "INSPIRE BAI", "value": "L.Di.gesu.1"}], "signature_block": "GASl", "uuid": "dd1f671a-43a3-4870-bf77-28802f4c8f2b"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "b8beba24-0813-4856-9fc6-ba7cd32d83a7"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "70fcca2d-b11b-4c12-a867-01f9e21bcafb"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "3ad41f1b-9a97-49ee-b0c1-6b43d513a359"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "a2e1c16a-0b5a-4eaf-b6bb-2c6e62539a0a"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "9a4fde71-cced-4ad4-a58b-52f2d58d40d9"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "421bad05-b019-4c0c-8b99-841567e4a173"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "e7458737-e1e2-4d12-b4c1-fa649c628f54"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "349db320-280e-4a38-9f26-8d9ea3d4f149"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "b274f7d6-8aff-4c4b-9d24-8518f072f4af"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "13549754-2aec-43c3-9bd0-92738e5011a9"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "7e879a49-a361-4583-9b71-2194649fde16"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "994008f1-1f79-4e25-9a07-3774098aee96"}, {"full_name": "Marin, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Marin.1"}], "signature_block": "MARANf", "uuid": "c8f63f03-5b1d-4bc3-80e8-57649ad47429"}], "citeable": true, "control_number": 1812138, "curated": false, "document_type": ["article"], "documents": [{"fulltext": true, "hidden": true, "key": "2008.07830.pdf", "material": "preprint", "original_url": "http://export.arxiv.org/pdf/2008.07830", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/2008.07830.pdf"}], "figures": [{"caption": "Scattering geometry for a molecular cloud located in front or behind the Sgr A* plane. The two positions depicted result in the same effective scattering and polarization degree. In this scheme, $d_{\\rm proj}$ is the cloud-Sgr A* distance projected in the plane of the sky, $d_{\\rm los}$ is the line of sight displacement of the cloud with respect to the Sgr A* plane, c is the speed of light $t_{\\rm light}$ is light travel time between Sgr A* and the cloud, $\\theta$ and $\\pi-\\theta$ are the two possible scattering angles.", "key": "geo.png", "label": "geo.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/geo.png"}, {"caption": "From the left to the right: background and continuum subtracted Chandra maps of the cloud, the hard-plasma, and the soft-plasma component in the Sgr A region. Images are smoothed using a 3 pixel Gaussian kernel. The color bar displayed on the bottom has adimensional units because the images are normalized to the maximum value. The regions comprising the targets selected for IXPE simulations (i.e. MC2, Bridge-B2, Bridge-E, and G0.11-0.11) are shown. In the first panel, a circle having the size of the IXPE PSF is shown for comparison. The direction of Sgr A* is indicated with an arrow.", "key": "allmaps.png", "label": "sga_maps.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/allmaps.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_mc2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_mc2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_bridge_b2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_bridge_b2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_cbridge_e.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_cbridge_e.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_g011.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_g011.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_sgrb2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_sgrb2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c1.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_c1.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_c2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c3.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_c3.png"}, {"caption": "Histograms showing the distribution of the polarization degree in the 4.0-8.0 keV band obtained simulating the cloud G0.11-0.11 for different instrumental resolution. Orange histogram: infinite spatial resolution case. Blue histogram: IXPE resolution case.", "key": "histonew.png", "label": "dilution.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/histonew.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "g011_map_arrow.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/g011_map_arrow.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "b2_arrows_pos.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/b2_arrows_pos.png"}], "inspire_categories": [{"source": "arxiv", "term": "Astrophysics"}], "legacy_creation_date": "2020-08-19", "legacy_version": "20200820034323.0", "license": [{"license": "arXiv nonexclusive-distrib 1.0", "material": "preprint", "url": "http://arxiv.org/licenses/nonexclusive-distrib/1.0/"}], "preprint_date": "2020-08-18", "public_notes": [{"source": "arXiv", "value": "accepted for publication in Astronomy&Astrophysics"}], "references": [{"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Baganoff, F. K., Bautz, M. W., Brandt, W. N., et al. 2001, Nature, 413, 45"}], "record": {"$ref": "https://inspirehep.net/api/literature/576909"}, "reference": {"authors": [{"full_name": "Baganoff, F.K."}, {"full_name": "Bautz, M.W."}, {"full_name": "Brandt, W.N."}], "publication_info": {"artid": "45", "journal_title": "Nature", "journal_volume": "413", "page_start": "45", "year": 2001}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Bunner, A. N. 1978, ApJ, 220, 261"}], "reference": {"authors": [{"full_name": "Bunner, A.N."}], "publication_info": {"artid": "261", "journal_title": "Astrophys.J.", "journal_volume": "220", "page_start": "261", "year": 1978}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Capelli, R., Warwick, R. S., Porquet, D., Gillessen, S., & Predehl, P."}], "reference": {"authors": [{"full_name": "Capelli, R."}, {"full_name": "Warwick, R.S."}, {"full_name": "Porquet, D."}, {"full_name": "Gillessen, S."}, {"full_name": "Predehl, P."}]}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "2012, A&A, 545, A35"}], "record": {"$ref": "https://inspirehep.net/api/literature/1121491"}, "reference": {"publication_info": {"artid": "A35", "journal_title": "Astron.Astrophys.", "journal_volume": "545", "page_start": "A35", "year": 2012}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Chuard, D., Terrier, R., Goldwurm, A., et al. 2018, A&A, 610, A34"}], "record": {"$ref": "https://inspirehep.net/api/literature/1641736"}, "reference": {"authors": [{"full_name": "Chuard, D."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A34", "journal_title": "Astron.Astrophys.", "journal_volume": "610", "page_start": "A34", "year": 2018}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Khabibullin, I., Ponti, G., & Sunyaev, R. 2017, MNRAS, 468, 165"}], "record": {"$ref": "https://inspirehep.net/api/literature/1501218"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Khabibullin, I."}, {"full_name": "Ponti, G."}, {"full_name": "Sunyaev, R."}], "publication_info": {"artid": "165", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "468", "page_start": "165", "year": 2017}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Sunyaev, R., & Sazonov, S. 2002, MNRAS, 330, 817"}], "record": {"$ref": "https://inspirehep.net/api/literature/577763"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Sunyaev, R."}, {"full_name": "Sazonov, S."}], "publication_info": {"artid": "817", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "330", "page_start": "817", "year": 2002}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Clavel, M., Terrier, R., Goldwurm, A., et al. 2013, A&A, 558, A32"}], "record": {"$ref": "https://inspirehep.net/api/literature/1242619"}, "reference": {"authors": [{"full_name": "Clavel, M."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A32", "journal_title": "Astron.Astrophys.", "journal_volume": "558", "page_start": "A32", "year": 2013}}}], "self": {"$ref": "https://inspirehep.net/api/literature/1812138"}, "texkeys": ["DiGesu:2020pxk"], "titles": [{"source": "arXiv", "title": "Prospects for IXPE and eXTP polarimetric archaeology of the reflection nebulae in the Galactic Center"}]} \ No newline at end of file +{"$schema": "https://inspirehep.net/schemas/records/hep.json", "_collections": ["Literature"], "abstracts": [{"source": "arXiv", "value": "The X-ray polarization of the reflection nebulae in the Galactic Center inform us about the direction of the illuminating source (through the polarization angle) and the cloud position along the line of sight (through the polarization degree). However, the detected polarization degree is expected to be lowered because of the mixing of the emission of the clouds with the unpolarized diffuse emission in the GC region. In addition, in a real observation, also the morphological smearing of the source due to the PSF and the unpolarized instrumental background contribute in diluting the polarization degree. So far, these effects have never been included in the estimation of the dilution. Here, we evaluate the detectability of the X-ray polarization predicted for the MC2, Bridge-B2, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2 and Sgr C3 molecular clouds with modern X-ray imaging polarimeters like the Imaging X-ray Polarimetry Explorer (IXPE) and the Enhanced X-ray Timing and Polarimetry mission (eXTP). We perform realistic simulations of X-ray polarimetric observations considering (with the aid of Chandra maps and spectra) the spatial, spectral and polarization properties of all the diffuse emission and background components in each region of interest. We find that in the 4.0$-$8.0 keV band, where the emission of the molecular clouds outshines the other components, the dilution of the polarization degree, including the contribution due to the morphological smearing of the source, ranges between $\\sim$19\\% and $\\sim$55\\%. We conclude that, for some values of distances reported in the literature, the diluted polarization degree of G0.11-0.11, Sgr B2, Bridge-B2, Bridge-E, Sgr C1 and Sgr C3, may be detectable in a 2 Ms long IXPE observations. The enhanced capabilities of eXTP may allow to detect the 4.0$-$8.0 keV of all the targets considered here."}], "acquisition_source": {"datetime": "2020-08-21T02:33:40.722742", "method": "hepcrawl", "source": "arXiv", "submission_number": "3606e706e35611ea87370a580a640aa1"}, "arxiv_eprints": [{"categories": ["astro-ph.HE"], "value": "2008.07830"}], "authors": [{"full_name": "Di Gesu, L.", "ids": [{"schema": "INSPIRE BAI", "value": "L.Di.gesu.1"}], "signature_block": "GASl", "uuid": "dd1f671a-43a3-4870-bf77-28802f4c8f2b"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "b8beba24-0813-4856-9fc6-ba7cd32d83a7"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "70fcca2d-b11b-4c12-a867-01f9e21bcafb"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "3ad41f1b-9a97-49ee-b0c1-6b43d513a359"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "a2e1c16a-0b5a-4eaf-b6bb-2c6e62539a0a"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "9a4fde71-cced-4ad4-a58b-52f2d58d40d9"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "421bad05-b019-4c0c-8b99-841567e4a173"}, {"full_name": "Ferrazzoli, R.", "ids": [{"schema": "INSPIRE BAI", "value": "R.Ferrazzoli.1"}], "signature_block": "FARASALr", "uuid": "e7458737-e1e2-4d12-b4c1-fa649c628f54"}, {"full_name": "Donnarumma, I.", "ids": [{"schema": "INSPIRE BAI", "value": "I.Donnarumma.1"}], "record": {"$ref": "https://inspirehep.net/api/authors/1044189"}, "signature_block": "DANARANi", "uuid": "349db320-280e-4a38-9f26-8d9ea3d4f149"}, {"full_name": "Soffitta, P.", "ids": [{"schema": "INSPIRE BAI", "value": "P.Soffitta.1"}], "signature_block": "SAFATp", "uuid": "b274f7d6-8aff-4c4b-9d24-8518f072f4af"}, {"full_name": "Costa, E.", "ids": [{"schema": "INSPIRE BAI", "value": "E.Costa.2"}], "record": {"$ref": "https://inspirehep.net/api/authors/1263881"}, "signature_block": "CASTe", "uuid": "13549754-2aec-43c3-9bd0-92738e5011a9"}, {"full_name": "Muleri, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Muleri.1"}], "signature_block": "MALARf", "uuid": "7e879a49-a361-4583-9b71-2194649fde16"}, {"full_name": "Pesce-Rollins, M.", "ids": [{"schema": "INSPIRE BAI", "value": "M.Pesce.Rollins.2"}], "signature_block": "RALANm", "uuid": "994008f1-1f79-4e25-9a07-3774098aee96"}, {"full_name": "Marin, F.", "ids": [{"schema": "INSPIRE BAI", "value": "F.Marin.1"}], "signature_block": "MARANf", "uuid": "c8f63f03-5b1d-4bc3-80e8-57649ad47429"}], "citeable": true, "control_number": 1812138, "curated": false, "document_type": ["article"], "documents": [{"fulltext": true, "hidden": true, "key": "2008.07830.pdf", "material": "preprint", "original_url": "http://export.arxiv.org/pdf/2008.07830", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/2008.07830.pdf"}], "figures": [{"caption": "Scattering geometry for a molecular cloud located in front or behind the Sgr A* plane. The two positions depicted result in the same effective scattering and polarization degree. In this scheme, $d_{\\rm proj}$ is the cloud-Sgr A* distance projected in the plane of the sky, $d_{\\rm los}$ is the line of sight displacement of the cloud with respect to the Sgr A* plane, c is the speed of light $t_{\\rm light}$ is light travel time between Sgr A* and the cloud, $\\theta$ and $\\pi-\\theta$ are the two possible scattering angles.", "key": "geo.png", "label": "geo.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/geo.png"}, {"caption": "From the left to the right: background and continuum subtracted Chandra maps of the cloud, the hard-plasma, and the soft-plasma component in the Sgr A region. Images are smoothed using a 3 pixel Gaussian kernel. The color bar displayed on the bottom has adimensional units because the images are normalized to the maximum value. The regions comprising the targets selected for IXPE simulations (i.e. MC2, Bridge-B2, Bridge-E, and G0.11-0.11) are shown. In the first panel, a circle having the size of the IXPE PSF is shown for comparison. The direction of Sgr A* is indicated with an arrow.", "key": "allmaps.png", "label": "sga_maps.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/allmaps.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_mc2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_mc2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_bridge_b2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_bridge_b2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_cbridge_e.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_cbridge_e.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_g011.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_g011.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_sgrb2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_sgrb2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c1.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_c1.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c2.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_c2.png"}, {"caption": "From the top to the bottom: unfolded spectra and the residuals to the best-fit model for MC2, Bridge B2, Bridge E, G0.11-0.11, Sgr B2, Sgr C1, Sgr C2, Sgr C3. The total best-fit model and the reflection component are displayed as a solid line. The spectrum of the hard-plasma is displayed as a dashed-line. The spectrum of the soft-plasma is displayed as a dotted line.", "key": "spec_c3.png", "label": "allspec.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/spec_c3.png"}, {"caption": "Histograms showing the distribution of the polarization degree in the 4.0-8.0 keV band obtained simulating the cloud G0.11-0.11 for different instrumental resolution. Orange histogram: infinite spatial resolution case. Blue histogram: IXPE resolution case.", "key": "histonew.png", "label": "dilution.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/histonew.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "g011_map_arrow.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/g011_map_arrow.png"}, {"caption": "Simulated IXPE polarization maps of G0.11-0.11 (left panel) and Sgr B2 (right panel). The background is color-scaled according to the polarization degree. The colored arrows represent the direction of the polarization angle and are colour-scaled accordingly. The color scales for the polarization degree and angle are shown on the right of each figure. The direction of Sgr A* is also indicated as a comparison.", "key": "b2_arrows_pos.png", "label": "polmap.fig", "material": "preprint", "source": "arxiv", "url": "/api/files/b8cd3c77-d157-4811-8449-645df7e29d06/b2_arrows_pos.png"}], "inspire_categories": [{"source": "arxiv", "term": "Astrophysics"}], "legacy_creation_date": "2020-08-19", "legacy_version": "20200820034323.0", "license": [{"license": "arXiv nonexclusive-distrib 1.0", "material": "preprint", "url": "http://arxiv.org/licenses/nonexclusive-distrib/1.0/"}], "preprint_date": "2020-08-18", "public_notes": [{"source": "arXiv", "value": "accepted for publication in Astronomy&Astrophysics"}], "references": [{"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Baganoff, F. K., Bautz, M. W., Brandt, W. N., et al. 2001, Nature, 413, 45"}], "record": {"$ref": "https://inspirehep.net/api/literature/576909"}, "reference": {"authors": [{"full_name": "Baganoff, F.K."}, {"full_name": "Bautz, M.W."}, {"full_name": "Brandt, W.N."}], "publication_info": {"artid": "45", "journal_title": "Nature", "journal_volume": "413", "page_start": "45", "year": 2001}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Bunner, A. N. 1978, ApJ, 220, 261"}], "reference": {"authors": [{"full_name": "Bunner, A.N."}], "publication_info": {"artid": "261", "journal_title": "Astrophys.J.", "journal_volume": "220", "page_start": "261", "year": 1978}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Capelli, R., Warwick, R. S., Porquet, D., Gillessen, S., & Predehl, P."}], "reference": {"authors": [{"full_name": "Capelli, R."}, {"full_name": "Warwick, R.S."}, {"full_name": "Porquet, D."}, {"full_name": "Gillessen, S."}, {"full_name": "Predehl, P."}]}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "2012, A&A, 545, A35"}], "record": {"$ref": "https://inspirehep.net/api/literature/1121491"}, "reference": {"publication_info": {"artid": "A35", "journal_title": "Astron.Astrophys.", "journal_volume": "545", "page_start": "A35", "year": 2012}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Chuard, D., Terrier, R., Goldwurm, A., et al. 2018, A&A, 610, A34"}], "record": {"$ref": "https://inspirehep.net/api/literature/1641736"}, "reference": {"authors": [{"full_name": "Chuard, D."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A34", "journal_title": "Astron.Astrophys.", "journal_volume": "610", "page_start": "A34", "year": 2018}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Khabibullin, I., Ponti, G., & Sunyaev, R. 2017, MNRAS, 468, 165"}], "record": {"$ref": "https://inspirehep.net/api/literature/1501218"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Khabibullin, I."}, {"full_name": "Ponti, G."}, {"full_name": "Sunyaev, R."}], "publication_info": {"artid": "165", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "468", "page_start": "165", "year": 2017}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Churazov, E., Sunyaev, R., & Sazonov, S. 2002, MNRAS, 330, 817"}], "record": {"$ref": "https://inspirehep.net/api/literature/577763"}, "reference": {"authors": [{"full_name": "Churazov, E."}, {"full_name": "Sunyaev, R."}, {"full_name": "Sazonov, S."}], "publication_info": {"artid": "817", "journal_title": "Mon.Not.Roy.Astron.Soc.", "journal_volume": "330", "page_start": "817", "year": 2002}}}, {"raw_refs": [{"schema": "text", "source": "arXiv", "value": "Clavel, M., Terrier, R., Goldwurm, A., et al. 2013, A&A, 558, A32"}], "record": {"$ref": "https://inspirehep.net/api/literature/1242619"}, "reference": {"authors": [{"full_name": "Clavel, M."}, {"full_name": "Terrier, R."}, {"full_name": "Goldwurm, A."}], "publication_info": {"artid": "A32", "journal_title": "Astron.Astrophys.", "journal_volume": "558", "page_start": "A32", "year": 2013}}}], "self": {"$ref": "https://inspirehep.net/api/literature/1812138"}, "texkeys": ["DiGesu:2020pxk"], "titles": [{"source": "arXiv", "title": "Prospects for IXPE and eXTP polarimetric archaeology of the reflection nebulae in the Galactic Center"}]} diff --git a/tests/unit/test_filterout_utils.py b/tests/unit/test_filterout_utils.py index ecde077..ae9fd27 100644 --- a/tests/unit/test_filterout_utils.py +++ b/tests/unit/test_filterout_utils.py @@ -24,8 +24,12 @@ from json_merger.conflict import Conflict -from inspire_json_merger.utils import filter_conflicts, \ - filter_conflicts_by_path, is_to_delete, conflict_to_list +from inspire_json_merger.utils import ( + conflict_to_list, + filter_conflicts, + filter_conflicts_by_path, + is_to_delete, +) def test_conflict_to_list(): @@ -67,7 +71,7 @@ def test_is_to_delete_field_substring(): path = 'figures' conflict_list = [ ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'), - ('SET_FIELD', ('figures_attached', 0, 'key'), 'figure2.png') + ('SET_FIELD', ('figures_attached', 0, 'key'), 'figure2.png'), ] assert is_to_delete(conflict_list[0], path) is True assert is_to_delete(conflict_list[1], path) is False @@ -76,7 +80,7 @@ def test_is_to_delete_field_substring(): def test_delete_conflict_with_path_prefix(): conflict_list = [ ('SET_FIELD', ('authors', 0, 'full_name'), 'John Ellis'), - ('SET_FIELD', ('figures', 1, 'key'), 'figure.png') + ('SET_FIELD', ('figures', 1, 'key'), 'figure.png'), ] conflict_list = filter_conflicts_by_path(conflict_list, 'authors') assert conflict_list == [('SET_FIELD', ('figures', 1, 'key'), 'figure.png')] @@ -86,7 +90,7 @@ def test_delete_conflicts_wrong_path(): conflicts = [ ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'), ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'), - ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith') + ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith'), ] assert len(filter_conflicts_by_path(conflicts, 'authors.source')) == 3 @@ -95,7 +99,7 @@ def test_delete_conflicts_good_path(): conflicts = [ ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'), ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'), - ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith') + ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith'), ] assert len(filter_conflicts_by_path(conflicts, 'authors.full_name')) == 2 @@ -104,7 +108,7 @@ def test_delete_conflicts_longer_path(): conflicts = [ ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'), ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'), - ('SET_FIELD', ('authors', 1, 'full_name', 0, 'foo'), 'John Smith') + ('SET_FIELD', ('authors', 1, 'full_name', 0, 'foo'), 'John Smith'), ] assert len(filter_conflicts_by_path(conflicts, 'authors.full_name')) == 2 @@ -113,7 +117,7 @@ def test_delete_conflicts_path_too_long(): conflicts = [ ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'), ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'), - ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith') + ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith'), ] assert len(filter_conflicts_by_path(conflicts, 'figures.key.foo')) == 3 @@ -122,7 +126,7 @@ def test_delete_conflicts_more_deletion(): conflicts = [ ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'), ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'), - ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith') + ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith'), ] assert len(filter_conflicts_by_path(conflicts, 'figures')) == 1 @@ -132,12 +136,12 @@ def test_filter_conflicts(): ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'), ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'), ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith'), - ('SET_FIELD', ('references', 0, 'reference', 'authors', 0, 'inspire_role'), 'John Smith'), - ('SET_FIELD', ('report_numbers'), 'DESY-17-036') - ] - fields = [ - 'authors.affiliations', - 'authors.full_name', - 'report_numbers' + ( + 'SET_FIELD', + ('references', 0, 'reference', 'authors', 0, 'inspire_role'), + 'John Smith', + ), + ('SET_FIELD', 'report_numbers', 'DESY-17-036'), ] + fields = ['authors.affiliations', 'authors.full_name', 'report_numbers'] assert len(filter_conflicts(conflicts, fields)) == 4 diff --git a/tests/unit/test_merger.py b/tests/unit/test_merger.py index bd82443..5c12ded 100644 --- a/tests/unit/test_merger.py +++ b/tests/unit/test_merger.py @@ -6,11 +6,13 @@ from utils import assert_ordered_conflicts, validate_subschema from inspire_json_merger.api import merge -from inspire_json_merger.config import (ArxivOnArxivOperations, - ArxivOnPublisherOperations, - ErratumOnPublisherOperations, - PublisherOnArxivOperations, - PublisherOnPublisherOperations) +from inspire_json_merger.config import ( + ArxivOnArxivOperations, + ArxivOnPublisherOperations, + ErratumOnPublisherOperations, + PublisherOnArxivOperations, + PublisherOnPublisherOperations, +) @patch( @@ -149,8 +151,7 @@ def test_real_record_merge_regression_1_authors_mismatch_on_update(): "titles": [ { "source": "arXiv", - "title": "Spontaneous symmetry breaking: a view from derived " - "geometry", + "title": "Spontaneous symmetry breaking: a view from derived geometry", } ], } @@ -217,8 +218,7 @@ def test_real_record_merge_regression_1_authors_mismatch_on_update(): "titles": [ { "source": "arXiv", - "title": "Spontaneous symmetry breaking: a view from derived " - "geometry", + "title": "Spontaneous symmetry breaking: a view from derived geometry", } ], } @@ -230,8 +230,7 @@ def test_real_record_merge_regression_1_authors_mismatch_on_update(): "titles": [ { "source": "arXiv", - "title": "Spontaneous symmetry breaking: a view from derived " - "geometry", + "title": "Spontaneous symmetry breaking: a view from derived geometry", } ], } @@ -688,7 +687,27 @@ def test_merging_copyright(fake_get_config): "abstracts": [ { "source": "arXiv", - "value": "Based on previously published multi-wavelength modelling of the GRB 170817A jet afterglow, that includes information from the VLBI centroid motion, we construct the posterior probability density distribution on the total energy in the bipolar jets launched by the GW170817 merger remnant. By applying a new numerical-relativity-informed fitting formula for the accretion disk mass, we construct the posterior probability density distribution of the GW170817 remnant disk mass. By combining the two, we estimate the accretion-to-jet energy conversion efficiency in this system, carefully accounting for uncertainties. The accretion-to-jet energy conversion efficiency in GW170817 is $\\eta\\sim 10^{-3}$ with an uncertainty of slightly less than two orders of magnitude. This low efficiency is in good agreement with expectations from the $\\nu\\bar\\nu$ mechanism, which therefore cannot be excluded by this measurement alone. Such an efficiency also agrees with that anticipated for the Blandford-Znajek mechanism, provided that the magnetic field in the disk right after the merger is predominantly toroidal (which is expected as a result of the merger dynamics).", + "value": ( + "Based on previously published multi-wavelength modelling of the" + " GRB 170817A jet afterglow, that includes information from the" + " VLBI centroid motion, we construct the posterior probability" + " density distribution on the total energy in the bipolar jets" + " launched by the GW170817 merger remnant. By applying a new" + " numerical-relativity-informed fitting formula for the accretion" + " disk mass, we construct the posterior probability density" + " distribution of the GW170817 remnant disk mass. By combining the" + " two, we estimate the accretion-to-jet energy conversion" + " efficiency in this system, carefully accounting for" + " uncertainties. The accretion-to-jet energy conversion efficiency" + " in GW170817 is $\\eta\\sim 10^{-3}$ with an uncertainty of" + " slightly less than two orders of magnitude. This low efficiency" + " is in good agreement with expectations from the $\\nu\\bar\\nu$" + " mechanism, which therefore cannot be excluded by this measurement" + " alone. Such an efficiency also agrees with that anticipated for" + " the Blandford-Znajek mechanism, provided that the magnetic field" + " in the disk right after the merger is predominantly toroidal" + " (which is expected as a result of the merger dynamics)." + ), } ], "acquisition_source": { @@ -703,10 +722,16 @@ def test_merging_copyright(fake_get_config): "full_name": "Salafia, Om S.", "raw_affiliations": [ { - "value": "INAF -Osservatorio Astronomico di Brera, via E. Bianchi 46, I-23807 Merate (LC), Italy" + "value": ( + "INAF -Osservatorio Astronomico di Brera, via E. Bianchi" + " 46, I-23807 Merate (LC), Italy" + ) }, { - "value": "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3, I-20126 Milano (MI), Italy" + "value": ( + "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3," + " I-20126 Milano (MI), Italy" + ) }, ], }, @@ -714,13 +739,23 @@ def test_merging_copyright(fake_get_config): "full_name": "Giacomazzo, Bruno", "raw_affiliations": [ { - "value": "INAF -Osservatorio Astronomico di Brera, via E. Bianchi 46, I-23807 Merate (LC), Italy" + "value": ( + "INAF -Osservatorio Astronomico di Brera, via E. Bianchi" + " 46, I-23807 Merate (LC), Italy" + ) }, { - "value": "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3, I-20126 Milano (MI), Italy" + "value": ( + "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3," + " I-20126 Milano (MI), Italy" + ) }, { - "value": 'Universit\xe0 degli Studi di Milano-Bicocca, Dip. di Fisica "G. Occhialini", Piazza della Scienza 3, I-20126 Milano, Italy' + "value": ( + 'Universit\xe0 degli Studi di Milano-Bicocca, Dip. di' + ' Fisica "G. Occhialini", Piazza della Scienza 3, I-20126' + ' Milano, Italy' + ) }, ], }, @@ -748,7 +783,14 @@ def test_merging_copyright(fake_get_config): ], "figures": [ { - "caption": "GW170817 accretion disc mass posterior distributions. The solid red line shows the posterior probability distribution of the logarithm of the accretion disc mass (in solar masses) for the low-spin LVC priors. The dashed blue line shows the corresponding result that would have been obtained using the disc mass fitting formula from \\citet{Radice2018}.", + "caption": ( + "GW170817 accretion disc mass posterior distributions. The solid" + " red line shows the posterior probability distribution of the" + " logarithm of the accretion disc mass (in solar masses) for the" + " low-spin LVC priors. The dashed blue line shows the corresponding" + " result that would have been obtained using the disc mass fitting" + " formula from \\citet{Radice2018}." + ), "key": "disk_mass.png", "label": "fig:disc_mass_posterior", "material": "preprint", @@ -769,7 +811,11 @@ def test_merging_copyright(fake_get_config): "public_notes": [ { "source": "arXiv", - "value": "11 pages, 6 figures, reflects the A&A published version, with\n equation 1 corrected as described in the corrigendum published on A&A", + "value": ( + "11 pages, 6 figures, reflects the A&A published version, with\n" + " equation 1 corrected as described in the corrigendum published" + " on A&A" + ), } ], "publication_info": [ @@ -802,11 +848,76 @@ def test_merging_copyright(fake_get_config): "abstracts": [ { "source": "EDP Sciences", - "value": "Gamma-ray bursts (GRBs) are thought to be produced by short-lived, supercritical accretion onto a newborn compact object. Some process is believed to tap energy from the compact object, or the accretion disc, powering the launch of a relativistic jet. For the first time, we can construct independent estimates of the GRB jet energy and of the mass in the accretion disc in its central engine; this is thanks to gravitational wave observations of the GW170817 binary neutron star merger by the Laser Interferometer Gravitational wave Observatory (LIGO) and Virgo interferometers, as well as a global effort to monitor the afterglow of the associated short gamma-ray burst GRB 170817A on a long-term, high-cadence, multi-wavelength basis. In this work, we estimate the accretion-to-jet energy conversion efficiency in GW170817, that is, the ratio of the jet total energy to the accretion disc rest mass energy, and we compare this quantity with theoretical expectations from the Blandford-Znajek and neutrino-antineutrino annihilation (\u03bd\u03bd\u0304) jet-launching mechanisms in binary neutron star mergers. Based on previously published multi-wavelength modelling of the GRB 170817A jet afterglow, we construct the posterior probability density distribution of the total energy in the bipolar jets launched by the GW170817 merger remnant. By applying a new numerical-relativity-informed fitting formula for the accretion disc mass, we construct the posterior probability density distribution of the GW170817 remnant disc mass. Combining the two, we estimate the accretion-to-jet energy conversion efficiency in this system, carefully accounting for uncertainties. The accretion-to-jet energy conversion efficiency in GW170817 is \u03b7\u2004\u223c\u200410\u22123, with an uncertainty of slightly less than two orders of magnitude. This low efficiency is in agreement with expectations from the mechanism, which therefore cannot be excluded by this measurement alone. The low efficiency also agrees with that anticipated for the Blandford-Znajek mechanism, provided that the magnetic field in the disc right after the merger is predominantly toroidal (which is expected as a result of the merger dynamics). This is the first estimate of the accretion-to-jet energy conversion efficiency in a GRB that combines independent estimates of the jet energy and accretion disc mass. Future applications of this method to a larger number of systems will reduce the uncertainties in the efficiency and reveal whether or not it is universal. This, in turn, will provide new insights into the jet-launching conditions in neutron star mergers.Key words: relativistic processes / gamma-ray burst: individual: GRB 170817A / stars: neutron / gravitational waves", + "value": ( + "Gamma-ray bursts (GRBs) are thought to be produced by short-lived," + " supercritical accretion onto a newborn compact object. Some" + " process is believed to tap energy from the compact object, or the" + " accretion disc, powering the launch of a relativistic jet. For" + " the first time, we can construct independent estimates of the GRB" + " jet energy and of the mass in the accretion disc in its central" + " engine; this is thanks to gravitational wave observations of the" + " GW170817 binary neutron star merger by the Laser Interferometer" + " Gravitational wave Observatory (LIGO) and Virgo interferometers," + " as well as a global effort to monitor the afterglow of the" + " associated short gamma-ray burst GRB 170817A on a long-term," + " high-cadence, multi-wavelength basis. In this work, we estimate" + " the accretion-to-jet energy conversion efficiency in GW170817," + " that is, the ratio of the jet total energy to the accretion disc" + " rest mass energy, and we compare this quantity with theoretical" + " expectations from the Blandford-Znajek and neutrino-antineutrino" + " annihilation (\u03bd\u03bd\u0304) jet-launching mechanisms in" + " binary neutron star mergers. Based on previously published" + " multi-wavelength modelling of the GRB 170817A jet afterglow, we" + " construct the posterior probability density distribution of the" + " total energy in the bipolar jets launched by the GW170817 merger" + " remnant. By applying a new numerical-relativity-informed fitting" + " formula for the accretion disc mass, we construct the posterior" + " probability density distribution of the GW170817 remnant disc" + " mass. Combining the two, we estimate the accretion-to-jet energy" + " conversion efficiency in this system, carefully accounting for" + " uncertainties. The accretion-to-jet energy conversion efficiency" + " in GW170817 is \u03b7\u2004\u223c\u200410\u22123, with an" + " uncertainty of slightly less than two orders of magnitude. This" + " low efficiency is in agreement with expectations from the" + " mechanism, which therefore cannot be excluded by this measurement" + " alone. The low efficiency also agrees with that anticipated for" + " the Blandford-Znajek mechanism, provided that the magnetic field" + " in the disc right after the merger is predominantly toroidal" + " (which is expected as a result of the merger dynamics). This is" + " the first estimate of the accretion-to-jet energy conversion" + " efficiency in a GRB that combines independent estimates of the" + " jet energy and accretion disc mass. Future applications of this" + " method to a larger number of systems will reduce the" + " uncertainties in the efficiency and reveal whether or not it is" + " universal. This, in turn, will provide new insights into the" + " jet-launching conditions in neutron star mergers.Key words:" + " relativistic processes / gamma-ray burst: individual: GRB 170817A" + " / stars: neutron / gravitational waves" + ), }, { "source": "arXiv", - "value": "Based on previously published multi-wavelength modelling of the GRB 170817A jet afterglow, that includes information from the VLBI centroid motion, we construct the posterior probability density distribution on the total energy in the bipolar jets launched by the GW170817 merger remnant. By applying a new numerical-relativity-informed fitting formula for the accretion disk mass, we construct the posterior probability density distribution of the GW170817 remnant disk mass. By combining the two, we estimate the accretion-to-jet energy conversion efficiency in this system, carefully accounting for uncertainties. The accretion-to-jet energy conversion efficiency in GW170817 is $\\eta\\sim 10^{-3}$ with an uncertainty of slightly less than two orders of magnitude. This low efficiency is in good agreement with expectations from the $\\nu\\bar\\nu$ mechanism, which therefore cannot be excluded by this measurement alone. Such an efficiency also agrees with that anticipated for the Blandford-Znajek mechanism, provided that the magnetic field in the disk right after the merger is predominantly toroidal (which is expected as a result of the merger dynamics).", + "value": ( + "Based on previously published multi-wavelength modelling of the" + " GRB 170817A jet afterglow, that includes information from the" + " VLBI centroid motion, we construct the posterior probability" + " density distribution on the total energy in the bipolar jets" + " launched by the GW170817 merger remnant. By applying a new" + " numerical-relativity-informed fitting formula for the accretion" + " disk mass, we construct the posterior probability density" + " distribution of the GW170817 remnant disk mass. By combining the" + " two, we estimate the accretion-to-jet energy conversion" + " efficiency in this system, carefully accounting for" + " uncertainties. The accretion-to-jet energy conversion efficiency" + " in GW170817 is $\\eta\\sim 10^{-3}$ with an uncertainty of" + " slightly less than two orders of magnitude. This low efficiency" + " is in good agreement with expectations from the $\\nu\\bar\\nu$" + " mechanism, which therefore cannot be excluded by this measurement" + " alone. Such an efficiency also agrees with that anticipated for" + " the Blandford-Znajek mechanism, provided that the magnetic field" + " in the disk right after the merger is predominantly toroidal" + " (which is expected as a result of the merger dynamics)." + ), }, ], "acquisition_source": { @@ -826,10 +937,16 @@ def test_merging_copyright(fake_get_config): ], "raw_affiliations": [ { - "value": "INAF -Osservatorio Astronomico di Brera, via E. Bianchi 46, I-23807 Merate (LC), Italy" + "value": ( + "INAF -Osservatorio Astronomico di Brera, via E. Bianchi" + " 46, I-23807 Merate (LC), Italy" + ) }, { - "value": "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3, I-20126 Milano (MI), Italy" + "value": ( + "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3," + " I-20126 Milano (MI), Italy" + ) }, ], "record": {"$ref": "https://inspirehep.net/api/authors/1598567"}, @@ -845,13 +962,23 @@ def test_merging_copyright(fake_get_config): ], "raw_affiliations": [ { - "value": "INAF -Osservatorio Astronomico di Brera, via E. Bianchi 46, I-23807 Merate (LC), Italy" + "value": ( + "INAF -Osservatorio Astronomico di Brera, via E. Bianchi" + " 46, I-23807 Merate (LC), Italy" + ) }, { - "value": "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3, I-20126 Milano (MI), Italy" + "value": ( + "INFN -Sezione di Milano-Bicocca, Piazza della Scienza 3," + " I-20126 Milano (MI), Italy" + ) }, { - "value": 'Universit\xe0 degli Studi di Milano-Bicocca, Dip. di Fisica "G. Occhialini", Piazza della Scienza 3, I-20126 Milano, Italy' + "value": ( + 'Universit\xe0 degli Studi di Milano-Bicocca, Dip. di' + ' Fisica "G. Occhialini", Piazza della Scienza 3, I-20126' + ' Milano, Italy' + ) }, ], "record": {"$ref": "https://inspirehep.net/api/authors/1056614"}, @@ -889,7 +1016,14 @@ def test_merging_copyright(fake_get_config): ], "figures": [ { - "caption": "GW170817 accretion disc mass posterior distributions. The solid red line shows the posterior probability distribution of the logarithm of the accretion disc mass (in solar masses) for the low-spin LVC priors. The dashed blue line shows the corresponding result that would have been obtained using the disc mass fitting formula from \\citet{Radice2018}.", + "caption": ( + "GW170817 accretion disc mass posterior distributions. The solid" + " red line shows the posterior probability distribution of the" + " logarithm of the accretion disc mass (in solar masses) for the" + " low-spin LVC priors. The dashed blue line shows the corresponding" + " result that would have been obtained using the disc mass fitting" + " formula from \\citet{Radice2018}." + ), "filename": "disk_mass.png", "key": "3a646ab3fbde76e1d6aa2489de70076d", "label": "fig:disc_mass_posterior", @@ -924,7 +1058,11 @@ def test_merging_copyright(fake_get_config): "public_notes": [ { "source": "arXiv", - "value": "11 pages, 6 figures, reflects the A&A published version, with\n equation 1 corrected as described in the corrigendum published on A&A", + "value": ( + "11 pages, 6 figures, reflects the A&A published version, with\n" + " equation 1 corrected as described in the corrigendum published" + " on A&A" + ), } ], "publication_info": [ @@ -958,7 +1096,10 @@ def test_merging_copyright(fake_get_config): "titles": [ { "source": "EDP Sciences", - "title": "Accretion-to-jet energy conversion efficiency in GW170817 (Corrigendum)", + "title": ( + "Accretion-to-jet energy conversion efficiency in GW170817" + " (Corrigendum)" + ), }, { "source": "arXiv", @@ -983,7 +1124,10 @@ def test_merging_copyright(fake_get_config): "_private_notes": [ {"value": "Erratum"}, { - "value": "1 combined refs (0 IDs differ, 1 IDs coincide, 0 DOIs/0 bulls added from SISSA, 0 IDs missing in SISSA)" + "value": ( + "1 combined refs (0 IDs differ, 1 IDs coincide, 0 DOIs/0 bulls" + " added from SISSA, 0 IDs missing in SISSA)" + ) }, {"value": "DOKIFILE:jhep2205.140-2130"}, ], @@ -1003,7 +1147,10 @@ def test_merging_copyright(fake_get_config): "full_name": "Arnold, Peter", "raw_affiliations": [ { - "value": "Department of Physics, University of Virginia, 22904-4714 Charlottesville, Virginia, USA" + "value": ( + "Department of Physics, University of Virginia, 22904-4714" + " Charlottesville, Virginia, USA" + ) } ], }, @@ -1016,10 +1163,16 @@ def test_merging_copyright(fake_get_config): "ids": [{"schema": "ORCID", "value": "0000-0003-3469-7574"}], "raw_affiliations": [ { - "value": "Department of Physics, University of Virginia, 22904-4714 Charlottesville, Virginia, USA" + "value": ( + "Department of Physics, University of Virginia, 22904-4714" + " Charlottesville, Virginia, USA" + ) }, { - "value": "Technische Universit\xe4t Darmstadt, Department of Physics, 64289 Darmstadt, Germany" + "value": ( + "Technische Universit\xe4t Darmstadt, Department of" + " Physics, 64289 Darmstadt, Germany" + ) }, ], }, @@ -1031,7 +1184,10 @@ def test_merging_copyright(fake_get_config): "ids": [{"schema": "ORCID", "value": "0000-0001-8640-9963"}], "raw_affiliations": [ { - "value": "Institute of Particle Physics, Central China Normal University, 430079 Wuhan, China" + "value": ( + "Institute of Particle Physics, Central China Normal" + " University, 430079 Wuhan, China" + ) } ], }, @@ -1071,7 +1227,10 @@ def test_merging_copyright(fake_get_config): "titles": [ { "source": "Springer", - "title": "Erratum to: The LPM effect in sequential bremsstrahlung: nearly complete results for QCD [doi: 10.1007/JHEP11(2020)053]", + "title": ( + "Erratum to: The LPM effect in sequential bremsstrahlung: nearly" + " complete results for QCD [doi: 10.1007/JHEP11(2020)053]" + ), } ], } diff --git a/tests/unit/test_merger_arxiv2arxiv.py b/tests/unit/test_merger_arxiv2arxiv.py index ea73fa5..ff1dc3d 100644 --- a/tests/unit/test_merger_arxiv2arxiv.py +++ b/tests/unit/test_merger_arxiv2arxiv.py @@ -28,17 +28,16 @@ from __future__ import absolute_import, division, print_function -from mock import MagicMock import pytest +from mock import MagicMock +from utils import assert_ordered_conflicts, validate_subschema from inspire_json_merger import api from inspire_json_merger.api import merge -from utils import assert_ordered_conflicts, validate_subschema - @pytest.fixture(autouse=True, scope='module') -def mock_get_acquisition_source(): +def _mock_get_acquisition_source(): original_func = api.get_acquisition_source api.get_acquisition_source = MagicMock(return_value='arxiv') yield @@ -48,18 +47,8 @@ def mock_get_acquisition_source(): def test_merging_acquisition_source_field(): root = {} # record_id: 1517095 - head = { - 'acquisition_source': { - 'method': 'submitter', - 'source': 'arxiv' - } - } - update = { - 'acquisition_source': { - 'method': 'batchuploader', - 'source': 'arxiv' - } - } + head = {'acquisition_source': {'method': 'submitter', 'source': 'arxiv'}} + update = {'acquisition_source': {'method': 'batchuploader', 'source': 'arxiv'}} expected_merged = update expected_conflict = [] @@ -112,9 +101,12 @@ def test_merging_raw_affiliations_field(): 'raw_affiliations': [ { 'source': 'arxiv', - 'value': 'Department of Physics, Indiana University, Bloomington, IN 47405, USA' + 'value': ( + 'Department of Physics, Indiana University, Bloomington, IN' + ' 47405, USA' + ), } - ] + ], } ] } @@ -125,13 +117,16 @@ def test_merging_raw_affiliations_field(): 'raw_affiliations': [ { 'source': 'arxiv', - 'value': 'Department of Physics, Indiana University, Bloomington, IN 47405, US' + 'value': ( + 'Department of Physics, Indiana University, Bloomington, IN' + ' 47405, US' + ), }, { 'source': 'arxiv', 'value': 'Padua U', - } - ] + }, + ], } ] } @@ -146,58 +141,33 @@ def test_merging_raw_affiliations_field(): def test_merging_dois_field_handles_repeated_values(): - root = { - 'dois': [ - { - 'material': 'preprint', - 'value': '10.1023/A:1026654312961' - } - ] - } + root = {'dois': [{'material': 'preprint', 'value': '10.1023/A:1026654312961'}]} head = { 'dois': [ - { - 'material': 'publication', - 'value': '10.1023/A:1026654312961' - }, - { - 'source': 'nowhere', - 'value': '10.1023/B:1026654312961' - }, + {'material': 'publication', 'value': '10.1023/A:1026654312961'}, + {'source': 'nowhere', 'value': '10.1023/B:1026654312961'}, ] } update = { 'dois': [ - { - 'material': 'erratum', - 'value': '10.1023/A:1026654312961' - }, + {'material': 'erratum', 'value': '10.1023/A:1026654312961'}, { 'material': 'erratum', 'source': 'nowhere', - 'value': '10.1023/B:1026654312961' + 'value': '10.1023/B:1026654312961', }, ] } expected_merged = { 'dois': [ - { - 'material': 'publication', - 'value': '10.1023/A:1026654312961' - }, - { - 'source': 'nowhere', - 'value': '10.1023/B:1026654312961' - }, - { - 'material': 'erratum', - 'value': '10.1023/A:1026654312961' - }, + {'material': 'publication', 'value': '10.1023/A:1026654312961'}, + {'source': 'nowhere', 'value': '10.1023/B:1026654312961'}, + {'material': 'erratum', 'value': '10.1023/A:1026654312961'}, { 'material': 'erratum', 'source': 'nowhere', - 'value': '10.1023/B:1026654312961' + 'value': '10.1023/B:1026654312961', }, ] } @@ -210,30 +180,19 @@ def test_merging_dois_field_handles_repeated_values(): def test_merging_inspire_categories_field(): - root = {'inspire_categories': [ - { - 'source': 'INSPIRE', - 'term': 'Theory-HEP' - } - ]} - head = {'inspire_categories': [ - { - 'source': 'curator', - 'term': 'Theory-HEP' - }, { - 'source': 'curator', - 'term': 'Theory-Nucl' - } - ]} - update = {'inspire_categories': [ - { - 'source': 'arxiv', - 'term': 'Computing' - }, { - 'source': 'arxiv', - 'term': 'Other' - } - ]} + root = {'inspire_categories': [{'source': 'INSPIRE', 'term': 'Theory-HEP'}]} + head = { + 'inspire_categories': [ + {'source': 'curator', 'term': 'Theory-HEP'}, + {'source': 'curator', 'term': 'Theory-Nucl'}, + ] + } + update = { + 'inspire_categories': [ + {'source': 'arxiv', 'term': 'Computing'}, + {'source': 'arxiv', 'term': 'Other'}, + ] + } expected_merged = head expected_conflict = [] @@ -250,42 +209,48 @@ def test_merging_license_field(): { 'imposing': 'Elsevier', 'url': 'http://creativecommons.org/licenses/by/4.0/', - 'license': 'elsevier foo bar' + 'license': 'elsevier foo bar', + } + ] + } + head = { + 'license': [ + { + 'imposing': 'Elsevier', + 'url': 'http://creativecommons.org/licenses/by/4.0/', + 'license': 'elsevier foo bar', + }, + { + 'imposing': 'arXiv', + 'url': 'http://creativecommons.org/licenses/by/4.0/', + 'license': 'arxiv foo bar', + }, + ] + } + update = { + 'license': [ + { + 'imposing': 'Elsevier', + 'url': 'http://creativecommons.org/licenses/by/4.0/', + 'license': 'elsevier foo bar updated!', } ] } - head = {'license': [ - { - 'imposing': 'Elsevier', - 'url': 'http://creativecommons.org/licenses/by/4.0/', - 'license': 'elsevier foo bar' - }, - { - 'imposing': 'arXiv', - 'url': 'http://creativecommons.org/licenses/by/4.0/', - 'license': 'arxiv foo bar' - } - ]} - update = {'license': [ - { - 'imposing': 'Elsevier', - 'url': 'http://creativecommons.org/licenses/by/4.0/', - 'license': 'elsevier foo bar updated!' - } - ]} - - expected_merged = {'license': [ - { - 'imposing': 'Elsevier', - 'url': 'http://creativecommons.org/licenses/by/4.0/', - 'license': 'elsevier foo bar updated!' - }, - { - 'imposing': 'arXiv', - 'url': 'http://creativecommons.org/licenses/by/4.0/', - 'license': 'arxiv foo bar' - } - ]} + + expected_merged = { + 'license': [ + { + 'imposing': 'Elsevier', + 'url': 'http://creativecommons.org/licenses/by/4.0/', + 'license': 'elsevier foo bar updated!', + }, + { + 'imposing': 'arXiv', + 'url': 'http://creativecommons.org/licenses/by/4.0/', + 'license': 'arxiv foo bar', + }, + ] + } expected_conflict = [] merged, conflict = merge(root, head, update, head_source='arxiv') @@ -303,7 +268,7 @@ def test_merging_publication_info_field(): "journal_volume": "12", "page_end": "979", "page_start": "948", - "year": 2008 + "year": 2008, } ] } # record 697133 @@ -318,7 +283,7 @@ def test_merging_publication_info_field(): "journal_volume": "12", "page_end": "979", "page_start": "948", - "year": 2008 + "year": 2008, } ] } @@ -352,7 +317,7 @@ def test_merging_publication_info_field(): "journal_volume": "12", "page_end": "979", "page_start": "948", - "year": 2008 + "year": 2008, }, { 'artid': '948-979', @@ -379,28 +344,34 @@ def test_merging_publication_info_field(): def test_merging_report_numbers_field_repeated_values(): - root = {'report_numbers': [ - { - 'source': 'arXiv', - 'value': 'CERN-CMS-2018-001', - }, - ]} # record: 1598022 - head = {'report_numbers': [ - { - 'hidden': True, - 'source': 'arXiv', - 'value': 'CERN-CMS-2018-001', - }, - { - 'value': 'CERN-CMS-2018-001', - }, - ]} - update = {'report_numbers': [ - { - 'source': 'arXiv', - 'value': 'CERN-CMS-2018-001', - }, - ]} + root = { + 'report_numbers': [ + { + 'source': 'arXiv', + 'value': 'CERN-CMS-2018-001', + }, + ] + } # record: 1598022 + head = { + 'report_numbers': [ + { + 'hidden': True, + 'source': 'arXiv', + 'value': 'CERN-CMS-2018-001', + }, + { + 'value': 'CERN-CMS-2018-001', + }, + ] + } + update = { + 'report_numbers': [ + { + 'source': 'arXiv', + 'value': 'CERN-CMS-2018-001', + }, + ] + } expected_merged = head expected_conflict = [] @@ -412,40 +383,48 @@ def test_merging_report_numbers_field_repeated_values(): def test_merging_titles_field(): - root = {'titles': [ - { - 'source': 'arXiv', - 'title': 'ANTARES: An observatory at the seabed ' - 'to the confines of the Universe' - } # record: 1519935 - ]} - head = {'titles': [ - { - 'source': 'arXiv', - 'subtitle': 'this subtitle has been added by a curator', - 'title': 'ANTARES: An observatory at the seabed ' - 'to the confines of the Universe' - } - ]} - update = {'titles': [ - { - 'source': 'arXiv', - 'title': 'ANTARES: Un osservatorio foo bar' - }, - ]} - - expected_merged = {'titles': [ - { - 'source': 'arXiv', - 'title': 'ANTARES: Un osservatorio foo bar' - }, - { - 'source': 'arXiv', - 'subtitle': 'this subtitle has been added by a curator', - 'title': 'ANTARES: An observatory at the seabed ' - 'to the confines of the Universe' - }, - ]} + root = { + 'titles': [ + { + 'source': 'arXiv', + 'title': ( + 'ANTARES: An observatory at the seabed ' + 'to the confines of the Universe' + ), + } # record: 1519935 + ] + } + head = { + 'titles': [ + { + 'source': 'arXiv', + 'subtitle': 'this subtitle has been added by a curator', + 'title': ( + 'ANTARES: An observatory at the seabed ' + 'to the confines of the Universe' + ), + } + ] + } + update = { + 'titles': [ + {'source': 'arXiv', 'title': 'ANTARES: Un osservatorio foo bar'}, + ] + } + + expected_merged = { + 'titles': [ + {'source': 'arXiv', 'title': 'ANTARES: Un osservatorio foo bar'}, + { + 'source': 'arXiv', + 'subtitle': 'this subtitle has been added by a curator', + 'title': ( + 'ANTARES: An observatory at the seabed ' + 'to the confines of the Universe' + ), + }, + ] + } expected_conflict = [] merged, conflict = merge(root, head, update, head_source='arxiv') @@ -469,7 +448,7 @@ def test_figures(): 'caption': 'Figure 2', 'source': 'arXiv', 'url': 'http://example.com/files/1234-1234-1234-1234/figure2.png', - } + }, ] } update = { @@ -485,15 +464,14 @@ def test_figures(): 'caption': 'Figure 2', 'source': 'arXiv', 'url': 'http://example.com/files/5678-5678-5678-5678/figure2.png', - } + }, ] } expected_merged = update expected_conflict = [] - merged, conflict = merge(root, head, update, - head_source='arxiv') + merged, conflict = merge(root, head, update, head_source='arxiv') assert merged == expected_merged assert_ordered_conflicts(conflict, expected_conflict) validate_subschema(merged) @@ -565,8 +543,7 @@ def test_figures_dont_duplicate_keys_even_from_different_sources(): expected_conflict = [] - merged, conflict = merge(root, head, update, - head_source='arxiv') + merged, conflict = merge(root, head, update, head_source='arxiv') assert merged == expected_merged assert_ordered_conflicts(conflict, expected_conflict) @@ -605,15 +582,14 @@ def test_documents(): 'description': 'some xml files', 'source': 'arXiv', 'url': 'http://example.com/files/5678-5678-5678-5678/foo.xml', - } + }, ] } expected_merged = update expected_conflict = [] - merged, conflict = merge(root, head, update, - head_source='arxiv') + merged, conflict = merge(root, head, update, head_source='arxiv') assert merged == expected_merged assert_ordered_conflicts(conflict, expected_conflict) validate_subschema(merged) @@ -623,28 +599,20 @@ def test_head_curates_author_no_duplicate(): # https://labs.inspirehep.net/api/holdingpen/1268973 root = { 'authors': [ - { - "full_name": "Li, Zhengxiang" - }, + {"full_name": "Li, Zhengxiang"}, ] } head = { "authors": [ { - "affiliations": [ - { - "value": "Beijing Normal U." - } - ], + "affiliations": [{"value": "Beijing Normal U."}], "full_name": "Li, Zheng-Xiang", } ] } update = { 'authors': [ - { - "full_name": "Li, Zhengxiang" - }, + {"full_name": "Li, Zhengxiang"}, ] } @@ -652,19 +620,15 @@ def test_head_curates_author_no_duplicate(): 'authors': [ {'full_name': 'Li, Zhengxiang'}, { - 'full_name': 'Li, Zheng-Xiang', 'affiliations': [ - {'value': 'Beijing Normal U.'} - ] - } + 'full_name': 'Li, Zheng-Xiang', + 'affiliations': [{'value': 'Beijing Normal U.'}], + }, ] } - expected_conflict = [{ - 'path': '/authors/1', - 'op': 'remove', - 'value': None, - '$type': 'REMOVE_FIELD' - }] + expected_conflict = [ + {'path': '/authors/1', 'op': 'remove', 'value': None, '$type': 'REMOVE_FIELD'} + ] merged, conflict = merge(root, head, update, head_source='arxiv') assert merged == expected_merged diff --git a/tests/unit/test_postprocess.py b/tests/unit/test_postprocess.py index a2ac119..530f836 100644 --- a/tests/unit/test_postprocess.py +++ b/tests/unit/test_postprocess.py @@ -21,15 +21,16 @@ # or submit itself to any jurisdiction. from __future__ import absolute_import, division, print_function -from inspire_json_merger.postprocess import _insert_to_list, _additem, _process_author_manual_merge_conflict +from inspire_json_merger.postprocess import ( + _additem, + _insert_to_list, + _process_author_manual_merge_conflict, +) from inspire_json_merger.utils import ORDER_KEY def test_insert_to_list_when_position_provided_insode_item(): - item_to_insert = { - "full_name": "INSERTED", - ORDER_KEY: 1 - } + item_to_insert = {"full_name": "INSERTED", ORDER_KEY: 1} objects_list = [ {"full_name": "First", ORDER_KEY: 0}, @@ -42,7 +43,7 @@ def test_insert_to_list_when_position_provided_insode_item(): {'full_name': 'First', ORDER_KEY: 0}, {'full_name': 'Second', ORDER_KEY: 1}, {'full_name': 'INSERTED', ORDER_KEY: 1}, - {'full_name': 'Third', ORDER_KEY: 2} + {'full_name': 'Third', ORDER_KEY: 2}, ] insert_position, merged_objects_list = _insert_to_list(item_to_insert, objects_list) @@ -66,19 +67,18 @@ def test_insert_to_list_when_position_provided_as_parameter(): {'full_name': 'First', ORDER_KEY: 0}, {'full_name': 'Second', ORDER_KEY: 1}, {'full_name': 'INSERTED'}, - {'full_name': 'Third', ORDER_KEY: 2} + {'full_name': 'Third', ORDER_KEY: 2}, ] - insert_position, merged_objects_list = _insert_to_list(item_to_insert, objects_list, 1) + insert_position, merged_objects_list = _insert_to_list( + item_to_insert, objects_list, 1 + ) assert insert_position == expected_insert_position assert merged_objects_list == expected_merged def test_insert_to_list_when_list_without_order_key_but_item_has_it(): - item_to_insert = { - "full_name": "INSERTED", - ORDER_KEY: 1 - } + item_to_insert = {"full_name": "INSERTED", ORDER_KEY: 1} objects_list = [ {"full_name": "First"}, @@ -91,7 +91,7 @@ def test_insert_to_list_when_list_without_order_key_but_item_has_it(): {'full_name': 'First'}, {'full_name': 'Second'}, {'full_name': 'INSERTED', ORDER_KEY: 1}, - {'full_name': 'Third'} + {'full_name': 'Third'}, ] insert_position, merged_objects_list = _insert_to_list(item_to_insert, objects_list) @@ -123,10 +123,7 @@ def test_insert_to_list_when_item_is_withour_order_key(): def test_insert_to_list_when_position_exceeds_lists_elements_count(): - item_to_insert = { - "full_name": "INSERTED", - ORDER_KEY: 10 - } + item_to_insert = {"full_name": "INSERTED", ORDER_KEY: 10} objects_list = [ {"full_name": "First", ORDER_KEY: 0}, @@ -149,23 +146,12 @@ def test_insert_to_list_when_position_exceeds_lists_elements_count(): def test_add_item_on_position(): item = {"path": "new"} - object = { - "some": [ - {"path": "1"}, - {"path": "2"}, - {"path": "3"} - ] - } + object = {"some": [{"path": "1"}, {"path": "2"}, {"path": "3"}]} path = ("some", 1) expected_path = ('some', 2) expected_merged = { - 'some': [ - {'path': '1'}, - {'path': '2'}, - {'path': 'new'}, - {'path': '3'} - ] + 'some': [{'path': '1'}, {'path': '2'}, {'path': 'new'}, {'path': '3'}] } new_path, merged_object = _additem(item, object, path) @@ -175,13 +161,7 @@ def test_add_item_on_position(): def test_add_item_at_the_end(): item = {"path": "new"} - object = { - "some": [ - {"path": "1"}, - {"path": "2"}, - {"path": "3"} - ] - } + object = {"some": [{"path": "1"}, {"path": "2"}, {"path": "3"}]} path = ("some", "-") expected_path = ('some', 3) @@ -201,22 +181,12 @@ def test_add_item_at_the_end(): def test_add_item_on_position_in_dictionary(): item = {"inside": "new"} - object = { - "some": [ - {"path": "1"}, - {"path": "2"}, - {"path": "3"} - ] - } + object = {"some": [{"path": "1"}, {"path": "2"}, {"path": "3"}]} path = ("some", 1, "path") expected_path = ('some', 1, 'path') expected_merged = { - 'some': [ - {'path': '1'}, - {'path': {"inside": "new"}}, - {'path': '3'} - ] + 'some': [{'path': '1'}, {'path': {"inside": "new"}}, {'path': '3'}] } new_path, merged_object = _additem(item, object, path) @@ -227,14 +197,14 @@ def test_add_item_on_position_in_dictionary(): def test_add_item_process_single_item_without_index_when_adding_to_list(): whole_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key': ['a', 'b', 'c'] + 'key': ['a', 'b', 'c'], } item = 'd' path = ("key",) expected_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key': ['a', 'b', 'c', 'd'] + 'key': ['a', 'b', 'c', 'd'], } expected_new_path = ("key", 3) @@ -247,14 +217,14 @@ def test_add_item_process_single_item_without_index_when_adding_to_list(): def test_add_item_overwrites_whole_key_when_needed(): whole_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key': ['a', 'b', 'c'] + 'key': ['a', 'b', 'c'], } item = ['d'] path = ("key",) expected_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key': ['d'] + 'key': ['d'], } expected_new_path = ("key",) @@ -267,14 +237,17 @@ def test_add_item_overwrites_whole_key_when_needed(): def test_add_item_process_deep_item_without_index_when_adding_to_list(): whole_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key1': {'key2': ['a', 'b', 'c']} + 'key1': {'key2': ['a', 'b', 'c']}, } item = 'd' - path = ("key1", "key2", ) + path = ( + "key1", + "key2", + ) expected_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key1': {'key2': ['a', 'b', 'c', 'd']} + 'key1': {'key2': ['a', 'b', 'c', 'd']}, } expected_new_path = ("key1", "key2", 3) @@ -287,16 +260,22 @@ def test_add_item_process_deep_item_without_index_when_adding_to_list(): def test_add_deep_item_overwrites_whole_key_when_needed(): whole_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key1': {'key2': ['a', 'b', 'c']} + 'key1': {'key2': ['a', 'b', 'c']}, } item = ['d'] - path = ("key1", "key2", ) + path = ( + "key1", + "key2", + ) expected_object = { 'something': {'not_important': ['should', 'be', 'unchanged']}, - 'key1': {'key2': ['d']} + 'key1': {'key2': ['d']}, } - expected_new_path = ("key1", "key2", ) + expected_new_path = ( + "key1", + "key2", + ) new_path, new_object = _additem(item, whole_object, path) @@ -305,7 +284,11 @@ def test_add_deep_item_overwrites_whole_key_when_needed(): def test_process_author_manual_merge_conflict_when_head_in_conflict_is_none(): - conflict = (None, None, ({"conflict": "root value"}, None, {"conflict": "update value"})) + conflict = ( + None, + None, + ({"conflict": "root value"}, None, {"conflict": "update value"}), + ) merged = {"authors": []} expected_output = (None, merged, None) diff --git a/tests/unit/test_pre_filters.py b/tests/unit/test_pre_filters.py index 0b29552..8e35f70 100644 --- a/tests/unit/test_pre_filters.py +++ b/tests/unit/test_pre_filters.py @@ -22,16 +22,16 @@ from __future__ import absolute_import, division, print_function -from inspire_json_merger.utils import filter_records from inspire_json_merger.pre_filters import ( - filter_documents_same_source, + clean_root_for_acquisition_source, filter_curated_references, - filter_publisher_references, + filter_documents_same_source, filter_figures_same_source, - clean_root_for_acquisition_source, + filter_publisher_references, remove_root, - update_material + update_material, ) +from inspire_json_merger.utils import filter_records def test_filter_documents_same_source(): @@ -140,7 +140,6 @@ def test_filter_documents_remove_head_source(): 'key': 'file3.pdf', 'url': '/files/1234-1234-1234-1234/file3.pdf', }, - ], } expected_head = { @@ -304,7 +303,7 @@ def test_filter_curated_references_keeps_update_if_head_almost_equal_to_root(): 'schema': 'text', 'value': 'foo 1810.12345', }, - ] + ], }, ], } @@ -335,7 +334,7 @@ def test_filter_curated_references_keeps_update_if_head_almost_equal_to_root(): assert result == expected -def test_filter_curated_references_keeps_head_if_head_almost_equal_to_root_with_curated(): +def test_filter_curated_references_keeps_head_if_almost_equal_to_root_with_curated(): root = { 'references': [ { @@ -359,7 +358,7 @@ def test_filter_curated_references_keeps_head_if_head_almost_equal_to_root_with_ 'schema': 'text', 'value': 'foo 1810.12345', }, - ] + ], }, ], } @@ -386,7 +385,7 @@ def test_filter_curated_references_keeps_head_if_head_almost_equal_to_root_with_ 'schema': 'text', 'value': 'foo 1810.12345', }, - ] + ], }, ], } @@ -518,7 +517,7 @@ def test_filter_missing_figures_on_update_are_properly_handled(): 'label': 'fig:bflow', 'material': 'preprint', 'source': 'arxiv', - 'url': '/api/files/8e2b4d59-6870-4517-8580-35822bf12edb/w0_bflow.png' + 'url': '/api/files/8e2b4d59-6870-4517-8580-35822bf12edb/w0_bflow.png', } fig_2 = { 'caption': 'CC2', @@ -526,7 +525,7 @@ def test_filter_missing_figures_on_update_are_properly_handled(): 'label': 'fig2:bflow', 'material': 'preprint', 'source': 'other', - 'url': '/api/files/8e2b4d59-6870-4517-8888-35822bf12edb/w1_bflow.png' + 'url': '/api/files/8e2b4d59-6870-4517-8888-35822bf12edb/w1_bflow.png', } fig_3 = { 'caption': 'CC', @@ -534,19 +533,10 @@ def test_filter_missing_figures_on_update_are_properly_handled(): 'label': 'fig:bflow', 'material': 'preprint', 'source': 'arxiv', - 'url': '/api/files/8e2b4d59-6870-4517-8580-35822bf12edb/w0_bflow.png' - } - root = { - "figures": [ - fig_1, fig_2 - - ] - } - head = { - "figures": [ - fig_2, fig_3 - ] + 'url': '/api/files/8e2b4d59-6870-4517-8580-35822bf12edb/w0_bflow.png', } + root = {"figures": [fig_1, fig_2]} + head = {"figures": [fig_2, fig_3]} update = {'acquisition_source': {'source': 'arXiv'}} @@ -554,7 +544,9 @@ def test_filter_missing_figures_on_update_are_properly_handled(): expected_head = {"figures": [fig_2]} expected_update = update - new_root, new_head, new_update = filter_records(root, head, update, filters=[filter_figures_same_source]) + new_root, new_head, new_update = filter_records( + root, head, update, filters=[filter_figures_same_source] + ) assert new_root == expected_root assert new_head == expected_head assert new_update == expected_update diff --git a/tests/utils/utils.py b/tests/utils/utils.py index d4e8d65..055d325 100644 --- a/tests/utils/utils.py +++ b/tests/utils/utils.py @@ -22,8 +22,8 @@ from __future__ import absolute_import, division, print_function -import json import itertools +import json from inspire_schemas.api import load_schema, validate @@ -33,7 +33,9 @@ def assert_ordered_conflicts(conflicts, expected): json.loads(c.to_json()) for c in expected if hasattr(c, 'to_json') ] if expected_conflicts: - expected_conflicts_flat = list(itertools.chain.from_iterable(expected_conflicts)) + expected_conflicts_flat = list( + itertools.chain.from_iterable(expected_conflicts) + ) else: expected_conflicts_flat = expected # order the lists to check if they match