FITS-Format
Patrick Chevalley
patrick.chevalley at sig-ge.cg
Fri Feb 12 04:30:38 EST 1999
This is a multi-part message in MIME format.
--------------3D85920641F73130D46E7214
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
You can find attached here two PASCAL sample of code that I use in some of
my programs to read and write two dimension FITS image files.
This is not a general FITS library, but only simples examples and you must
add
support for the keywords you want.
I cut it from my application code and some variables or routines may be
undefined.
Patrick
Stefan Kraus wrote:
> Hello Everyone!
> I want to integrate the FITS-Format in my own Astronomy-program.
> Know anyone a URL with a PASCAL or BASIC-Sample-Source-Code for reading
> and/or writing FITS-Image-Files?
>
> Many thanks in advance...
>
> Stefan
>
> Stefan_Kraus at gmx.net
--------------3D85920641F73130D46E7214
Content-Type: application/x-unknown-content-type-DelphiUnit;
name="fits_read.pas"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="fits_read.pas"
Ly8NCi8vICBQQVNDQUwvREVMUEhJIEZpdHMgcmVhZGluZyBzYW1wbGUNCi8vDQoNCnByb2Nl
ZHVyZSBTaG93Zml0c2hlYWRlcihub20gOiBzdHJpbmc7IHZhciBvayA6IGJvb2xlYW4pOw0K
Ly8NCi8vICBEaXNwbGF5IGZpdHMgaGVhZGVyIGluIGEgbWVtbw0KLy8NCg0KcHJvY2VkdXJl
IFJlYWRmaXRzaGVhZGVyKHZhciBmIDogZmlsZTsgdmFyIGgsdyxweCA6IGludGVnZXIgO3Zh
ciBkbWluLGRtYXgsYmxhbmssYnplcm8sYnNjYWxlIDogZG91YmxlKTsNCi8vDQovLyAgIFJl
YWQgaGVhZGVyIHRvIGluaXRpYWxpemUgaW1hZ2Ugc2l6ZSBhbmQgd29ybGQgY29vcmRpbmF0
ZSANCi8vDQoNClByb2NlZHVyZSBSZWFkRml0c0ltYWdlKG5vbSA6IHN0cmluZzt2YXIgaCx3
IDppbnRlZ2VyO3ZhciBkbWluLGRtYXggOiBkb3VibGU7IHZhciBpbWEgOiBJbnRJbWFnZSk7
DQovL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0OiAgYmVnaW4N
CiAgICAgICAgICAgaWYgKG5waXggbW9kIDM2MCA9IDApIHRoZW4gYmVnaW4NCiAgICAgICAg
ICAgICBCbG9ja1JlYWQoZixkNjQsc2l6ZW9mKGQ2NCksbik7DQogICAgICAgICAgICAgbnBp
eDo9MDsNCiAgICAgICAgICAgZW5kOw0KICAgICAgICAgICBpbmMobnBpeCk7DQogICAgICAg
ICAgIHg6PUludmVydEY2NChkNjRbbnBpeF0pOw0KICAgICAgICAgICBpZiB4PWJsYW5rIHRo
ZW4geDo9MDsNCiAgICAgICAgICBlbmQ7DQogICAgLTMyOiAgYmVnaW4NCiAgICAgICAgICAg
aWYgKG5waXggbW9kIDcyMCA9IDApIHRoZW4gYmVnaW4NCiAgICAgICAgICAgICBCbG9ja1Jl
YWQoZixkMzIsc2l6ZW9mKGQzMiksbik7DQogICAgICAgICAgICAgbnBpeDo9MDsNCiAgICAg
ICAgICAgZW5kOw0KICAgICAgICAgICBpbmMobnBpeCk7DQogICAgICAgICAgIHg6PUludmVy
dEYzMihkMzJbbnBpeF0pOw0KICAgICAgICAgICBpZiB4PWJsYW5rIHRoZW4geDo9MDsNCiAg
ICAgICAgICBlbmQ7DQogICAgIDggOiAgYmVnaW4NCiAgICAgICAgICAgaWYgKG5waXggbW9k
IDI4ODAgPSAwKSB0aGVuIGJlZ2luDQogICAgICAgICAgICAgQmxvY2tSZWFkKGYsZDgsc2l6
ZW9mKGQ4KSxuKTsNCiAgICAgICAgICAgICBucGl4Oj0wOw0KICAgICAgICAgICBlbmQ7DQog
ICAgICAgICAgIGluYyhucGl4KTsNCiAgICAgICAgICAgeDo9ZDhbbnBpeF07DQogICAgICAg
ICAgIGlmIHg9YmxhbmsgdGhlbiB4Oj0wOw0KICAgICAgICAgICB4Oj1iemVybytic2NhbGUq
eDsNCiAgICAgICAgICBlbmQ7DQogICAgIDE2IDogYmVnaW4NCiAgICAgICAgICAgaWYgKG5w
aXggbW9kIDE0NDAgPSAwKSB0aGVuIGJlZ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FttYXhsLGhdKSk7
DQp3Oj10cnVuYyhtaW52YWx1ZShbbWF4bCx3XSkpOw0KbW95ZW5uZTo9c3VtL25pOw0Kc2ln
bWE6PXNxcnQoIChzdW0yL25pKS0obW95ZW5uZSptb3llbm5lKSApOw0KZW5kOw0KDQoNCg0K
DQo=
--------------3D85920641F73130D46E7214
Content-Type: application/x-unknown-content-type-DelphiUnit;
name="fits_write.pas"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="fits_write.pas"
Ly8NCi8vICBQQVNDQUwvREVMUEhJIEZpdHMgd3JpdGluZyBzYW1wbGUNCi8vDQoNCg0KdHlw
ZQ0KRklUU2hlYWRlciA9IGFycmF5IFsxLi4zNiwxLi44MF0gb2YgY2hhcjsNCkZJVFNyZWMx
NiA9IGFycmF5IFsxLi4xNDQwXSBvZiBzbWFsbGludCA7DQpGSVRTcmVjOCA9IGFycmF5IFsx
Li4yODgwXSBvZiBieXRlIDsNCg0KaW1wbGVtZW50YXRpb24NCg0KDQpWYXIgSW1nVyxJbWdI
LG5ibXAgOiBpbnRlZ2VyOw0KICAgIGltYWJtcCA6IFRiaXRtYXA7DQogICAgY29uZmlybXJl
cGxhY2UgOiBib29sZWFuOw0KDQpQcm9jZWR1cmUgV3JpdGVGSVRTKG5vbWJtcCxub20sZGF0
LHRpbSA6IHN0cmluZzsgdmFyIG9rIDogYm9vbGVhbik7DQp2YXIgaGVhZGVyIDogRklUU2hl
YWRlciA7DQogICAgYnVmMTYgICAgOiBGSVRTcmVjMTY7DQogICAgYnVmOCAgICA6IEZJVFNy
ZWM4Ow0KICAgIGZpdHNmaWxlIDogZmlsZSA7DQogICAgbixpLGosayA6IGludGVnZXI7DQog
ICAgcyA6IHNob3J0c3RyaW5nOw0KICAgIFAgOiBQYnl0ZUFycmF5Ow0KYmVnaW4NCm5vbTo9
bm9tKycuZml0JzsNCmlmIGZpbGVleGlzdHMobm9tKSBhbmQgKG5vdCBjb25maXJtcmVwbGFj
ZSkgdGhlbiBiZW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d3Jp
dGUoZml0c2ZpbGUsYnVmOCxzaXplb2YoYnVmOCksbik7DQogICAgICAgICBrOj0wOw0KICAg
ICAgZW5kOw0KICAgIGVuZCBlbHNlIGJlZ2luDQogICAgICBidWYxNltrXTo9NjMtUFtpXTsN
CiAgICAgIGJ1ZjE2W2tdOj1zd2FwKGJ1ZjE2W2tdKTsNCiAgICAgIGlmIGs9MTQ0MCB0aGVu
IGJlZ2luDQogICAgICAgICBibG9ja3dyaXRlKGZpdHNmaWxlLGJ1ZjE2LHNpemVvZihidWYx
Niksbik7DQogICAgICAgICBrOj0wOw0KICAgICAgZW5kOw0KICAgIGVuZDsNCiAgZW5kOw0K
ZW5kOw0KaWYgZm9ybTEuUmFkaW9CdXR0b24xLmNoZWNrZWQgdGhlbiBiZWdpbg0KICBpZiBr
PjAgdGhlbiBiZWdpbg0KICAgICBmb3IgaTo9aysxIHRvIDI4ODAgZG8gYnVmOFtpXTo9MDsN
CiAgICAgYmxvY2t3cml0ZShmaXRzZmlsZSxidWY4LHNpemVvZihidWY4KSxuKTsNCiAgZW5k
Ow0KZW5kIGVsc2UgYmVnaW4NCiAgaWYgaz4wIHRoZW4gYmVnaW4NCiAgICAgZm9yIGk6PWsr
MSB0byAxNDQwIGRvIGJ1ZjE2W2ldOj0wOw0KICAgICBibG9ja3dyaXRlKGZpdHNmaWxlLGJ1
ZjE2LHNpemVvZihidWYxNiksbik7DQogIGVuZDsNCmVuZDsNCmNsb3NlZmlsZShmaXRzZmls
ZSk7DQplbmQ7DQoNCg0K
--------------3D85920641F73130D46E7214--
More information about the fitsbits
mailing list