Problems while trying to create a new LSST obs packag

Thank you!

The topic is Problems while trying to create a new LSST obs packag, And the DECam mentioned above is for reference to create a new obs_package.

And I created an obs_ZTF to process the ZTF image aiming at learning the pipeline, the Pixel Scale: 0.263498 arcsec/pixel above is get by the image ingested with the obs_ZTF.

And in another package obs_wfst I created, the same problem occured again:

The header of the image:

SIMPLE  =                    T / conforms to FITS standard                      
BITPIX  =                  -64 / array data type                                
NAXIS   =                    2 / number of array dimensions                     
NAXIS1  =                 9216                                                  
NAXIS2  =                 9232                                                  
EXTEND  =                    T                                                  
CRPIX1  =               4608.5                                                  
CRPIX2  =               4616.5                                                  
CRVAL1  =                  180                                                  
CRVAL2  =                   36                                                  
CD1_1   = 9.16666666666666E-05                                                  
CD1_2   =                    0                                                  
CD2_1   =                    0                                                  
CD2_2   = 9.16666666666666E-05                                                  
CTYPE1  = 'RA---TAN'                                                            
CTYPE2  = 'DEC--TAN'                                                            
EXPTIME =                   30                                                  
DARKTIME=                   30                                                  
AIRMASS =                    1                                                  
EXP-ID  = 'WFST00000060'                                                        
OBJECT  = '9999    '                                                            
CCDNUM  =                    4                                                  
HUMIDITY=                   20                                                  
OUTTEMP =                   20                                                  
PRESSURE=                621.6                                                  
INSTRUME= 'WFST    '                                                            
FILTER  = 'WFST-G  '                                                            
DATE-OBS= '2022-09-27'                                                          
UT-STR  = '10:55:27.728'                                                        
UT-END  = '10:55:57.728'                                                        
DATA-TYP= 'object  '                                                            
RA2000  =                  180                                                  
DEC2000 =                   36                                                  
ALTITUDE=                    0                                                  
AZIMUTH =                    0         

The pixel scale by the wcs of LSST pipeline:

FITS standard SkyWcs:
Sky Origin: (180.0000000000, +36.0000000000)
Pixel Origin: (4607.5, 4615.5)
Pixel Scale: 0.175665 arcsec/pixel

which should be 0.33(3600*9.16e-5 )?
It’s that normal? I guess it’s related to I have set something wrong in my obs_package?

Thank you!

Hello!
What you have said is correct, the value Pixel Scale: 0.263498 arcsec/pixel is indeed related to the DECam, since I write the package based on the obs_decam, and the above question is caused by the following code in camera.py:

# Name of native coordinate system
config.transformDict.nativeSys = 'FocalPlane'

config.transformDict.transforms = {}
config.transformDict.transforms['FieldAngle'] = lsst.afw.geom.transformConfig.TransformConfig()
config.transformDict.transforms['FieldAngle'].transform['multi'].transformDict = None
# x, y translation vector
config.transformDict.transforms['FieldAngle'].transform['affine'].translation = [0.0, 0.0]

# 2x2 linear matrix in the usual numpy order;
#             to rotate a vector by theta use: cos(theta), sin(theta), -sin(theta), cos(theta)
config.transformDict.transforms['FieldAngle'].transform['affine'].linear = [1.0, 0.0, 0.0, 1.0]

# Coefficients for the radial polynomial; coeff[0] must be 0
config.transformDict.transforms['FieldAngle'].transform['radial'].coeffs = [
    0.0, 8.516497674138379e-05, 0.0, -4.501399132955917e-12]

config.transformDict.transforms['FieldAngle'].transform.name = 'radial'

I didn’t fully understand the code above when I wrote the package a long time ago, and copied that of the DECam.
If they are any tutorial about how to set these value? And if there are any article or website introducing these transform and the exact meaning of these term(for example FieldAngle) used in the coordinate describe the camera?
Thank you!

That code is how you define the camera geometry. We are currently migrating away from that scheme to something based on YAML.

We needed something a bit more flexible for LSSTCam. This is also not really documented though.

cc/ @leanne

Hello,
Recently I want to process the CCD with different division methods to test which divison is better,
The distortion is only related to the radius, but the correct match is mainly concentrate in the bottom left part of the image:

And seems like the TAN-SIP can’t descirbe the top right area well,
Figure_1

So I want to divide the image into some smaller part, (our CCDs is 9k * 9k with 16 amplifier 1k * 4k). I also want to know If it’s useless to divide them?
And the way I think that can achieve this aim is to modify the description of CCDs in camery.py and the file about amplifier that end with .fits meanwhile. But it’s kinda troublesome to modify so much files, if exists a simpler way, for example to modify something in isrTask.py or assemebkeCcdTask.py that can achieve these too?
Thank you!

Another question is about the transforms, I have read some material about camera gemotry, and transform[‘affine’] here is a model that make every pixel in the FocalPlane have the same pixel scale,
For example, if I set the

config.transformDict.transforms['FieldAngle'].transform['affine'].linear = [1.0, 0.0, 0.0, 1.0]

And will get:

Pixel Scale: 2062.57 arcsec/pixel
CdMatrix:[[0.5729578,0.],[0.,0.5729578]]

And since

0.5729578 * 3600 = 2062.64808 #more similar to 206.265

So, I guess the 2062.57 arcsec/pixel is a more approximate value, And 0.5729578 is more precise, is it?

As for the transform['radial'], I am not certain about it’s meaning, since there are different defination about radial distortion in different article,
I guess you use

x0 = x1(1+k1*r+k2*r**2+k3*r**3+k4*r**4......)

Where x0 is the corrected coordinate, and x1 is the distorted coordinate here. Is it right?

Also, I want to know, How to give a more accurate description about camera gemetry? For example, if the distortion changes in different directions? And there are many instruments use self-calibrate which create an accurate instrument model about gemotry distortion and so on, and use externel reference only to calibrate shift, rotation, and scale). Where should I modify if I want to do calibrate with an instrument model like that before match?(for example, an instrument model composed of precise gemotry distortion in different directions).
Thank you!

Hello!

By tediously modify the descriptions of CCDs in camery.py and the file about amplifier that end with .fits, I divided the CCDs into 4 parts, and it indeed improve the calibrate results(The distortion is a piecewise cubic spline, only related with raidus, and is about 100 pixels large at the edge of the CCD):
Before divide:
Figure 2023-04-09 110046

After divide(composed of 4 parts):
Figure 2023-04-09 110839

One part of the picture:
4_3

Any advice you give will be helpful,

Thank you!

Given the size of your CCD one thing that was suggested to me was to increase the polynomial order for the fitting.

Also, have you considered using the YAML camera definition format for your camera geometry?