Facility Modules (JCMT)

hedwig.facility.jcmt.calculator_heterodyne

class hedwig.facility.jcmt.calculator_heterodyne.ReceiverInfo
_fields = ()
class hedwig.facility.jcmt.calculator_heterodyne.ReceiverInfoID(id, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('id', 'available')
classmethod _make(iterable)

Make a new ReceiverInfoID object from a sequence or iterable

_replace(**kwds)

Return a new ReceiverInfoID object replacing specified fields with new values

available

Alias for field number 1

id

Alias for field number 0

class hedwig.facility.jcmt.calculator_heterodyne.MappingMode(id, name, sw_modes)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('id', 'name', 'sw_modes')
classmethod _make(iterable)

Make a new MappingMode object from a sequence or iterable

_replace(**kwds)

Return a new MappingMode object replacing specified fields with new values

id

Alias for field number 0

name

Alias for field number 1

sw_modes

Alias for field number 2

class hedwig.facility.jcmt.calculator_heterodyne.SwitchingMode(id, name)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('id', 'name')
classmethod _make(iterable)

Make a new SwitchingMode object from a sequence or iterable

_replace(**kwds)

Return a new SwitchingMode object replacing specified fields with new values

id

Alias for field number 0

name

Alias for field number 1

class hedwig.facility.jcmt.calculator_heterodyne.ACSISMode(name, freq_res, array_only)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'freq_res', 'array_only')
classmethod _make(iterable)

Make a new ACSISMode object from a sequence or iterable

_replace(**kwds)

Return a new ACSISMode object replacing specified fields with new values

array_only

Alias for field number 2

freq_res

Alias for field number 1

name

Alias for field number 0

class hedwig.facility.jcmt.calculator_heterodyne.RVSystem(id, name, no_unit)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('id', 'name', 'no_unit')
classmethod _make(iterable)

Make a new RVSystem object from a sequence or iterable

_replace(**kwds)

Return a new RVSystem object replacing specified fields with new values

id

Alias for field number 0

name

Alias for field number 1

no_unit

Alias for field number 2

class hedwig.facility.jcmt.calculator_heterodyne.HeterodyneCalculator(*args)
CALC_TIME = 1
CALC_RMS_FROM_ELAPSED_TIME = 2
CALC_RMS_FROM_INT_TIME = 3
modes = {1: ('time', 'Time required for target RMS'), 2: ('rms_el', 'RMS expected in elapsed time'), 3: ('rms_int', 'RMS for integration time per point')}
_map_modes = {'grid': (<Mock name='mock.HeterodyneITC.GRID' id='140070916040400'>, 'Grid', None), 'jiggle': (<Mock name='mock.HeterodyneITC.JIGGLE' id='140070916039696'>, 'Jiggle', None), 'raster': (<Mock name='mock.HeterodyneITC.RASTER' id='140070916039376'>, 'Raster', None)}
switch_modes = {'bmsw': (<Mock name='mock.HeterodyneITC.BMSW' id='140070916040592'>, 'Beam'), 'frsw': (<Mock name='mock.HeterodyneITC.FRSW' id='140070916041488'>, 'Frequency'), 'pssw': (<Mock name='mock.HeterodyneITC.PSSW' id='140070916040976'>, 'Position')}
acsis_modes = {1: ('250 MHz', 0.0305, False), 2: ('400 MHz', 0.061, True), 3: ('1000 MHz', 0.488, False), 4: ('1600 MHz', 0.977, True)}
rv_systems = {'opt': (<Mock name='mock.HeterodyneITC.RV_DEF_OPT' id='140070916041616'>, 'optical', False), 'rad': (<Mock name='mock.HeterodyneITC.RV_DEF_RAD' id='140070916041872'>, 'radio', False), 'z': (None, 'redshift', True)}
version = 3
classmethod get_code()

Get the calculator “code”.

This is a short string used to uniquely identify the calculator within the facility which uses it.

get_name()
get_calc_version()
get_custom_routes()

Get list of custom routes used by this calculator.

get_inputs(mode, version=None)

Get the list of calculator inputs for a given version of the calculator.

get_default_input(mode)

Get the default input values (for the current version).

format_input(inputs, values)

Format input values for display in the input form.

get_form_input(inputs, form)

Extract the input values from the submitted form.

convert_input_mode(mode, new_mode, input_)

Convert the inputs for one mode to form a suitable set of inputs for another mode. Only called if the mode is changed.

convert_input_version(mode, old_version, input_)

Converts the inputs from an older version so that they can be used with the current version of the calculator.

get_outputs(mode, version=None)

Get the list of calculator outputs for a given version of the calculator.

get_extra_context()

Return extra information to be given to the view template.

parse_input(mode, input_, defaults=None)

Parse inputs as obtained from the HTML form (typically unicode) and return values suitable for calculation (perhaps float).

get_receiver_by_name(receiver_name, as_object=False)

Get a receiver by name.

condense_calculation(mode, version, calculation)

Method which can be called before an existing calculation result is to be displayed in a compact form.

Takes a “CalculationExtra” object, which has “inputs”, “input”, “outputs” and “output” attributes and modifies it in place.

_condense_rv_sys(calculation, code, code_sys)
view_line_catalog(current_user, db)

View handler for line catalog query function.

This returns the line catalog (from the Heterodyne ITC module) in JSON format to make it available to the JavaScript managing the web interface.

hedwig.facility.jcmt.calculator_jcmt

class hedwig.facility.jcmt.calculator_jcmt.JCMTCalculator(facility, id_)
class PositionTypeInfo(name, no_unit)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'no_unit')
classmethod _make(iterable)

Make a new PositionTypeInfo object from a sequence or iterable

_replace(**kwds)

Return a new PositionTypeInfo object replacing specified fields with new values

name

Alias for field number 0

no_unit

Alias for field number 1

position_type = {'am': ('airmass', True), 'dec': ('declination', False), 'el': ('elevation', False), 'zen': ('zenith angle', False)}
get_tau_band(tau)

Finds the band number matching the given tau.

Returns None if a match within 0.0001 was not found.

get_form_tau(form)

Extracts the tau value from the given form.

Uses the “tau_band” select element unless “other” is selected, in which case it uses the “tau” input box.

Returns a (tau, band) tuple.

_condense_merge_values(calculation, value_tuples)

Helper routine for the “condense_calculation” method.

Takes a collection of value tuples (currently assumed to be pairs). Then updates the calculation to merge the two values in each of those pairs.

_condense_tau_band(calculation, code)

Helper routine for the “condense_calculation” method.

Replaces an opacity value with a weather band if one can be identified.

Parameters:
  • calculation – calculation object to modify (in place)

  • code – input item code for tau value

classmethod _validate_position(pos, pos_type)

Validate the position, with the given position type, raising UserError if a problem is detected.

hedwig.facility.jcmt.calculator_scuba2

class hedwig.facility.jcmt.calculator_scuba2.SCUBA2Calculator(*args)
CALC_TIME = 1
CALC_RMS = 2
modes = {1: ('time', 'Time required for target RMS'), 2: ('rms', 'RMS expected in given time')}
version = 2
classmethod get_code()

Get the calculator “code”.

This is a short string used to uniquely identify the calculator within the facility which uses it.

get_name()
get_calc_version()
get_inputs(mode, version=None)

Get the list of calculator inputs for a given version of the calculator.

get_default_input(mode)

Get the default input values (for the current version).

format_input(inputs, values)

Format input values for display in the input form.

get_form_input(inputs, form)

Extract the input values from the submitted form.

convert_input_mode(mode, new_mode, input_)

Convert the inputs for one mode to form a suitable set of inputs for another mode. Only called if the mode is changed.

convert_input_version(mode, old_version, input_)

Converts the inputs from an older version so that they can be used with the current version of the calculator.

get_outputs(mode, version=None)

Get the list of calculator outputs for a given version of the calculator.

get_extra_context()

Return extra information to be given to the view template.

parse_input(mode, input_, defaults=None)

Parse inputs as obtained from the HTML form (typically unicode) and return values suitable for calculation (perhaps float).

condense_calculation(mode, version, calculation)

Method which can be called before an existing calculation result is to be displayed in a compact form.

Takes a “CalculationExtra” object, which has “inputs”, “input”, “outputs” and “output” attributes and modifies it in place.

hedwig.facility.jcmt.control

class hedwig.facility.jcmt.control.JCMTPart
get_jcmt_alloc_options(proposal_id)

Retrieve the JCMT allocation options for a given proposal.

get_jcmt_call_options(call_id)

Retrieve the JCMT call options for a given call.

get_jcmt_options(proposal_id)

Retrieve the JCMT proposal options for a given proposal.

get_jcmt_review(reviewer_id)

Retrieve the JCMT-specific parts of a review.

search_jcmt_alloc_options(proposal_id=None)

Retrieve JCMT allocation options for one or more proposals.

search_jcmt_allocation(proposal_id)

Retrieve the observing allocations for the given proposal.

search_jcmt_available(call_id)

Retrieve information about the observing time available (normally for a given call for proposals).

search_jcmt_call_options(call_id=None)

Retrieve JCMT options for one or more calls.

search_jcmt_options(proposal_id=None)

Retrieve JCMT options for one or more proposals.

_search_jcmt_prop_alloc_opt(table, proposal_id)
search_jcmt_request(proposal_id)

Retrieve the observing requests for the given proposal.

_search_jcmt_req_alloc(table, proposal_id)

Common method to search for either requests or allocations.

search_jcmt_review(reviewer_id=None, proposal_id=None)

Search for JCMT review entries.

set_jcmt_alloc_options(proposal_id, **kwargs)

Set the JCMT proposal options for a given proposal.

set_jcmt_call_options(call_id, time_min, time_max, time_excl_free)

Set the JCMT options for a given call.

set_jcmt_options(proposal_id, **kwargs)

Set the JCMT proposal options for a given proposal.

_set_jcmt_prop_alloc_opt(table, proposal_id, target_of_opp=None, daytime=None, time_specific=None, polarimetry=None)
set_jcmt_review(role_class, reviewer_id, review_state, review)
sync_jcmt_call_available(call_id, records, _test_skip_check=False)

Update the records of the amount of time available for a call.

sync_jcmt_proposal_allocation(proposal_id, records, _test_skip_check=False)

Update the observing allocations for the given proposal to match the specified records.

sync_jcmt_proposal_request(proposal_id, records, _test_skip_check=False)

Update the observing requests for the given proposal to match the specified records.

_sync_jcmt_proposal_alloc_req(table, proposal_id, records, _test_skip_check)

Common method to sync either requests or allocations.

_exists_jcmt_review(conn, reviewer_id)

Test whether a JCMT review record exists.

hedwig.facility.jcmt.meta

hedwig.facility.jcmt.meta._request_cols()
hedwig.facility.jcmt.meta._option_cols()

hedwig.facility.jcmt.type

class hedwig.facility.jcmt.type.JCMTAvailable
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ()
classmethod _make(iterable)

Make a new JCMTAvailable object from a sequence or iterable

_replace(**kwds)

Return a new JCMTAvailable object replacing specified fields with new values

class hedwig.facility.jcmt.type.JCMTCallOptions
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ()
classmethod _make(iterable)

Make a new JCMTCallOptions object from a sequence or iterable

_replace(**kwds)

Return a new JCMTCallOptions object replacing specified fields with new values

class hedwig.facility.jcmt.type.JCMTOptions
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ()
classmethod _make(iterable)

Make a new JCMTOptions object from a sequence or iterable

_replace(**kwds)

Return a new JCMTOptions object replacing specified fields with new values

class hedwig.facility.jcmt.type.JCMTRequest
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ()
classmethod _make(iterable)

Make a new JCMTRequest object from a sequence or iterable

_replace(**kwds)

Return a new JCMTRequest object replacing specified fields with new values

class hedwig.facility.jcmt.type.JCMTReview
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ()
classmethod _make(iterable)

Make a new JCMTReview object from a sequence or iterable

_replace(**kwds)

Return a new JCMTReview object replacing specified fields with new values

class hedwig.facility.jcmt.type.JCMTRequestTotal(total, weather, instrument, total_non_free)
property instrument_total

Calculate totals by instrument, instead of by (instrument, ancillary) pair.

property instrument_grouped

Group instrument values by instrument. I.e. instead of a dictionary by (instrument, ancillary) returns a dictionary (by instrument) of sub-dictionaries by ancillary. The sub-dictionary for the unknown instrument (if present) just contains an entry for ancillary JCMTAncillary.NONE.

class hedwig.facility.jcmt.type.JCMTAffiliationType
EXPANDING = 101
_info = {1: ('Standard', True), 2: ('Excluded', False), 3: ('Shared', False), 101: ('Expanding partner program', True)}
class hedwig.facility.jcmt.type.JCMTAncillary
NONE = 0
ROVER = 1
POL2 = 2
FTS2 = 3
class AncillaryInfo(name, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'available')
classmethod _make(iterable)

Make a new AncillaryInfo object from a sequence or iterable

_replace(**kwds)

Return a new AncillaryInfo object replacing specified fields with new values

available

Alias for field number 1

name

Alias for field number 0

_info = {1: ('Rover', False), 2: ('POL-2', True), 3: ('FTS-2', False)}
class hedwig.facility.jcmt.type.JCMTCallType

Class providing information about JCMT call types.

_jcmt_info = {1: {'code': 'M', 'name': 'Regular', 'url_path': 'regular'}, 2: {'code': 'S', 'name': 'Urgent', 'name_proposal': True, 'url_path': 'urgent'}, 3: {'code': 'X'}, 4: {'code': 'R', 'name': 'Rapid Turnaround', 'name_proposal': True, 'url_path': 'rapid'}, 5: {'code': 'E'}}
_info = {1: ('M', 'Regular', True, 'regular', False, False, False, (1, 2, 6, 3, 4, 5), ()), 2: ('S', 'Urgent', True, 'urgent', True, True, False, (1, 5, 6), (1,)), 3: ('X', 'Test', True, 'test', False, True, False, (1, 2, 7, 6, 3, 4, 5), ()), 4: ('R', 'Rapid Turnaround', True, 'rapid', False, True, True, (1, 7, 6), ()), 5: ('E', 'Supplemental', True, 'supplement', False, False, False, (1, 2, 6, 3, 4, 5), ())}
override = {'code': 'X'}
role_id = 3
role_info = ('T', 'Test', True, 'test', False, True, False, (1, 2, 7, 6, 3, 4, 5), ())
class hedwig.facility.jcmt.type.JCMTInstrument
SCUBA2 = 1
HARP = 2
RXA3 = 3
RXA3M = 4
ALAIHI = 5
UU = 6
AWEOWEO = 7
KUNTUR = 8
class InstrumentInfo(name, available, ancillary)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'available', 'ancillary')
classmethod _make(iterable)

Make a new InstrumentInfo object from a sequence or iterable

_replace(**kwds)

Return a new InstrumentInfo object replacing specified fields with new values

ancillary

Alias for field number 2

available

Alias for field number 1

name

Alias for field number 0

_info = {1: ('SCUBA-2', True, (2, 3)), 2: ('HARP', True, (1,)), 3: ('RxA3', False, (1,)), 4: ('RxA3m', False, (1,)), 5: ('ʻAlaʻihi', False, ()), 6: ('ʻŪʻū', True, ()), 7: ('ʻĀweoweo', True, ()), 8: ('Kuntur', False, ())}
classmethod get_ancillary(instrument)
classmethod get_name_with_ancillary(instrument, ancillary)
classmethod get_options_with_ancillary(include_unavailable=False)
classmethod has_available_ancillary(instrument, ancillary)
class hedwig.facility.jcmt.type.JCMTAvailableCollection

Class used to represent a collection of time availability records.

validate()

Attempts to validate a collection of JCMT time availabilities.

Raises UserError is a problem is found.

get_total()

Get total by weather band.

Only weather bands currently labeled as “available” are included. Other time requested is returned with identifier zero.

class hedwig.facility.jcmt.type.JCMTOptionsCollection

Class to hold results of a search for JCMT options.

class hedwig.facility.jcmt.type.JCMTOptionValue
class OptionInfo(name, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'available')
classmethod _make(iterable)

Make a new OptionInfo object from a sequence or iterable

_replace(**kwds)

Return a new OptionInfo object replacing specified fields with new values

available

Alias for field number 1

name

Alias for field number 0

_info = {'daytime': ('Daytime observation', True), 'polarimetry': ('Polarimetry', False), 'target_of_opp': ('Target of opportunity', True), 'time_specific': ('Time-specific observation', True)}
class hedwig.facility.jcmt.type.JCMTPeerReviewerExpertise

Class representing peer reviewer expertise levels.

LITTLE_KNOL = 1
SOME_KNOL = 2
KNOWLEDGEABLE = 3
class ExpertiseInfo(name, short_name, weight, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'short_name', 'weight', 'available')
classmethod _make(iterable)

Make a new ExpertiseInfo object from a sequence or iterable

_replace(**kwds)

Return a new ExpertiseInfo object replacing specified fields with new values

available

Alias for field number 3

name

Alias for field number 0

short_name

Alias for field number 1

weight

Alias for field number 2

_info = {1: ('I know little about this field', 'Little knowledge', 50, True), 2: ('Somewhat knowledgeable about this field', 'Some knowledge', 75, True), 3: ('I consider myself knowledgeable about this field', 'Knowledgeable', 100, True)}
classmethod get_weight(expertise)
class hedwig.facility.jcmt.type.JCMTPeerReviewRating

Class representing possible outcomes of a peer review.

POOR = 1
FAIR = 2
GOOD = 3
VERY_GOOD = 4
EXCELLENT = 5
class RatingInfo(name, rating, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'rating', 'available')
classmethod _make(iterable)

Make a new RatingInfo object from a sequence or iterable

_replace(**kwds)

Return a new RatingInfo object replacing specified fields with new values

available

Alias for field number 2

name

Alias for field number 0

rating

Alias for field number 1

_info = {1: ('Poor', 0, True), 2: ('Fair', 25, True), 3: ('Good', 50, True), 4: ('Very good', 75, True), 5: ('Excellent', 100, True)}
classmethod get_rating(rating)
class hedwig.facility.jcmt.type.JCMTRequestCollection

Class used for collections of JCMT requests. Also used for JCMT allocations (by the time allocation committee) since these have the same structure.

validate()

Attempts to validate a collection of JCMT observing requests.

Raises UserError is a problem is found.

to_table()

Rearrange the records into a table by instrument and weather band.

Returns: ResultTable(table, weather bands, instruments)

Where:
  • table is a nested dictionary of time by instrument and band, with additional “total” figures having identifier None. Totals by band (i.e. instrument=None) are only added if there is more than one instrument. Instruments are identified by a (instrument, ancillary) pair.

  • bands is an ordered dictionary of band names by identifier for bands present in the table and currently available bands.

  • instruments is an ordered dictionary of instruments by identifier for instruments present in the table only.

get_total(include_unavailable_instrument=False, include_unavailable_weather=False)

Get total by instrument and weather band.

Only instruments and weather bands currently labeled as “available” are included. Other time requested is returned with identifier None.

Instruments are identified by a (instrument, ancillary) pair.

get_total_by_weather(include_unavailable_instrument=False, include_unavailable_weather=False)

Return totals by weather band.

The “weather” and “total_non_free” properties of the total objects are not filled in.

to_sorted_list()

Get sorted list with weather/instrument as names.

The collection is returned as a sorted list of JCMTRequest objects with the instrument and weather entries replaced by the names of the corresponding instrument (including ancillary) and weather band.

class hedwig.facility.jcmt.type.JCMTReviewerExpertise

Class representing reviewer expertise levels.

NON_EXPERT = 1
INTERMEDIATE = 2
EXPERT = 3
class ExpertiseInfo(name, weight, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'weight', 'available')
classmethod _make(iterable)

Make a new ExpertiseInfo object from a sequence or iterable

_replace(**kwds)

Return a new ExpertiseInfo object replacing specified fields with new values

available

Alias for field number 2

name

Alias for field number 0

weight

Alias for field number 1

_info = {1: ('Non-expert', 50, True), 2: ('Intermediate', 75, True), 3: ('Expert', 100, True)}
classmethod get_weight(expertise)
class hedwig.facility.jcmt.type.JCMTReviewerRole

Class providing information about reviewer roles for JCMT.

class RoleInfo(name, unique, text, assessment, rating, weight, cttee, name_review, feedback_direct, feedback_indirect, note, invite, edit_rev, edit_fr, rating_hide, calc, figure, accept, display_class, url_path, help_page, review_group, jcmt_expertise, jcmt_external, jcmt_peer_expertise, jcmt_peer_rating)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'unique', 'text', 'assessment', 'rating', 'weight', 'cttee', 'name_review', 'feedback_direct', 'feedback_indirect', 'note', 'invite', 'edit_rev', 'edit_fr', 'rating_hide', 'calc', 'figure', 'accept', 'display_class', 'url_path', 'help_page', 'review_group', 'jcmt_expertise', 'jcmt_external', 'jcmt_peer_expertise', 'jcmt_peer_rating')
classmethod _make(iterable)

Make a new RoleInfo object from a sequence or iterable

_replace(**kwds)

Return a new RoleInfo object replacing specified fields with new values

accept

Alias for field number 17

assessment

Alias for field number 3

calc

Alias for field number 15

cttee

Alias for field number 6

display_class

Alias for field number 18

edit_fr

Alias for field number 13

edit_rev

Alias for field number 12

feedback_direct

Alias for field number 8

feedback_indirect

Alias for field number 9

figure

Alias for field number 16

help_page

Alias for field number 20

invite

Alias for field number 11

jcmt_expertise

Alias for field number 22

jcmt_external

Alias for field number 23

jcmt_peer_expertise

Alias for field number 24

jcmt_peer_rating

Alias for field number 25

name

Alias for field number 0

name_review

Alias for field number 7

note

Alias for field number 10

rating

Alias for field number 4

rating_hide

Alias for field number 14

review_group

Alias for field number 21

text

Alias for field number 2

unique

Alias for field number 1

url_path

Alias for field number 19

weight

Alias for field number 5

_jcmt_default_info = (False, False, False, False)
_jcmt_info = {2: ((False, True, False, False), {'accept': True}), 3: ((True, False, False, False), {'name': 'TAC Primary', 'weight': False}), 4: ((True, False, False, False), {'name': 'TAC Secondary', 'unique': True, 'weight': False}), 5: ((True, False, False, False), {'name': 'Rating', 'name_review': False, 'url_path': 'rating', 'weight': False}), 7: ((False, False, True, True), {'rating': False, 'weight': False})}
_info = {1: ('Technical', True, True, True, False, False, False, True, False, False, True, False, True, True, False, True, True, False, 'tech', 'technical', 'technical', 2, False, False, False, False), 2: ('External', False, True, False, True, False, False, True, False, False, False, True, True, False, False, False, False, True, 'ext', 'external', 'external', None, False, True, False, False), 3: ('TAC Primary', True, True, False, True, False, True, True, True, False, True, False, True, True, True, False, False, False, 'cttee', 'committee', 'committee', 1, True, False, False, False), 4: ('TAC Secondary', True, True, False, True, False, True, True, False, True, True, False, True, True, True, False, False, False, 'cttee', None, 'committee', None, True, False, False, False), 5: ('Rating', False, True, False, True, False, True, False, False, False, True, False, True, True, True, False, False, False, 'cttee', 'rating', 'committee', None, True, False, False, False), 6: ('Feedback', True, True, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, 'feedback', 'feedback', None, None, False, False, False, False), 7: ('Peer', False, True, False, False, False, False, True, False, False, False, False, True, False, False, False, False, True, 'ext', 'peer', 'peer', -1, False, False, True, True)}
extra = (False, False, False, False)
override = {}
role_id = 6
role_info = ('Feedback', True, True, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, 'feedback', 'feedback', None, None)
class hedwig.facility.jcmt.type.JCMTReviewRatingJustification
class RatingInfo(name, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'available')
classmethod _make(iterable)

Make a new RatingInfo object from a sequence or iterable

_replace(**kwds)

Return a new RatingInfo object replacing specified fields with new values

available

Alias for field number 1

name

Alias for field number 0

_info = {1: ('Extremely thorough and compelling', True), 2: ('Convincing and well described', True), 3: ('Adequate, with minor problems', True), 4: ('Inadequate (too brief, confusing, incomplete or incorrect)', True)}
class hedwig.facility.jcmt.type.JCMTReviewRatingTechnical
class RatingInfo(name, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'available')
classmethod _make(iterable)

Make a new RatingInfo object from a sequence or iterable

_replace(**kwds)

Return a new RatingInfo object replacing specified fields with new values

available

Alias for field number 1

name

Alias for field number 0

_info = {1: ('Thorough and clearly understood', True), 2: ('Correct and well described', True), 3: ('Adequate, with minor problems', True), 4: ('Inadequately described or poorly understood', True)}
class hedwig.facility.jcmt.type.JCMTReviewRatingUrgency
class RatingInfo(name, available)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'available')
classmethod _make(iterable)

Make a new RatingInfo object from a sequence or iterable

_replace(**kwds)

Return a new RatingInfo object replacing specified fields with new values

available

Alias for field number 1

name

Alias for field number 0

_info = {1: ('Timely and competitive: must be done now', True), 2: ('Should be done now', False), 3: ('Urgency is not a major consideration', True)}
class hedwig.facility.jcmt.type.JCMTTextRole

Class providing information about proposal text roles for JCMT.

PR_SUMMARY = 101
class RoleInfo(name, code, url_path, proposal_section)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'code', 'url_path', 'proposal_section')
classmethod _make(iterable)

Make a new RoleInfo object from a sequence or iterable

_replace(**kwds)

Return a new RoleInfo object replacing specified fields with new values

code

Alias for field number 1

name

Alias for field number 0

proposal_section

Alias for field number 3

url_path

Alias for field number 2

_info = {1: ('Abstract', 'abst', None, None), 2: ('Technical Justification', 'tech', 'technical', 'technical_case'), 3: ('Scientific Justification', 'sci', 'scientific', 'science_case'), 4: ('Note on Tool Results', 'tool', None, None), 5: ('Continuation Request Description', 'cnrq', 'continuation', 'continuation_request'), 101: ('Public Summary', 'pr', None, None)}
class hedwig.facility.jcmt.type.JCMTWeather
BAND1 = 1
BAND2 = 2
BAND3 = 3
BAND4 = 4
BAND5 = 5
class WeatherInfo(name, available, rep, min, max, free)
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('name', 'available', 'rep', 'min', 'max', 'free')
classmethod _make(iterable)

Make a new WeatherInfo object from a sequence or iterable

_replace(**kwds)

Return a new WeatherInfo object replacing specified fields with new values

available

Alias for field number 1

free

Alias for field number 5

max

Alias for field number 4

min

Alias for field number 3

name

Alias for field number 0

rep

Alias for field number 2

_info = {1: ('Band 1', True, 0.045, None, 0.05, False), 2: ('Band 2', True, 0.065, 0.05, 0.08, False), 3: ('Band 3', True, 0.1, 0.08, 0.12, False), 4: ('Band 4', True, 0.16, 0.12, 0.2, False), 5: ('Band 5', True, 0.25, 0.2, None, True)}
classmethod get_available()

hedwig.facility.jcmt.view

class hedwig.facility.jcmt.view.JCMT(id_)
classmethod get_code()

Get the facility “code”.

This is a short string to uniquely identify the facility. It will correspond to an entry in the “facility” table.

get_name()

Get the name of the facility.

get_affiliation_types()

Get the affiliation type enum-style class to be used with this facility.

get_call_types()

Get the call type enum-style class to be used with this facility.

get_text_roles()

Get the text roles enum-style class to be used with this facility.

get_reviewer_roles()

Get the reviewer roles enum-style class to be used with this facility.

get_custom_filters()

Return list of custom template filter functions.

These will be registed with the web application with their names prefixed with the facility code and an underscore.

get_custom_routes()

Return list of custom routes required for this facility.

Note that the route information will automatically be prefixed as follows:

  • template: <facility code>/

Returns:

a list of RouteInfo tuples

get_proposal_order(type_=None)

Get a list of proposal sections in the order in which they should be shown.

get_observing_info()

Get observing information.

make_proposal_code(db, proposal)

Generate the proposal identifying code for a given proposal.

This should be overridden by sub-classes to apply the naming scheme in use at each facility.

_parse_proposal_code(proposal_code)

Perform the parsing step of processing a proposal code.

This splits the code into the semester code, queue code and proposal number.

get_calculator_classes()

Get a tuple of calculator classes which can be used with this facility.

Sub-classes should override this method to provide the correct list of calculators.

make_archive_search_urls(coord, public=True)

Make an URL to search the JSA at CADC.

make_proposal_info_urls(proposal_code)

Generate an additional links to CADC for a given proposal code.

make_review_guidelines_url(role)

Make an URL for the guidelines page in the included documentation, if the role is external or feedback.

get_review_rating_weight_function()

Get the numerical rating and weight of a review.

Returns:

a (rating, weight) tuple. If either value is None then the review should not be included in the overall rating.

calculate_affiliation_assignment(db, members, affiliations)

Calculate the fractional affiliation assignment for the members of a proposal.

This acts like the Generic method which it overrides but applies the JCMT affiliation assignment rules.

_copy_proposal(current_user, db, old_proposal, proposal, *args, **kwargs)
_copy_proposal_request(notes, current_user, db, old_proposal, proposal, is_continuation=False)
_continue_proposal(current_user, db, old_proposal, proposal, *args, **kwargs)
_view_call_extra(db, call)
_view_call_edit_copy(db, call_orig)
_view_call_edit_get(db, call, form)
_view_call_edit_save(db, call, info)
_view_call_edit_extra(db, call, info)
_view_proposal_extra(current_user, db, proposal, auth_cache=None)

Method to gather additional information for the proposal view page.

Sub-classes can override this method to add additional information to the proposal.

_get_option_names(option_values)
_view_proposal_feedback_extra(current_user, db, proposal, can)

Method to gather additional information for the proposal feedback page.

_validate_proposal_extra(db, proposal, extra, proposal_order)
_get_proposal_tabulation(current_user, db, call, can, with_extra=False)

Prepare information for the detailed tabulation of proposals.

This is used to prepare the information both for the online version and the downloadable CSV file. For the CSV file, the with_extra option is enabled and additional information, beyond that which can be displayed on the online version, is retrieved.

_get_proposal_tabulation_titles(tabulation)
_get_proposal_tabulation_rows(tabulation)
_get_review_call_allocation(db, call, can)
_get_review_call_allocation_dynamic(db, call, can, proposals)

Get dynamic information, including total time (hours) for each proposal.

This method should be overridden by subclasses to return the most suitable representative total time for each proposal. For example this could be the total allocation, falling back to the total request if no allocation has yet been assigned.

view_request_edit(current_user, db, proposal, can, form)
_get_option_default(proposal)
_read_option_form(form, option_values)
_read_request_form(proposal, form, skip_blank_time=False)

Read a set of JCMT observing requests (or time allocations) from the form and return as a JCMTRequestCollection object.

Can optionally skip entries with blank times, rather than leaving them as non-floats to cause an error to be raised later.

_view_review_edit_get(db, reviewer, proposal, form)

Read JCMT-specific review form values.

Returns:

a JCMTReview object.

Raises:

HTTPError – if a serious parsing error occurs.

_view_review_edit_save(db, reviewer, proposal, info)

Save JCMT-specific review parts.

Raises:

UserError – in the event of a problem with the input.

_view_review_edit_extra(db, reviewer, proposal, info)

Placeholder for facility-specific method to generate extra information to show in the proposal edit page.

info will be the object returned by _view_review_edit_get if a POST is being handled, or None otherwise.

_view_proposal_decision_get(db, proposal, form)

Read the JCMT observing allocation from the form without raising parsing errors yet.

_view_proposal_decision_save(db, proposal, info)

Store the JCMT observing allocation.

_view_proposal_decision_extra(db, proposal, info)

Generate template context for the JCMT allocation on the decision page.

_view_review_call_available_get(db, call, form)
_view_review_call_available_save(db, call, info)
_view_review_call_available_extra(db, call, info)
attach_review_extra(db, proposals)

Attach JCMT review information to each review associated with the given collection of proposals.

get_feedback_extra(db, proposal)

Get additional context to include in the proposal feedback email message.

Retrieves the proposal’s time allocation for display in the message. The allocation is returned as a sorted list of JCMTRequest objects with the instrument and weather entries replaced by the names of the corresponding instrument and weather band.

view_pr_summary_edit(current_user, db, proposal, can, form)