-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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