Do L2 SNPP SST data have a flag to distinguish day/night SST?
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Hi,
I wonder if L2 SNPP SST data have a flag to distinguish day/night SST. I don't see it in "flags_sst" or "l2_flags".
Thanks,
Jianke
I wonder if L2 SNPP SST data have a flag to distinguish day/night SST. I don't see it in "flags_sst" or "l2_flags".
Thanks,
Jianke
Filters:
-
- Subject Matter Expert
- Posts: 271
- Joined: Thu Mar 05, 2009 10:25 am America/New_York
- Been thanked: 2 times
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Every L2 file has a global attribute "day_night_flag". It is a string and has Day, Night, Mixed, or Unknown stored in it. It that what you are looking for?
don
don
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Don,
Thanks for the response. Does this mean all the the values in one granule file share the same Day, Night, or Mixed flag? Is there a pixel pinpointed day/night flag in the data?
Also does "Mixed" mean part of the data are night time and part of them are day time, but we don't know which part is day or night?
Jianke
Thanks for the response. Does this mean all the the values in one granule file share the same Day, Night, or Mixed flag? Is there a pixel pinpointed day/night flag in the data?
Also does "Mixed" mean part of the data are night time and part of them are day time, but we don't know which part is day or night?
Jianke
-
- Subject Matter Expert
- Posts: 147
- Joined: Tue Feb 09, 2021 8:19 am America/New_York
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Hi Jianke,
Yes, "Mixed" means that the scene spans the day/night terminator.
When I need to know the day/night status of a single pixel, I compare
the pixel's position vector with the solar position vector like this.
The code for the l_sun function is attached. You pass it the time
of the scan line containing the pixel of interest.
Some assembly is required, but I'm passing this along since the weekend
is here and other responses may not be forthcoming until the new week.
Regards,
Normanattachment 1
attachment 2
attachment 3
attachment 4
attachment 5
attachment 6
attachment 7
Yes, "Mixed" means that the scene spans the day/night terminator.
When I need to know the day/night status of a single pixel, I compare
the pixel's position vector with the solar position vector like this.
/* Get the solar position vector. */
l_sun(year, dayOfYear, secondOfDay, sv, &sundist);
for(p=0; p<wid; p++){
float pv[3];
double coslat = cos(lat[s][p] * PI/180);
pv[0] = coslat * cos(lon[s][p] * PI/180);
pv[1] = coslat * sin(lon[s][p] * PI/180);
pv[2] = sin(lat[s][p] * PI/180);
if(pv[0]*sv[0] + pv[1]*sv[1] + pv[2]*sv[2] > 0){
/*
If the dot product of the sun vector and the pixel
vector is greater than zero (i.e. the angle between
the two vectors is less than 90 degrees) then the
pixel is on the day side of the planet.
*/
day++;
}
else{
night++;
}
}
The code for the l_sun function is attached. You pass it the time
of the scan line containing the pixel of interest.
Some assembly is required, but I'm passing this along since the weekend
is here and other responses may not be forthcoming until the new week.
Regards,
Normanattachment 1
attachment 2
attachment 3
attachment 4
attachment 5
attachment 6
attachment 7
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Hi Norman,
Thanks for the detailed information. Very helpful. I wonder if NASA has any plan to add pixelwise day/night flag in the future. I know this is important to some users.
Jianke
Thanks for the detailed information. Very helpful. I wonder if NASA has any plan to add pixelwise day/night flag in the future. I know this is important to some users.
Jianke
-
- Subject Matter Expert
- Posts: 271
- Joined: Thu Mar 05, 2009 10:25 am America/New_York
- Been thanked: 2 times
Do L2 SNPP SST data have a flag to distinguish day/night SST?
If you want to get per pixel day/night information, run l2gen and add "solz" to the product output list. Then you will have a per pixel solz. If solz > 90, you have a nighttime pixel.
don
don
-
- Posts: 1519
- Joined: Wed Sep 18, 2019 6:15 pm America/New_York
- Been thanked: 9 times
Do L2 SNPP SST data have a flag to distinguish day/night SST?
For SST, the HISOLZEN flag bit of the l2_flags is set for solz > 90. So, if you are looking at SST products, you simply need to check the l2_flags to determine if the pixel is day or night. For ocean color products the HISOLZEN flag bit is set for solz > 70, so for those you would need to rerun outputting solz as a product or set sunzen=90.0.
Sean
Sean
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Don and Sean,
Thanks for the response, I really appreciate it. So if I use this command line
index=bitand(l2_flags,flag_Hisolzen)/flag_Hisolzen
Then index == 1 would mean nighttime, and index ==0 would mean daytime, is that right?
Thanks for the response, I really appreciate it. So if I use this command line
index=bitand(l2_flags,flag_Hisolzen)/flag_Hisolzen
Then index == 1 would mean nighttime, and index ==0 would mean daytime, is that right?
-
- Posts: 1519
- Joined: Wed Sep 18, 2019 6:15 pm America/New_York
- Been thanked: 9 times
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Great. Thanks for all the help. I really appreciate it.
Best wishes,
Jianke
Best wishes,
Jianke