Skip to content

Instantly share code, notes, and snippets.

@msakuta
Created May 26, 2015 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msakuta/40b02451f13e4d78abe3 to your computer and use it in GitHub Desktop.
Save msakuta/40b02451f13e4d78abe3 to your computer and use it in GitHub Desktop.
reads and parses AcuA_V1.txt file that can be downloaded from http://darts.isas.jaxa.jp/astro/akari/catalogue/AcuA.html. Not tested for Matlab
function [acua] = readacua(file)
%READACUA reads and parses AcuA_V1.txt file that can be downloaded from
% http://darts.isas.jaxa.jp/astro/akari/catalogue/AcuA.html
%
% [acua] = readacua(file)
% file File path
% acua The structure array that contains following members
%
% num Asteroid number
% name Name of the asteroid
% prov_des Asteroid's provisional designation
% hmag Absolute magnitude
% diameter Diameter of the asteroid
% Albedo Mean geometric albedo
f = fopen(file, "r");
linecount = 1;
while !feof(f)
line = fgetl(f);
acua(linecount).num = sscanf(line(1:6), "%d", 1);
acua(linecount).name = line(8:25);
acua(linecount).prov_des = line(27:36);
acua(linecount).hmag = sscanf(line(38:42), "%f", 1);
acua(linecount).diameter = sscanf(line(53:59), "%f", 1);
acua(linecount).albedo = sscanf(line(67:71), "%f", 1);
linecount = linecount + 1;
end;
fclose(f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment