<commit_before>"""
desitarget.too
==============

Targets of Opportunity.

.. _`moving average`: https://stackoverflow.com/a/14314054
.. _`rolling sum`: https://stackoverflow.com/a/28288535
"""
import os
import numpy as np
from astropy.table import Table

from desiutil.log import get_logger

from desitarget import io
# ADM the data model for ToO, similar to that of secondary targets...
from desitarget.secondary import indatamodel
from desitarget.secondary import outdatamodel
# ADM ...but the OVERRIDE column isn't necessary...
indtype = [tup for tup in indatamodel.dtype.descr if "OVERRIDE" not in tup]
outdtype = [tup for tup in outdatamodel.dtype.descr if "OVERRIDE" not in tup]
# ADM ...and some extra columns are necessary.
indatamodel = np.array([], dtype=indtype + [
    ('CHECKER', '>U3'), ('TOO_TYPE', '>U5'), ('OCLAYER', '>U6'),
    ('MJD_BEGIN', '>f8'), ('MJD_END', '>f8')])
outdatamodel = np.array([], dtype=outdtype + [
    ('CHECKER', '>U3'), ('TOO_TYPE', '>U5'), ('OCLAYER', '>U6'),
    ('MJD_BEGIN', '>f8'), ('MJD_END', '>f8')])

# ADM when using basic or csv ascii writes, specifying the formats of
# ADM float32 columns can make things easier on the eye.
tooformatdict = {"PARALLAX": '%16.8f', 'PMRA': '%16.8f', 'PMDEC': '%16.8f'}

# ADM This RELEASE means Target of Opportunity in TARGETID.
release = 9999

# ADM Constraints on how many ToOs are allowed in a given time period.
# ADM dictionary keys are total nights, dictionary vals are total fibers.
# ADM so, e.g., 365: 500 means no more than 500 fibers per year.
# ADM There are separate allocations for tile and fiber overrides.
constraints = {"FIBER": {1: 2, 30: 50, 365: 500},
               "TILE": {1: 5000, 30: 5000, 365: 10000}}<commit_msg>add a bespoke TOOID to the ToO ledger<commit_after>"""
desitarget.too
==============

Targets of Opportunity.

.. _`moving average`: https://stackoverflow.com/a/14314054
.. _`rolling sum`: https://stackoverflow.com/a/28288535
"""
import os
import numpy as np
from astropy.table import Table

from desiutil.log import get_logger

from desitarget import io
# ADM the data model for ToO, similar to that of secondary targets...
from desitarget.secondary import indatamodel
from desitarget.secondary import outdatamodel
# ADM ...but the OVERRIDE column isn't necessary...
indtype = [tup for tup in indatamodel.dtype.descr if "OVERRIDE" not in tup]
outdtype = [tup for tup in outdatamodel.dtype.descr if "OVERRIDE" not in tup]
# ADM ...and some extra columns are necessary.
indatamodel = np.array([], dtype=indtype + [
    ('CHECKER', '>U3'), ('TOO_TYPE', '>U5'), ('OCLAYER', '>U6'),
    ('TOOID', '>i4'), ('MJD_BEGIN', '>f8'), ('MJD_END', '>f8')])
outdatamodel = np.array([], dtype=outdtype + [
    ('CHECKER', '>U3'), ('TOO_TYPE', '>U5'), ('OCLAYER', '>U6'),
    ('TOOID', '>i4'), ('MJD_BEGIN', '>f8'), ('MJD_END', '>f8')])

# ADM when using basic or csv ascii writes, specifying the formats of
# ADM float32 columns can make things easier on the eye.
tooformatdict = {"PARALLAX": '%16.8f', 'PMRA': '%16.8f', 'PMDEC': '%16.8f'}

# ADM This RELEASE means Target of Opportunity in TARGETID.
release = 9999

# ADM Constraints on how many ToOs are allowed in a given time period.
# ADM dictionary keys are total nights, dictionary vals are total fibers.
# ADM so, e.g., 365: 500 means no more than 500 fibers per year.
# ADM There are separate allocations for tile and fiber overrides.
constraints = {"FIBER": {1: 2, 30: 50, 365: 500},
               "TILE": {1: 5000, 30: 5000, 365: 10000}}
{'fraction_non_alphanumeric': 0.1556442417331813, 'fraction_numerical': 0.046750285062713795, 'mean_word_length': 4.30060422960725, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '194203', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1221, 'n_words': 436}