set_star_data Function

private function set_star_data(self, catalog, min_mag, max_mag, max_stars, min_size, max_size, min_dim_ratio) result(ok)

Draw the stars of catalog (found with find_data_file; '' for none) with magnitudes from min_mag to max_mag (default -2 to 8), at most max_stars (default 10000), sized from min_size to max_size window units (default 1 to 10) by brightness, the smallest dimmed to min_dim_ratio (0 to 1, default 0.5) of their color (OpenFrames' setSkySphereStarData). Returns false if the catalog cannot be read or the limits are invalid (min_mag > max_mag, max_stars < 1, min_size > max_size, a ratio outside 0 to 1).

Type Bound

SkySphere

Arguments

Type IntentOptional Attributes Name
class(SkySphere), intent(inout) :: self
character(len=*), intent(in) :: catalog

star catalog file; '' for none

real(kind=wp), intent(in), optional :: min_mag

apparent magnitudes

real(kind=wp), intent(in), optional :: max_mag

apparent magnitudes

integer, intent(in), optional :: max_stars

the most stars drawn (default 10000; >= 1)

real(kind=wp), intent(in), optional :: min_size

window units

real(kind=wp), intent(in), optional :: max_size

window units

real(kind=wp), intent(in), optional :: min_dim_ratio

0 to 1

Return Value logical


Calls

proc~~set_star_data~~CallsGraph proc~set_star_data SkySphere%set_star_data proc~make_star_node make_star_node proc~set_star_data->proc~make_star_node proc~read_stars read_stars proc~set_star_data->proc~read_stars interface~vkf_compile_node vkf_compile_node proc~make_star_node->interface~vkf_compile_node interface~vkf_node_add_child vkf_node_add_child proc~make_star_node->interface~vkf_node_add_child interface~vkf_node_delete vkf_node_delete proc~make_star_node->interface~vkf_node_delete interface~vkf_node_remove_child vkf_node_remove_child proc~make_star_node->interface~vkf_node_remove_child interface~vkf_sky_stars vkf_sky_stars proc~make_star_node->interface~vkf_sky_stars interface~vkf_sky_stars_changed vkf_sky_stars_changed proc~make_star_node->interface~vkf_sky_stars_changed interface~vkf_stars_create vkf_stars_create proc~make_star_node->interface~vkf_stars_create proc~apply_attitude apply_attitude proc~make_star_node->proc~apply_attitude proc~apply_mode apply_mode proc~make_star_node->proc~apply_mode proc~check_status check_status proc~make_star_node->proc~check_status proc~make_name_node make_name_node proc~make_star_node->proc~make_name_node proc~add_name add_name proc~read_stars->proc~add_name proc~after_fields after_fields proc~read_stars->proc~after_fields proc~find_data_file find_data_file proc~read_stars->proc~find_data_file proc~raw_size raw_size proc~read_stars->proc~raw_size proc~size_of size_of proc~read_stars->proc~size_of proc~star_to_point star_to_point proc~read_stars->proc~star_to_point proc~apply_attitude->proc~check_status interface~vkf_sky_style vkf_sky_style proc~apply_attitude->interface~vkf_sky_style interface~vkf_sky_style_changed vkf_sky_style_changed proc~apply_attitude->interface~vkf_sky_style_changed proc~quat_to_matrix quat_to_matrix proc~apply_attitude->proc~quat_to_matrix proc~apply_mode->proc~check_status interface~vkf_switch_set vkf_switch_set proc~apply_mode->interface~vkf_switch_set proc~find_in_dirs find_in_dirs proc~find_data_file->proc~find_in_dirs proc~make_name_node->interface~vkf_compile_node proc~make_name_node->interface~vkf_node_add_child proc~make_name_node->interface~vkf_node_delete proc~make_name_node->interface~vkf_node_remove_child proc~make_name_node->proc~apply_mode proc~make_name_node->proc~check_status interface~vkf_label_set_at_infinity vkf_label_set_at_infinity proc~make_name_node->interface~vkf_label_set_at_infinity interface~vkf_transform_create vkf_transform_create proc~make_name_node->interface~vkf_transform_create proc~apply_name_attitude apply_name_attitude proc~make_name_node->proc~apply_name_attitude proc~label_create label_create proc~make_name_node->proc~label_create proc~star_to_point->proc~raw_size proc~apply_name_attitude->proc~check_status proc~apply_name_attitude->proc~quat_to_matrix interface~vkf_transform_set_matrix vkf_transform_set_matrix proc~apply_name_attitude->interface~vkf_transform_set_matrix interface~vkf_label_create vkf_label_create proc~label_create->interface~vkf_label_create proc~get_font get_font proc~label_create->proc~get_font proc~vsg_alignment vsg_alignment proc~label_create->proc~vsg_alignment interface~vkf_font_read vkf_font_read proc~get_font->interface~vkf_font_read proc~find_font find_font proc~get_font->proc~find_font proc~find_font->proc~find_in_dirs

Source Code

    logical function set_star_data(self, catalog, min_mag, max_mag, max_stars, min_size, max_size, min_dim_ratio) &
            result(ok)
        class(SkySphere), intent(inout) :: self
        character(len=*), intent(in) :: catalog             !! star catalog file; '' for none
        real(wp), intent(in), optional :: min_mag, max_mag  !! apparent magnitudes
        real(wp), intent(in), optional :: min_size, max_size  !! window units
        real(wp), intent(in), optional :: min_dim_ratio     !! 0 to 1
        integer, intent(in), optional :: max_stars          !! the most stars drawn (default 10000; >= 1)
        real(wp) :: mags(2), sizes(2), dim
        integer :: n
        mags = [self%min_mag, self%max_mag]
        if (present(min_mag)) mags(1) = min_mag
        if (present(max_mag)) mags(2) = max_mag
        sizes = [self%min_size, self%max_size]
        if (present(min_size)) sizes(1) = min_size
        if (present(max_size)) sizes(2) = max_size
        dim = self%min_dim
        if (present(min_dim_ratio)) dim = min_dim_ratio
        n = self%max_stars
        if (present(max_stars)) n = max_stars
        ok = mags(1) <= mags(2) .and. n >= 1 .and. sizes(1) <= sizes(2) .and. dim >= 0.0_wp .and. dim <= 1.0_wp
        if (.not. ok) return
        self%min_mag = mags(1)
        self%max_mag = mags(2)
        self%min_size = sizes(1)
        self%max_size = sizes(2)
        self%min_dim = dim
        self%max_stars = n
        self%catalog = trim(catalog)
        self%n_stars = 0
        if (len_trim(catalog) > 0) ok = read_stars(self)
        if (c_associated(self%root)) call make_star_node(self)
    end function set_star_data