Release 1.1.4: replace noisy preview modes with patch denoising and fixed stretch
All checks were successful
Release AstroFrame / packages (push) Successful in 59s
All checks were successful
Release AstroFrame / packages (push) Successful in 59s
This commit is contained in:
parent
d3362c8341
commit
b8ffe97c46
17 changed files with 143 additions and 270 deletions
|
|
@ -60,11 +60,11 @@ static class ImageRegression
|
|||
}
|
||||
finally{Directory.Delete(directory,true);}
|
||||
}
|
||||
internal static void WriteFits(string path,float[] pixels,int width,int height,int n,string bayer="",int offsetX=0,int offsetY=0)
|
||||
internal static void WriteFits(string path,float[] pixels,int width,int height,int n)
|
||||
{
|
||||
string Card(string key,string value)=>(key.PadRight(8)+"= "+value).PadRight(80);
|
||||
string date=new DateTime(2026,9,20,8,0,0,DateTimeKind.Utc).AddSeconds(n*30).ToString("yyyy-MM-ddTHH:mm:ss",CultureInfo.InvariantCulture);
|
||||
string header=Card("SIMPLE","T")+Card("BITPIX","-32")+Card("NAXIS","2")+Card("NAXIS1",width.ToString())+Card("NAXIS2",height.ToString())+Card("EXPTIME","30")+Card("OBJECT","'Synthetic field'")+Card("DATE-OBS",$"'{date}'")+(bayer==""?"":Card("BAYERPAT",$"'{bayer}'")+Card("XBAYROFF",offsetX.ToString())+Card("YBAYROFF",offsetY.ToString()))+"END".PadRight(80);
|
||||
string header=Card("SIMPLE","T")+Card("BITPIX","-32")+Card("NAXIS","2")+Card("NAXIS1",width.ToString())+Card("NAXIS2",height.ToString())+Card("EXPTIME","30")+Card("OBJECT","'Synthetic field'")+Card("DATE-OBS",$"'{date}'")+"END".PadRight(80);
|
||||
using var stream=File.Create(path);stream.Write(Encoding.ASCII.GetBytes(header.PadRight((header.Length+2879)/2880*2880)));
|
||||
byte[] row=new byte[width*4];for(int y=0;y<height;y++){for(int x=0;x<width;x++)BinaryPrimitives.WriteInt32BigEndian(row.AsSpan(x*4,4),BitConverter.SingleToInt32Bits(pixels[y*width+x]));stream.Write(row);}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue