autowisp.astrometry package — AutoWISP documentation

# autowisp.astrometry package

## Class Inheritance Diagram

Module implementing the low-level astrometry.

class autowisp.astrometry.AnmatchTransformation(trans_file=None)

  Bases: `object`

  A clas that applies transformations generated by anmatch.

  __call__(sources, save_intermediate=False)

    Return the x and y coordinates to which the given (ra, dec) project to.

    Parameters:

      - sources – The sky position to project to frame coordinates. Should have keys named ‘RA’ and ‘Dec’ in degrees.

      - save_intermediate – Should the intermediate coordinates be saved. Those are the coordinates after apllying the sky projection and before applying the polynomial transformation.

    Returns:

      The position in pixels relative to the lower left frame of the corner to which the given sky position projects under the currently defined transformation, as a numpy array with fields named ‘x’ and ‘y’. If save_intermediate is True, the result also contains fields called ‘xi’ and ‘eta’ containing the intermediate coordinates.

    Return type:

      numpy.array(dtype=[(‘x’, float), (‘y’, float)])

  __init__(trans_file=None)

    Parse the transformation to apply from the given file.

    Parameters:

      trans_file – The transformation file contaning the transformation to apply. If this is the name of an existing file, it is opened and parsed, otherwise this should be a sequence of the lines contained in the transfomation file.

    Returns:

      None

  evaluate_polynomial(projected, transformed)

    Apply the currently defined polynomial transfomation to (xi, eta).

    Parameters:

      - projected – The projected (c.f. gnomonic_projection()) coordinates to transform. Should have ‘xi’ and ‘eta’ keys containing the projected coordinates to transform in degrees.

      - transformed – A numpy array with ‘x’ and ‘y’ fields to fill with the transformed coordinates (in pixels).

    Returns:

      None

  read_anmatch_transformation(trans_lines)

    Parse the transformation to apply from the given file.

    Parameters:

      trans_lines – A sequence of the individual lines of the trans file defining the transformation to apply.

    Returns:

      None

class autowisp.astrometry.Transformation(dr_fname=None, **dr_path_substitutions)

  Bases: `object`

  A class that applies transformation stored in DR files.

  pre_projection

    One of the map projections in autowisp.astrometry.map_projections that is applied first to transform RA, Dec -> xi, eta. The latter are then projected to x, y.

    Type:

      callable

  evaluate_transformation

    Evaluator for the pre-projected catalog -> frame coordinates transformation.

    Type:

      fit_expression.Interface

  __call__(sources, save_intermediate=False, in_place=False)

    Return the projected positions of the given catalogue sources.

    Parameters:

      - sources (structured numpy array or pandas.DataFrame) – The catalogue sources to project.

      - save_intermediate (bool) – If True, the result includes the coordinate of the pre-projection, in addition to the final frame coordinates.

      - in_place (bool) – If True, the input sources are updated with the projected coordinates (sources must allow setting entries for x and y columns, also for xi and eta if save_intermediate is True).

    Returns:

      The projected source positions with labels ‘x’, ‘y’, and optionally (if save_intermediate == True) the pre-projected coordinates xi and eta. If in_place is True, return None.

    Return type:

      numpy structured array

  __init__(dr_fname=None, **dr_path_substitutions)

    Prepare to apply the transformation stored in the given DR file.

    Parameters:

      dr_fname (str) – The filename of the data reduction file to read a transformation from. If not specified, read_transformation() must be called before using this class.

    Returns:

      None

  static _create_projected_arrays(sources, save_intermediate, in_place)

    Create a numpy structured array to hold the projected sources.

  inverse(x, y, result='equatorial', **source_properties)

    Return the sky coordinates of the given source.

  read_transformation(dr_file, **dr_path_substitutions)

    Read the transformation from the given DR file (already opened).

  set_transformation(pre_projection_center, terms_expression, coefficients, pre_projection_name='tan_projection')

    Set the projection to use.

## Submodules

- autowisp.astrometry.anmatch_transformation module
  - Class Inheritance Diagram
  - `AnmatchTransformation`
    - `AnmatchTransformation.__call__()`
    - `AnmatchTransformation.__init__()`
    - `AnmatchTransformation.evaluate_polynomial()`
    - `AnmatchTransformation.read_anmatch_transformation()`
- autowisp.astrometry.astrometry module
  - Class Inheritance Diagram
  - `TempAstrometryFiles`
    - `TempAstrometryFiles.__enter__()`
    - `TempAstrometryFiles.__exit__()`
    - `TempAstrometryFiles.__init__()`
  - `create_config_file()`
  - `create_sources_file()`
  - `estimate_transformation()`
  - `estimate_transformation_from_corr()`
  - `find_ra_dec()`
  - `get_initial_corr()`
  - `get_initial_corr_local()`
  - `get_initial_corr_web()`
  - `refine_transformation()`
  - `transformation_matrix()`
- autowisp.astrometry.astrometry_max_mag_estimate module
  - Class Inheritance Diagram
  - `main()`
  - `match_sources()`
  - `parse_command_line()`
  - `query_gaia()`
  - `read_dr_file()`
- autowisp.astrometry.astrometry_net_client module
  - Class Inheritance Diagram
  - `Client`
    - `Client.annotate_data()`
    - `Client.default_url`
    - `Client.galex_plot()`
    - `Client.get_url()`
    - `Client.job_status()`
    - `Client.jobs_by_tag()`
    - `Client.login()`
    - `Client.myjobs()`
    - `Client.overlay_plot()`
    - `Client.sdss_plot()`
    - `Client.send_request()`
    - `Client.sub_status()`
    - `Client.submission_images()`
    - `Client.upload()`
    - `Client.url_upload()`
  - `MalformedResponse`
  - `RequestError`
  - `json2python()`
- autowisp.astrometry.healpix_utilities module
  - Class Inheritance Diagram
  - `square_query_vertices()`
- autowisp.astrometry.map_projections module
  - `gnomonic_projection()`
  - `inverse_gnomonic_projection()`
  - `inverse_tan_projection()`
  - `tan_projection()`
- autowisp.astrometry.transformation module
  - Class Inheritance Diagram
  - `Transformation`
    - `Transformation.pre_projection`
    - `Transformation.evaluate_transformation`
    - `Transformation.__call__()`
    - `Transformation.__init__()`
    - `Transformation._create_projected_arrays()`
    - `Transformation.inverse()`
    - `Transformation.read_transformation()`
    - `Transformation.set_transformation()`
  - `main()`
  - `parse_command_line()`